/* CUTMO design system — tokens are the contract from the UI kit, verbatim. */
/* first-visit tips (app.js startTour) */
.tour-tip { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-md);
  padding: 12px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.5); font-size: 14px; }
.tour-tip p { margin: 0 0 10px; line-height: 1.45; }
.tour-row { display: flex; align-items: center; gap: 10px; }
.tour-row .btn { margin-left: auto; }
/* a window on top of the editor hides the tips that point into it */
body:has(.reel-modal:not([hidden])) .tour-tip { display: none; }
/* the page behind an open window doesn't scroll (phones scrolled it under the finger) */
body:has(.reel-modal:not([hidden])) { overflow: hidden; }
.tour-focus { outline: 2px solid var(--accent) !important; outline-offset: 3px; border-radius: 6px; }
:root {
  /* color */
  --bg:            #080B08;
  --surface:       #0F120F;
  --surface-2:     #141814;
  --border:        rgba(245,245,240,0.10);
  --border-strong: rgba(245,245,240,0.22);
  --text:          #F5F5F0;
  --text-muted:    #9AA09A;
  --text-dim:      #7E857E;
  --accent:        #D9FF3B;
  --accent-ink:    #0B0B0B;
  --accent-soft:   rgba(217,255,59,0.10);
  --moss:          #145C3A;
  --graphite:      #3A3A3A;
  --danger:        #FF6B5E;

  /* type */
  --font-display: "Space Grotesk", sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-display-xl: 76px;  --lh-display-xl: 1.00;  --ls-display-xl: -0.035em;
  --fs-display-l:  48px;  --lh-display-l:  1.06;  --ls-display-l:  -0.025em;
  --fs-h-m: 28px; --fs-h-s: 20px;
  --fs-body-l: 18px; --fs-body-m: 15px; --fs-body-s: 13px;
  --fs-label: 11px; --ls-label: 0.20em;

  /* space — 8px baseline */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 120px;

  /* radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;

  /* layout */
  --container: 1200px; --margin: 120px; --gutter: 24px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms; --dur-base: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-body-m)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; }
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.mono  { font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dim   { color: var(--text-dim); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-body-s); }
.label {
  font: 600 var(--fs-label)/1 var(--font-body); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--text-dim);
}
.ic {
  width: 16px; height: 16px; flex: 0 0 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── brand ─── */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font: 700 18px/1 var(--font-display); letter-spacing: .08em; }
.logo { display: block; }

/* ─── APP buttons: radius-sm ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  font: 500 13px/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(245,245,240,.12); background: var(--surface-2); color: var(--text);
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.btn:hover { border-color: var(--border-strong); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; padding: 0 18px; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.04); }
.btn-secondary { background: var(--surface-2); }
.btn:disabled { background: var(--graphite); border-color: var(--graphite); color: #8C8C8C; cursor: not-allowed; filter: none; }
.btn.wide { width: 100%; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 34px; padding: 0;
  border: 1px solid rgba(245,245,240,.12); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.btn-icon:hover { border-color: var(--border-strong); }
.btn-icon:disabled { color: var(--text-dim); opacity: .45; cursor: not-allowed; }

/* ─── inputs ─── */
.field { display: flex; flex-direction: column; gap: 8px; }
.select {
  height: 48px; padding: 0 40px 0 16px; width: 100%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239AA09A' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center;
  border: 1px solid rgba(245,245,240,.16); border-radius: 10px;
  color: var(--text); font: 400 var(--fs-body-m) var(--font-body); appearance: none; cursor: pointer;
}
.select:focus { border-color: var(--accent); outline: none; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-muted); min-height: 32px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle input + span {
  position: relative; flex: 0 0 44px; height: 24px; border-radius: var(--r-pill);
  background: var(--graphite); transition: background var(--dur-base) var(--ease);
}
.toggle input + span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); transition: transform var(--dur-base) var(--ease);
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); background: var(--accent-ink); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ═════════════════ LANDING ═════════════════ */
.site { max-width: calc(var(--container) + 2 * var(--sp-6)); margin: 0 auto; padding: 0 var(--sp-6); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; border-bottom: 1px solid var(--border); }
.nav-meta { display: flex; gap: var(--sp-2); }

.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--graphite); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 250px; border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  background: var(--bg); cursor: pointer; text-align: center; padding: var(--sp-5);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ico { width: 34px; height: 34px; stroke: var(--text); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font: 600 var(--fs-h-s)/1.2 var(--font-display); }
.settings {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3);
}
.notice { margin: 0 0 var(--sp-8); padding: var(--sp-5); border: 1px solid rgba(255,107,94,.35); border-radius: var(--r-lg); background: var(--surface); }
.notice h3 { font-size: var(--fs-h-s); color: var(--danger); margin-bottom: var(--sp-2); }
#notInstalled { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 95; margin: 0;
  width: min(560px, calc(100% - 32px)); padding: 14px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

@media (max-width: 980px) {
  .site { padding: 0 var(--sp-4); }
  .nav-meta #ver { display: none; }
}

/* ═════════════════ EDITOR (app) ═════════════════ */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  height: 56px; padding: 0 var(--sp-4); border-bottom: 1px solid var(--border); background: var(--bg);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 var(--sp-2); }
.proj {
  height: 32px; display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm); font-weight: 500; font-size: 13px;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#phaseLine { margin-left: var(--sp-2); white-space: nowrap; }
#phaseLine b { color: var(--text); font-weight: 600; margin: 0 4px; }
.topbar-progress { height: 2px; background: transparent; }
.topbar-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); }

.workspace {
  flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 1px; background: var(--border); min-height: 420px;
}
.panel { background: var(--bg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-title { font: 600 var(--fs-body-m)/1 var(--font-display); }

/* media */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); align-content: start; overflow: auto; max-height: 46vh; }
.media-card {
  position: relative; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); cursor: pointer; transition: border-color var(--dur-base) var(--ease);
}
.media-card:hover { border-color: var(--border-strong); }
.media-card.active { border-color: var(--accent); }
.media-card img, .media-card .ph { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface-2); }
.media-card .nm { padding: 6px 8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card .dur, .media-card .badge {
  position: absolute; top: 6px; font: 500 10px/1 var(--font-mono); padding: 4px 6px; border-radius: 6px;
  background: rgba(8,11,8,.78); color: var(--text); backdrop-filter: blur(4px);
}
.media-card .dur { right: 6px; }
.media-card .badge { left: 6px; }
.media-card .badge.done { background: var(--accent); color: var(--accent-ink); }
.media-card .badge.err { background: var(--danger); color: var(--accent-ink); }
.media-card .rm {
  position: absolute; right: 6px; bottom: 30px; width: 24px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: rgba(8,11,8,.78); color: var(--text); cursor: pointer;
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.media-card:hover .rm, .media-card:focus-within .rm { opacity: 1; }
.media-card .rm:hover { background: var(--danger); color: var(--accent-ink); }
.media-card .rm .ic { width: 12px; height: 12px; flex-basis: 12px; }
.media-card .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.media-card .prog i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s var(--ease); }
.import-tile {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; width: 100%;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: transparent;
  color: var(--text-muted); font: 500 13px var(--font-body); cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.import-tile:hover { border-color: var(--text-muted); color: var(--text); }

/* monitor */
.monitor { padding: var(--sp-3); }
.monitor-screen {
  position: relative; flex: 1; min-height: 260px; background: #000;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.monitor-screen video { width: 100%; height: 100%; max-height: 56vh; object-fit: contain; display: block; }
/* effects tab + timeline marks */
.fx-piece { display: flex; flex-direction: column; gap: var(--sp-2); }
.seg-btn.wide { width: auto; padding: 0 12px; font-size: 13px; color: var(--text-muted); }
.seg-btn.wide.active { color: var(--text); }
.src-keep .zmark {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  font: 500 10px/1 var(--font-mono, ui-monospace, monospace); color: var(--text);
  background: rgba(8,11,8,.7); padding: 2px 4px; border-radius: 4px; pointer-events: none;
}
.src-keep .ztick { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(245,245,240,.6); pointer-events: none; }
.jmark {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  transform: rotate(45deg); background: var(--text); border: 2px solid var(--bg);
  border-radius: 2px; z-index: 5; pointer-events: auto; cursor: pointer;
}
.jmark:hover { background: var(--accent); }
.jmark.jadd { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: rgba(245,245,240,.25); opacity: 0; }
.track:hover .jmark.jadd { opacity: 1; }
.jmark.jadd:hover { background: var(--accent); opacity: 1; }
.monitor-screen .flash-veil { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.monitor-screen video { transform-origin: 50% 40%; }
/* double-buffered preview: the standby player sits pre-seeked on the next kept
   piece, invisible, and takes over at the join so cuts play without a stall */
/* transparent, not visibility: hidden — a phone's browser stops decoding a hidden video and it started cold at the cut */
.monitor-screen video.standby { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.monitor-screen video.leaving { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bracket, .badge-r { position: absolute; top: 10px; z-index: 2; pointer-events: none; }
.bracket { left: 12px; }
.badge-r { right: 12px; }
.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-1) 0; }
.transport-mid { display: flex; align-items: center; gap: var(--sp-2); }
.tc { white-space: nowrap; }
.tc-right { justify-self: end; }
.play {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  transition: transform var(--dur-fast) var(--ease);
}
.play:hover { transform: scale(1.05); }
.play .ic { width: 18px; height: 18px; flex-basis: 18px; }

/* inspector */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); }
.tab {
  position: relative; height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font: 500 13px var(--font-body);
}
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tab-body { display: flex; flex-direction: column; gap: var(--sp-3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); }
.stat b { display: block; font: 600 22px/1.1 var(--font-display); letter-spacing: -0.01em; }
.stat span { font-size: 12px; color: var(--text-dim); }
.stat.hl { border-color: var(--border-strong); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); }
.status { margin: var(--sp-2) 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.export-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.export-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  height: 48px; padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; font: 500 14px var(--font-body);
  transition: border-color var(--dur-base) var(--ease);
}
.export-item:hover { border-color: var(--border-strong); }
.export-item b { font-weight: 500; }
.export-item span { font: 500 11px var(--font-mono); }
.export-item:disabled { opacity: .5; cursor: wait; }

/* timeline */
.timeline { border-top: 1px solid var(--border); background: var(--surface); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.tl-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.tl-label { margin-left: var(--sp-2); }
.grow { flex: 1; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid rgba(245,245,240,.12); border-radius: var(--r-sm); background: var(--surface-2); }
.seg-btn {
  width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.seg-btn.active { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.zoom { display: inline-flex; align-items: center; gap: 6px; }
#zoomVal { min-width: 42px; text-align: center; }
#btnBuild.dirty { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.tl-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-color: var(--graphite) transparent; padding-bottom: 4px; }
.tl-inner { position: relative; width: 100%; min-width: 100%; }
.ruler { position: relative; height: 22px; margin-left: 64px; border-bottom: 1px solid var(--border); }
.ruler i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.ruler i b { position: absolute; left: 5px; top: 4px; font: 400 10px var(--font-mono); color: var(--text-dim); white-space: nowrap; }
.track-row { display: flex; align-items: stretch; gap: 0; margin-top: var(--sp-2); }
.track-name { flex: 0 0 64px; display: flex; align-items: center; font-size: 10px; letter-spacing: .12em; }
.track {
  position: relative; flex: 1; height: 88px; border-radius: var(--r-sm); overflow: hidden; cursor: pointer;
  background: var(--bg) center / 100% 100% no-repeat; border: 1px solid var(--border);
  user-select: none; touch-action: none;
}
.track::after { content: ""; position: absolute; inset: 0; background: rgba(8,11,8,.74); pointer-events: none; z-index: 1; }
.keeps { position: absolute; inset: 0; z-index: 2; }
/* project of several files: each file's film strip + its name, boundaries marked */
.file-tiles { position: absolute; inset: 0; }
.file-tile { position: absolute; top: 0; bottom: 0; background: center / 100% 100% no-repeat; }
.file-tile + .file-tile { box-shadow: inset 2px 0 0 var(--text); }
.file-tile .file-name {
  position: absolute; left: 6px; bottom: 4px; z-index: 3; max-width: calc(100% - 12px);
  font: 500 10px/1.2 var(--font-mono, ui-monospace, monospace); color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.src-keep {
  position: absolute; top: 3px; bottom: 3px; border-radius: 6px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px rgba(245,245,240,.85);
  backdrop-filter: brightness(3.2) saturate(1.05);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.src-keep:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.src-keep.picked { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.src-keep .h { position: absolute; top: 0; bottom: 0; width: 16px; cursor: ew-resize; z-index: 3; }
.src-keep .h.l { left: -8px; } .src-keep .h.r { right: -8px; }
.src-keep .h::before {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 4px; height: 36px; border-radius: 3px; background: var(--text);
  box-shadow: 0 0 0 1px rgba(8,11,8,.6);
}
.src-keep.picked .h::before { background: var(--accent); }
.sel { position: absolute; top: 0; bottom: 0; z-index: 4; pointer-events: none;
  background: rgba(255,107,94,.22); border-left: 2px solid var(--danger); border-right: 2px solid var(--danger); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); z-index: 5; pointer-events: none; }
.playhead::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--text); }
.tl-foot { display: flex; flex-wrap: wrap; gap: var(--sp-5); margin-top: var(--sp-3); align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-keep { box-shadow: inset 0 0 0 1.5px var(--text); background: rgba(245,245,240,.18); }
.sw-cut { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.tl-msg { color: var(--text); }

.log-wrap { padding: 0 var(--sp-4) var(--sp-4); background: var(--surface); }
.log-wrap summary { cursor: pointer; padding: var(--sp-2) 0; }
.log {
  margin: 0; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-sm);
  font: 400 11px/1.55 var(--font-mono); padding: var(--sp-3); max-height: 200px; overflow: auto; white-space: pre-wrap;
}

/* the inspector scrolls on its own: a long tab (export, effects) must not
   stretch the row — that pushed the preview picture out of its frame */
@media (min-width: 1101px) {
  .inspector { contain: size; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 240px minmax(0,1fr); }
  .inspector { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  /* flatten the grid so panels and the timeline can be ordered by task stage */
  .workspace { display: contents; }
  .panel { border-top: 1px solid var(--border); }
  .topbar { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .tb-left .brand span, .tb-sep, #phaseLine { display: none; }
  .proj { max-width: 120px; }
  #dl .txt { display: none; }
  #dl { width: 44px; padding: 0; }
  .media-grid { max-height: none; }
  .track { height: 72px; }
  .tl-label, .tl-foot span:nth-child(3) { display: none; }
  .timeline { padding: var(--sp-3); }
  /* before a result: media (and the start button) first */
  .media { order: 2; } .monitor { order: 3; } .timeline { order: 4; }
  .inspector { order: 5; } .log-wrap { order: 6; }
  /* with a result: watch and edit first, library below */
  .app.ready .monitor { order: 2; } .app.ready .timeline { order: 3; }
  .app.ready .media { order: 4; }
  .monitor-screen { min-height: 200px; }
  .tc .dim { display: none; }
  .track-name { flex-basis: 40px; font-size: 9px; }
  .ruler { margin-left: 40px; }
}
/* touch: 44px minimum hit targets (rule 4) */
@media (pointer: coarse) {
  .btn, .btn-icon { height: 44px; min-width: 44px; }
  .btn-icon { width: 44px; flex-basis: 44px; }
  .seg-btn { min-width: 44px; height: 44px; }
  .media-card .rm { opacity: 1; width: 44px; height: 44px; }
  .fb-thumb button { width: 36px; height: 36px; }
  .bi-tools button { min-height: 36px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ─── reels ─── */
.input {
  height: 44px; padding: 0 12px; width: 100%;
  background: var(--surface); border: 1px solid rgba(245,245,240,.16); border-radius: 10px;
  color: var(--text); font: 400 14px var(--font-body);
}
.input:focus { border-color: var(--accent); outline: none; }
input[type=file].input { padding: 10px 12px; height: auto; }
.select.sm, .btn.sm { height: 34px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); align-items: end; }
.reels-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.reel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.reel-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
}
.reel-card:hover { border-color: var(--border-strong); }
.reel-card img { display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #000; }
.reel-card .sc {
  position: absolute; top: 6px; left: 6px; font: 600 12px/1 var(--font-mono, monospace);
  background: rgba(8,11,8,.8); color: var(--text); padding: 4px 6px; border-radius: 6px;
}
.reel-card .du { position: absolute; top: 6px; right: 6px; font: 500 11px/1 var(--font-mono, monospace);
  background: rgba(8,11,8,.8); color: var(--text-muted); padding: 4px 6px; border-radius: 6px; }
.reel-card .tt { display: block; padding: 8px; font-size: 12px; line-height: 1.3; color: var(--text); }
.reel-card .ok { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 10px;
  background: rgba(8,11,8,.8); color: var(--text-muted); padding: 3px 6px; border-radius: 6px; }

.reel-modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,11,8,.82); display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.reel-modal[hidden] { display: none; }
.reel-sheet { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-lg, 18px);
  width: min(980px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; }
.reel-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.reel-score { font: 600 13px var(--font-mono, monospace); color: var(--text); }
.reel-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-5, 24px); padding: 16px; }
.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phone {
  position: relative; container-type: size; height: min(70vh, 640px); aspect-ratio: 9/16;
  background: #000; border-radius: 18px; overflow: hidden; border: 1px solid var(--border-strong);
}
.phone video { position: absolute; top: 0; height: 100%; width: auto; max-width: none; left: 0; }
.phone .ov-title {
  position: absolute; top: calc(230 / 1920 * 100cqh); left: 8%; right: 8%; text-align: center;
  font: 700 calc(78 / 1920 * 100cqh)/1.15 "DejaVu Sans", var(--font-body); color: #000;
}
.phone .ov-title span { background: #fff; padding: .12em .35em; border-radius: .18em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; }
:is(.phone, .cap-box) .ov-cap {
  position: absolute; left: 6%; right: 6%; bottom: calc(520 / 1920 * 100cqh); text-align: center;
  font: 800 calc(84 / 1080 * 100cqmin * var(--capk, 1))/1.15 "DejaVu Sans", var(--font-body); color: var(--capc, #fff);
  text-shadow: 0 0 .09em #000, 0 0 .09em #000, 0 0 .09em #000, 0 0 .09em #000;
}
:is(.phone, .cap-box) .ov-cap b { color: var(--caphi, #D9FF3B); font-weight: 800; display: inline-block; transform: scale(1.08); }
:is(.phone, .cap-box) .ov-cap i.kw { color: var(--capkw, #FFD23F); font-style: normal; }
:is(.phone, .cap-box) .ov-cap.box span { background: rgba(0,0,0,.6); padding: .1em .3em; border-radius: .15em; text-shadow: none; }
:is(.phone, .cap-box) .ov-cap.minimal { bottom: calc(240 / 1920 * 100cqh); font-size: calc(54 / 1080 * 100cqmin * var(--capk, 1)); font-weight: 600; }
:is(.phone, .cap-box) .ov-cap.karaoke { font-size: calc(76 / 1080 * 100cqmin * var(--capk, 1)); }
:is(.phone, .cap-box) .ov-cap.box { font-size: calc(64 / 1080 * 100cqmin * var(--capk, 1)); }
:is(.phone, .cap-box) .ov-cap.top { bottom: auto; top: calc(420 / 1920 * 100cqh); }
.phone .ov-texts > div:not(.tx) { position: absolute; left: 6%; right: 6%; text-align: center;
  font: 700 calc(64 / 1920 * 100cqh)/1.2 "DejaVu Sans", var(--font-body); color: #fff;
  text-shadow: 0 0 .08em #000, 0 0 .08em #000, 0 0 .08em #000; }
.phone-bar { display: flex; align-items: center; gap: 12px; }
.play.small { width: 36px; height: 36px; }
.reel-ctrl { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.reel-caps { flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer; font: 500 13px var(--font-body); }
.chip-btn.active { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.tracks { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; }
.track-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; background: var(--surface); }
.track-item.active { border-color: var(--text); }
.track-item .nm { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-item .meta { font: 500 11px var(--font-mono, monospace); color: var(--text-dim); }
.nudge { display: flex; align-items: center; gap: 6px; }
.reel-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .reel-modal { padding: 0; }
  .reel-sheet { border-radius: 0; height: 100%; }
  .reel-body { grid-template-columns: 1fr; }
  .phone { height: min(62vh, 560px); }
}

/* ─── tabs overflow, transcript, review, output settings ─── */
.tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; }
.text-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.transcript {
  max-height: 52vh; overflow: auto; line-height: 1.9; font-size: 15px; color: var(--text);
  padding: 8px 4px; outline: none; user-select: text;
}
.transcript .fh { display: block; margin: 12px 0 4px; font: 500 11px var(--font-mono, monospace); color: var(--text-dim); letter-spacing: .08em; }
.transcript .w { cursor: pointer; border-radius: 4px; padding: 1px 0; }
.transcript .w:hover { background: var(--surface-2); }
.transcript .w.cut { color: var(--text-dim); text-decoration: line-through; text-decoration-color: rgba(255,107,94,.7); }
.transcript .w.now { background: var(--text); color: var(--accent-ink); }
.transcript input.wedit { font: inherit; width: 8em; background: var(--surface); color: var(--text);
  border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; }
.review-card { display: flex; flex-direction: column; gap: 8px; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.review-item q { font-size: 14px; color: var(--text); cursor: pointer; }
.review-item .why { font-size: 12px; color: var(--text-muted); }
.review-item .acts { display: flex; gap: 6px; }
.review-item.done { opacity: .5; }
.out-card { display: flex; flex-direction: column; gap: 8px; }

/* waveform under the pieces (ТЗ 3.12) */
.track canvas.wave { position: absolute; left: 0; bottom: 0; width: 100%; height: 46%; z-index: 2; pointer-events: none; }
/* snapping guide (ТЗ 3.11) */
.snapline { position: absolute; top: -2px; bottom: -2px; width: 0; z-index: 6; pointer-events: none;
  border-left: 1.5px solid var(--accent); box-shadow: 0 0 6px var(--accent); }
/* hotkeys (ТЗ 3.10) */
.keys-btn { font-size: 16px; line-height: 1; }
.keys-help { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: var(--sp-2) 0 0 64px; font-size: 12px; color: var(--text-muted); }
.keys-help kbd { display: inline-block; min-width: 18px; padding: 1px 5px; margin-right: 2px; border: 1px solid var(--border);
  border-radius: 4px; font: 500 11px var(--font-mono, ui-monospace, monospace); color: var(--text); text-align: center; background: var(--bg); }
@media (max-width: 720px) { .keys-help { padding-left: 0; } }
/* file order (ТЗ 1.5) */
.media-card[draggable="true"] { cursor: grab; }
.media-card.dragging { opacity: .4; }
.media-card.drop-to { box-shadow: 0 0 0 2px var(--accent); }

/* reels: glued reels, layouts (ТЗ 6.7.1–6.7.2) */
.reel-card .pc { position: absolute; top: 30px; right: 6px; font: 500 10px/1 var(--font-mono, monospace);
  background: var(--accent); color: #0b0f0b; padding: 3px 5px; border-radius: 6px; }
.phone .phone-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
:is(.phone, .cap-box) .ov-cap.center { bottom: auto; top: 50%; transform: translateY(-50%); }
.reel-layouts, .reel-caps { flex-wrap: wrap; }

/* account (ТЗ 1.7) */
.acct-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font: 500 13px var(--font-body); cursor: pointer; }
.acct-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn:hover { border-color: var(--accent); }
.acct-btn .ic { flex: 0 0 auto; }
.auth-sheet { width: min(520px, 100%); }
.auth-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.auth-body form { display: flex; flex-direction: column; gap: 12px; }
.auth-title { margin: 0 0 4px; font-size: 22px; }
.auth-err { color: var(--danger); min-height: 1em; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--text-muted); text-decoration: underline; cursor: pointer; align-self: flex-start; }
.proj-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.proj-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.proj-row .pr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.proj-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-change summary { cursor: pointer; color: var(--text-muted); }
.pw-change .row2 { margin: 8px 0; }
@media (max-width: 720px) { .topbar .acct-btn span { display: none; } .topbar .acct-btn { padding: 0 8px; } }

/* reels: emoji, call to action, progress bar (ТЗ 5.6, 6.7.4) */
.phone .ov-emoji { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none;
  bottom: calc((520 + 84 * 2.6 * var(--capk, 1)) / 1920 * 100cqh); font-size: calc(150 / 1920 * 100cqh); line-height: 1;
  animation: pop-in .18s ease-out; }
.phone .ov-emoji.center { bottom: auto; top: calc(700 / 1920 * 100cqh); }
.phone .ov-emoji.top { bottom: auto; top: calc(760 / 1920 * 100cqh); }
.phone .ov-emoji:empty { display: none; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.phone .ov-cta { position: absolute; left: 8%; right: 8%; top: calc(30% - 1.2em); text-align: center;
  font: 700 calc(78 / 1920 * 100cqh)/1.15 "DejaVu Sans", var(--font-body); color: #000; }
.phone .ov-cta span { background: #fff; padding: .12em .35em; border-radius: .18em; }
.phone .ov-bar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(14 / 1920 * 100cqh); }
.phone .ov-bar[hidden] { display: none; }
.phone .ov-bar i { display: block; height: 100%; width: 0; background: var(--caphi, #D9FF3B); }
.cap-style summary, .cap-style { color: var(--text-muted); }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 10px; align-items: center; }
.color-field { display: flex; align-items: center; gap: 8px; color: var(--text); }
.color-field input[type=color] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 6px; background: transparent; cursor: pointer; }
@media (max-width: 720px) { .cap-grid { grid-template-columns: 1fr; } }

/* brand kit (ТЗ 8) */
.brand-kit > summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.brand-kit > summary::-webkit-details-marker { display: none; }
.bk-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.bk-row { display: flex; flex-direction: column; gap: 6px; }
.bk-row2 { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.bk-row2 .field { flex: 1 1 120px; }
.bk-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-file input[type=file] { max-width: 220px; font-size: 12px; color: var(--text-muted); }
.bk-file img { height: 36px; max-width: 120px; object-fit: contain; background: #333; border-radius: 4px; padding: 3px; }
.bk-line { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }

/* B-roll track + music row (ТЗ 3.8–3.9) */
.track2 { position: relative; flex: 1; height: 34px; border-radius: var(--r-sm); border: 1px dashed var(--border);
  background: rgba(245,245,240,.02); user-select: none; }
.broll-item { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: rgba(120,160,255,.28);
  box-shadow: inset 0 0 0 1.5px rgba(150,185,255,.9); cursor: grab; overflow: visible; }
.broll-item.pip { background: rgba(255,170,90,.25); box-shadow: inset 0 0 0 1.5px rgba(255,190,120,.9); }
.broll-item.picked { box-shadow: inset 0 0 0 2px var(--accent); }
.broll-item > span { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%);
  font: 500 11px var(--font-mono, monospace); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.broll-item .h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.broll-item .h.l { left: -4px; } .broll-item .h.r { right: -4px; }
.broll-item { touch-action: none; }                 /* a finger drags the clip instead of scrolling the page */
@media (pointer: coarse) { .broll-item .h { width: 18px; } .broll-item .h.l { left: -8px; } .broll-item .h.r { right: -8px; } }
.bi-tools { position: absolute; bottom: calc(100% + 4px); left: 0; display: flex; gap: 4px; z-index: 8; }
/* the infographic cards on the timeline (21c-graphics.js): dragged in time, their edges are the length */
.gfx-item { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: rgba(217,255,59,.16);
  box-shadow: inset 0 0 0 1px rgba(217,255,59,.55); cursor: grab; touch-action: none; min-width: 6px; }
.gfx-item.off { opacity: .4; }
.gfx-item.picked { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(217,255,59,.26); }
.gfx-item > span { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gfx-item .h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.gfx-item .h.l { left: -4px; } .gfx-item .h.r { right: -4px; }
@media (pointer: coarse) { .gfx-item .h { width: 18px; } .gfx-item .h.l { left: -8px; } .gfx-item .h.r { right: -8px; } }
.bi-tools button { font: 500 11px var(--font-body); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); cursor: pointer; white-space: nowrap; }
.bi-tools button.on { border-color: var(--accent); color: var(--accent); }
/* the music lane: pieces of the track with its waveform, fades drawn as ramps (16-broll-music.js) */
.music-row .track2 { height: 46px; }
.music-track { border-style: solid; background: rgba(245,245,240,.02); }
.music-track.empty, .music-track.off { border-style: dashed; }
.m-empty { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; color: var(--text-muted);
  font: 500 12px var(--font-body); cursor: pointer; text-align: left; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-empty:hover { color: var(--accent); }
.m-clip { --wave: rgba(217,255,59,.55); position: absolute; top: 2px; bottom: 2px; border-radius: 6px; overflow: visible;
  background: rgba(217,255,59,.10); box-shadow: inset 0 0 0 1px rgba(217,255,59,.45); cursor: grab; touch-action: none; min-width: 4px; }
.m-clip.picked { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(217,255,59,.18); --wave: rgba(217,255,59,.8); }
.m-clip canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6px; pointer-events: none; }
.m-clip .m-fade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.m-fade polygon { fill: rgba(0,0,0,.45); }
.m-fade polyline { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.m-lbl { position: absolute; left: 8px; right: 8px; top: 3px; font: 500 10px var(--font-mono, monospace); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.m-clip .h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 1; }
.m-clip .h.l { left: -4px; } .m-clip .h.r { right: -4px; }
.m-clip .fh { position: absolute; top: -5px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; z-index: 2;
  background: var(--bg); border: 2px solid var(--accent); cursor: ew-resize; opacity: 0; transition: opacity .12s; }
.m-clip:hover .fh, .m-clip.picked .fh { opacity: 1; }
@media (pointer: coarse) { .m-clip .h { width: 18px; } .m-clip .h.l { left: -8px; } .m-clip .h.r { right: -8px; }
  .m-clip.picked .fh { width: 18px; height: 18px; margin-left: -9px; top: -9px; } .m-clip:not(.picked) .fh { display: none; } }
/* the music's settings: under the timeline, never scrolled away with a zoom */
.m-edit { margin-top: var(--sp-2); padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  display: flex; flex-direction: column; gap: 8px; background: rgba(217,255,59,.03); }
.m-edit[hidden] { display: none; }
.me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.me-row .grow { flex: 1; }
.m-edit .toggle { font-size: 12px; gap: 8px; white-space: nowrap; }
.m-edit .toggle { min-height: 26px; }
.m-edit .toggle input + span { flex-basis: 32px; height: 18px; }
.m-edit .toggle input + span::after { top: 3px; left: 3px; width: 12px; height: 12px; }
.m-edit .toggle input:checked + span::after { transform: translateX(14px); }
.mt-vol span, .me-rng span, .me-num span { white-space: nowrap; }
.me-clip { border-top: 1px dashed var(--border); padding-top: 8px; }
.me-h { font: 600 12px var(--font-body); }
.me-tip { margin: 0; }
.m-edit .mt-name { border: 0; background: transparent; color: var(--text); font: 600 12px var(--font-body); cursor: pointer; padding: 0;
  max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-edit .mt-name:hover { color: var(--accent); }
.mt-vol, .me-rng { display: flex; align-items: center; gap: 6px; font: 500 11px var(--font-mono, monospace); color: var(--text-muted); }
.mt-vol input, .me-rng input { width: 110px; accent-color: var(--accent); }
.mt-vol b, .me-rng b { min-width: 34px; font-weight: 600; color: var(--text); }
.me-num { display: flex; align-items: center; gap: 4px; font: 500 11px var(--font-mono, monospace); color: var(--text-muted); }
.me-num input { width: 64px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); font: 500 12px var(--font-mono, monospace); }
.me-num i { font-style: normal; }
.mt-btn { font: 600 11px var(--font-body); padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); cursor: pointer; white-space: nowrap; }
.mt-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mt-btn:disabled { opacity: .4; cursor: default; }
.mt-btn.danger:hover { border-color: #ff6b6b; color: #ff6b6b; }
@media (max-width: 760px) { .mt-vol input, .me-rng input { width: 84px; } .mt-btn { padding: 5px 8px; } .me-row { gap: 8px 10px; }
  .me-rng { width: 100%; } .me-rng span { flex: 0 0 116px; } .me-rng input { flex: 1; width: auto; min-width: 0; }
  .timeline .zoom, #btnKeys { display: none; }    /* a phone zooms the timeline with two fingers */ }
.broll-view { position: absolute; z-index: 3; pointer-events: none; overflow: hidden; }
.broll-view[hidden] { display: none; }
.broll-view img, .broll-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.broll-view img[hidden], .broll-view video[hidden] { display: none; }
.broll-view.pip img, .broll-view.pip video { inset: 4% 4% auto auto; width: 36%; height: auto; aspect-ratio: 16 / 9;
  border: 3px solid #fff; border-radius: 2px; }
.stock-panel { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; margin-top: var(--sp-2); }
.stock-panel[hidden] { display: none; }
.stock-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stock-bar .input { flex: 1 1 220px; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.stock-item { padding: 0; border: 1px solid var(--border); border-radius: 6px; background: #000; cursor: pointer; overflow: hidden; text-align: left; }
.stock-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.stock-item span { display: block; padding: 4px 6px; font-size: 11px; color: var(--text-muted); }

/* operator view (ТЗ 10.5) */
.admin-box summary { cursor: pointer; color: var(--text-muted); }
.admin-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin-top: 10px; font-size: 12px; }
.admin-grid b { font-weight: 500; overflow-wrap: anywhere; }

/* import by link (ТЗ 1.6) */
.link-import { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.link-import .link-msg { margin: 0; min-height: 1em; }
.link-more summary { cursor: pointer; margin: 8px 0 0; }

/* effects inside a piece, preview (ТЗ 4.7) — the render does the same with ffmpeg */
@keyframes fx-push { from { scale: 1; } to { scale: 1.1; } }
@keyframes fx-shake { 0% { translate: 0 0; } 10% { translate: 2.5% -2% } 25% { translate: -2% 1.5% }
  40% { translate: 1.2% -1% } 60% { translate: -.6% .5% } 100% { translate: 0 0; } }
@keyframes fx-rgb { 0%, 80% { filter: drop-shadow(-6px 0 0 rgba(255,0,0,.55)) drop-shadow(6px 0 0 rgba(0,90,255,.55)); } 100% { filter: none; } }
video.fx-push { animation: fx-push var(--piece-s, 4s) linear forwards; }
video.fx-shake { animation: fx-shake .6s ease-out; }
video.fx-rgb { animation: fx-rgb .3s steps(1) forwards; }
video.fx-glow { filter: brightness(1.06) contrast(.96) saturate(1.05) drop-shadow(0 0 12px rgba(255,255,255,.25)); }

/* the whole screen box goes fullscreen (both players, B-roll, zoom) */
.monitor-screen:fullscreen, .monitor-screen:-webkit-full-screen { border: 0; border-radius: 0; background: #000; cursor: pointer; }
.monitor-screen:fullscreen video, .monitor-screen:-webkit-full-screen video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.monitor-screen:fullscreen .bracket, .monitor-screen:fullscreen .badge-r { display: none; }

.track-item .tk-play { flex: 0 0 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); cursor: pointer; font-size: 11px; margin-right: 8px; }
.track-item .tk-play:hover { border-color: var(--accent); color: var(--accent); }

/* transition catalog (like CapCut) */
.fx-joins { display: flex; flex-direction: column; gap: 6px; }
.fx-joins .btn { justify-content: space-between; text-align: left; }
.tr-catalog { display: flex; flex-direction: column; gap: 10px; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; }
.tr-card { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.tr-card:hover { border-color: var(--border-strong); }
.tr-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tr-demo { position: relative; display: block; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; background: #000; }
.tr-demo i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 16px var(--font-body); font-style: normal; }
.tr-demo .tr-a { background: linear-gradient(135deg, #3a4a3a, #6d7d6d); color: #fff; z-index: 1; }
.tr-demo .tr-b { background: linear-gradient(135deg, #d9ff3b, #8fd13b); color: #0b0f0b; }
.tr-demo .tr-veil { opacity: 0; z-index: 3; }
.tr-name { font-size: 11px; line-height: 1.2; color: var(--text-muted); }
.tr-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* sound of a piece (volume, mute, fades) */
.snd { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: center; }
.src-keep .smark { position: absolute; right: 4px; top: 3px; font: 500 10px/1 var(--font-mono, monospace); color: var(--text);
  background: rgba(8,11,8,.7); padding: 2px 4px; border-radius: 4px; pointer-events: none; }
.src-keep i.fadein, .src-keep i.fadeout { position: absolute; bottom: 0; height: 45%; pointer-events: none; }
.src-keep i.fadein { left: 0; background: linear-gradient(to top right, rgba(217,255,59,.45) 50%, transparent 50%); }
.src-keep i.fadeout { right: 0; background: linear-gradient(to top left, rgba(217,255,59,.45) 50%, transparent 50%); }
@media (max-width: 720px) { .snd { grid-template-columns: 1fr; } }

/* turn and pace of a piece */
.fx-rot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.src-keep .pmark { position: absolute; left: 4px; top: 3px; font: 500 10px/1 var(--font-mono, monospace); color: var(--text);
  background: rgba(8,11,8,.7); padding: 2px 4px; border-radius: 4px; pointer-events: none; }
/* "Монтаж" view (CapCut-like): only the kept pieces, back to back */
.track.edit-view::after { display: none; }
.track.edit-view .src-keep { backdrop-filter: none; top: 2px; bottom: 2px; border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(245,245,240,.55); }
.track.edit-view .src-keep:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.track.edit-view .src-keep.picked { box-shadow: inset 0 0 0 2.5px var(--accent); background: transparent; }
.track.edit-view .jmark.jadd { opacity: .9; background: rgba(245,245,240,.85); }
.file-tile.piece-tile { overflow: hidden; top: 2px; bottom: 2px; border-radius: 6px; box-shadow: none; }
.file-tile.piece-tile + .file-tile.piece-tile { box-shadow: inset 2px 0 0 var(--bg); }
.file-tile.piece-tile .strip { position: absolute; top: 0; bottom: 0; background: center / 100% 100% no-repeat; }
.view-seg { margin-right: 6px; }
.confirm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin: 6px 0;
  border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--accent-soft); font-size: 13px; }
.confirm-bar[hidden] { display: none; }

/* ── teaching the AI: «норм / не норм» on each join ── */
.taste-card { display: grid; gap: 8px; margin-top: 10px; }
.taste-card .btn { justify-self: start; }
.taste-card ul { margin: 4px 0 0; padding-left: 18px; }
.teach-bar { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--accent);
  border-radius: var(--r-sm); background: var(--accent-soft); }
.teach-bar[hidden] { display: none; }
.teach-head { display: flex; align-items: center; gap: 10px; }
.teach-what { flex: 1; font-size: 14px; }
.teach-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.teach-actions .teach-no, .teach-actions .teach-yes { flex: 1; min-width: 120px; height: 44px; font-size: 15px; }
.teach-why { display: grid; gap: 6px; }
.teach-why[hidden], .teach-done[hidden], .teach-actions[hidden] { display: none; }
.teach-done { font-size: 14px; display: grid; gap: 8px; }
.teach-done ul { margin: 0; padding-left: 18px; }
.teach-done .row { display: flex; gap: 8px; flex-wrap: wrap; }
.jmark.teach-now { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── my projects ── */
button.proj { background: transparent; color: var(--text); cursor: pointer; font-family: inherit; gap: 6px; }
button.proj::after { content: "▾"; color: var(--text-dim, #8a8f88); font-size: 11px; }
button.proj:hover { border-color: var(--border-strong); }
.proj-sheet { width: min(1040px, 100%); }
.proj-body { padding: 16px; display: grid; gap: 14px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.proj-card { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); color: var(--text);
  cursor: pointer; font: inherit; min-height: 150px; }
.proj-card:hover, .proj-card:focus-visible { border-color: var(--border-strong); outline: none; }
.proj-card.current { border-color: var(--accent); }
.pc-thumb { position: relative; height: 96px; background: #111 no-repeat center / cover; overflow: hidden; }   /* a poster: one frame */
.pc-thumb.tall { background-size: contain; }
.pc-thumb.tall::before { content: ""; position: absolute; inset: -12px; background: inherit; background-size: cover; filter: blur(12px) brightness(.6); z-index: 0; }
.pc-thumb.tall > .pc-badge { z-index: 1; }
.pc-thumb.tall { isolation: isolate; }
.pc-thumb.tall::after { content: ""; position: absolute; inset: 0; background: inherit; background-size: contain; z-index: 0; }
.pc-badge { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: var(--accent); color: var(--accent-ink); }
.pc-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-width: 0; }
.pc-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pc-input { height: 30px; font-size: 14px; }
.pc-acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.proj-card:hover .pc-acts, .proj-card:focus-within .pc-acts { opacity: 1; }
.pc-acts .btn-icon { background: rgba(0,0,0,.6); color: #fff; }
@media (hover: none) { .pc-acts { opacity: 1; } }
.proj-new { align-items: center; justify-content: center; gap: 6px; border-style: dashed; color: var(--text-dim, #8a8f88); }
.proj-new .pc-plus { font-size: 34px; line-height: 1; color: var(--accent); }
@media (max-width: 520px) { .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-thumb { height: 72px; } }
.tr-sound { display: flex; align-items: center; gap: 8px; }
.tr-sound .select { flex: 1; min-width: 0; height: 32px; }

/* ── looks (filters for the whole video) ── */
.look-pick { display: grid; gap: 6px; margin-top: 10px; }
.look-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.look-card { flex: 0 0 auto; width: 76px; display: grid; gap: 4px; padding: 0; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: transparent; color: var(--text); cursor: pointer; font: inherit; overflow: hidden; }
.look-card i { display: block; height: 46px; background: #333 center / cover no-repeat; }
.look-card span { font-size: 11px; line-height: 1.15; padding: 0 3px 5px; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.look-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.monitor-screen { filter: var(--look, none); }

/* piece effects in the preview (the render: fxplan.effect_chain) */
@keyframes fx-pull { from { scale: 1.1; } to { scale: 1; } }
@keyframes fx-punchin { from { scale: 1.2; } to { scale: 1; } }
@keyframes fx-flash { from { filter: brightness(4) saturate(0); } to { filter: none; } }
@keyframes fx-blurin { from { filter: blur(14px); } to { filter: blur(0); } }
video.fx-pull { animation: fx-pull var(--piece-s, 4s) linear forwards; }
video.fx-punchin { animation: fx-punchin .35s cubic-bezier(0.33, 1, 0.68, 1); }
video.fx-flash { animation: fx-flash .25s linear; }
video.fx-blurin { animation: fx-blurin .5s cubic-bezier(0.33, 1, 0.68, 1); }
video.fx-vhs { filter: saturate(1.25) contrast(1.05) drop-shadow(2px 0 0 rgba(255,0,60,.45)) drop-shadow(-2px 0 0 rgba(0,200,255,.45)); }
video.fx-bw { filter: grayscale(1) contrast(1.1); }
video.fx-vignette { filter: brightness(0.96); }
video.fx-cinebars { clip-path: inset(var(--cine, 12%) 0 var(--cine, 12%) 0); }
.pc-warn { font-size: 11px; color: #ffb454; }
.consent { align-items: flex-start; line-height: 1.4; }
.consent input + span { margin-top: 1px; }
.consent a { color: var(--accent); }
.btn.danger { color: #ff6b6b; border-color: #ff6b6b55; }
#authForgot { margin-left: 12px; }
/* «Забыли пароль?» / a new password: only that form, not the tabs and the social buttons */
.auth-main.recover .auth-tabs, .auth-main.recover #authSocial, .auth-main.recover #authOr { display: none; }

/* ── landing: features, FAQ, footer ── */

.faq details { border-top: 1px solid var(--border); padding: 14px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-dim); }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--text-muted); margin: 10px 0 0; max-width: 760px; }
.faq a, .site-foot a { color: var(--text); }
.site-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 24px 0 40px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.site-foot .grow { flex: 1; }

/* inspector: tabs always in view and all five fit */
.inspector .tabs { position: sticky; top: calc(-1 * var(--sp-4)); z-index: 3; background: var(--bg);
  margin-top: calc(-1 * var(--sp-4)); padding-top: var(--sp-4); gap: 0; justify-content: space-between; }
.inspector .tab { padding: 0 6px; }
.inspector .tab:first-child { padding-left: 0; }
.inspector .tab:last-child { padding-right: 0; }
@media (min-width: 1300px) { .workspace { grid-template-columns: 280px minmax(0, 1fr) 360px; } }

/* export tab: the main action on top, the rest folded */
.out-sec summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
.out-sec summary::-webkit-details-marker { display: none; }
.out-sec summary::after { content: "▾"; margin-left: auto; color: var(--text-dim); transition: transform .15s; }
.out-sec[open] summary::after { transform: rotate(180deg); }
.out-sec[open] { display: flex; flex-direction: column; gap: var(--sp-2); }
.out-sec summary .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.out-main .btn.wide { justify-content: center; }
.ex-title { margin-top: var(--sp-2); }
[data-dev] { display: none !important; }
.is-admin [data-dev]:not([hidden]) { display: flex !important; }
.settings-fold { border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.settings-fold summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.settings-fold summary::-webkit-details-marker { display: none; }
.settings-fold summary::after { content: "▾"; margin-left: auto; color: var(--text-dim); }
.settings-fold[open] summary::after { content: "▴"; }
.settings-fold[open] .settings { margin-top: var(--sp-3); }
@media (max-width: 760px) {
  #btnKeys, #tlPos { display: none; }            /* shortcuts and a second timecode are desktop things */
  .confirm-bar { font-size: 12px; padding: 8px 10px; gap: 6px; }
  .confirm-bar .grow { display: none; }
  .confirm-bar .btn { height: 36px; flex: 1; justify-content: center; }
  .teach-actions .teach-no, .teach-actions .teach-yes { min-width: 0; }
}
.inspector > * { flex-shrink: 0; }              /* a height-bound column must scroll, not squash its rows */

/* ── plans, demo, support, cookies, share ── */

.ba { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter, 16px); }
.ba figure { margin: 0; display: grid; gap: 8px; }
.ba video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--r-md); object-fit: contain; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.price { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 8px; align-content: start; }
.price.hl { border-color: var(--accent); }
.price h3 { margin: 0; font-size: 18px; }
.price .cost { font: 600 26px var(--font-display, inherit); }
.price ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }
.price .btn { justify-self: start; }
.lead-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead-form .input { max-width: 280px; }
.sup-sheet { width: min(560px, 100%); }
.sup-body { padding: 16px; display: grid; gap: 14px; }
.sup-body form { display: grid; gap: 10px; }
.sup-body textarea { min-height: 110px; resize: vertical; font: inherit; }
.help-btn { font-weight: 700; }
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70; display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 760px; margin: 0 auto; }
.cookie-bar[hidden] { display: none; }
/* asked on the landing only: a signed-in person agreed to the policy (the visit counter in it) when signing up, and
   unasked, Metrika stays off — in the app the bar only covered the cabinet's buttons */
body:not(.on-landing) .cookie-bar { display: none; }
.cookie-bar span { flex: 1; min-width: 220px; }
.cookie-bar a { color: var(--accent); }
.plan-line { font-size: 13px; color: var(--text-muted); }
.plan-line b { color: var(--text); }
.verify-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid #ffb45455; color: #ffb454; }
.admin-users table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-users td, .admin-users th { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-users select { font-size: 12px; }
.admin-inbox .msg { border-bottom: 1px solid var(--border); padding: 6px 0; font-size: 12px; white-space: pre-wrap; }
.share-box { display: flex; gap: 6px; }
.share-box .input { flex: 1; min-width: 0; font-size: 12px; }
@media (max-width: 760px) { .ba, .price-grid { grid-template-columns: 1fr; } }

/* ── home: the signed-in start (like CapCut's) ── */
.home-main { display: grid; gap: 28px; padding: 8px 0 40px; }
.home-title { font: 600 34px/1.1 var(--font-display, inherit); margin: 0 0 8px; }
.home-upload .hero-card { margin: 0; }
.home-projects { display: grid; gap: 12px; }
.home-row { display: flex; align-items: center; gap: 12px; }
.home-search { max-width: 240px; height: 34px; }
.home .proj-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

@media (max-width: 520px) { .home-title { font-size: 26px; } .home .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── learning dialog ── */
.learn-sheet { width: min(760px, 100%); }
.learn-body { padding: 16px; display: grid; gap: 14px; }
.learn-body .card { display: grid; gap: 10px; }
.learn-notes { margin: 0; padding-left: 18px; }
.learn-notes li { margin: 3px 0; }
.learn-steps { margin: 0; padding-left: 18px; color: var(--text-muted); display: grid; gap: 4px; }
.learn-prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.learn-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.ref-report { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.ref-score { font: 600 28px var(--font-display, inherit); }
.ref-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.ref-item { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.ref-item .t { font-family: var(--font-mono, monospace); color: var(--text-dim); }
.ref-item .why { color: #ffb454; font-size: 11px; }
.ref-past { display: grid; gap: 4px; }
.ref-past button { text-align: left; }

/* ── teaching: what exactly is being rated ── */
.teach-tag { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: none;
  padding: 6px 12px; border-radius: 999px; font: 600 13px var(--font-body); background: rgba(8,11,8,.8); color: #fff;
  border: 1px solid var(--border-strong); }
.teach-tag.cut { background: rgba(200,40,40,.85); border-color: #ff6b6b; }
.teach-tag.join { background: rgba(215,255,58,.9); color: #111; border-color: var(--accent); }
.monitor-screen.teach-cut-on { box-shadow: inset 0 0 0 3px #ff6b6b; }
.teach-band { position: absolute; top: -3px; bottom: -3px; z-index: 6; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 6px; background: rgba(215,255,58,.10); }
.teach-band i { position: absolute; top: 0; bottom: 0; background: rgba(255,80,80,.35); border-left: 2px solid #ff6b6b; border-right: 2px solid #ff6b6b; }
.teach-ctx { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.teach-ctx q { color: var(--text); quotes: "«" "»"; }
.teach-ctx .cutw { color: #ff8b8b; text-decoration: line-through; }
.home .drop { min-height: 0; padding: 22px 16px; }
.home .hero-card .link-import { margin-top: 10px; }
/* teach bar: the step on its own line, buttons wrap instead of cutting their labels */
.teach-head { flex-wrap: wrap; align-items: flex-start; }
.teach-step { flex: 1 0 100%; order: -1; }
.teach-what { flex: 1; min-width: 0; }
.teach-actions .teach-no, .teach-actions .teach-yes { flex: 1 1 170px; height: auto; min-height: 44px; white-space: normal; }
.teach-actions .btn.sm { flex: 0 1 auto; white-space: nowrap; }
.resume-btn { position: absolute; left: 8px; right: 8px; bottom: 30px; height: 30px; border-radius: 8px; border: 0;
  background: var(--accent); color: var(--accent-ink, #111); font: 600 12px var(--font-body); cursor: pointer; z-index: 2; }

/* the two «rate» buttons wrap instead of pushing the inspector sideways */
.taste-card .row2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: stretch; }
.taste-card .row2 .btn { min-width: 0; white-space: normal; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; line-height: 1.2; }

/* ── project version history ── */
.hist-sheet { max-width: 560px; }
.hist-body { padding: 16px 18px 20px; display: grid; gap: 10px; max-height: min(70vh, 640px); overflow: auto; }
.hist-body p { margin: 0; }
.hist-list { display: grid; gap: 6px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); }
.hist-row .hr-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hist-row b { font-weight: 600; font-size: 14px; }
.hist-row.manual { border-color: rgba(217,255,59,.35); }
.hist-row.now { opacity: .6; }

/* ═════ the piece panel (like the details panel of CapCut) ═════ */
.clip-body .fx-piece { display: flex; flex-direction: column; gap: 14px; }
.clip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.clip-head .label { display: block; margin-bottom: 4px; }
.clip-title { font: 600 15px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.clip-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); }
.clip-nav-btn { height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer;
  font: 600 12px/1 var(--font-body); padding: 0 4px; white-space: nowrap; transition: background .15s, color .15s;  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;}
.clip-nav-btn:hover { color: var(--text); }
.clip-nav-btn.active { background: var(--bg); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-strong); }
.clip-sec { display: flex; flex-direction: column; gap: 12px; }
.clip-sec[hidden] { display: none; }
.prop { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prop.col { flex-direction: column; align-items: stretch; }
.prop-l { font-size: 13px; color: var(--text-muted); }
.prop-v { font: 600 13px var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.prop-hint { margin: -4px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.fx-rot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* speed */
.speed-big { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.speed-big b { font: 700 34px/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.speed-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.speed-chips .chip-btn { height: 32px; padding: 0; justify-content: center; font-variant-numeric: tabular-nums; }
.range-ticks { display: flex; justify-content: space-between; margin-top: -6px; font: 500 11px var(--font-mono); color: var(--text-dim); }

/* sliders in the style of the product: a lime fill, a round knob */
.inspector input[type=range], input.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0;
}
.inspector input[type=range]::-webkit-slider-runnable-track, input.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), rgba(245,245,240,.14) var(--p, 50%));
}
.inspector input[type=range]::-moz-range-track, input.range::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(245,245,240,.14); }
.inspector input[type=range]::-moz-range-progress, input.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.inspector input[type=range]::-webkit-slider-thumb, input.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(217,255,59,.25), 0 2px 6px rgba(0,0,0,.5); transition: transform .12s;
}
.inspector input[type=range]::-moz-range-thumb, input.range::-moz-range-thumb {
  width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(217,255,59,.25);
}
.inspector input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.inspector input[type=range]:disabled { opacity: .4; cursor: not-allowed; }
.inspector input[type=range]:focus-visible { outline: none; }
.inspector input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent); }

/* effect tiles: the piece's own frame, the effect plays on hover */
.fx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fx-tile { display: flex; flex-direction: column; gap: 5px; padding: 4px 4px 7px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.fx-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.fx-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fx-thumb { position: relative; display: block; aspect-ratio: 16/10; border-radius: 7px; overflow: hidden; background: #111; }
.fx-thumb em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 22px; color: var(--text-dim); z-index: 2; }
.fx-pic { position: absolute; inset: 0; background: linear-gradient(135deg, #2c302c, #151815) center / cover no-repeat; }
.fx-tile[data-fx=""] .fx-pic { opacity: .35; }
.fx-name { font-size: 12px; font-weight: 600; line-height: 1.2; padding: 0 3px; }
.fx-group { font-size: 10px; color: var(--text-dim); padding: 0 3px; margin-top: -3px; }
.fx-tile[data-fx="glow"] .fx-pic, .fx-tile[data-fx="bw"] .fx-pic, .fx-tile[data-fx="vhs"] .fx-pic { transition: filter .3s; }
.fx-tile[data-fx="bw"] .fx-pic { filter: grayscale(1); }
.fx-tile[data-fx="glow"] .fx-pic { filter: brightness(1.15) saturate(1.2) drop-shadow(0 0 6px rgba(255,255,255,.6)); }
.fx-tile[data-fx="vhs"] .fx-pic { filter: contrast(1.2) saturate(1.4) hue-rotate(-8deg); }
.fx-tile[data-fx="vignette"] .fx-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.85)); z-index: 1; }
.fx-tile[data-fx="cinebars"] .fx-thumb::before, .fx-tile[data-fx="cinebars"] .fx-thumb::after {
  content: ""; position: absolute; left: 0; right: 0; height: 13%; background: #000; z-index: 1; }
.fx-tile[data-fx="cinebars"] .fx-thumb::before { top: 0; } .fx-tile[data-fx="cinebars"] .fx-thumb::after { bottom: 0; }
.fx-tile:hover[data-fx="push"] .fx-pic { animation: fxp-push 1.6s ease-in-out infinite; }
.fx-tile:hover[data-fx="pull"] .fx-pic { animation: fxp-pull 1.6s ease-in-out infinite; }
.fx-tile:hover[data-fx="punchin"] .fx-pic { animation: fxp-punch 1.2s cubic-bezier(.2,.8,.2,1) infinite; }
.fx-tile:hover[data-fx="shake"] .fx-pic { animation: fxp-shake 1.2s linear infinite; }
.fx-tile:hover[data-fx="flash"] .fx-pic { animation: fxp-flash 1.2s ease-out infinite; }
.fx-tile:hover[data-fx="blurin"] .fx-pic { animation: fxp-blur 1.4s ease-out infinite; }
.fx-tile:hover[data-fx="rgb"] .fx-pic { animation: fxp-rgb 1.2s steps(6) infinite; }
.fx-tile:hover[data-fx="vhs"] .fx-pic { animation: fxp-vhs .5s steps(3) infinite; }
.fx-tile:hover[data-fx="glow"] .fx-pic { animation: fxp-glow 1.4s ease-in-out infinite; }
@keyframes fxp-push { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes fxp-pull { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes fxp-punch { 0% { transform: scale(1.25); } 40%, 100% { transform: scale(1); } }
@keyframes fxp-shake { 0%, 40%, 100% { transform: translate(0); } 5% { transform: translate(-4px, 2px) rotate(-1deg); }
  10% { transform: translate(4px, -2px) rotate(1deg); } 15% { transform: translate(-3px, -1px); } 20% { transform: translate(2px, 2px); } }
@keyframes fxp-flash { 0% { filter: brightness(3); } 45%, 100% { filter: brightness(1); } }
@keyframes fxp-blur { 0% { filter: blur(8px); } 60%, 100% { filter: blur(0); } }
@keyframes fxp-rgb { 0%, 100% { filter: drop-shadow(3px 0 0 rgba(255,0,60,.8)) drop-shadow(-3px 0 0 rgba(0,220,255,.8)); }
  50% { filter: drop-shadow(-2px 0 0 rgba(255,0,60,.8)) drop-shadow(2px 0 0 rgba(0,220,255,.8)); } }
@keyframes fxp-vhs { 0% { transform: translateX(0); } 33% { transform: translateX(-2px) skewX(-2deg); } 66% { transform: translateX(2px); } }
@keyframes fxp-glow { 50% { filter: brightness(1.35) saturate(1.3) drop-shadow(0 0 10px rgba(255,255,255,.8)); } }

/* transitions of this piece: two cards, the catalog opens below */
.fx-joins { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.join-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 84px; text-align: left;
  border: 1px dashed var(--border-strong); border-radius: 12px; background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s; }
.join-card[hidden] { display: none; }
.join-card:hover { border-color: var(--accent); background: rgba(217,255,59,.04); }
.join-card.on { border-style: solid; }
.join-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.join-card .jc-side { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.join-card b { font-size: 13px; line-height: 1.3; }
.join-card .jc-go { font-size: 12px; color: var(--accent); margin-top: auto; }
.clip-body .tr-catalog { padding-top: 4px; border-top: 1px solid var(--border); }

/* joins on the timeline: visible, clickable, say what is there */
.jmark {
  width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: none; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.6); transition: transform .12s;
}
.jmark::before { content: "⇄"; font: 700 11px/1 var(--font-body); color: #0b0b0b; font-style: normal; }
.jmark:hover { background: #fff; transform: scale(1.15); }
.jmark.jadd { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: rgba(8,11,8,.88); border: 1.5px solid rgba(245,245,240,.75); opacity: .9; }
.jmark.jadd::before { content: "+"; color: var(--text); font-size: 13px; }
.track:hover .jmark.jadd { opacity: 1; }
.jmark.jadd:hover { background: var(--accent); opacity: 1; }
.jmark.jadd:hover::before { color: #0b0b0b; }
.track.edit-view .jmark.jadd { background: rgba(8,11,8,.88); opacity: .95; }

/* transition tiles with this cut's own frames */
.tr-demo.real i { background-size: cover; background-position: center; font-size: 0; }
.tr-demo.real .tr-b.tint { filter: hue-rotate(70deg) saturate(1.4) brightness(.85); }   /* no next frame yet: A and B still differ */
.src-keep .emark { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font: 600 10px/1 var(--font-body); color: #0b0b0b; background: var(--accent); padding: 2px 5px;
  border-radius: 4px; pointer-events: none; z-index: 2; }
.clip-body .seg-btn.wide.active { color: var(--accent); }

/* support: the Telegram chat first */
.sup-tg { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #2AABEE, #229ED9); box-shadow: 0 8px 24px -8px rgba(34,158,217,.7); }
.sup-tg[hidden] { display: none; }
.sup-tg svg { width: 30px; height: 30px; fill: #fff; flex: 0 0 30px; }
.sup-tg span { display: grid; gap: 2px; }
.sup-tg b { font-size: 16px; }
.sup-tg small { font-size: 12px; opacity: .85; }
.sup-tg:hover { filter: brightness(1.08); }

/* ═════ the library on the left (like CapCut): tabs with icons on top ═════ */
.panel.media.lib { padding-top: 10px; }
.lib-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 0 -6px 4px; }
.lib-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 2px 6px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-muted); font: 600 10.5px/1 var(--font-body); cursor: pointer; transition: background .15s, color .15s; }
.lib-tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lib-tab:hover { color: var(--text); background: var(--surface-2); }
.lib-tab.active { color: var(--accent); background: rgba(217,255,59,.08); }
.lib-body { display: flex; flex-direction: column; gap: var(--sp-3); min-height: 0; }
.lib-body[hidden] { display: none; }
.lib-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chips .chip-btn { height: 28px; font-size: 12px; padding: 0 10px; }
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: auto; max-height: 52vh; align-content: start; padding-right: 2px; }
.lib-grid.tr-grid { max-height: 52vh; }
/* a phone / tablet: the library is a sheet that scrolls itself — its grids go down with it, never a scroll in a scroll
   (the tiles below the fold could not be reached: the inner list scrolled out of sight) */
@media (max-width: 900px) { .lib-grid, .lib-grid.tr-grid { max-height: none; overflow: visible; } }
.lib-item { cursor: grab; }
.lib-item:active { cursor: grabbing; }
.look-tile { display: flex; flex-direction: column; gap: 5px; padding: 4px 4px 7px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 600 12px var(--font-body); text-align: left; }
.look-tile i { display: block; aspect-ratio: 16/10; border-radius: 7px; background: #222 center / cover no-repeat; }
.look-tile:hover { border-color: var(--border-strong); }
.look-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.look-tile span { padding: 0 3px; }
/* the tracks go down with the panel, never in a box of their own: on a phone that box sat below the sheet's edge,
   under the format's 4–5 picks — the library looked like those four tracks (285 were in it) */
.lib-music { display: flex; flex-direction: column; gap: 6px; }
.lib-track { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lib-track.active { border-color: var(--accent); }
.lt-play, .lt-add { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 12px; }
.lt-add { font-size: 18px; line-height: 1; }
.lib-track.active .lt-add { background: var(--accent); color: #0b0b0b; border-color: var(--accent); }
.lt-play:hover, .lt-add:hover { border-color: var(--accent); }
.lt-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lt-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-meta span { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* while dragging from the library: where it can land lights up */
body.lib-drag-tr .jmark { transform: scale(1.35); background: rgba(217,255,59,.35); border-color: var(--accent); opacity: 1; }
body.lib-drag-tr .jmark.drop-hot { background: var(--accent); transform: scale(1.7); }
body.lib-drag-fx .src-keep { outline: 1px dashed rgba(217,255,59,.5); outline-offset: -1px; }
body.lib-drag-fx .src-keep.drop-hot { outline: 2px solid var(--accent); background-color: rgba(217,255,59,.18); }
body.lib-dragging .track.drop-hot { box-shadow: inset 0 0 0 2px var(--accent); }
.lib-flash { animation: lib-flash 1.2s ease-out; }
@keyframes lib-flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* the library scrolls inside its column: a long list must not push the timeline down */
@media (min-width: 1101px) {
  .panel.media.lib { contain: size; overflow-y: auto; overscroll-behavior: contain; }
  .panel.media.lib .lib-tabs { position: sticky; top: -10px; z-index: 3; background: var(--bg); padding-top: 4px; }
  .lib-grid, .lib-grid.tr-grid, .lib-music { max-height: none; overflow: visible; }
}

/* ═════ reel editor: scrub, pieces, tabs, framing, text looks ═════ */
.phone .ov-title, .phone .ov-texts { position: absolute; inset: 0; top: 0; left: 0; right: 0; pointer-events: none; font: inherit; color: inherit; }
.phone .ov-texts .tx { pointer-events: auto; cursor: grab; }
.phone .ov-texts .tx:active { cursor: grabbing; }
.phone .tx { position: absolute; transform: translate(-50%, -50%); max-width: 88%; width: max-content; text-align: center;
  font-family: "DejaVu Sans", var(--font-body); font-weight: 700; line-height: 1.15; white-space: pre-wrap; overflow-wrap: anywhere; }
.phone .ov-texts .tx.tx-picked { outline: 1.5px dashed rgba(217,255,59,.9); outline-offset: 4px; }
.phone .ov-texts .tx { right: auto; bottom: auto; }
/* the six looks — the same as reels.TEXT_STYLES in the render */
.tx-stroke { color: #fff; -webkit-text-stroke: .11em #000; paint-order: stroke fill; }
.tx-clean  { color: #fff; text-shadow: 0 .04em .12em rgba(0,0,0,.75), 0 0 .04em #000; }
.tx-accent { color: #D9FF3B; -webkit-text-stroke: .1em #000; paint-order: stroke fill; }
.tx-neon   { color: #fff; text-shadow: 0 0 .06em #D9FF3B, 0 0 .18em #D9FF3B, 0 0 .36em rgba(217,255,59,.7); }
.tx-shadow { color: #fff; text-shadow: .05em .08em .14em rgba(0,0,0,.85); }
.tx-box    { color: #000; background: #fff; padding: .08em .3em; border-radius: .15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.phone-bar { width: 100%; }
.phone-bar .reel-seek { flex: 1; min-width: 0; }
.reel-seek { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.reel-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), rgba(245,245,240,.16) var(--p, 0%)); }
.reel-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: #fff; }
.reel-seek::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(245,245,240,.16); }
.reel-seek::-moz-range-progress { height: 6px; background: var(--accent); border-radius: 3px; }
.reel-strip { position: relative; display: flex; gap: 3px; width: 100%; height: 30px; cursor: pointer; }
.rs-piece { display: grid; place-items: center; min-width: 14px; border-radius: 6px; font: 600 11px var(--font-mono); font-style: normal;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border-strong); }
.rs-piece.framed { border-color: rgba(217,255,59,.6); }
.rs-piece.active { background: rgba(217,255,59,.14); color: var(--text); border-color: var(--accent); }
.rs-head { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px #fff; pointer-events: none; }
.reel-cut { display: flex; gap: 8px; width: 100%; }
.reel-cut .btn { flex: 1; }

.reel-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); }
.reel-tab { height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: 600 13px var(--font-body); cursor: pointer; }
.reel-tab:hover { color: var(--text); }
.reel-tab.active { background: var(--bg); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-strong); }
.reel-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.reel-sec[hidden] { display: none; }
.reel-msg { min-height: 18px; }
.reel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.frame-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid rgba(217,255,59,.35); }
.frame-tools[hidden] { display: none; }
.phone.framing { cursor: grab; box-shadow: 0 0 0 2px var(--accent); }
.phone.framing:active { cursor: grabbing; }
.frame-hint { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5; padding: 6px 8px; border-radius: 8px; text-align: center;
  font: 600 11px var(--font-body); color: #0b0b0b; background: var(--accent); pointer-events: none; }
.frame-hint[hidden] { display: none; }
.tx-styles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tx-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: #1b1f1b; color: var(--text-muted); cursor: pointer; }
.tx-chip .tx { position: static; transform: none; font: 800 18px/1 "DejaVu Sans", var(--font-body); }
.tx-chip small { font-size: 10.5px; }
.tx-chip.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--text); }
.sm-range { flex: 1; min-width: 80px; }
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.tx-row.active { border-color: var(--accent); }
.tx-top, .tx-mid, .tx-time { display: flex; align-items: center; gap: 8px; }
.tx-top .input { flex: 1; }
.tx-mid .select { width: 120px; }
.tx-color { width: 32px; height: 28px; padding: 0; border: 1px solid var(--border-strong); border-radius: 6px; background: none; }
.tx-time .chip-btn { height: 28px; font-size: 12px; font-variant-numeric: tabular-nums; }
.reel-ctrl input[type=range]:not(.reel-seek) { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.reel-ctrl input[type=range]:not(.reel-seek)::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), rgba(245,245,240,.14) var(--p, 50%)); }
.reel-ctrl input[type=range]:not(.reel-seek)::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(217,255,59,.25); }

/* the seller's details: plain text in every footer (payment providers check it) */
.site-foot .foot-req { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--text-dim); }

/* everything on the phone can be grabbed: own texts, the hook title, the captions */
.phone .ov-title .tx { pointer-events: auto; cursor: grab; }
:is(.phone, .cap-box) .ov-cap { cursor: grab; touch-action: none; }
:is(.phone, .cap-box) .ov-cap:active, .phone .ov-title .tx:active { cursor: grabbing; }
.phone .tx:hover, :is(.phone, .cap-box) .ov-cap:hover { outline: 1px dashed rgba(255,255,255,.55); outline-offset: 4px; }
.phone .ov-texts .tx.tx-off { opacity: .45; }
.phone { touch-action: none; }

/* ─────────── sign in: a pitch on the left, one-tap socials, then e-mail ─────────── */
.auth-sheet:has(#authIn:not([hidden])) { width: min(900px, 100%); }
.auth-sheet:has(#authIn:not([hidden])) .auth-body { padding: 0; }
.auth-split { display: grid; grid-template-columns: 5fr 6fr; min-height: 520px; }
.auth-pitch { position: relative; overflow: hidden; padding: 36px 32px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid var(--border);
  background: radial-gradient(120% 70% at 0% 0%, rgba(217,255,59,.16), transparent 60%),
              radial-gradient(90% 60% at 100% 100%, rgba(139,92,246,.22), transparent 65%), var(--surface); }
.auth-pitch .logo { color: var(--accent); }
.auth-pitch h3 { margin: 0; font: 600 30px/1.08 var(--font-display); letter-spacing: -.02em; }
.auth-pitch h3 em { font-style: normal; color: var(--accent); }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-pitch li { position: relative; padding-left: 26px; color: var(--text-muted); font-size: 14px; line-height: 1.45; }
.auth-pitch li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230B0B0B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.auth-pitch-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.auth-pitch-foot b { font: 700 40px/1 var(--font-display); color: var(--accent); }
.auth-pitch-foot span { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.auth-main { padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.auth-main form { display: flex; flex-direction: column; gap: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); }
.auth-tab { height: 34px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-muted);
  font: 600 13px var(--font-body); cursor: pointer; transition: background var(--dur-base) var(--ease), color var(--dur-base); }
.auth-tab.active { background: var(--text); color: var(--accent-ink); }
.auth-main .auth-title { font: 600 26px/1.1 var(--font-display); letter-spacing: -.015em; margin: 6px 0 0; }
.auth-sub { margin: -6px 0 2px; color: var(--text-muted); font-size: 14px; }
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social[hidden] { display: none; }
.soc { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 12px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: 600 14px var(--font-body); text-decoration: none; transition: border-color var(--dur-base), transform var(--dur-fast), background var(--dur-base); }
.soc:hover { border-color: var(--text-muted); background: #1a1f1a; }
.soc:active { transform: scale(.98); }
.soc svg { width: 22px; height: 22px; flex: none; }
.soc-yandex { background: #fff; color: #000; border-color: #fff; }
.social.odd .soc:first-child { grid-column: 1 / -1; }
.soc-yandex:hover { background: #f2f2f2; border-color: #f2f2f2; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-or[hidden] { display: none; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; border: 0;
  background: none; cursor: pointer; opacity: .5; font-size: 15px; filter: grayscale(1); }
.pw-eye.on, .pw-eye:hover { opacity: 1; }
.auth-go { height: 46px; font-size: 15px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth-legal { margin: auto 0 0; font-size: 11px; line-height: 1.45; color: var(--text-dim); }
.auth-legal a { color: var(--text-muted); }
.auth-legal[hidden] { display: none; }
@media (max-width: 760px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-pitch { padding: 20px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-pitch h3 { font-size: 22px; }
  .auth-pitch ul, .auth-pitch-foot { display: none; }
  .auth-main { padding: 18px 16px; }
  .social { grid-template-columns: 1fr; }
}

/* ─────────── the paywall ─────────── */
.pay-modal { z-index: 60; backdrop-filter: blur(6px); }
.pay-sheet { position: relative; width: min(1040px, 100%); max-height: 100%; overflow: auto; border-radius: var(--r-xl);
  border: 1px solid var(--border-strong); padding: 40px 32px 28px;
  background: radial-gradient(80% 50% at 50% 0%, rgba(139,92,246,.20), transparent 70%), var(--bg); }
.pay-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.pay-head { text-align: center; display: grid; justify-items: center; gap: 14px; }
.pay-kicker { font: 600 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  padding: 6px 12px; border-radius: var(--r-pill); background: var(--accent-soft); }
.pay-head h2 { margin: 0; font: 600 clamp(26px, 4vw, 40px)/1.05 var(--font-display); letter-spacing: -.025em; max-width: 20ch; }
.pay-head h2 em { font-style: normal; color: var(--accent); }
.period { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); }
.period-btn { height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-muted);
  font: 600 13px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.period-btn.active { background: var(--text); color: var(--accent-ink); }
.period-btn b { font-size: 11px; padding: 2px 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); }
.pay-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 272px)); justify-content: center; gap: 14px; margin-top: 28px; align-items: stretch; }
.pay-card.free { opacity: .92; }
.pay-card.free.now { border-color: var(--text-muted); }
.pay-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 20px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface); }
.pay-card.hot { border-color: var(--accent); background: linear-gradient(180deg, rgba(217,255,59,.08), transparent 45%), var(--surface);
  box-shadow: 0 0 0 1px var(--accent), 0 24px 60px -24px rgba(217,255,59,.35); }
.pay-card.focus:not(.hot) { border-color: var(--text-muted); }
.pay-badge { position: absolute; top: -11px; left: 20px; padding: 4px 10px; border-radius: var(--r-pill); font: 700 11px var(--font-body);
  background: var(--accent); color: var(--accent-ink); }
.pay-badge.alt { background: #8B5CF6; color: #fff; }
.pay-card h3 { margin: 0; font: 600 18px var(--font-display); }
.pay-price { display: flex; align-items: baseline; gap: 6px; }
.pay-price b { font: 700 36px/1 var(--font-display); letter-spacing: -.02em; }
.pay-price span { color: var(--text-muted); font-size: 13px; }
.pay-note { font-size: 12px; color: var(--text-muted); min-height: 1.3em; }
.pay-card ul { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 8px; flex: 1; }
.pay-card li { position: relative; padding-left: 22px; font-size: 13px; color: var(--text); }
.pay-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pay-buy { width: 100%; height: 44px; }
.pay-extra { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px;
  border-radius: var(--r-lg); border: 1px dashed var(--border-strong); background: var(--surface); }
.pay-extra[hidden] { display: none; }
.pay-extra > div { display: grid; gap: 2px; }
.pay-trust { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  font-size: 12px; color: var(--text-muted); }
.pay-trust li::before { content: "● "; color: var(--accent); font-size: 8px; vertical-align: 2px; }
.pay-msg { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--text-muted); min-height: 1em; }
.pay-msg b { color: var(--text); }
@media (max-width: 820px) {
  .pay-sheet { padding: 36px 16px 20px; border-radius: 0; height: 100%; }
  .pay-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .pay-card.hot { order: -1; }
  .pay-extra { flex-direction: column; align-items: stretch; }
}

/* ─────────── «wait — −50 % on the first month» ─────────── */
.offer-modal { z-index: 70; backdrop-filter: blur(8px); }
.offer-card { position: relative; width: min(440px, 100%); padding: 36px 28px 24px; border-radius: var(--r-xl); text-align: center;
  display: grid; justify-items: center; gap: 14px; border: 1px solid rgba(217,255,59,.45);
  background: radial-gradient(100% 60% at 50% 0%, rgba(217,255,59,.18), transparent 70%),
              radial-gradient(90% 60% at 50% 100%, rgba(139,92,246,.25), transparent 70%), var(--surface);
  animation: offerIn .45s var(--ease); }
@keyframes offerIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.offer-badge { font: 700 11px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent); padding: 6px 12px; border-radius: var(--r-pill); }
.offer-card h2 { margin: 0; font: 700 30px/1.05 var(--font-display); letter-spacing: -.02em; }
.offer-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; }
.offer-price s { color: var(--text-dim); font-size: 20px; }
.offer-price b { font: 700 46px/1 var(--font-display); color: var(--accent); }
.offer-price span { color: var(--text-muted); font-size: 13px; width: 100%; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-muted); }
.offer-list li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.offer-timer { display: flex; align-items: baseline; gap: 8px; padding: 10px 18px; border-radius: var(--r-md);
  background: rgba(8,11,8,.6); border: 1px solid var(--border); }
.offer-timer span { font: 700 26px/1 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.offer-timer small { color: var(--danger); font-size: 12px; }
.offer-take { width: 100%; height: 50px; font-size: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 90; opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: var(--r-md); background: var(--text); color: var(--accent-ink); font: 600 14px var(--font-body);
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease); max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ─────────── «Обратная связь»: always in sight ─────────── */
.fb-fab { position: fixed; right: 0; top: 50%; z-index: 45; transform: translateY(-50%); writing-mode: vertical-rl;
  display: flex; align-items: center; gap: 10px; padding: 16px 10px; border: 0; border-radius: 12px 0 0 12px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--font-body); letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px var(--border-strong); transition: padding var(--dur-base) var(--ease), color var(--dur-base); }
.fb-fab:hover { color: var(--accent); }   /* quiet: the lime is for the next step on the screen */
.fb-fab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  transform: rotate(90deg); }
.fb-fab span { transform: rotate(180deg); }
.fb-fab:hover { padding-right: 14px; filter: brightness(1.05); }
.fb-fab[hidden] { display: none; }
body:has(.reel-modal:not([hidden])) .fb-fab { display: none; }
.fb-rec { position: fixed; right: 16px; bottom: 16px; z-index: 95; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--danger); box-shadow: 0 10px 40px -10px #000; }
.fb-rec[hidden] { display: none; }
.fb-rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: fbBlink 1s infinite; }
.fb-rec span { font: 600 13px var(--font-mono); font-variant-numeric: tabular-nums; }
@keyframes fbBlink { 50% { opacity: .25; } }
.fb-modal { z-index: 65; backdrop-filter: blur(6px); }
.fb-sheet { position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 28px 24px 22px; border-radius: var(--r-xl);
  border: 1px solid var(--border-strong); display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(90% 40% at 0% 0%, rgba(217,255,59,.10), transparent 70%), var(--bg); }
.fb-sheet h2 { margin: 0; font: 600 26px/1.1 var(--font-display); letter-spacing: -.015em; }
.fb-lead { margin: -4px 0 2px; }
.fb-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-kind { height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: none;
  color: var(--text-muted); font: 600 13px var(--font-body); cursor: pointer; }
.fb-kind.active { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.fb-text { width: 100%; min-height: 110px; resize: vertical; padding: 12px; font: 400 15px/1.45 var(--font-body); height: auto; }
.fb-drop { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); transition: border-color var(--dur-base), background var(--dur-base); }
.fb-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.fb-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-tools [hidden] { display: none; }
.fb-file { cursor: pointer; }
.fb-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fb-files:empty { display: none; }
.fb-thumb { position: relative; aspect-ratio: 16/10; border-radius: var(--r-sm); overflow: hidden; background: #000; border: 1px solid var(--border); }
.fb-thumb img, .fb-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-thumb b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 18px; text-shadow: 0 1px 6px #000; }
.fb-thumb span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(8,11,8,.8); }
.fb-thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(8,11,8,.85); color: var(--text); font-size: 14px; line-height: 1; }
.fb-thumb button:hover { background: var(--danger); color: var(--accent-ink); }
.fb-msg { text-align: left; margin: 0; }
.fb-send { height: 48px; font-size: 15px; }
@media (max-width: 760px) {
  .fb-fab { top: auto; bottom: 16px; right: 16px; transform: none; writing-mode: horizontal-tb; border-radius: var(--r-pill); padding: 12px 16px; }
  .fb-fab svg, .fb-fab span { transform: none; }
  .fb-fab:hover { padding-right: 16px; }
  .fb-sheet { border-radius: 0; height: 100%; padding: 24px 16px 16px; }
}

/* ─────────── audit fixes: mobile editor bar, the feedback tab, small layout slips ─────────── */
.pay-cur { height: 44px; display: grid; place-items: center; border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  color: var(--text-muted); font: 600 13px var(--font-body); }
.log-wrap { display: none; }
body.is-admin .log-wrap { display: block; }
#authNote:empty { display: none; }
.ruler i:last-child b { left: auto; right: 5px; }
/* in the editor the tab sits low and slim, clear of the inspector's cards */
body:has(#work:not([hidden])) .fb-fab { top: auto; bottom: 96px; transform: none; padding: 12px 7px; font-size: 11px; gap: 6px; }
body:has(#work:not([hidden])) .fb-fab svg { width: 15px; height: 15px; }
@media (max-width: 760px) {
  html, body { overflow-x: clip; }
  /* history stays (it was the only way back to an earlier version); the name gives up the room */
  #helpBtn, .topbar .acct-btn span { display: none; }
  .proj { max-width: 72px; }
  .topbar #dl .txt { display: none; }              /* the download button: an icon (it stuck out 4 px) */
  /* the reel's «Начало / Конец» nudges: one under the other, wrapping (+0,5 / +3 с were off screen) */
  .row2.trim { grid-template-columns: 1fr; }
  .nudge { flex-wrap: wrap; }
  body:has(.lp-sticky.on) .fb-fab { bottom: 80px; }
  body:has(#work:not([hidden])) .fb-fab { bottom: 16px; padding: 12px 16px; font-size: 13px; }
}
.fail-line { display: block; color: var(--text); }
.fail-line code { display: block; margin-top: 6px; font-size: 11px; color: var(--text-dim); white-space: pre-wrap; }
.fail-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ═══════════ v2.56 — one accent per screen, calm secondary buttons ═══════════ */
/* secondary = a quiet outline; only .btn-primary is lime, so the one important button stands out */
.btn, .btn-secondary { background: transparent; border-color: rgba(245,245,240,.16); }
.btn:hover, .btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: none; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255,107,94,.4); }
.btn.danger:hover { background: rgba(255,107,94,.1); border-color: var(--danger); }

/* every slider on the site: lime fill and a round knob (the browser's blue one is gone) */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 50%), rgba(245,245,240,.14) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(245,245,240,.14); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(217,255,59,.25), 0 2px 6px rgba(0,0,0,.5); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(217,255,59,.25); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
/* a keyboard sees where it is in a field too (a 1px border tint alone was too faint) */
.input:focus-visible, .select:focus-visible, .wish-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* a file picker that looks like the product, not like 2010 */
.file-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px dashed var(--border-strong); color: var(--text); font: 500 13px var(--font-body); transition: border-color var(--dur-base), background var(--dur-base); }
.file-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-btn .ic { width: 16px; height: 16px; }
.color-field input[type=color] { border-radius: 8px; cursor: pointer; }

/* ─── the cabinet ─── */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.home-head .home-title { margin: 0 0 6px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.home-col { display: grid; gap: 28px; min-width: 0; }
.home-side { display: grid; gap: 12px; position: sticky; top: 16px; }
.up-card { padding: 14px; display: grid; gap: 10px; }
.up-drop { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 0; gap: 18px; padding: 26px 24px;
  border: 1px dashed rgba(217,255,59,.45); background: linear-gradient(135deg, rgba(217,255,59,.07), transparent 55%), var(--bg); }
.up-drop:hover, .up-drop.over { background: linear-gradient(135deg, rgba(217,255,59,.14), transparent 60%), var(--bg); }
.up-ico { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 16px; background: var(--accent-soft); }
.up-ico .drop-ico { stroke: var(--accent); width: 28px; height: 28px; }
.up-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.up-pick { height: 44px; padding: 0 20px; font-size: 14px; pointer-events: none; }
.link-fold > summary { cursor: pointer; color: var(--text-muted); list-style: none; padding: 2px 4px; }
.link-fold > summary::-webkit-details-marker { display: none; }
.link-fold > summary::before { content: "＋ "; color: var(--accent); }
.link-fold[open] > summary::before { content: "− "; }
.link-fold .link-import { margin-top: 10px; }
.home-empty { padding: 24px; border: 1px dashed var(--border); border-radius: var(--r-md); color: var(--text-muted); }
.home-empty b { color: var(--text); font-size: 15px; }
.home-empty ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
/* the plan card: the only lime-tinted thing in the side column */
.side-card { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: var(--r-md); cursor: pointer; color: var(--text);
  border: 1px solid rgba(217,255,59,.35); background: linear-gradient(160deg, rgba(217,255,59,.10), transparent 60%), var(--surface); font: inherit; }
.side-card:hover { border-color: var(--accent); }
.side-card b { font: 600 20px/1.1 var(--font-display); }
.plan-meter { height: 6px; border-radius: 3px; background: rgba(245,245,240,.1); overflow: hidden; }
.plan-meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease); }
.side-go { color: var(--accent); font: 600 13px var(--font-body); margin-top: 4px; }
.side-list { display: grid; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.side-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 13px 14px; border: 0;
  border-top: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.side-item:first-child { border-top: 0; }
.side-item:hover { background: var(--surface-2); }
.side-item > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.side-item b { font-size: 14px; font-weight: 600; }
.side-item .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item i { font-style: normal; color: var(--text-dim); font-size: 18px; }
.side-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); font-size: 14px; }
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-side { position: static; }
}
@media (max-width: 600px) {
  .up-drop { flex-wrap: wrap; padding: 20px 16px; }
  .up-pick { width: 100%; justify-content: center; }
  .up-ico { width: 44px; height: 44px; }
}

/* ─── the account window: a head, tabs, sections, a danger zone ─── */
.acc-head { display: flex; align-items: center; gap: 14px; }
.acc-ava { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 18px var(--font-display);
  background: var(--accent); color: var(--accent-ink); }
.acc-id { flex: 1; min-width: 0; display: grid; gap: 2px; }
.acc-id b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.acc-tab { height: 38px; padding: 0 14px; border: 0; background: none; color: var(--text-muted); font: 600 13px var(--font-body); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.acc-tab:hover { color: var(--text); }
.acc-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-only { display: none; }
body.is-admin .admin-only { display: inline-block; }
.acc-pane { display: grid; gap: 12px; }
.acc-pane[hidden] { display: none; }
.acc-sec { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); }
.acc-sec .pw-change summary { color: var(--text); font-weight: 600; }
.danger-zone { border-color: rgba(255,107,94,.25); }
.danger-zone .pw-change summary { color: var(--danger); }
.brand-kit > summary { display: none; }
.bk-h { margin: 8px 0 0; font: 600 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.bk-h:first-of-type { margin-top: 0; }
.bk-grid { margin-top: 0; }
.plan-pill { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent);
  font: 600 11px var(--font-body); margin-right: 4px; }
.acc-id .plan-line { font-size: 12px; }
.bk-row2 .field { flex: 1 1 150px; }
.bk-row2 .field .select { width: 100%; }
.fb-kind { display: inline-flex; align-items: center; gap: 6px; }
.fb-kind .ic, .fb-tools .ic { width: 15px; height: 15px; }
.pw-eye { filter: none; opacity: .55; display: grid; place-items: center; }
.pw-eye .ic { width: 18px; height: 18px; }

/* ─── the edit in words ─── */
.wish { display: grid; gap: 8px; }
.wish-l { font-size: 13px; }
.wish-t { width: 100%; min-height: 58px; resize: vertical; padding: 10px 12px; font: 400 14px/1.45 var(--font-body); height: auto; }
.wish-t:focus { border-color: var(--accent); outline: none; }
.wish-chips, .ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wish-chips .chip-btn, .ask-chips .chip-btn { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: none; color: var(--text-muted); font: 500 12px var(--font-body); cursor: pointer; }
.wish-chips .chip-btn:hover, .ask-chips .chip-btn:hover { border-color: var(--accent); color: var(--text); }
.wish-got, .ask-got { margin: 0; color: var(--text-muted); min-height: 1.2em; line-height: 1.8; }
.got-chip { display: inline-block; margin: 0 4px 2px 0; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-weight: 600; font-size: 12px; }
.btn-ai { border-color: rgba(217,255,59,.45); color: var(--accent); }
.btn-ai:hover { background: var(--accent-soft); border-color: var(--accent); }
.ask-pop { margin: 8px 12px 0; padding: 14px 16px; border-radius: var(--r-md); display: grid; gap: 10px;
  border: 1px solid rgba(217,255,59,.4); background: linear-gradient(160deg, rgba(217,255,59,.07), transparent 60%), var(--surface); }
.ask-pop[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 10px; }
.ask-row { display: flex; gap: 8px; }
.ask-row .input { flex: 1; min-width: 0; }
/* in a column «flex: 1» made the field 13 px high */
@media (max-width: 760px) { .ask-row { flex-direction: column; } .ask-row .input { flex: none; min-height: 44px; } }
/* the next step after adding files: the wish, then «Начать монтаж» */
.start-card { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border-radius: var(--r-md);
  border: 1px solid rgba(217,255,59,.45); background: linear-gradient(160deg, rgba(217,255,59,.08), transparent 60%), var(--surface); }
.start-card[hidden] { display: none; }
.start-card .wish-t { min-height: 72px; font-size: 13px; }
.start-card .wish-chips .chip-btn { height: 26px; font-size: 11.5px; padding: 0 9px; }
.start-card #startBtn { height: 42px; font-size: 14px; }
.monitor-screen video.local-prev { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none;
  object-fit: contain; background: #000; z-index: 4; border-radius: inherit; transform: none; }
.local-prev[hidden], .local-tag[hidden] { display: none; }
.local-tag { position: absolute; left: 12px; top: 12px; z-index: 5; padding: 4px 10px; border-radius: 999px; font: 600 12px var(--font-body);
  background: rgba(8,11,8,.8); color: var(--accent); border: 1px solid rgba(217,255,59,.35); pointer-events: none; }
.monitor-screen video.local-prev.cant { opacity: .25; }
.side-app { display: grid; gap: 6px; padding: 13px 14px; border-top: 1px solid var(--border); }
.side-app[hidden] { display: none; }
.side-app b { font-size: 14px; }
.side-app-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.side-app-row [hidden] { display: none; }
/* the note under the sign-in columns sits inside the window, not glued to its edge */
.auth-sheet:has(#authIn:not([hidden])) #authNote { margin: 0; padding: 12px 32px 16px; border-top: 1px solid var(--border); }

/* «Попросить ИИ» floats over the editor instead of pushing it off the screen */
.ask-pop { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(760px, calc(100% - 32px));
  margin: 0; z-index: 40; box-shadow: 0 24px 60px -12px rgba(0,0,0,.8); }
@media (max-width: 760px) {
  /* the feedback tab: a small round button, clear of the player and the pricing buttons */
  .fb-fab span { display: none; }
  .fb-fab, body:has(#work:not([hidden])) .fb-fab { width: 44px; height: 44px; padding: 0; justify-content: center; bottom: 88px; right: 12px; }
  .confirm-bar .btn { white-space: normal; height: auto; min-height: 34px; line-height: 1.2; padding: 6px 10px; }
  .nav { gap: 12px; }
}
.ask-prog { display: block; height: 4px; border-radius: 2px; background: rgba(245,245,240,.1); overflow: hidden; margin: 2px 0 6px; }
.ask-prog i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s linear; }

/* the consent bar sits above the landing's sticky button, never on top of it */
body:has(.lp-sticky.on) .cookie-bar { bottom: 80px; }

/* in the editor feedback is a top-bar button (on phones too); the floating tab covered the timeline's end */
body:has(#work:not([hidden])) .fb-fab { display: none; }
/* the editor's feedback button: lime and labelled like the old side tab — seen at once */
.fb-top { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; cursor: pointer;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--font-body);
  white-space: nowrap; box-shadow: inset 0 0 0 1px var(--border-strong); transition: box-shadow var(--dur-base), color var(--dur-base); }
/* one accent per screen: the next step is lime, feedback is a quiet button */
.fb-top:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.fb-top:hover { filter: brightness(1.06); }
.fb-top .ic { width: 17px; height: 17px; }
@media (max-width: 760px) {
  .fb-top { height: 44px; padding: 0 12px; }
  .fb-top span { display: none; }
}
/* «Посмотреть, что вырезано» open: the picture gets smaller so the bar AND the timeline stay on screen */
@media (min-width: 900px) {
  .monitor:has(#teachBar:not([hidden])) .monitor-screen { min-height: 180px; }
  .monitor:has(#teachBar:not([hidden])) .monitor-screen video { max-height: 34vh; }
  .teach-bar { max-height: 30vh; overflow: auto; }
}
/* phones: the form first (the decorative pitch pushed the e-mail field under the keyboard),
   and every tappable thing at least 44 px high */
@media (max-width: 600px) {
  .auth-pitch { display: none; }
  .chip-btn, .seg-btn, .btn.sm, .clip-nav button, .reel-tabs button, .pc-acts .btn-icon,
  .auth-tab, .lp-cta.sm, .home-search, .acct-btn { min-height: 44px; }
  .pw-eye { width: 44px; height: 44px; right: 0; }
  .linkish { min-height: 44px; }
  .faq summary, .site-foot a { display: inline-block; min-height: 44px; line-height: 44px; }
  .toggle { min-height: 44px; }
  /* the cabinet header: the account pill is an icon (the whole e-mail ran off a 390 px screen) */
  .acct-btn span { display: none; }
  .acct-btn { padding: 0 10px; min-width: 44px; justify-content: center; }
  .nav-meta { align-items: center; }
  /* the last lines scroll clear of the round feedback button */
  body { padding-bottom: 72px; }
}
/* the Mac app / «значок в Доке» mean nothing on a phone or a tablet */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  #appCard, .desk-only { display: none !important; }
  .touch-only { display: inline; }                 /* a phone can't drag files: «Выбери файлы» */
}
/* keyboard focus is always visible (the transcript and the project cards had none) */
.transcript:focus-visible, .proj-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dropped connection: the note sits in the middle of the (black) picture, over any teach tag */
.net-tag { top: 50%; transform: translate(-50%, -50%); z-index: 6; max-width: min(460px, 86%); white-space: normal;
  text-align: center; line-height: 1.35; border-color: var(--accent); }

/* format + length, picked before the edit (start card) */
.fit-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }   /* the start card is a narrow column */
.fit-row .field { margin: 0; }
.fit-row #fitCustomWrap { grid-column: 1 / -1; }
.fit-note { margin: 0 0 10px; }
/* the export frame over the preview: what stays in 9:16 / 1:1 / 4:5 */
.aspect-mask { position: absolute; z-index: 4; pointer-events: none; border: 2px solid var(--accent); border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(8, 11, 8, .58); }
.aspect-mask span { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 11px var(--font-body); }
.monitor-screen:has(.aspect-mask:not([hidden])) { overflow: hidden; }

/* montage «как в референсе» */
.ref-row { margin: 0 0 10px; display: grid; gap: 6px; }
.ref-state { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); line-height: 1.4; }
.ref-state b { color: var(--accent); }
.ref-state .ref-x { float: right; background: none; border: 0; color: var(--text-muted); cursor: pointer; font: inherit; }
.ref-state .ref-x:hover { color: var(--text); }

/* house styles per format (admin) + the style shown under «Формат» */
.fmt-list { display: grid; gap: 10px; margin-top: 8px; }
.fmt-row { border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 6px; }
.fmt-row .fmt-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fmt-row .fmt-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.fit-style { margin: 0; line-height: 1.4; }
.fit-style b { color: var(--accent); }
/* «Какой формат контента?» — before the upload */
.cf-row { display: grid; gap: 8px; margin-bottom: 12px; }
/* the formats as cards (14-output-text.js drawCats): picture, name, what it is for, length · captions · music */
.cf-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 8px; }
.cf-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic name" "hint hint" "facts facts";
  align-items: center; align-content: start; gap: 4px 8px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(245,245,240,.02); color: var(--text); text-align: left; cursor: pointer; font: inherit; min-width: 0;
  transition: border-color .12s, background .12s; }
.cf-card:hover { border-color: rgba(217,255,59,.55); }
.cf-card.active { border-color: var(--accent); background: rgba(217,255,59,.09); box-shadow: inset 0 0 0 1px var(--accent); }
.cf-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-ic { grid-area: ic; font-size: 18px; line-height: 1; }
.cf-name { grid-area: name; font-size: 13px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.cf-hint { grid-area: hint; font-size: 11.5px; line-height: 1.3; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cf-facts { grid-area: facts; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.cf-facts i { font-style: normal; font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 999px;
  background: rgba(245,245,240,.06); color: var(--text-muted); white-space: nowrap; }
.cf-card.active .cf-facts i { background: rgba(217,255,59,.14); color: var(--text); }
.cf-q .dim { font-weight: 400; text-transform: none; letter-spacing: 0; }
.cf-note { margin: 0; line-height: 1.4; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(217,255,59,.04); }
.cf-note[hidden] { display: none; }
.cf-note-h { display: block; font-weight: 600; color: var(--text); font-size: 12.5px; }
.cf-note-f { display: block; margin-top: 4px; }
.cf-does { margin: 4px 0 2px; padding-left: 18px; color: var(--text); }
.cf-does li { margin: 1px 0; }
/* the docked start card (a narrow column): one line a format, the facts hidden */
.start-card.docked .cf-chips { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.start-card.docked .cf-card { padding: 7px 9px; grid-template-areas: "ic name"; }
.start-card.docked .cf-hint, .start-card.docked .cf-facts { display: none; }
@media (max-width: 640px) { .cf-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cf-card { padding: 8px 9px; } .cf-hint { display: none; } .cf-card.active .cf-hint { display: block; } }
.start-card { min-width: 0; }
.start-card > *, .fit-row > *, .cf-row > * { min-width: 0; }
.fit-row { grid-template-columns: minmax(0, 1fr); }
.fit-row .select { width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.cf-row .label { overflow-wrap: anywhere; }
.ref-row { min-width: 0; }
.ref-row .btn { max-width: 100%; white-space: normal; height: auto; min-height: 36px; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
/* music like CapCut: picks for the format, this week's trends, the user's own track */
.lib-sec { display: grid; gap: 8px; margin: 12px 0; }
.lib-all { display: block; margin-top: 12px; }
.lib-trends { display: grid; gap: 8px; }
.trend { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface); display: grid; gap: 8px; }
.trend-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trend-h .btn { flex: 0 0 auto; }
.cf-track { display: grid; gap: 6px; margin-bottom: 8px; min-width: 0; }
.cf-track .btn { max-width: 100%; white-space: normal; height: auto; min-height: 36px; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
.cf-track-state b { color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-dim); text-decoration: underline; cursor: pointer; font: inherit; }
.trend-form { display: grid; gap: 6px; margin-bottom: 8px; }
.trend-admin { display: grid; gap: 8px; }
/* script assistant: on the home page before the shoot, a toggle in the start card after it */
.script-card { display: grid; gap: 10px; margin-top: 12px; }
.sc-head { display: grid; gap: 4px; }
.sc-rec { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sc-rec .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-text { font-size: 14px; line-height: 1.45; }
.sc-msg { margin: 0; }
.sc-row { display: grid; gap: 6px; margin-bottom: 8px; min-width: 0; }
.sc-row .toggle { align-items: flex-start; }

/* ── the start card: a dialog in the middle of the editor, not a 200-px column (it can be docked back) ── */
.start-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.start-head b { font-size: 16px; font-family: var(--font-display, inherit); }
.start-dock { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; }
.start-dock:hover { border-color: var(--accent); }
.start-card:not([hidden]):not(.docked) {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 70; margin: 0;
  width: min(780px, calc(100vw - 32px)); max-height: min(90vh, 940px); overflow: auto; overscroll-behavior: contain;
  gap: 14px; padding: 20px 22px 0; border-radius: 18px; background: var(--surface-2);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6), 0 30px 90px rgba(0, 0, 0, .55);
}
.start-card:not(.docked) .wish-t { min-height: 64px; font-size: 14px; }
.start-card:not(.docked) #startBtn { position: sticky; bottom: 0; z-index: 1; height: 54px; font-size: 15px;
  margin: 2px -22px 0; width: calc(100% + 44px); border-radius: 0 0 18px 18px; }
.start-card.docked .start-head b { font-size: 13px; }
.start-more { border-top: 1px solid var(--border); padding-top: 10px; }
.start-more > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; }
.start-more > summary::-webkit-details-marker { display: none; }
.start-more > summary::before { content: "▸"; color: var(--text-dim); transition: transform .15s; }
.start-more[open] > summary::before { transform: rotate(90deg); }
.start-more[open] { display: grid; gap: 10px; }
.start-more[open] > summary { margin-bottom: 2px; }
.start-card:not(.docked) .fit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.start-card:not(.docked) .fit-row #fitCustomWrap, .start-card:not(.docked) .fit-row .fit-style { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .start-card:not([hidden]):not(.docked) { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 92vh;
    border-radius: 18px 18px 0 0; padding: 16px 16px 0; }
  .start-card:not(.docked) #startBtn { margin: 2px -16px 0; width: calc(100% + 32px); border-radius: 0; }
  .start-card:not(.docked) .fit-row { grid-template-columns: minmax(0, 1fr); }
}

/* the script assistant on the home page: one line under the upload until it's opened */
details.script-card { display: block; }
details.script-card[open] { display: grid; }
.script-card > summary.sc-head { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.script-card > summary::-webkit-details-marker { display: none; }
.script-card > summary::after { content: "▸"; margin-left: auto; color: var(--text-dim); transition: transform .15s; }
.script-card[open] > summary::after { transform: rotate(90deg); }
.sc-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(217, 255, 59, .12); color: var(--accent); font-size: 17px; }
.sc-sum { display: grid; gap: 2px; min-width: 0; }
.sc-sum .beta-tag { justify-self: start; }    /* (the grid stretched it over the card's width) */
.sc-intro { margin: 0; }
.home-upload { display: grid; gap: 12px; }
details.script-card:not([open]) { padding: 14px 18px; background: transparent; border-style: dashed; }
details.script-card:not([open]):hover { border-color: var(--border-strong); background: var(--surface); }
details.script-card[open] { gap: 12px; }
.script-card #scDraft { justify-self: start; min-width: 200px; }
.script-card #scIdea { min-height: 76px; resize: vertical; }
.script-card .sc-rec .btn { height: 36px; }
details.script-card[open] #scSumText { display: none; }
.script-card .sc-text { min-height: 168px; height: auto; resize: vertical; line-height: 1.5; }
.script-card #scIdea { height: auto; }
.script-card textarea.input { padding: 10px 12px; }


/* live captions over the editor's preview: what the export will burn in, inside the output frame */
.cap-box { position: absolute; z-index: 4; pointer-events: none; container-type: size; overflow: hidden; }
.cap-box[hidden] { display: none; }
.cap-box .ov-cap:empty { display: none; }
:is(.phone, .cap-box) .ov-cap.hormozi { font-size: calc(96 / 1080 * 100cqmin * var(--capk, 1)); font-weight: 900; text-transform: uppercase;
  text-shadow: 0 0 .12em #000, 0 0 .12em #000, 0 .06em .02em #000; }
:is(.phone, .cap-box) .ov-cap.neon { color: #fff; text-shadow: 0 0 .15em #D9FF3B, 0 0 .35em #D9FF3B, 0 0 .06em #000; }
:is(.phone, .cap-box) .ov-cap.d3, :is(.phone, .cap-box) .ov-cap.d3gold { font-weight: 900; text-transform: uppercase;
  text-shadow: .02em .03em 0 #333, .04em .06em 0 #222, .06em .09em 0 #111, .08em .12em .04em #000; }
:is(.phone, .cap-box) .ov-cap.d3gold { color: #FFD23F; }
.cap-quick { height: 30px; width: auto; max-width: 180px; font-size: 12px; margin-right: 6px; }
:is(.phone, .cap-box) .ov-cap b { margin: 0 .14em; }     /* the lifted word keeps its spaces */

/* a mid-size window (small laptop, a browser not full screen, a tablet): the timeline stays right under
   the preview — before, the inspector spread full width under it at its whole height (export, effects)
   and pushed the timeline ~2 screens down */
@media (min-width: 901px) and (max-width: 1100px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr) 270px; }
  .inspector { grid-column: auto; contain: size; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  .panel.media.lib { contain: size; overflow-y: auto; overscroll-behavior: contain; }
  .panel.media.lib .lib-tabs { position: sticky; top: -10px; z-index: 3; background: var(--bg); padding-top: 4px; }
  .lib-grid, .lib-grid.tr-grid, .lib-music { max-height: none; overflow: visible; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .inspector { max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; }
}
.tc-right { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
@media (max-width: 1300px) {
  .inspector .tabs { gap: 14px; }
  .inspector .tabs .tab { font-size: 13px; white-space: nowrap; }
  .cap-quick { max-width: 150px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .inspector .tabs { gap: 10px; }
  .inspector .tabs .tab { font-size: 12px; padding-left: 0; padding-right: 0; }
  .lib-tabs .lib-tab { font-size: 10px; letter-spacing: 0; }
  .cap-quick { max-width: 128px; font-size: 11px; }
}
.lib-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lib-tab { min-width: 0; }
.lib-tab > span, .lib-tab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a tablet: the top bar keeps its buttons on screen (undo / redo / download went past the edge at 768 px) */
@media (max-width: 1250px) { .topbar .acct-btn span { display: none; } .topbar .acct-btn { padding: 0 8px; } }
@media (max-width: 1000px) {
  .topbar .acct-btn span, .topbar .fb-top span, #dl .txt { display: none; }
  .topbar .acct-btn { padding: 0 8px; }
  #dl { width: 44px; padding: 0; justify-content: center; }
}
/* a phone and a narrow tablet: nothing sticks out of the top bar or the player's bar */
@media (max-width: 900px) {
  .transport { grid-template-columns: auto 1fr auto; row-gap: 6px; }
  .transport .tc-right { grid-column: 1 / -1; justify-self: stretch; }
  .transport .cap-quick { flex: 1; max-width: none; }
}
/* «＋ свой шрифт / трек»: the text wraps in a narrow library instead of being cut */
#libOwnPick, #capOwnPick { white-space: normal; height: auto; min-height: 32px; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
/* a phone: a folded section's title is a finger's height (they were 20–23 px) */
@media (max-width: 760px) { .app details > summary { padding-top: 11px; padding-bottom: 11px; } }
@media (max-width: 760px) {
  .transport { grid-template-columns: auto 1fr auto; row-gap: 6px; }
  .transport .tc-right { grid-column: 1 / -1; justify-self: stretch; }
  .transport .cap-quick { flex: 1; max-width: none; }
}
@media (max-width: 420px) {
  .topbar .tb-right { gap: 4px; }
  .topbar .btn-icon, .topbar .fb-top, .topbar .acct-btn { width: 36px; min-width: 36px; height: 36px; padding: 0; }
  .topbar .proj, .topbar .tb-sep { display: none; }   /* the name is on the projects page; every button stays */
}

/* captions: dragged on the preview; the library tab shows every look */
.cap-box .ov-cap { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.cap-box .ov-cap.placed { bottom: auto; transform: translateY(-50%); }
.cap-box .ov-cap.dragging { cursor: grabbing; outline: 1px dashed rgba(255,255,255,.7); outline-offset: 6px; }
.cap-box .ov-cap:hover { outline: 1px dashed rgba(255,255,255,.45); outline-offset: 6px; }
.cap-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cap-tile { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); cursor: pointer; text-align: center; min-width: 0; }
.cap-tile:hover { border-color: var(--border-strong); }
.cap-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cap-tile small { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-box.cap-mini { position: relative; display: grid; place-items: center; height: 58px; border-radius: 7px;
  background: linear-gradient(160deg, #2a3326, #0c0f0c); overflow: hidden; }
.cap-mini .ov-cap { position: static; left: auto; right: auto; bottom: auto; top: auto; transform: none;
  font-size: 13px !important; line-height: 1.15; pointer-events: none; }
.cap-mini em { font-size: 11px; font-style: normal; }
.cap-size { margin-top: 10px; }
.cap-pos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lib-tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); }
/* (six tabs in a narrow column were icons only, 761–1300 px — they go to two rows with names now, below) */
/* as the export writes them: these looks are in capitals */
.cap-box .ov-cap.bold, .cap-box .ov-cap.d3, .cap-box .ov-cap.d3gold, .cap-box .ov-cap.hormozi { text-transform: uppercase; }

/* 3D captions like the export: a flat face with a light rim, a deep side down-right, a glow in the face's colour
   (reels.py _d3: 14 copies stepped 1.5/3.0 px at size 110 — here 10 shadows over the same depth) */
:is(.phone, .cap-box) .ov-cap:is(.d3green, .d3white, .d3yellow, .d3red, .d3pink, .d3blue) {
  font-size: calc(110 / 1080 * 100cqmin * var(--capk, 1)); font-weight: 900; text-transform: uppercase; line-height: 1.25;
  color: var(--face); -webkit-text-stroke: .09em var(--rim); paint-order: stroke fill; letter-spacing: .01em;
  text-shadow: 0.019em 0.038em 0 var(--side), 0.038em 0.076em 0 var(--side), 0.057em 0.114em 0 var(--side), 0.076em 0.152em 0 var(--side), 0.095em 0.190em 0 var(--side), 0.114em 0.228em 0 var(--side), 0.133em 0.266em 0 var(--side), 0.152em 0.304em 0 var(--side), 0.171em 0.342em 0 var(--side), 0.190em 0.380em 0 var(--side), .21em .42em .06em rgba(0,0,0,.55), 0 0 .16em var(--face), 0 0 .38em var(--face);
}
:is(.phone, .cap-box) .ov-cap:is(.d3green, .d3white, .d3yellow, .d3red, .d3pink, .d3blue) b { font-weight: inherit; color: var(--caphi); }
.ov-cap.d3green  { --face: #4CFF2A; --rim: #D6FFC4; --side: #146A0C; --caphi: #FFFFFF; }
.ov-cap.d3white  { --face: #FFFFFF; --rim: #FFFFFF; --side: #404040; --caphi: #FFE500; }
.ov-cap.d3yellow { --face: #FFE600; --rim: #FFF7B0; --side: #7A5E00; --caphi: #FFFFFF; }
.ov-cap.d3red    { --face: #FF2D2D; --rim: #FFB3B3; --side: #700A0A; --caphi: #FFFFFF; }
.ov-cap.d3pink   { --face: #FF3DC8; --rim: #FFC2EE; --side: #700B55; --caphi: #FFFFFF; }
.ov-cap.d3blue   { --face: #2EA8FF; --rim: #BFE4FF; --side: #0A3A70; --caphi: #FFFFFF; }
.cap-mini .ov-cap:is(.d3green, .d3white, .d3yellow, .d3red, .d3pink, .d3blue) { font-size: 12px !important; }
.cap-box .ov-cap:is(.d3green, .d3white, .d3yellow, .d3red, .d3pink, .d3blue) { text-transform: uppercase; }

/* the fonts: each tile written in its own font */
.cap-font-sec { margin-top: 14px; display: grid; gap: 8px; }
.cap-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 360px; overflow-y: auto;
  overscroll-behavior: contain; padding-right: 2px; }
.font-tile { display: grid; gap: 2px; padding: 8px 6px 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--text); cursor: pointer; text-align: center; min-width: 0; }
.font-tile:hover { border-color: var(--border-strong); }
.font-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.font-tile .ft-s { font-size: 19px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.font-tile small { font-size: 10.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* «Кадр» under the player: the frame, a turn of the whole video, how another shape is laid in, the quality */
.frame-btn { height: 30px; gap: 6px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.frame-btn .ic { width: 15px; height: 15px; }
.frame-pop { position: absolute; right: 10px; bottom: 10px; z-index: 8; width: min(360px, calc(100% - 20px));
  max-height: calc(100% - 20px); overflow-y: auto; padding: 12px; border-radius: 12px; display: grid; gap: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 18px 48px -12px rgba(0,0,0,.7); }
.frame-pop[hidden] { display: none; }
.fp-sec { display: grid; gap: 6px; }
.fp-sec[hidden] { display: none; }
.fp-sec .label { font-size: 11px; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chips button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font: 600 12px/1 var(--font-body); cursor: pointer; }
.fp-chips button:hover { border-color: var(--border-strong); }
.fp-chips button.active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.fp-sec p { margin: 0; }
/* the blurred surround of «целиком, фон размыт», under the picture */
/* whichever of the two players is showing sits over the blurred surround; by id it outranked .standby —
   after a transition the hidden one kept half the screen and pushed the picture aside */
/* only the two project players: the upload's own preview (.local-prev) keeps its layer over them */
.monitor-screen video:is(#player, #player2):not(.standby):not(.leaving) { position: relative; z-index: 1; }
.fill-bg { position: absolute; z-index: 0; pointer-events: none; filter: blur(14px) brightness(.85) saturate(1.1); transform: scale(1.06); }
.fill-bg[hidden] { display: none; }
@media (max-width: 760px) { .frame-pop { left: 8px; right: 8px; width: auto; bottom: 8px; } .frame-btn span { display: none; } }
.aspect-mask.whole { box-shadow: 0 0 0 9999px #000; }
.aspect-mask.pan:not(.whole) { pointer-events: auto; cursor: grab; touch-action: none;   /* drag: what stays in the frame */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72); }   /* what is not in the reel goes dark: a wide shot read as the result */
.aspect-mask.pan.dragging { cursor: grabbing; }
/* the reel view (14-output-text.js reelView): a 9:16 cut of a wide shot shown as the reel — every player of the screen
   (the one showing, the armed one, the one leaving in a transition) the whole picture grown so the frame's part fills the
   reel's box; the frame's mask («edge») blacks out the rest */
.monitor-screen.reel video:is(#player, #player2) { position: absolute !important; inset: auto !important;
  left: var(--reel-l) !important; top: var(--reel-t) !important; width: var(--reel-w) !important; height: var(--reel-h) !important;
  max-width: none !important; max-height: none !important; object-fit: contain; }       /* «целиком»: outside the frame is not in the file at all */

/* «Референсы и мой стиль» */
.side-item.side-hot b { color: var(--accent); }
.style-tabs { margin: 0 16px; display: flex; gap: 6px; }
.ms-sum { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.ms-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.ms-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); }
.ms-item.busy { border-style: dashed; }
.ms-item.bad { border-color: var(--danger, #ff5d5d); }
.ms-item b { font-size: 13px; overflow-wrap: anywhere; }
.ms-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 2px; }
.ms-cta { display: block; margin: 8px 0 2px; color: var(--accent); }
[data-spane] { display: grid; gap: 10px; }
[data-spane][hidden] { display: none; }
.style-tabs[hidden] { display: none; }
.style-tabs .seg-btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: 600 13px/1 var(--font-body); cursor: pointer; }
.style-tabs .seg-btn.active { border-color: var(--accent); color: var(--accent); }

/* ── review fixes ── */
/* hints for a mouse or a finger: each shows its own */
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: inline; } .desk-only { display: none; } }
/* the library's tabs: in a narrow panel two rows of three, the labels whole («ереходы / ффекты» at 1440 px) */
.panel.media { container-type: inline-size; }
@container (max-width: 340px) {
  .lib-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; row-gap: 2px; }
  .lib-tabs .lib-tab { font-size: 11px !important; }
}
/* the music's credit line with a long link stays inside its card */
#pmCredit { overflow-wrap: anywhere; }
/* while the upload plays from the device: its own controls, not a second transport that does nothing yet */
.monitor:has(#localPrev:not([hidden])) .transport { display: none; }
/* a phone: no «CUTMO for Mac» card */
@media (max-width: 760px) { #appCard { display: none; } }
/* a phone with a project: the picture stays on top while the timeline, library and settings scroll under it */
@media (max-width: 760px) {
  .app.ready .monitor { position: sticky; top: 0; z-index: 20; background: var(--bg); }
  #fxPiece, .tab-body { scroll-margin-top: 60vh; }
  .app.ready .inspector .tabs { position: static; }   /* the player is pinned on top: the tabs scroll with the page */
}

/* ── infographics from speech: the card over the preview (the export draws the same with libass) ── */
.gfx-box { position: absolute; z-index: 4; pointer-events: none; overflow: hidden; }
.gfx-box[hidden] { display: none; }
/* «Текст за спиной»: the words over the picture, the person laid back over them (21c-graphics.js) */
/* the cards and scenes drawn by the browser's libass (JASSUB) from the export's own ASS; their handles above */
.gfx-ass { position: absolute; z-index: 4; pointer-events: none; overflow: hidden; }
.gfx-ass[hidden] { display: none; }
.gfx-ass-cv { position: absolute; left: 0; top: 0; width: 100% !important; height: 100% !important; }
.gfx-box { z-index: 5; }
.gfx-hit { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; border-radius: 8px; }
.gfx-hit:hover { outline: 1px dashed rgba(217,255,59,.6); outline-offset: 2px; }
.gfx-hit.dragging { cursor: grabbing; outline: 2px dashed var(--accent); outline-offset: 3px; }
.gfx-themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.gfx-th { display: inline-flex; align-items: center; gap: 6px; }
.gfx-th i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.gfx-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.gfx-full { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  grid-column: 3 / -1; }                             /* a row of its own under the label (no implicit column) */
.gfx-item.full { background: rgba(217,255,59,.34); }
.gfx-item .bi-tools { flex-wrap: wrap; }
.gfx-item.full > span { font-weight: 600; }
.gfx-behind { position: absolute; z-index: 2; pointer-events: none; }
.gfx-behind[hidden] { display: none; }
.gfx-behind-hit { position: absolute; z-index: 3; cursor: grab; touch-action: none; border-radius: 6px; }
.gfx-behind-hit.dragging { cursor: grabbing; outline: 2px dashed var(--accent); outline-offset: 3px; }
.gfx-behind-hit[hidden] { display: none; }
.gfx-del { font: 600 14px/1 var(--font-body); width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text-muted); cursor: pointer; grid-area: unit; justify-self: end; }
.gfx-card { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; user-select: none;
  padding: calc(36 * var(--k)) calc(36 * var(--k)) calc(36 * var(--k)) calc(50 * var(--k));
  background: rgba(20, 20, 20, .85); border-radius: calc(22 * var(--k)); color: #fff; }
.gfx-card.dragging { cursor: grabbing; outline: 2px dashed var(--accent); outline-offset: 3px; }
.gfx-rule { position: absolute; left: calc(20 * var(--k)); top: calc(36 * var(--k)); bottom: calc(36 * var(--k));
  width: calc(8 * var(--k)); border-radius: calc(4 * var(--k)); background: #D9FF3B; }
.gfx-lab { font: 500 calc(40 * var(--k) * 0.646) / calc(40 * var(--k) * 1.15) var(--flab, sans-serif); opacity: .9; white-space: nowrap; }
.gfx-val { display: flex; align-items: baseline; gap: calc(8 * var(--k)); white-space: nowrap;
  height: calc(118 * var(--k) * 0.5445); line-height: calc(118 * var(--k) * 0.5445); }
.gfx-num { font: 900 calc(118 * var(--k) * 0.646) / 1 var(--fnum, sans-serif); font-variant-numeric: tabular-nums; }
.gfx-tail { font: 900 calc(59 * var(--k) * 0.646) / 1 var(--fnum, sans-serif); color: #D9FF3B; }
.gfx-track { position: relative; margin-top: calc(14 * var(--k)); height: calc(16 * var(--k)); border-radius: calc(8 * var(--k));
  background: rgba(255, 255, 255, .22); }
.gfx-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: #D9FF3B; }
.gfx-notch { position: absolute; top: calc(-4 * var(--k)); bottom: calc(-4 * var(--k)); width: calc(4 * var(--k)); margin-left: calc(-2 * var(--k));
  background: #fff; border-radius: 2px; }
/* the list in «Текст» */
.gfx-sec { margin: 0 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.gfx-sec[hidden] { display: none; }
.gfx-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; margin-bottom: 8px; flex-wrap: wrap; min-width: 0; }
.gfx-head .toggle { white-space: nowrap; }
.gfx-list { display: grid; gap: 6px; }
/* two lines a card: the switch, the time and the label on top; the figure and its unit under the label */
.gfx-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.gfx-row:last-child { border-bottom: 0; padding-bottom: 0; }
.gfx-row.off { opacity: .5; }
.gfx-go { font: 600 11px var(--font-mono, monospace); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); cursor: pointer; }
.gfx-go:disabled { opacity: .5; cursor: default; }
@media (max-width: 760px) { .gfx-go { min-height: 36px; min-width: 44px; } }   /* a finger's size */
.gfx-in-lab, .gfx-in-val { min-width: 0; }
.gfx-unit { white-space: nowrap; }


/* stage 2: a list, the speaker's name, a quote */
.gfx-items { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(14 * var(--k)); }
.gfx-items li { display: flex; align-items: baseline; gap: calc(22 * var(--k)); white-space: nowrap;
  font: 500 calc(50 * var(--k) * 0.646) / calc(50 * var(--k)) var(--flab, sans-serif); }
.gfx-items b { font: 900 calc(54 * var(--k) * 0.646) / 1 var(--fnum, sans-serif); color: #D9FF3B; min-width: calc(30 * var(--k)); }
.gfx-list .gfx-lab { margin-bottom: calc(8 * var(--k)); }
.gfx-nm { font: 900 calc(70 * var(--k) * 0.646) / 1.1 var(--fnum, sans-serif); white-space: nowrap; }
.gfx-role { font: 500 calc(36 * var(--k) * 0.646) / 1.4 var(--flab, sans-serif); color: #D9FF3B; white-space: nowrap; }
.gfx-quote { padding: calc(40 * var(--k)); }
.gfx-qm { display: block; font: 900 calc(130 * var(--k) * 0.646) / .7 var(--fnum, sans-serif); color: #D9FF3B; margin-bottom: calc(10 * var(--k)); }
.gfx-qt { font: 500 calc(50 * var(--k) * 0.646) / 1.35 var(--flab, sans-serif); }
.gfx-kind { grid-column: 3 / -1; grid-row: 2; }

/* ── «Графика» (21c-graphics.js): the library pane, the card picked, the lane right under the video ── */
.gfx-pane .gfx-sec { border: 0; padding: 0; margin: 0; }
.gfx-pane .label { display: block; margin: 10px 0 6px; }
.gfx-head2 { margin-top: 14px; }
.gfx-lib { display: grid; gap: 10px; }
.gfx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gfx-grps { display: flex; flex-wrap: wrap; gap: 5px; }
.gfx-grps .chip-btn { font-size: 11.5px; padding: 5px 9px; white-space: nowrap; }
.gfx-grp { display: grid; gap: 6px; }
.gfx-grp-t { letter-spacing: .04em; }
.gfx-tile { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 7px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); text-align: left; cursor: grab; font: inherit; transition: border-color .15s, transform .15s; }
.gfx-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.gfx-tile b { font-size: 12px; font-weight: 600; padding: 0 3px; }
.gfx-tile i { font-style: normal; font-size: 10.5px; line-height: 1.25; color: var(--text-dim); padding: 0 3px; }
.gt-media { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: #1b1d22; margin-bottom: 3px; }
.gfx-lib.tall .gt-media { aspect-ratio: 9 / 13; }
.gt-media img, .gt-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gfx-lib.tall .gt-media img, .gfx-lib.tall .gt-media video { object-position: 50% 0; }
/* (the ticker runs along the frame's bottom: the tall tile shows that part — its top, as the rest, cut the band off) */
.gfx-lib.tall .gfx-tile[data-add="ticker"] .gt-media img, .gfx-lib.tall .gfx-tile[data-add="ticker"] .gt-media video { object-position: 50% 100%; }
.gt-media video { opacity: 0; transition: opacity .15s; }
.gfx-tile.playing .gt-media video { opacity: 1; }
.gt-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; }
.gfx-insp { margin: 0 0 12px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--r-md);
  background: var(--surface); display: grid; gap: 9px; }
.gfx-insp[hidden] { display: none; }
.gi-head { display: flex; align-items: center; gap: 8px; }
.gi-kind { font-weight: 700; font-size: 13px; text-transform: capitalize; }
.gi-f { display: grid; gap: 3px; min-width: 0; }
.gi-f > span, .gi-sec > span { font-size: 11px; color: var(--text-dim); letter-spacing: .02em; }
.gi-f textarea { resize: vertical; min-height: 44px; font: inherit; }
.gi-row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.gi-row > .gi-f { flex: 1 1 90px; }
.gi-unit { padding-bottom: 8px; font-size: 13px; }
.gi-time .gi-f:first-child { flex: 1.4 1 110px; }
.gi-nudge { display: flex; gap: 4px; }
.gi-nudge button, .gi-seg button, .gi-pos button { font: 500 12px var(--font-body); padding: 6px 8px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); cursor: pointer; white-space: nowrap; }
.gi-sec { display: grid; gap: 5px; }
.gi-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.gi-seg button.on, .gi-pos button.on { border-color: var(--accent); color: var(--accent); background: rgba(217,255,59,.08); }
.gi-sec input[type=range] { width: 100%; accent-color: var(--accent); }
.gi-pos { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.gi-pos button { height: 26px; padding: 0; display: grid; place-items: center; }
.gi-pos button i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: .55; }
.gi-pos button.on i { opacity: 1; }
.gi-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.gi-del { color: #ff8a8a; }
@media (max-width: 760px) { .gi-seg button, .gi-nudge button { min-height: 36px; } .gi-pos { grid-template-columns: repeat(3, 44px); } .gi-pos button { height: 34px; } }
.gfx-pick { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 6px; border: 0; border-radius: 6px; background: none;
  color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.gfx-pick:hover { background: var(--surface-2); }
.gfx-pick em, .gfx-item em { font-style: normal; flex: none; width: 18px; text-align: center; color: var(--accent); font-weight: 700; }
.gfx-item.tiny em { display: none; }
.gfx-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.gfx-pick i { font-style: normal; font-size: 10.5px; flex: none; }
.gfx-row.picked { background: rgba(217,255,59,.06); border-radius: 8px; }
.gfx-moved { margin: 0 0 12px; }
/* the lane: right under the video, taller, the kind at a glance */
.gfx-row-tl .track2 { height: 38px; }
.gfx-empty { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px; font-size: 11px; color: var(--text-dim);
  pointer-events: none; white-space: nowrap; overflow: hidden; }
.gfx-empty[hidden] { display: none; }
body.gfx-dragging #gfxTrack { border-color: var(--accent); background: rgba(217,255,59,.05); }
#gfxTrack.drop { border-style: solid; border-color: var(--accent); background: rgba(217,255,59,.12); }
.gfx-item > span { display: flex; align-items: center; gap: 4px; }
.gfx-item.lay-half { background: rgba(120,170,255,.22); box-shadow: inset 0 0 0 1px rgba(150,190,255,.8); }
.gfx-item.lay-full { background: rgba(217,255,59,.34); }
.gfx-item.lay-half em { color: #a9c6ff; }
.gfx-item.user { border-top: 2px solid rgba(255,255,255,.35); }
.gfx-item.picked { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 2px rgba(217,255,59,.25); }
/* the preview's handles: a card — drag it, its corner sizes it; a scene — a click picks it */
.gfx-hit.picked { outline: 2px solid var(--accent); outline-offset: 3px; }
.gfx-hit.scene { cursor: pointer; border-radius: 0; }
.gfx-hit.scene:hover { outline: 1px dashed rgba(217,255,59,.5); outline-offset: -6px; }
.gfx-rs { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 2px solid #111; cursor: nwse-resize; display: none; }
.gfx-hit:not(.scene):hover .gfx-rs, .gfx-hit.picked:not(.scene) .gfx-rs, .gfx-hit.dragging .gfx-rs { display: block; }
@media (pointer: coarse) { .gfx-hit.picked:not(.scene) .gfx-rs { display: block; width: 26px; height: 26px; right: -13px; bottom: -13px; } }
.gfx-behind-hit.picked { outline: 2px solid var(--accent); outline-offset: 3px; }
.gfx-pane .gfx-themes { display: flex; flex-wrap: wrap; gap: 5px; }
.gfx-pane .gfx-th { font-size: 11.5px; padding: 5px 9px; white-space: nowrap; }
.gfx-pane .gfx-head { margin: 0; }
.gfx-pane .gfx-head .label { margin: 4px 0; }
/* a short screen: the video's film strip lower, so the graphics lane under it is seen without scrolling */
@media (min-width: 761px) and (max-height: 960px) { .track { height: 58px; } .gfx-row-tl .track2 { height: 34px; } }
.gfx-item.covered { opacity: .55; background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
@container (max-width: 270px) {
  .lib-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.gfx-pick.covered span { text-decoration: line-through; opacity: .6; }
@media (max-width: 560px) { .lib-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; row-gap: 2px; } }
/* the captions' size handle (14-output-text.js capHandle) */
.cap-rs { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent);
  border: 2px solid #111; cursor: nwse-resize; pointer-events: auto; z-index: 2; touch-action: none; opacity: 0; transition: opacity .15s; }
.cap-rs[hidden] { display: none; }
/* out of the way until wanted: the mouse over the picture, or the captions just touched (a finger has no hover) */
.cap-rs { pointer-events: none; }
.monitor-screen:hover .cap-rs, .cap-box.rs-on .cap-rs, .cap-rs.dragging { opacity: .85; pointer-events: auto; }
.cap-rs:hover, .cap-rs.dragging { opacity: 1; }
.cap-rs::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }   /* a finger-sized grip */
@media (pointer: coarse) { .cap-rs { width: 24px; height: 24px; margin: -12px 0 0 -12px; } }
/* the themes as swatches, the chosen one named */
.gfx-pane .gfx-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; }
.gfx-pane .gfx-th { width: 34px; height: 34px; padding: 3px; border-radius: 50%; border: 1px solid var(--border-strong); background: none; cursor: pointer; }
.gfx-pane .gfx-th i { display: block; width: 100%; height: 100%; border-radius: 50%; }
.gfx-pane .gfx-th.active { border: 2px solid var(--accent); padding: 2px; }
.gfx-th-name { font-size: 12px; color: var(--text-muted); margin-left: 4px; white-space: nowrap; }
@media (pointer: coarse) { .gfx-pane .gfx-th { width: 40px; height: 40px; } }
/* stretches without captions on the video track (14-output-text.js paintCapOffs) */
.capoffs { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; z-index: 5; pointer-events: none; }
.capoff { position: absolute; bottom: 0; height: 16px; border-radius: 4px 4px 0 0; pointer-events: auto; cursor: pointer;
  background: repeating-linear-gradient(135deg, rgba(255,90,90,.75) 0 5px, rgba(255,90,90,.35) 5px 10px); display: flex; align-items: center;
  overflow: hidden; }
.capoff span { font: 600 9.5px/1 var(--font-body); color: #fff; padding: 0 4px; white-space: nowrap; text-shadow: 0 0 2px #000; flex: 1; min-width: 0; overflow: hidden; }
.capoff button { flex: none; width: 16px; height: 16px; border: 0; background: rgba(0,0,0,.4); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.gfx-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 6px; }
.gfx-fonts select { width: 100%; min-width: 0; }
@container (max-width: 260px) { .gfx-fonts { grid-template-columns: 1fr; } }
/* a paper theme's texture over the drawing (21c-graphics.js gaTexPaint): the sheets' mask hidden, the texture multiplied */
.gfx-mask-cv { display: none; }
.gfx-tex-cv { position: absolute; left: 0; top: 0; width: 100% !important; height: 100% !important; mix-blend-mode: multiply; pointer-events: none; }
.gfx-tex-cv[hidden] { display: none; }
/* «Поверх» on half the frame: the picture fills the panel the video moved away from */
.broll-view.half img, .broll-view.half video { inset: 0 50% 0 0; width: 50%; height: 100%; object-fit: cover; }
.broll-view.half.right img, .broll-view.half.right video { inset: 0 0 0 50%; }
.broll-view.half.tall img, .broll-view.half.tall video { inset: 0 0 50% 0; width: 100%; height: 50%; }
.broll-item.half { background: rgba(120,170,255,.22); box-shadow: inset 0 0 0 1.5px rgba(150,190,255,.9); }
/* «Графика»: the look folded into one line above the tiles */
.gfx-look { border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; margin: 2px 0 8px; }
.gfx-look > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; list-style: none; }
.gfx-look > summary::-webkit-details-marker { display: none; }
.gfx-look > summary b { font-size: 13px; font-weight: 600; }
.gfx-look-sw { width: 18px; height: 18px; border-radius: 5px; flex: 0 0 18px; }
.gfx-look[open] { padding-bottom: 8px; }
.gfx-look .gfx-th-name { display: none; }
/* the card's settings (21c-graphics.js paintInsp): three tabs; lists and a chat as rows; fonts as tiles */
.gi-head .btn-icon { width: 30px; height: 30px; }
.gi-head .btn-icon .ic { width: 15px; height: 15px; }
.gi-head .btn-icon.off { opacity: .45; }
.gi-head .gi-del:hover { color: #ff6b6b; }
.gi-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.gi-tabs button { flex: 1; min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted);
  font: 600 12.5px var(--font-body); cursor: pointer; }
.gi-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 1px 6px rgba(0,0,0,.3); }
.gi-pane { display: grid; gap: 11px; }
.gi-pane[hidden] { display: none; }
.gi-list, .gi-chat { display: grid; gap: 6px; }
.gl-row, .gc-row { display: flex; align-items: center; gap: 6px; }
.gl-row .input, .gc-row .input { flex: 1; min-width: 0; }
.gl-del { flex: 0 0 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-dim);
  font-size: 18px; line-height: 1; cursor: pointer; }
.gl-del:hover { color: #ff6b6b; background: rgba(255,107,107,.08); }
.gl-add { justify-self: start; }
.gc-row.me { flex-direction: row-reverse; }
.gc-row.me .input { background: rgba(43, 82, 120, .45); border-color: rgba(100, 181, 239, .35); }
.gc-who { flex: 0 0 auto; min-width: 44px; height: 30px; padding: 0 8px; border-radius: 15px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-muted); font: 600 11.5px var(--font-body); cursor: pointer; }
.gc-row.me .gc-who { color: #9fd3ff; border-color: rgba(100, 181, 239, .45); }
.gc-add { display: flex; flex-wrap: wrap; gap: 6px; }
.gi-fonts { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; grid-template-rows: repeat(2, auto); gap: 6px;
  overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gi-font { display: grid; gap: 2px; padding: 8px 8px 6px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); text-align: left; cursor: pointer; min-width: 0; }
.gi-font span { font-size: 17px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-font small { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-font.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gi-size { display: flex; align-items: center; gap: 8px; }
.gi-size input[type=range] { flex: 1; }
.gi-size button { flex: 0 0 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font: 600 16px/1 var(--font-body); cursor: pointer; }
#gfxBehindHit .gfx-rs { display: none; }
#gfxBehindHit:hover .gfx-rs, #gfxBehindHit.picked .gfx-rs, #gfxBehindHit.dragging .gfx-rs { display: block; }
@media (pointer: coarse) { #gfxBehindHit.picked .gfx-rs { display: block; width: 26px; height: 26px; right: -13px; bottom: -13px; } }
/* fullscreen: a bar of its own (12-transport-export.js fullBar), gone while the mouse rests */
.fs-bar { display: none; }
.monitor-screen:fullscreen .fs-bar, .monitor-screen:-webkit-full-screen .fs-bar {
  display: flex; align-items: center; gap: 12px; position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 28px 22px 18px; background: linear-gradient(transparent, rgba(0,0,0,.72)); transition: opacity .25s; }
.monitor-screen.fs-idle .fs-bar { opacity: 0; pointer-events: none; }
.monitor-screen.fs-idle { cursor: none; }
.fs-btn { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  display: grid; place-items: center; }
.fs-btn:hover { background: rgba(255,255,255,.24); }
.fs-btn .ic { width: 18px; height: 18px; }
.fs-t { color: #fff; font-size: 13px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.fs-seek { flex: 1; accent-color: var(--accent); height: 22px; cursor: pointer; }
/* (the inspector never wider than its column: the font strip scrolls inside, the rows shrink) */
.gfx-insp, .gi-pane { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.gfx-insp { overflow: hidden; }
.gi-head { min-width: 0; gap: 2px; }
.gi-kind { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; flex: 1 1 auto; }
.gi-kind::first-letter { text-transform: uppercase; }
.gi-head .grow { display: none; }
.gi-head .btn-icon { flex: 0 0 28px; width: 28px; height: 28px; }
.gi-sec, .gi-f, .gi-list, .gi-chat { min-width: 0; }
.gc-row .gc-who { min-width: 0; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-row.them .gc-who { font-size: 10.5px; padding: 0 6px; }
/* nothing cut short (uitest/clip.py): names and labels take a second line instead of «…» */
.gi-kind { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.gi-fonts { grid-auto-columns: 124px; }
.gi-font span { font-size: 16px; line-height: 1.4; overflow: visible; text-overflow: clip; padding-bottom: 1px; }
.gi-font small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
.font-tile .ft-s { font-size: 17px; line-height: 1.4; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.font-tile small, .cap-tile small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
.gfx-pick span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; overflow-wrap: anywhere; text-align: left; }
.lt-meta b, .lt-meta span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.side-item .dim { white-space: normal; overflow: visible; text-overflow: clip; }
/* (a column never wider than the library: «Оформление» or a long word made the whole pane wider and cut «в ролике») */
#work .lib-body > * { min-width: 0; max-width: 100%; }
.gfx-look > summary { flex-wrap: wrap; row-gap: 2px; padding: 6px 0; }
.gfx-look > summary b { white-space: normal; }
.gfx-tile b, .gfx-tile i { overflow-wrap: anywhere; hyphens: auto; }
/* the card's settings: its name and ✕, then the actions named in their own row */
.gi-head { display: flex; align-items: flex-start; gap: 6px; }
.gi-head .gi-kind { flex: 1 1 auto; overflow-wrap: anywhere; padding-top: 5px; }
.gi-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.gi-act { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font: 500 12px var(--font-body); cursor: pointer; }
.gi-act:hover { color: var(--text); border-color: var(--border-strong); }
.gi-act .ic { width: 13px; height: 13px; }
.gi-act.off { color: var(--accent); }
.gi-act.gi-del:hover { color: #ff6b6b; border-color: rgba(255,107,107,.4); }
/* a chat's message: whose it is and ✕ on top, the words the whole width under them */
.gc-row, .gc-row.me { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "who . del" "inp inp inp"; gap: 4px 6px; }
.gc-row .gc-who { grid-area: who; max-width: none; height: 24px; font-size: 11px; }
.gc-row .gl-del { grid-area: del; height: 24px; }
.gc-row .input { grid-area: inp; }
.gc-row.me .gc-who { justify-self: start; }
.gi-chat { gap: 10px; }
/* names of files and projects, the account's address: a second line, not «…» */
.media-card .nm { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.track-item .nm { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#authWho { overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
.pc-name { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
/* the editor's four figures: two by two when the column is narrow */
.inspector { container: insp / inline-size; }
@container insp (max-width: 340px) {
  #work .inspector .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #work .inspector .stat + .stat { box-shadow: none; }
  #work .inspector .stat:nth-child(2n) { box-shadow: inset 1px 0 0 var(--border); }
  #work .inspector .stat:nth-child(n+3) { box-shadow: inset 0 1px 0 var(--border); }
  #work .inspector .stat:nth-child(4) { box-shadow: inset 1px 0 0 var(--border), inset 0 1px 0 var(--border); }
}
/* a narrow column: the card's actions as icons (their names in the hint) instead of three rows */
#gfxInsp { container: ginsp / inline-size; }
@container ginsp (max-width: 250px) { .gi-act span { display: none; } .gi-act { padding: 0; width: 34px; justify-content: center; } }
/* the editor's five tabs share the column's width: none cut at the edge («Эксп…») however narrow the column */
#work .inspector .tabs { gap: 2px; overflow-x: visible; }
#work .inspector .tabs .tab { flex: 1 1 auto; min-width: 0; padding-left: 3px; padding-right: 3px; text-align: center; white-space: nowrap; }
@container insp (max-width: 340px) { #work .inspector .tabs .tab { font-size: 12px; padding-left: 1px; padding-right: 1px; } }
@container insp (max-width: 285px) { #work .inspector .tabs .tab { font-size: 11px; letter-spacing: -0.01em; } }
/* two fields side by side: a long choice (a track's name) never widens the pair past the column */
.row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row2 > * { min-width: 0; }
/* «В ролике» in a narrow column: on / when / ✕ on top, the card's name under them, the whole width */
.gfx-list { container: glist / inline-size; }
@container glist (max-width: 260px) {
  .gfx-row { grid-template-columns: auto auto 1fr auto; grid-template-areas: "on go . del" "pick pick pick pick"; row-gap: 2px; }
  .gfx-row > .toggle { grid-area: on; } .gfx-row > .gfx-go { grid-area: go; } .gfx-row > .gfx-del { grid-area: del; }
  .gfx-row > .gfx-pick { grid-area: pick; }
}
@container insp (max-width: 300px) { #work .inspector .row2 { grid-template-columns: minmax(0, 1fr); } }
/* a dropdown's choice too long for its box takes a second line instead of «…» (01b-ui.js uiSelect) */
button.dd, button.dd.sm { height: auto; min-height: var(--ctl-h); padding-top: 4px; padding-bottom: 4px; }
button.dd.sm { min-height: var(--ctl-h-sm); }
button.dd > .dd-v { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; text-align: left; }
