/* Editor layout — functional styling (visual redesign comes in the next pass). */
body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.top { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; gap: 12px; background: var(--surface); }
.tb-mid, .tb-right { display: flex; align-items: center; gap: 8px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.mini { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.mini select { width: auto; padding: 6px 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 16px; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.badge.pro { background: var(--accent); color: #fff; }
.main { flex: 1; display: flex; min-height: 0; }
.rail { width: 76px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--surface); }
.rail button { border: 0; background: transparent; color: var(--muted); font: 600 11px/1.2 inherit; font-family: inherit; padding: 10px 2px; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rail button span { font-size: 18px; line-height: 1; }
.rail button.on { background: var(--soft); color: var(--ink); }
.panel { width: 312px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; background: var(--surface); }
.stage { flex: 1; overflow: auto; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg); }
.strip { display: flex; gap: 26px; padding: 28px 32px 16px; align-items: flex-start; flex: 1; }
.hint { font-size: 12px; color: var(--faint); padding: 0 32px 14px; }
.slot { flex: none; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.slot .frame { position: relative; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.slot.cur .frame { box-shadow: 0 0 0 2px var(--accent); }
.slot canvas { display: block; border-radius: 12px; }
.slot .ov { position: absolute; inset: 0; cursor: default; touch-action: none; overflow: hidden; border-radius: 12px; }
.slot .stools { display: flex; gap: 4px; align-items: center; opacity: .6; font-size: 12px; color: var(--muted); }
.slot:hover .stools, .slot.cur .stools { opacity: 1; }
.slot .stools button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; }
.selbox { position: absolute; left: 0; top: 0; border: 1.5px solid var(--accent); pointer-events: none; transform-origin: center; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.selbox .h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--accent); border-radius: 50%; pointer-events: auto; }
.selbox .h.sc { right: -8px; bottom: -8px; cursor: nwse-resize; }
.selbox .h.ro { left: 50%; top: -30px; margin-left: -7px; cursor: grab; }
.selbox .stem { position: absolute; left: 50%; top: -18px; width: 1.5px; height: 18px; background: var(--accent); }
.guide { position: absolute; background: #ff3d81; pointer-events: none; display: none; }
.guide.v { width: 1px; top: 0; bottom: 0; }
.guide.hz { height: 1px; left: 0; right: 0; }
.addslide { width: 150px; border: 1.5px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 13px; flex: none; text-align: center; padding: 12px; }
.addslide:hover { border-color: var(--ink); color: var(--ink); }

/* panel controls */
.ph { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 12px; }
.grp { margin-bottom: 18px; }
.lbl { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.panel textarea, .panel input[type=text], .panel select, .modal input[type=text] { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.panel textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; font: inherit; font-size: 12.5px; padding: 7px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.rowc { display: flex; gap: 8px; align-items: center; }
.rowc > * { flex: 1; }
.sl { display: grid; grid-template-columns: 74px 1fr 40px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.sl input[type=range] { width: 100%; accent-color: var(--accent); }
.sl output { text-align: right; font-variant-numeric: tabular-nums; }
.cpick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cpick input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--bg); cursor: pointer; flex: none; }
.cpick .sw { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; flex: none; }
.cline { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 7px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tcard { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; cursor: pointer; background: var(--bg); }
.tcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tcard .thumbs { display: flex; gap: 6px; }
.tcard canvas { border-radius: 6px; flex: 1; min-width: 0; height: auto; aspect-ratio: 1000 / 2173; }
.tcard .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.tcard .meta b { font-weight: 700; }
.tcard .meta small { color: var(--faint); margin-left: 6px; }
.dots { display: flex; gap: 5px; }
.dots button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.dots button.on { box-shadow: 0 0 0 2px var(--accent); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid .it { aspect-ratio: 1; border-radius: 10px; background: var(--soft); border: 1px solid transparent; cursor: pointer; display: grid; place-items: center; overflow: hidden; position: relative; }
.grid .it:hover { border-color: var(--ink); }
.grid .it img { width: 78%; height: 78%; object-fit: contain; }
.grid .it.shot img { width: 100%; height: 100%; object-fit: cover; }
.grid .it.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.presets button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 4px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.presets button i { width: 14px; height: 24px; border: 2px solid currentColor; border-radius: 4px; display: block; }
.presets button:hover, .presets button.on { border-color: var(--accent); }
.wide { width: 100%; }
.btn.sm.wide { margin-top: 6px; }
.note { font-size: 12px; color: var(--faint); margin-top: 8px; line-height: 1.45; }
.empty { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 14px; margin-bottom: 14px; line-height: 1.45; }
.between { display: flex; justify-content: space-between; align-items: center; }
.tog { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 8px 0; color: var(--ink); }
.tog input { accent-color: var(--accent); width: 18px; height: 18px; }
.droparea { border: 1.5px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 12px; }
.droparea:hover { border-color: var(--ink); color: var(--ink); }
.upact { position: absolute; inset: auto 4px 4px 4px; display: none; gap: 3px; }
.grid .it:hover .upact { display: flex; }
.upact button { flex: 1; font-size: 10px; padding: 3px 0; border-radius: 6px; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.modal.open { display: flex; }
.modal .card { max-width: 440px; width: 100%; }
.modal .card.ex { max-width: 520px; }
.exstore { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 16px 0 8px; }
.excards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.excard { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; background: var(--bg); color: var(--ink); font: inherit; }
.excard b { display: block; font-size: 14px; }
.excard span { font-size: 12px; color: var(--faint); }
.excard em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); float: right; }
.excard.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.excard.lock { opacity: .5; }
.row-btns { display: flex; gap: 8px; margin-top: 18px; }
.row-btns .btn { flex: 1; }
.drop { position: fixed; inset: 0; background: rgba(59,91,255,.1); border: 3px dashed var(--accent); display: none; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--accent); z-index: 40; pointer-events: none; }
.drop.on { display: flex; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; display: none; z-index: 50; }
@media (max-width: 860px) {
  body { height: auto; overflow: auto; }
  .main { flex-direction: column; }
  .rail { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail button { flex: 1; min-width: 64px; }
  .panel { width: 100%; border-right: 0; max-height: 46vh; }
  .strip { overflow-x: auto; padding: 18px 14px; }
  .tb-mid .mini { display: none; }
  .top .badge { display: none; }
}
.panel .rowc .btn { white-space: nowrap; padding: 0 8px; font-size: 12.5px; }
