/* Studio "pro" shell (2026-10-08) - loaded AFTER style.css on studio.html.
   One grouped left sidebar (replaces the 2-column category + icon rails),
   flatter/tighter surfaces, smaller radii. Overrides only; style.css stays
   the source for everything else. */

:root {
  --rail-w: 208px;
  --radius: 8px;
}

/* old category column is no longer shown (kept in DOM so its JS is inert) */
.category-rail { display: none !important; }

header { padding: 12px 24px; }

.icon-rail {
  left: 0;
  width: var(--rail-w);
  align-items: stretch;
  gap: 2px;
  padding: 14px 10px 20px;
  overflow-y: auto;
  background: var(--bg-alt);
  backdrop-filter: none;
}

.rail-group {
  display: none;
  padding: 16px 10px 6px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.7;
}
.rail-group:first-child { padding-top: 4px; }

.rail-btn {
  width: 100%;
  height: 36px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
}
.rail-btn svg { width: 16px; height: 16px; flex: none; }
.rail-label { font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
.rail-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); border: none; }
.rail-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
  border: none;
}

.rail-content { margin-left: var(--rail-w); }

/* tighter, squarer surfaces across tools */
.btn, button.btn, input, select, textarea { border-radius: var(--radius); }
.section-head h2 { font-size: 1.25rem; letter-spacing: -0.01em; }

@media (max-width: 860px) {
  .icon-rail {
    width: 56px;
    padding: 10px 6px;
    align-items: center;
  }
  .rail-group { display: none !important; }
  .rail-btn { width: 44px; justify-content: center; padding: 0; }
  .rail-label { display: none; }
  .rail-content { margin-left: 56px; }
}

/* workflow guide */
.guide-list { display: grid; gap: 10px; max-width: 720px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.guide-check { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.guide-n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--accent-border); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; color: var(--accent); }
.guide-step.done { opacity: 0.55; }
.guide-step.done .guide-n { background: var(--accent); color: var(--accent-on); }
.guide-body { flex: 1; }

/* ---------- video editor ---------- */
.ed-wrap { padding: 14px 18px 24px; }
.ed-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ed-ctl { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-dim); }
.ed-ctl select, .ed-ctl input[type=number] { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 0.8rem; }
.ed-btn { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 11px; font-size: 0.8rem; cursor: pointer; font-family: inherit; }
.ed-btn:hover { border-color: var(--accent-border); }
.ed-btn:disabled { opacity: .4; cursor: default; }
.ed-btn.primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); font-weight: 600; text-decoration: none; display: inline-block; }
.ed-btn.danger { color: #ff9c9c; }
.ed-btn.small { padding: 2px 8px; font-size: 0.72rem; }
.ed-hint { font-size: 0.72rem; color: var(--text-dim); }
.ed-main { display: grid; grid-template-columns: 220px minmax(0,1fr) 250px; gap: 10px; align-items: stretch; }
.ed-panel { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; min-height: 340px; max-height: 460px; overflow: hidden; }
.ed-panel-h { display: flex; align-items: center; padding: 8px 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.ed-bin, .ed-ins { overflow-y: auto; flex: 1; padding: 6px; }
.ed-bin-item { display: flex; gap: 8px; align-items: center; padding: 5px; border-radius: 6px; cursor: default; }
.ed-bin-item:hover { background: rgba(255,255,255,.04); }
.ed-bin-th { width: 52px; height: 34px; border-radius: 4px; background: #000 center/cover; display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.ed-bin-meta { flex: 1; min-width: 0; }
.ed-bin-name { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-bin-act button { background: none; border: 1px solid var(--border); color: var(--text); width: 22px; height: 22px; border-radius: 5px; cursor: pointer; margin-left: 3px; }
.ed-bin-act button:hover { border-color: var(--accent-border); color: var(--accent); }
.ed-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-previewwrap { background: #05050a; border: 1px solid var(--border); border-radius: 8px; height: 392px; display: flex; align-items: center; justify-content: center; padding: 6px; }
.ed-preview { position: relative; background: #000; max-height: 100%; max-width: 100%; height: 100%; overflow: hidden; }
.ed-preview video, .ed-preview img { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
#edTextLayer { position: absolute; inset: 0; pointer-events: none; }
.ed-text { position: absolute; transform: translate(-50%,-50%); text-align: center; white-space: nowrap; line-height: 1.25; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.ed-transport { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-time { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--text-dim); margin-left: 6px; }
.ed-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 5px 4px; font-size: 0.76rem; }
.ed-field label { width: 100%; color: var(--text-dim); font-size: 0.68rem; }
.ed-field input[type=range] { flex: 1; min-width: 0; }
.ed-field input[type=number], .ed-field select, .ed-field textarea { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 0.78rem; width: 100%; font-family: inherit; }
.ed-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.ed-val { width: 38px; text-align: right; color: var(--text-dim); font-size: 0.7rem; }
.ed-ins-head { font-size: 0.8rem; font-weight: 600; padding: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-tl { margin-top: 10px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; overflow-y: hidden; position: relative; user-select: none; }
.ed-tl-inner { position: relative; min-width: 100%; padding-bottom: 8px; }
.ed-ruler { position: relative; height: 22px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ed-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.ed-tick span { position: absolute; left: 3px; top: 3px; font-size: 0.6rem; color: var(--text-dim); }
.ed-row { position: relative; height: 46px; margin: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.04); }
.ed-rowlbl { position: sticky; left: 4px; z-index: 3; font-size: 0.6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); background: rgba(9,9,18,.7); padding: 1px 5px; border-radius: 4px; }
.ed-clip { position: absolute; top: 2px; height: 42px; border-radius: 6px; overflow: hidden; cursor: grab; background: #1c2540 center left / auto 100% repeat-x; border: 1px solid rgba(255,255,255,.15); display: flex; align-items: center; }
.ed-clip.ed-audio { background: #1f3b34; }
.ed-clip.ed-text { background: #3d2f55; }
.ed-clip.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ed-lbl { font-size: 0.68rem; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; pointer-events: none; position: relative; z-index: 1; }
.ed-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; background: rgba(255,255,255,.12); }
.ed-h.l { left: 0; } .ed-h.r { right: 0; }
.ed-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; z-index: 5; }
.ed-export { margin-top: 12px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-width: 760px; }
.ed-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.ed-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.ed-row2 { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 1100px) { .ed-main { grid-template-columns: 1fr; } .ed-panel { max-height: 260px; min-height: 160px; } .ed-previewwrap { height: 300px; } }
.ed-tr { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(240,233,160,.55) 0 4px, rgba(240,233,160,.2) 4px 8px); z-index: 1; pointer-events: none; }
.ed-banner { background: rgba(240,233,160,.1); border: 1px solid var(--accent-border); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: 0.8rem; }
#edOverlayLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ed-ov { position: absolute; display: none; }
.ed-ov img, .ed-ov video, .ed-ov canvas { display: block; width: 100%; height: auto; }
.ed-clip.ed-overlay { background: #4a3a1c; }
.ed-sec { width: 100%; margin: 12px 4px 2px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.ed-sw { display: inline-flex; gap: 4px; margin-left: 6px; }
.ed-sw button { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); cursor: pointer; padding: 0; }
.ed-kf { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.ed-kf th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 2px 3px; }
.ed-kf td { padding: 2px 2px; }
.ed-kf input { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 3px 4px; font-size: 0.72rem; }
.ed-clip.ed-adjust { background: #3a2c4f; }
.ed-brand { border-top: 1px solid var(--border); padding: 6px 8px 8px; }
