/* ClipMatrix UI. Palette «Табак», dark only. Tokens first, components after. */

/* ---------- Tokens ---------- */
:root {
  /* Accent: change this single line to recolor the product. */
  --accent-rgb: 152 181 131;

  --accent: rgb(var(--accent-rgb));
  --accent-soft: rgb(var(--accent-rgb) / .14);
  --accent-ink: #11140e;

  --bg: #11100e;
  --surface: #1a1815;
  --raised: #24211d;
  --line: #312d27;
  --line-strong: #736b5e;
  --text: #efe9de;
  --muted: #aba393;
  --faint: #908978;
  --danger: #e08a6e;
  --danger-soft: rgb(224 138 110 / .1);
  --minutes-pack: #c9b77e;
  --minutes-bonus: #8fb2c4;
  --on-media: #f3efe6;
  --media-veil: rgb(10 10 8 / .6);
  --blob-1: #3a2a1a;
  --blob-2: #22392a;
  --blob-3: #45361f;

  --r-ctl: 999px;
  --r-field: 14px;
  --r-media: 18px;
  --r-tile: 20px;
  --r-card: 24px;
  --r-panel: 32px;
  --shadow-float: 0 30px 80px -30px rgb(0 0 0 / .7);

  --display: 'Unbounded', system-ui, sans-serif;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --t-fast: 160ms;
  --t-base: 280ms;
  --t-slow: 520ms;
  --soft: cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.2, .4, 1);

  --header-h: 72px;
  color-scheme: dark;
}

@font-face { font-family: Unbounded; font-weight: 500; font-display: swap; src: url('/fonts/unbounded-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Unbounded; font-weight: 500; font-display: swap; src: url('/fonts/unbounded-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Unbounded; font-weight: 600; font-display: swap; src: url('/fonts/unbounded-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Unbounded; font-weight: 600; font-display: swap; src: url('/fonts/unbounded-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url('/fonts/nunito-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url('/fonts/nunito-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url('/fonts/nunito-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url('/fonts/nunito-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url('/fonts/nunito-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url('/fonts/nunito-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url('/fonts/nunito-cyrillic-800.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url('/fonts/nunito-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100svh; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
img, video, svg { display: block; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; position: relative; }
@media (min-width: 720px) { .wrap { padding-inline: 40px; } }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-ctl); background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; }
.skip-link:focus-visible { top: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: var(--r-ctl); font-weight: 800; font-size: 15px; line-height: 1; white-space: nowrap; text-decoration: none; transition: transform var(--t-base) var(--spring), background-color var(--t-fast) var(--soft), color var(--t-fast) var(--soft), opacity var(--t-fast) var(--soft); }
.btn .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.btn:not(:disabled):hover { transform: scale(1.04); }
.btn:not(:disabled):active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--raised); color: var(--text); }
.btn-soft:not(:disabled):hover { background: var(--line); }
.btn-link { min-height: 40px; padding: 0 14px; color: var(--muted); }
.btn-link:not(:disabled):hover { color: var(--text); transform: none; }
.btn-danger { background: var(--raised); color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background-color var(--t-fast) var(--soft), color var(--t-fast) var(--soft); }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.text-link { color: var(--text); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.accent-link { color: var(--accent); font-weight: 800; text-decoration: none; }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input { width: 100%; height: 50px; border-radius: var(--r-field); border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--text); font-weight: 600; font-size: 16px; padding: 0 16px; transition: border-color var(--t-base) var(--soft); }
.input:focus { border-color: var(--accent); }
.input:focus-visible { outline: none; }
.input-wrap.with-eye .input { padding-right: 104px; }
.eye { position: absolute; right: 6px; top: 6px; z-index: 2; height: 38px; min-width: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg); color: var(--muted); font-weight: 700; font-size: 13px; touch-action: manipulation; }
/* Hide browser-native reveal buttons so only one control remains. */
.input-wrap.with-eye input::-ms-reveal, .input-wrap.with-eye input::-ms-clear { display: none; }
.eye:hover { color: var(--text); background: var(--raised); }
.field.is-bad .input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 14px; font-weight: 700; margin-top: 6px; }
.field-error a { color: var(--text); }
.field-hint { color: var(--faint); font-size: 13px; margin-top: 6px; }
.alert { border-radius: var(--r-field); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; font-weight: 700; background: var(--danger-soft); color: var(--danger); }
.alert.neutral { background: var(--raised); color: var(--muted); }
.alert b { font-variant-numeric: tabular-nums; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; line-height: 1; color: var(--text); text-decoration: none; border-radius: 10px; }
.logo svg { width: 30px; height: 30px; flex: none; }
@media (max-width: 419px) { .logo { font-size: 16px; } }
.mk-band { fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.mk-frame { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.logo-anim .mk-frame { animation: mk-frame 1.4s var(--spring) both; }
.logo-anim .mk-band { stroke-dasharray: 12; animation: mk-band 1.1s var(--soft) both; }
.logo:hover .mk-frame { animation: mk-frame .6s var(--spring) both; }
.logo:hover .mk-band { stroke-dasharray: 12; animation: mk-band .6s var(--soft) both; }
@keyframes mk-frame { 0% { transform: scale(1.8, .25); opacity: 0; } 50% { opacity: 1; } 100% { transform: none; } }
@keyframes mk-band { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }

/* ---------- Blobs (auth and landing only) ---------- */
.blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; filter: blur(70px); opacity: .6; border-radius: 42% 58% 63% 37% / 45% 41% 59% 55%; will-change: transform; animation: blob 22s var(--soft) infinite alternate; }
.blobs.static .blob { animation: none; will-change: auto; }
@keyframes blob { 50% { transform: translate(40px, -30px) rotate(40deg) scale(1.05); } 100% { transform: translate(-30px, 30px) rotate(-20deg); } }

/* ---------- Spotlight ---------- */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; opacity: 0; transition: opacity var(--t-slow) var(--soft); background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%); }
.spot.is-lit::before { opacity: 1; }

/* ---------- Auth ---------- */
.auth-page { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; padding-block: 24px 64px; }
.auth-page .b1 { width: 460px; height: 460px; background: var(--blob-1); left: -160px; top: -120px; }
.auth-page .b2 { width: 400px; height: 400px; background: var(--blob-2); right: -140px; bottom: -120px; animation-duration: 26s; animation-delay: -8s; }
.auth-nav { position: relative; z-index: 1; display: flex; align-items: center; height: 56px; }
.auth-main { position: relative; z-index: 1; display: grid; justify-content: center; grid-template-columns: min(400px, 100%); margin-top: 40px; }
.card { border-radius: 28px; background: var(--surface); padding: 32px 28px; }
@media (max-width: 380px) { .card { padding: 28px 20px; } }
.card h1 { font-size: 28px; margin-bottom: 24px; }
.card .lead { color: var(--muted); margin: -12px 0 20px; }
.card .btn-block { margin-top: 8px; }
.below { margin-top: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.below + .below { margin-top: 8px; }
.invite-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 50px; border-radius: var(--r-field); background: var(--raised); padding: 0 6px 0 16px; font-weight: 700; margin-bottom: 16px; }
.invite-chip small { color: var(--muted); font-weight: 700; font-size: 14px; }
.invite-chip .btn-link { color: var(--accent); font-weight: 800; padding: 0 10px; }
.done-note { color: var(--muted); }
.done-note b { color: var(--text); }

/* ---------- App header ---------- */
.appbar { display: flex; align-items: center; gap: 8px; height: var(--header-h); border-bottom: 1px solid var(--line); }
.appbar .spacer { flex: 1; }
.appbar nav { display: flex; gap: 2px; margin-left: 16px; }
.appbar nav a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.appbar nav a:hover { color: var(--text); }
.appbar nav a[aria-current="page"] { background: var(--raised); color: var(--text); }
@media (max-width: 719px) { .appbar nav { display: none; } .appbar .logo .logo-text { display: none; } }
@media (max-width: 719px) {
  .appbar:has(.storage-notice) { flex-wrap: wrap; height: auto; min-height: var(--header-h); padding-block: 12px; }
  .appbar .storage-notice { order: 1; flex-basis: 100%; justify-content: center; white-space: normal; }
}
.quota { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 6px; border-radius: var(--r-ctl); background: var(--surface); font-size: 14px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.quota svg { width: 26px; height: 26px; }
.quota b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.quota .ring-bg { stroke: var(--line); }
.expense-controls { display: grid; gap: 12px; margin-top: 16px; }
.expense-controls label { display: flex; align-items: center; gap: 10px; }
.quota .ring-fill { stroke: var(--accent); transition: stroke-dasharray var(--t-base) var(--soft); }
.quota.is-low .ring-fill { stroke: var(--danger); }
.quota.is-low b { color: var(--danger); }
.tip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: max-content; max-width: 260px; padding: 8px 12px; border-radius: 12px; background: var(--raised); color: var(--text); font-size: 13px; font-weight: 700; white-space: normal; box-shadow: var(--shadow-float); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity var(--t-fast) var(--soft), transform var(--t-fast) var(--soft); }
.quota:hover .tip, .quota:focus-visible .tip { opacity: 1; transform: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--muted); text-transform: uppercase; }
.avatar:hover, .avatar[aria-expanded="true"] { color: var(--text); background: var(--line); }

/* ---------- Menu ---------- */
.menu-anchor { position: relative; }
.menu { position: fixed; z-index: 70; min-width: 200px; padding: 6px; border-radius: 18px; background: var(--raised); box-shadow: var(--shadow-float); transform-origin: top right; animation: pop var(--t-base) var(--soft) both; }
.menu .menu-head { padding: 8px 12px 10px; color: var(--muted); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.menu [role="menuitem"] { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; text-align: left; font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; white-space: nowrap; }
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible { background: var(--line); outline: none; }
.menu [role="menuitem"].danger { color: var(--danger); }
.menu [role="menuitem"]:disabled { color: var(--faint); background: none; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Studio: queue ---------- */
.studio { padding-bottom: 96px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-block: 32px 14px; }
.section-head h2 { font-size: 18px; }
.section-head a { color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.queue-strip { position: relative; margin: -4px 0 40px -4px; }
.queue { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 0 12px 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior-x: contain; }
.queue::-webkit-scrollbar { height: 4px; }
.queue::-webkit-scrollbar-thumb { border-radius: 2px; background: var(--line-strong); }
.queue::-webkit-scrollbar-track { background: transparent; }
/* More videos beyond an edge: the strip fades there and an arrow leads to them. */
.queue-strip::before, .queue-strip::after { content: ""; position: absolute; top: 0; bottom: 12px; z-index: 1; width: 56px; pointer-events: none; opacity: 0; transition: opacity var(--t-fast) var(--soft); }
.queue-strip::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.queue-strip::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.queue-strip.more-start::before, .queue-strip.more-end::after { opacity: 1; }
.queue-arrow { position: absolute; top: calc(50% - 26px); z-index: 2; background: var(--raised); color: var(--text); box-shadow: var(--shadow-float); }
.queue-arrow.back { left: 6px; }
.queue-arrow.forth { right: 6px; }
@media (hover: none) { .queue-arrow { display: none; } }
.tile { position: relative; flex: none; width: 220px; scroll-snap-align: start; border-radius: var(--r-tile); background: var(--surface); padding: 6px; text-align: left; transition: transform var(--t-slow) var(--spring), box-shadow var(--t-base) var(--soft); }
.tile:hover { transform: translateY(-3px); }
.tile[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tile-open { display: block; width: 100%; text-align: left; border-radius: 15px; }
.tile-thumb { aspect-ratio: 16 / 9; border-radius: 15px; overflow: hidden; position: relative; background: var(--raised); }
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(10 10 8 / .45); }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / .12); }
.tile-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 300ms linear; }
.tile-meta { padding: 10px 8px 6px; min-height: 66px; }
.tile-meta b { display: block; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 30px; }
.tile-status { display: block; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.4; }
.tile-status.ok { color: var(--accent); }
.tile-status .bad { color: var(--danger); }
.tile-cost { display: block; color: var(--faint); font-size: 13px; font-weight: 600; }
.tile-error { display: block; color: var(--danger); font-size: 13px; font-weight: 700; line-height: 1.4; margin-top: 2px; }
.tile .find { width: 100%; min-height: 36px; margin-top: 10px; font-size: 14px; padding: 0 12px; }
.tile .find span { font-weight: 700; opacity: .7; }
.tile .tile-more { position: absolute; right: 6px; bottom: 6px; }
.tile .tile-more .icon-btn { width: 36px; height: 36px; }
.tile-actions { display: flex; gap: 6px; margin-top: 8px; }
.tile-actions .btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .18); border-top-color: var(--accent); animation: spin 1s linear infinite; will-change: transform; }
.clock { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--media-veil); color: var(--on-media); }
.clock .icon { width: 18px; height: 18px; }
.tile-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--media-veil); font: 500 13px var(--display); color: var(--on-media); }
.tile-alert { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--media-veil); color: var(--danger); font: 600 18px var(--display); }
@keyframes spin { to { transform: rotate(360deg); } }

.add-tile { position: sticky; right: 0; z-index: 2; flex: none; width: 220px; min-height: 180px; border-radius: var(--r-tile); background: var(--surface); border: 1.5px dashed var(--line-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; transition: border-color var(--t-base) var(--soft), background-color var(--t-base) var(--soft); box-shadow: -24px 0 24px -8px var(--bg); scroll-snap-align: end; }
.add-tile:hover, .add-tile.is-drop { border-color: var(--accent); }
.add-tile.is-drop { background: var(--raised); }
.add-ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--accent); animation: breathe 4s var(--soft) infinite; }
.add-ring .icon { width: 22px; height: 22px; }
.add-tile b { font-weight: 800; }
/* Import by link: the tile holds the file button and the link field; the dialog shows what was found. */
.add-tile.has-link { justify-content: space-between; gap: 8px; padding: 12px; }
.add-pick { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; min-height: 96px; }
.add-pick:hover b { color: var(--accent); }
.link-form { width: 100%; }
.link-row { display: flex; gap: 8px; }
.link-row .input { flex: 1; min-width: 0; text-overflow: ellipsis; }
.link-form.is-compact .link-row { gap: 6px; }
.link-form.is-compact .input { height: 40px; font-size: 14px; padding: 0 10px; border-radius: 12px; }
.link-form.is-compact .btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; }
.link-error { text-align: left; }
.link-error, .link-found .field-error { color: var(--danger); font-size: 12px; font-weight: 400; }
.first-run .link-form { max-width: 520px; margin-top: 4px; }
.first-run .first-or { margin-top: 10px; font-size: 14px; }
.hero-link { max-width: min(560px, 100%); margin: 0 auto 22px; }
.hero { min-width: 0; }
.hero-link .input { background: var(--surface); }
.hero-or { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--muted); }
/* The field and «Нарезать» are one control: same height, same corners, joined in the middle. */
.hero-link .link-row { gap: 0; }
.hero-link .input { height: 52px; border-radius: var(--r-field) 0 0 var(--r-field); border-right: 0; }
.hero-link .link-row .btn { min-height: 52px; height: 52px; padding: 0 26px; border-radius: 0 var(--r-field) var(--r-field) 0; }
.hero-link .link-row .btn:not(:disabled):hover { transform: none; filter: brightness(1.08); }
@media (min-width: 900px) { .hero-link { margin-inline: 0; max-width: 470px; } }
@media (max-width: 479px) { .hero-link .link-row { gap: 8px; } .hero-link .input { border-right: 1.5px solid var(--line-strong); border-radius: var(--r-field); } .hero-link .input:focus { border-color: var(--accent); } .hero-link .link-row .btn { border-radius: var(--r-field); }
  .hero-link .link-row, .first-run .link-row { flex-direction: column; } .hero-link .link-row .input, .first-run .link-row .input { flex: none; } .hero-link .btn, .first-run .link-form .btn { width: 100%; } }
.link-found { min-height: 96px; margin-top: 14px; }
.link-card { display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: center; }
.link-cover { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--raised); }
.link-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-facts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.link-facts b { font-weight: 800; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.link-facts small { color: var(--muted); font-size: 14px; }
.link-found .field-error { margin-top: 12px; }
.link-wait { display: flex; align-items: center; gap: 10px; }
@media (max-width: 419px) { .link-card { grid-template-columns: 104px 1fr; gap: 10px; } }
.add-tile small { color: var(--muted); font-size: 13px; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px var(--accent-soft); } }
/* On phones a sticky tile would cover half of the row: it stays last in the row instead. */
@media (max-width: 719px) { .tile, .add-tile { width: 168px; } .add-tile { position: relative; min-height: 158px; box-shadow: none; } }

.drop-frame { position: fixed; inset: 8px; z-index: 60; border: 2px solid var(--accent); border-radius: 24px; pointer-events: none; opacity: 0; transition: opacity var(--t-base) var(--soft); }
.drop-frame.on { opacity: 1; }

/* ---------- Studio: first-run empty state ---------- */
.first-run { margin-top: 40px; border-radius: var(--r-panel); background: var(--surface); padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; transition: box-shadow var(--t-base) var(--soft); }
.first-run.is-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.first-run h1 { font-size: clamp(22px, 3vw, 32px); margin-top: 8px; }
.first-run p { color: var(--muted); }
.first-run .btn { margin-top: 12px; }
.first-run .add-ring { width: 72px; height: 72px; }
.first-run .add-ring .icon { width: 28px; height: 28px; }
.first-run .first-error { color: var(--danger); font-weight: 700; font-size: 14px; max-width: 460px; }
.steps { margin-top: 40px; }

/* ---------- Explainer tabs (shared with landing) ---------- */
.explain { border-radius: var(--r-panel); background: var(--surface); padding: 20px; }
@media (min-width: 720px) { .explain { padding: 28px; } }
.explain-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
.explain-tab { flex: none; }
.explain-tabs::-webkit-scrollbar { display: none; }
.explain-tab { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 8px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; transition: background-color var(--t-base) var(--soft), color var(--t-base) var(--soft); }
.explain-tab .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); font: 500 13px var(--display); }
.explain-tab[aria-selected="true"] { background: var(--raised); color: var(--text); }
.explain-tab[aria-selected="true"] .n { background: var(--accent); color: var(--accent-ink); }
.explain-panel { display: grid; gap: 20px; margin-top: 24px; align-items: center; }
@media (min-width: 720px) { .explain-panel { grid-template-columns: 1fr 1fr; gap: 40px; } }
.explain-panel h3 { font-size: clamp(20px, 2.4vw, 26px); margin-bottom: 8px; }
.explain-panel p { color: var(--muted); max-width: 46ch; }
.explain-art { height: 140px; border-radius: var(--r-media); background: var(--bg); position: relative; overflow: hidden; }
.explain-text { animation: rise var(--t-slow) var(--soft) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.art-wave { position: absolute; inset: 20px 20px 52px; display: flex; align-items: center; gap: 4px; }
.art-wave i { flex: 1; border-radius: 3px; background: var(--accent); opacity: .75; transform-origin: center; animation: wave 1.6s var(--soft) infinite alternate; }
@keyframes wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.art-words { position: absolute; left: 20px; right: 20px; bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 14px; }
.art-words span { opacity: 0; animation: rise var(--t-slow) var(--soft) both; }
.art-rail { position: absolute; left: 20px; right: 20px; top: 50%; height: 14px; margin-top: -7px; border-radius: 7px; background: var(--raised); }
.art-rail i { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: var(--accent); opacity: 0; transform: scaleX(.4); animation: seg var(--t-slow) var(--spring) both; }
@keyframes seg { to { opacity: 1; transform: none; } }
.art-rail-scale { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.explain-art.art-build { height: 290px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.art-morph { position: relative; flex: none; width: 296px; height: 167px; border-radius: 10px; overflow: hidden; background: var(--raised); box-shadow: 0 0 0 1px rgb(255 255 255 / .08); animation: art-morph 1.3s .6s var(--soft) forwards; }
@keyframes art-morph { to { width: 146px; height: 258px; border-radius: 20px; box-shadow: 0 0 0 4px #0b0a09, 0 0 0 5px rgb(255 255 255 / .1), var(--shadow-float); } }
.art-bg { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(12px) brightness(.5); opacity: 0; animation: fade-in .8s 1s var(--soft) forwards; }
.art-bg-plain { background: linear-gradient(160deg, var(--blob-2), var(--blob-1)); }
.art-frame { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transform: translateY(-50%); }
.art-frame-plain { background: linear-gradient(135deg, var(--blob-2), var(--blob-1)); }
.art-sub { position: absolute; left: 6%; right: 6%; top: 67%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .28em; font: 800 12px/1.2 var(--sans); text-transform: uppercase; color: #fff; text-align: center; text-shadow: 0 1px 3px #000c; }
.art-sub span { opacity: 0; animation: art-word .5s var(--soft) forwards; }
@keyframes art-word { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; transform: none; color: var(--accent); } 100% { opacity: 1; color: #fff; } }
.art-texts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.art-texts li { padding: 6px 12px; border-radius: 10px; background: var(--raised); font-size: 13px; font-weight: 700; color: var(--muted); opacity: 0; animation: rise var(--t-slow) var(--soft) forwards; }
@keyframes fade-in { to { opacity: 1; } }
@media (max-width: 479px) { .explain-art.art-build { height: 260px; gap: 12px; } .art-morph { width: 240px; height: 135px; } @keyframes art-morph { to { width: 128px; height: 228px; border-radius: 18px; box-shadow: 0 0 0 4px #0b0a09, var(--shadow-float); } } .art-texts li { font-size: 12px; padding: 5px 9px; } }
/* Questions on the landing (and in the server's HTML). */
.faq { width: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item, .faq details { border-radius: var(--r-field); background: var(--surface); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; font-weight: 800; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--raised); color: var(--muted); font-weight: 600; }
.faq details[open] summary::after { content: "−"; color: var(--accent); }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--muted); max-width: 70ch; }
@media (max-width: 479px) { .faq summary { padding: 14px 16px; font-size: 15px; } .faq details p { padding: 0 16px 16px; font-size: 15px; } }
.page-faq .page-body { gap: 24px; }
/* The landing's words in the server's HTML, shown until the app starts (and to readers without scripts). */
.static-page { display: grid; gap: 48px; padding-block: 96px 0; }
.static-page h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 18px; }
.static-steps { display: grid; gap: 16px; padding-left: 20px; color: var(--muted); }
.static-steps h3 { color: var(--text); font-size: 18px; }

/* Phone mockup: fixed 9:16, never shrinks; the caption keeps a readable size. */
.phone-mock { position: relative; flex: 0 0 auto; height: clamp(180px, 26vw, 220px); aspect-ratio: 9 / 16; padding: 5px; border-radius: 22px; background: #0b0a09; box-shadow: 0 0 0 1px rgb(255 255 255 / .08), var(--shadow-float); }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 17px; overflow: hidden; background: var(--surface); }
.phone-notch { position: absolute; left: 50%; top: 9px; width: 28%; height: 5px; margin-left: -14%; border-radius: 3px; background: #0b0a09; }
.phone-mock .short-caption { font-size: clamp(12px, 1.4vw, 15px); }
.short-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Studio: project ---------- */
.project-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; margin-bottom: 24px; }
.project-head h1 { font-size: clamp(24px, 3vw, 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-rename { display: block; max-width: 100%; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 10px; cursor: text; }
.title-rename:hover { color: var(--accent); }
.project-meta { color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 6px; }
.project-hint { color: var(--faint); font-size: 13px; margin-top: 4px; }
.project-error { color: var(--muted); margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.project-error b { color: var(--danger); }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.project-title-row { min-width: 0; flex: 1 1 320px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.grid-note { color: var(--muted); font-weight: 700; margin-bottom: 16px; }
.review-block { margin-top: 40px; }
.content-copies { display: flex; flex-wrap: wrap; gap: 6px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-block[hidden] { display: none; }
.review-title { font-size: 20px; margin: 0 0 6px; }
.clip { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-card); background: var(--surface); padding: 8px; transition: transform var(--t-slow) var(--spring); animation: rise var(--t-base) var(--soft) both; animation-delay: calc(var(--i, 0) * 60ms); }
.clip:hover { transform: translateY(-4px); }
.poster { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-media); position: relative; overflow: hidden; background: var(--raised); }
.poster img, .poster video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster video { opacity: 0; transition: opacity var(--t-base) var(--soft); }
.poster video.on { opacity: 1; }
.dur { position: absolute; right: 10px; bottom: 10px; z-index: 1; font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: var(--r-ctl); background: var(--media-veil); color: var(--on-media); font-variant-numeric: tabular-nums; }
.prog { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgb(10 10 8 / .55); color: var(--on-media); }
.prog .pct { font: 500 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.prog .lbl { font-weight: 800; font-size: 14px; opacity: .85; }
.prog .bar { width: 60%; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .18); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform 600ms linear; }
.skeleton { background: linear-gradient(110deg, var(--raised) 30%, var(--line) 50%, var(--raised) 70%); background-size: 250% 100%; animation: shimmer 2.4s linear infinite; }
.poster .skel-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--muted); }
.poster.is-queued img { filter: brightness(.42) saturate(.7); }
.poster.is-queued .skel-label { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); padding: 0 10px; text-align: center; }
@keyframes shimmer { to { background-position: -150% 0; } }
.poster .err-mark { position: absolute; inset: 0; display: grid; place-items: center; background: var(--media-veil); }
.clip-body { flex: 1; display: flex; flex-direction: column; padding: 14px 8px 8px; }
.clip-body .acts { margin-top: auto; }
.clip .clip-title { font-family: var(--sans); font-weight: 800; font-size: 16px; line-height: 1.3; letter-spacing: 0; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; overflow-wrap: anywhere; }
.clip.is-waiting .clip-title { color: var(--muted); }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; font-weight: 700; color: var(--muted); margin: -4px 0 12px; min-height: 18px; transition: opacity 200ms var(--soft); }
.note .dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); animation: pulse 1.4s var(--soft) infinite; }
.note.ok { color: var(--accent); }
.note.review { color: var(--muted); }
.note.review span:first-child { background: var(--raised); padding: 2px 8px; border-radius: 10px; }
.note .lvl { white-space: nowrap; }
.note .bad { color: var(--danger); }
.note .lvl { margin-left: auto; color: var(--muted); font-weight: 700; white-space: nowrap; }
@keyframes pulse { 50% { opacity: .3; } }
.acts { display: flex; gap: 6px; }
.acts .edit { flex: 1; min-width: 0; min-height: 40px; border-radius: var(--r-ctl); background: var(--raised); font-weight: 800; font-size: 14px; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--t-fast) var(--soft); }
.acts .edit:not(:disabled):hover { background: var(--line); }
.acts .dl { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform var(--t-base) var(--spring); }
.acts .dl:not(:disabled):hover { transform: scale(1.08); }
.acts .dl .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.acts [disabled] { opacity: .4; }
.acts .dl[disabled] { background: var(--raised); color: var(--muted); }
.edit .s { display: none; }
@media (max-width: 719px) { .edit .l { display: none; } .edit .s { display: inline; } }

.empty-result { border-radius: var(--r-card); background: var(--surface); padding: 32px 24px; text-align: center; color: var(--muted); }
.empty-result p { max-width: 46ch; margin: 0 auto 16px; }
.state-screen { padding: 96px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.state-screen h1 { font-size: clamp(22px, 3vw, 32px); }
.state-screen p { color: var(--muted); }
/* First paint, before any script: the mark and a quiet skeleton instead of an empty screen. */
.boot { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; align-content: center; gap: 28px; }
.boot-mark { width: 56px; height: 56px; animation: boot-mark 1.1s var(--soft) infinite alternate; }
.boot-lines { display: grid; gap: 10px; width: min(240px, 60vw); }
.boot-lines i { height: 10px; border-radius: 5px; background: var(--raised); animation: boot-line 1.1s var(--soft) infinite alternate; }
.boot-lines i:nth-child(2) { width: 72%; animation-delay: .15s; }
.boot-lines i:nth-child(3) { width: 46%; animation-delay: .3s; }
@keyframes boot-mark { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes boot-line { from { opacity: .45; } to { opacity: 1; } }

/* ---------- Clip editor ---------- */
.editor { padding-bottom: 64px; }
.editor-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; margin-block: 24px 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 8px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; max-width: 220px; }
.back-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link:hover { color: var(--text); background: var(--surface); }
.title-input { display: block; width: 100%; min-width: 0; min-height: 52px; resize: none; overflow: hidden; padding: 9px 12px; line-height: 1.2; border-radius: var(--r-field); border: 1.5px solid transparent; background: transparent; color: var(--text); font: 500 clamp(20px, 2.4vw, 28px)/1.2 var(--display); letter-spacing: -.02em; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--accent); background: var(--bg); }
.title-input:focus-visible { outline: none; }
.editor-actions { display: flex; gap: 8px; }
.btn.icon-only { width: 40px; padding: 0; }
.btn-xs { min-height: 36px; padding: 0 12px; font-size: 13px; }
@media (max-width: 719px) {
  .editor-top { grid-template-columns: minmax(0, 1fr) auto; }
  .editor-title { grid-column: 1 / -1; grid-row: 2; }
  .back-link { padding-left: 4px; }
}
.editor-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding-left: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.chip.neutral { background: var(--raised); color: var(--muted); }
.chip.small { min-height: 22px; font-size: 13px; padding: 1px 8px; }
.note-text { color: var(--muted); font-size: 14px; flex-basis: 100%; }
.editor-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .editor-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; } }
.stage { position: sticky; top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
@media (max-width: 899px) {
  /* Phones: the preview stays on screen while the tabs scroll under it (one block, so it can stick). */
  .editor-grid { display: block; }
  .stage { top: 0; z-index: 6; margin: 0 -16px 16px; padding: 8px 16px 4px; background: var(--bg); box-shadow: 0 10px 16px -12px rgb(0 0 0 / .6); }
  .stage-under { min-height: 36px; }
  .title-input { font-size: 20px; line-height: 1.25; padding-block: 10px; }
}
.player { position: relative; height: min(70vh, 720px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: var(--r-card); overflow: hidden; background: #000; }
@media (max-width: 899px) { .player { height: min(40vh, 420px); } }
.stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-video:not(.source) { opacity: 0; transition: opacity 200ms var(--soft); }
.stage-video.on { opacity: 1; }
.stage-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(10 10 8 / .6); color: var(--on-media); z-index: 2; }
.stage-msg { display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 800; text-align: center; padding: 16px; font-variant-numeric: tabular-nums; }
/* Loading over a still frame: a small note at the bottom, the picture stays visible. */
.stage-overlay.soft { background: none; place-items: end center; pointer-events: none; }
.stage-overlay.soft .stage-msg { flex-direction: row; gap: 8px; margin-bottom: 56px; padding: 6px 12px; border-radius: var(--r-ctl); background: var(--media-veil); font-size: 13px; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; cursor: pointer; }
.stage-play { position: absolute; left: 12px; bottom: 12px; z-index: 1; background: var(--media-veil); color: var(--on-media); }
.stage-tag.unsaved { background: var(--accent); color: var(--accent-ink); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.range-value { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 800; }
.stage-tag { position: absolute; left: 12px; top: 12px; z-index: 1; padding: 3px 10px; border-radius: var(--r-ctl); background: var(--media-veil); color: var(--on-media); font-size: 13px; font-weight: 800; }
.stage-under { min-height: 40px; display: flex; align-items: center; justify-content: center; }
.muted-note { color: var(--muted); font-size: 14px; }
.link-btn { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.panel { border-radius: var(--r-card); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 0; }
/* Every tab stays visible: with a long name or a fifth tab the row wraps instead of hiding one. */
.panel-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.panel-tab { min-height: 40px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 800; font-size: 14px; white-space: nowrap; }
.panel-tab:hover { color: var(--text); }
.panel-tab[aria-selected="true"] { background: var(--raised); color: var(--text); }
.dirty-flag { color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 6px; }
.panel-body { padding: 16px 20px; min-height: 320px; }
.pane-title { font-family: var(--sans); font-size: 15px; font-weight: 800; letter-spacing: 0; margin: 4px 0 12px; }
.pane-title:not(:first-child) { margin-top: 28px; }
.panel-foot { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 8px; }
/* «Применить» stays at the bottom of the screen while the long panel scrolls (all widths). */
.panel-foot { position: sticky; bottom: 0; z-index: 5; padding-top: 14px; background: linear-gradient(to top, var(--surface) 82%, transparent); border-radius: 0 0 var(--r-card) var(--r-card); }
.build-state { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 14px; color: var(--muted); }
.build-state.is-dirty { color: var(--text); }
.build-state.is-ok { color: var(--accent); }
.build-state .spinner { flex: none; }

.trim-time { font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.trim-rail { position: relative; height: 64px; border-radius: 12px; background: var(--bg); touch-action: none; }
.trim-bars { position: absolute; inset: 8px 0; display: flex; align-items: center; gap: 2px; padding: 0 2px; }
.trim-bars i { flex: 1; height: 100%; border-radius: 2px; background: var(--line-strong); transform-origin: center; }
.trim-sel { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 10px; pointer-events: none; }
.trim-handle { position: absolute; top: -4px; bottom: -4px; width: 22px; margin-left: -11px; border-radius: 8px; background: var(--accent); cursor: ew-resize; touch-action: none; }
.trim-handle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 18px; margin: -9px 0 0 -1px; border-radius: 1px; background: var(--accent-ink); opacity: .6; }
.trim-handle:focus-visible { outline-offset: 2px; }
.trim-nudges { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.trim-nudges > div { display: flex; gap: 6px; }

.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 92px; padding: 12px 8px; border-radius: 16px; background: var(--raised); font-weight: 800; font-size: 14px; text-align: center; hyphens: auto; overflow-wrap: anywhere; transition: box-shadow var(--t-fast) var(--soft); }
.preset[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.layout-icon { width: 30px; height: 46px; border-radius: 6px; border: 2px solid var(--muted); position: relative; overflow: hidden; }
.layout-icon i { position: absolute; background: var(--muted); }
.layout-icon.face i { left: 6px; right: 6px; top: 6px; height: 14px; border-radius: 50% 50% 4px 4px; }
.layout-icon.blur i { left: 0; right: 0; top: 14px; height: 14px; }
.layout-icon.crop i { inset: 4px; border-radius: 3px; }
.layout-icon.zoom i { left: 3px; right: 3px; top: 5px; height: 22px; border-radius: 50% 50% 6px 6px; }
.layout-icon.speaker i { left: 3px; right: 3px; top: 5px; height: 14px; border-radius: 50% 50% 4px 4px; box-shadow: 0 20px 0 var(--muted); }
.preset[aria-pressed="true"] .layout-icon.speaker i { box-shadow: 0 20px 0 var(--accent); }
.preset[aria-pressed="true"] .layout-icon { border-color: var(--accent); }
.preset[aria-pressed="true"] .layout-icon i { background: var(--accent); }
.range { width: 100%; accent-color: var(--accent); }
.style-sample { min-height: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 4px; padding: 4px; border-radius: 8px; background: #000; color: #fff; font-size: 13px; line-height: 1.15; width: 100%; overflow: hidden; white-space: nowrap; word-break: keep-all; }
.style-clean .style-sample { font-weight: 600; }
.style-pop .style-sample { font-weight: 800; text-transform: uppercase; }
.style-karaoke .style-sample { font-weight: 800; }
.style-karaoke .style-sample em { font-style: normal; color: var(--accent); }
.style-shorts .style-sample, .style-plate .style-sample { font-weight: 800; text-transform: uppercase; }
.style-calm .style-sample { font-weight: 800; }
.style-shorts .style-sample em { font-style: normal; color: #ffe600; }
.style-plate .style-sample em { font-style: normal; padding: 0 4px; border-radius: 5px; background: #7c4dff; }
.style-calm .style-sample em { font-style: normal; color: #4bffae; }
.look { display: flex; flex-direction: column; gap: 14px; }
.look-reset { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 14px; }
.panel-foot .btn + .btn { margin-top: 8px; }
/* Word-level caption editing. */
.cue-tools { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 2px; }
.cue-tools .link-btn { min-height: 36px; display: inline-flex; align-items: center; }
.cue-tools .link-btn { font-size: 13px; }
.cue-tools .link-btn:disabled { opacity: .45; cursor: default; }
.word-editor { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 12px; border-radius: 14px; background: var(--raised); }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chip { min-height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.word-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.word-time { display: flex; align-items: center; gap: 6px; }
.word-time .field-label { flex: 1; margin: 0; }
.word-time output { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
/* Clip content: the caption fix journal and the publishing texts. */
.content-block { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.content-status { font-size: 14px; font-weight: 700; }
.content-status.tone-ok { color: var(--accent); }
.content-status.tone-bad { color: var(--danger); }
.content-status.tone-plain { color: var(--muted); font-weight: 600; }
.content-changes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.content-changes li { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.content-diff { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.content-diff del { color: var(--faint); text-decoration: line-through; }
.content-diff ins { color: var(--text); font-weight: 800; text-decoration: none; }
.content-arrow { color: var(--faint); }
.content-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.content-platforms { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.content-fields { display: flex; flex-direction: column; gap: 12px; }
.content-field-head { display: flex; align-items: center; gap: 8px; }
.content-field-head .field-label { flex: 1; margin: 0; }
.content-count { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.content-count.is-over { color: var(--danger); font-weight: 800; }
.look-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.look .segmented { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--raised); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); }
.swatch.own { background: conic-gradient(#ffe600, #4bffae, #3da5ff, #7c4dff, #ff4d8d, #ffe600); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggles { display: flex; flex-direction: column; gap: 6px; }
.toggle-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--raised); }
.toggle-label { flex: 1; font-weight: 700; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background-color var(--t-fast) var(--soft); }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform var(--t-base) var(--spring); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.switch:disabled { opacity: .5; cursor: default; }

.cues { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cue { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: start; }
.cue-time { min-height: 40px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.cue-time:hover { color: var(--text); background: var(--raised); }
.cue-main { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cue-text { width: 100%; min-height: 44px; field-sizing: content; overflow: hidden; resize: none; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; }
.cue-text:focus { border-color: var(--accent); }

.more-section + .more-section { margin-top: 28px; }
.more-section .muted-note { margin-bottom: 12px; }
.broll-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.broll-item { border-radius: 16px; background: var(--raised); padding: 12px; }
.broll-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.broll-thumb { width: 64px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.broll-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.broll-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broll-name small { color: var(--muted); font-size: 13px; }
.broll-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.four-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 479px) { .four-cols { grid-template-columns: 1fr 1fr; } }
.input-sm { height: 42px; font-size: 15px; padding: 0 12px; }
select.input { appearance: auto; }
dialog.dlg.wide { max-width: min(720px, calc(100vw - 32px)); }
.cam-frame { position: relative; margin: 16px 0; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; cursor: crosshair; touch-action: none; }
.cam-video { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cam-box { position: absolute; border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 4px; pointer-events: none; }
.cam-fields summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; min-height: 32px; }

/* ---------- Pages: projects, account, admin, transcript ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-block: 32px 24px; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); }
.search { max-width: 320px; height: 44px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1100px) { .project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.project-grid .tile { width: auto; }
.section-head .all-link { color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.section-head .all-link:hover { color: var(--text); }

.account-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.account-card, .admin-card { border-radius: var(--r-card); background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.account-card h2, .admin-card h2 { font-size: 20px; }
.account-card .field, .admin-card .field { width: 100%; margin-bottom: 4px; }
.meter-block { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter-label { color: var(--muted); font-weight: 700; font-size: 14px; }
.meter-value { font: 500 22px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.meter.is-low i { background: var(--danger); }
.facts { padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.facts-line { color: var(--text); }
.danger-zone { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger-link { color: var(--danger) !important; padding-left: 0; }
.danger-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.admin-tabs { margin-bottom: 20px; }
.admin-body { display: flex; flex-direction: column; gap: 16px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-card); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { font-variant-numeric: tabular-nums; }
.table td.actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-link { cursor: pointer; }
.row-link:hover td, .row-link:focus-visible td { background: var(--raised); }
.row-link:focus-visible { outline: none; }
.empty-table { padding: 24px; border-radius: var(--r-card); background: var(--surface); }
.pager { display: flex; align-items: center; gap: 12px; }
.copy-row { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.copy-row .input { flex: 1 1 260px; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.dlg-actions.start { justify-content: flex-start; }
dialog.dlg.side { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; max-width: min(480px, 100vw); border-radius: var(--r-card) 0 0 var(--r-card); overflow-y: auto; }
.dlg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dlg-top h2 { overflow-wrap: anywhere; }
.inline-field .row { display: flex; gap: 8px; }
.inline-field .row .input { flex: 1; }
.dlg-body .pane-title { margin-top: 24px; }

.transcript-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 16px; margin-block: 24px; }
.transcript-head h1 { font-size: clamp(22px, 2.6vw, 30px); }
.transcript-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
@media (max-width: 719px) { .transcript-head { grid-template-columns: 1fr; } .transcript-actions { justify-content: flex-start; } }
.transcript-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .transcript-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; } }
.transcript-player { position: sticky; top: 8px; z-index: 4; display: flex; flex-direction: column; gap: 12px; background: var(--bg); padding-bottom: 8px; }
.source-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-media); overflow: hidden; background: #000; }
.source-video { width: 100%; height: 100%; object-fit: contain; }
.source-caption { position: absolute; left: 12px; right: 12px; bottom: 72px; text-align: center; color: var(--on-media); font-weight: 800; text-shadow: 0 1px 3px #000; pointer-events: none; }
.clip-rail { position: relative; height: 18px; border-radius: 9px; background: var(--raised); }
.rail-clip { position: absolute; top: 0; bottom: 0; border-radius: 9px; background: var(--accent); opacity: .85; min-width: 6px; }
.rail-clip:hover { opacity: 1; }
.rail-head { position: absolute; left: 0; top: -3px; bottom: -3px; width: 2px; background: var(--text); pointer-events: none; }
@media (max-width: 899px) { .clip-rail { display: none; } }
.search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.search-row .input { flex: 1; }
.transcript-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
.phrases { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; padding-bottom: 96px; }
.phrase { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) 10px; gap: 8px; align-items: start; padding: 4px 6px; border-radius: 12px; }
.phrase.in-clip { box-shadow: inset 3px 0 0 var(--accent); }
.phrase.is-now { background: var(--surface); }
.phrase.is-hit .phrase-text { background: var(--accent-soft); }
.phrase.is-selected { background: var(--raised); }
.phrase-time { min-height: 36px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.phrase-time:hover { color: var(--text); background: var(--raised); }
.phrase-text { width: 100%; resize: none; overflow: hidden; padding: 7px 8px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; color: var(--text); font-size: 15px; line-height: 1.45; }
.phrase-text:hover { border-color: var(--line); }
.phrase-text:focus { border-color: var(--accent); background: var(--bg); }
.changed-dot { width: 8px; height: 8px; margin-top: 14px; border-radius: 50%; background: var(--accent); }
.clip-label { display: flex; justify-content: space-between; gap: 12px; padding: 16px 8px 4px 12px; font-weight: 800; font-size: 14px; color: var(--muted); }
.empty-phrases { padding: 32px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.select-bar { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 20px; border-radius: var(--r-ctl); background: var(--raised); box-shadow: var(--shadow-float); font-weight: 800; animation: rise var(--t-base) var(--soft) both; }
.past { margin-top: 24px; border-radius: var(--r-card); background: var(--surface); padding: 12px 16px; }
.past summary { cursor: pointer; font-weight: 800; min-height: 32px; }
.past-list { list-style: none; padding: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.past-list li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; }

/* ---------- Landing (DESIGN §2.1) ---------- */
/* Public site: full-screen pages that snap while scrolling (home.js). */
html.paged { scroll-snap-type: y proximity; scroll-behavior: smooth; }
@media (min-width: 900px) and (min-height: 620px) { html.paged { scroll-snap-type: y mandatory; } }
.home { position: relative; }
.home .blobs { position: fixed; }
.home .b1 { width: 520px; height: 520px; background: var(--blob-1); left: -140px; top: -40px; }
.home .b2 { width: 440px; height: 440px; background: var(--blob-2); right: -120px; top: 120px; animation-duration: 24s; animation-delay: -8s; }
.home .b3 { width: 360px; height: 360px; background: var(--blob-3); left: 35%; top: 520px; animation-duration: 28s; animation-delay: -14s; }
.home-nav { position: fixed; left: 0; right: 0; top: 0; z-index: 20; transition: background-color var(--t-base) var(--soft); }
.home-nav.is-solid { background: rgb(17 16 14 / .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.home-nav-row { display: flex; align-items: center; gap: 4px; height: 68px; }
.home-nav .spacer { flex: 1; }
/* A phone has no room for three actions: the access button is in the first screen itself. */
@media (max-width: 519px) { .home-nav .btn-link { padding: 0 10px; } .home-nav-access { display: none; } }
.home main { position: relative; z-index: 1; }
.page { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.page-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; width: 100%; min-width: 0; padding-block: 84px 36px; }
.page h2 { font-size: clamp(26px, 3.4vw, 40px); max-width: 20ch; margin: 0 auto; text-align: center; }
.page-lead { color: var(--muted); text-align: center; max-width: 54ch; margin: -12px auto 0; }
.page-examples .page-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; align-items: center; gap: 24px; }
.hero { text-align: center; }
.hero h1 { font-size: clamp(30px, 5.2vw, 64px); line-height: 1.05; max-width: 13ch; margin: 0 auto; }
.hero-lead { color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); max-width: 38ch; margin: 16px auto 22px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.examples { margin: 0; }
@media (min-width: 900px) {
  .page-examples .page-body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; }
  .hero { text-align: left; }
  .hero h1, .hero-lead { margin-inline: 0; }
  .hero-lead { margin-block: 22px 30px; }
  .hero-actions { justify-content: flex-start; }
}
@media (max-width: 899px) { .page-examples .page-body { padding-block: 76px 16px; gap: 16px; } .hero-lead { margin-block: 12px 18px; } }
.examples { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.examples-host { min-width: 0; min-height: calc(var(--reel-h) + 96px); --reel-h: clamp(220px, 38svh, 540px); }
@media (min-width: 900px) { .examples-host { --reel-h: clamp(320px, 62svh, 560px); } }
.reel { position: relative; width: 100%; height: var(--reel-h); --reel-w: calc(var(--reel-h) * .5625); }
.phone { position: absolute; left: 50%; top: 50%; height: 100%; aspect-ratio: 9 / 16; padding: 0; border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px rgb(255 255 255 / .05); transform: translate(-50%, -50%); transition: transform 450ms var(--soft), opacity 450ms var(--soft), height 450ms var(--soft); }
.phone.c { z-index: 2; box-shadow: 0 40px 100px -30px rgb(0 0 0 / .8), 0 0 0 1px var(--accent-soft); }
.phone.s1 { z-index: 1; height: 84%; opacity: .5; }
.phone.s1.before { transform: translate(calc(-50% - var(--reel-w) * .84), -50%); }
.phone.s1.after { transform: translate(calc(-50% + var(--reel-w) * .84), -50%); }
.phone.off { height: 70%; opacity: 0; pointer-events: none; }
.phone .short-media { position: absolute; inset: 0; }
.phone video.short-media { opacity: 0; transition: opacity 250ms var(--soft); }
.phone video.short-media.on { opacity: 1; }
.reel-meta { text-align: center; min-height: 46px; max-width: 46ch; }
.reel-title { font-weight: 800; font-size: 15px; line-height: 1.3; }
.reel-credit { color: var(--faint); font-size: 13px; }
.reel-note { margin-top: 6px; color: var(--faint); font-size: 12px; }
.pager { position: fixed; right: 0; top: 50%; z-index: 20; display: flex; flex-direction: column; transform: translateY(-50%); }
@media (min-width: 900px) { .pager { right: 14px; } }
.pager-dot { position: relative; width: 20px; height: 26px; border-radius: 50%; }
.pager-dot::after { content: ""; position: absolute; left: 8px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color var(--t-fast) var(--soft), transform var(--t-fast) var(--soft); }
@media (min-width: 900px) { .pager-dot { width: 28px; height: 28px; } .pager-dot::after { left: 10px; top: 10px; width: 8px; height: 8px; } }
.pager-dot[aria-current="true"]::after { background: var(--accent); transform: scale(1.4); }
.phone-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .18); overflow: hidden; }
.phone-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.short { position: absolute; inset: 0; transition: opacity 350ms var(--soft); }
.short.entering { opacity: 0; }
.short.tone-0 { background: linear-gradient(170deg, #2b2418, #14120f 70%); }
.short.tone-1 { background: linear-gradient(170deg, #1d2a20, #12130f 70%); }
.short.tone-2 { background: linear-gradient(170deg, #2e2116, #13110e 70%); }
.short.tone-3 { background: linear-gradient(170deg, #222326, #121110 70%); }
.short-figure { position: absolute; left: 24%; right: 24%; top: 22%; aspect-ratio: 1 / 1.25; border-radius: 48% 48% 40% 40%; background: radial-gradient(circle at 50% 35%, rgb(255 255 255 / .14), transparent 70%); }
.short-caption { position: absolute; left: 8%; right: 8%; bottom: 18%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .3em; font: 800 clamp(11px, 1.3vw, 17px)/1.25 var(--sans); text-transform: uppercase; color: var(--on-media); text-align: center; }
.short-caption span { opacity: .35; animation: karaoke 9s linear both; }
@keyframes karaoke { 0% { opacity: .35; } 4%, 100% { opacity: 1; color: var(--on-media); } }
.short-caption span:nth-child(odd) { animation-name: karaoke-accent; }
@keyframes karaoke-accent { 0% { opacity: .35; } 4% { opacity: 1; color: var(--accent); } 10%, 100% { opacity: 1; color: var(--on-media); } }
.reel.paused .short-caption span { animation-play-state: paused; }
.page-how .explain { width: 100%; max-width: 960px; margin: 0 auto; }
.page-how .explain-tabs { justify-content: center; }
.explain.is-auto .explain-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; animation: tab-timer 6s linear both; }
@keyframes tab-timer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.page-plans .plans-host { width: 100%; max-width: 1080px; margin: 0 auto; }
.page-plans .plan-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.page-access .page-body { align-items: center; }
.access-block { width: min(100%, 460px); }
.access-block .card h2 { font-size: 28px; max-width: none; margin: 0 0 24px; text-align: left; }
dialog.access-dlg { background: transparent; box-shadow: none; overflow: visible; }
dialog.access-dlg .card { box-shadow: var(--shadow-float); }
dialog.access-dlg .card h1 { font-size: 26px; }
.dlg-close { position: absolute; right: 12px; top: 12px; z-index: 1; }

/* ---------- Dialogs ---------- */
dialog.dlg { border: 0; padding: 0; margin: auto; max-width: min(460px, calc(100vw - 32px)); width: 100%; border-radius: var(--r-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
dialog.dlg[open] { animation: pop var(--t-base) var(--soft) both; }
dialog.dlg::backdrop { background: rgb(5 5 4 / .7); animation: fade 200ms var(--soft) both; }
@keyframes fade { from { opacity: 0; } }
.dlg-body { padding: 28px 24px 24px; }
.dlg-body h2 { font-size: 22px; margin-bottom: 10px; }
.dlg-body p { color: var(--muted); }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }
dialog.player { max-width: min(420px, calc(100vw - 32px)); background: #000; overflow: visible; }
dialog.player video { width: 100%; max-height: 82vh; max-height: 82svh; aspect-ratio: 9 / 16; border-radius: var(--r-card); background: #000; object-fit: contain; }
dialog.player .close { position: absolute; top: -52px; right: 0; background: var(--raised); color: var(--text); }

/* ---------- Toast and network bar ---------- */
.toast-host { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 18px; border-radius: 18px; background: var(--raised); color: var(--text); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-float); animation: rise var(--t-base) var(--soft) both; }
.toast.error { color: var(--text); }
.toast.error::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--danger); }
.toast .icon-btn { width: 32px; height: 32px; }
.netbar { position: fixed; left: 0; right: 0; top: 0; z-index: 90; padding: 6px 16px; text-align: center; background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); animation: fade var(--t-base) var(--soft) both; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:not(:disabled):hover, .tile:hover, .clip:hover, .acts .dl:not(:disabled):hover { transform: none; }
  .spot::before { display: none; }
  .explain-text, .art-words span, .art-rail i, .art-sub span, .art-texts li, .art-bg { opacity: 1; transform: none; }
  .art-morph { width: 146px; height: 258px; border-radius: 20px; }
  .short-caption span { opacity: 1; }
}

/* Admin on phones: tabs wrap, table rows become labelled cards. */
@media (max-width: 719px) {
  .admin-tabs { flex-wrap: wrap; overflow: visible; }
  .table-wrap { background: transparent; overflow: visible; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px 16px; margin-bottom: 8px; border-radius: 18px; background: var(--surface); }
  .table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table td:first-child { grid-column: 1 / -1; font-weight: 800; }
  .table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
  .table td.actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Editor: frame strip, peek and scrubber (AUTH_API v2 «Кадры редактора»). */
.trim-rail { overflow: hidden; }
.frame-strip { position: absolute; inset: 0; pointer-events: none; opacity: .75; }
.trim-rail.has-strip .trim-bars { opacity: .35; }
.frame-strip img { position: absolute; top: 0; height: 100%; width: auto; aspect-ratio: 16 / 9; transform: translateX(-50%); object-fit: cover; border-radius: 4px; }
.frame-strip img.strip-sprite { left: 0; width: 100%; aspect-ratio: auto; transform: none; object-fit: fill; border-radius: 10px; }
.frame-peek { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.scrub { display: flex; flex-direction: column; gap: 10px; }
.scrub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scrub-range { flex: 1; min-width: 160px; height: 32px; }
.scrub-time { min-width: 64px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.scrub-steps { display: flex; gap: 6px; }
.scrub-steps .btn { min-width: 44px; }
.scrub-steps .icon { width: 16px; height: 16px; }
.scrub-steps .btn:first-child .icon { transform: none; }
.segmented { display: inline-flex; padding: 3px; border-radius: var(--r-ctl); background: var(--raised); }
.seg { min-height: 36px; padding: 0 14px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 800; font-size: 13px; }
.seg[aria-pressed="true"] { background: var(--line); color: var(--text); }

/* ---------- plans (AUTH_API v2) ---------- */
.plan-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.plan-chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (max-width: 379px) { .plan-chip { padding: 0 8px; } }
.plans .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.plans-lead { max-width: 64ch; margin: -8px 0 20px; }
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.plan-card { border-radius: var(--r-card); background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.plan-card.is-current { box-shadow: inset 0 0 0 1.5px var(--accent); }
.plan-card.is-selected { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head :is(h2, h3) { font-size: 20px; }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.plan-price b { font-family: var(--display); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.plan-facts { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); flex: 1; }
.plan-facts b { color: var(--text); }
.plan-terms { color: var(--text); font-weight: 700; font-size: 14px; margin-bottom: -4px; }
/* Settings: a jump list and sections. */
.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.settings-nav a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-ctl); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.settings-nav a:hover { color: var(--text); }
.account-card { scroll-margin-top: 16px; }
.account-card.wide { grid-column: 1 / -1; }
.sub-title { font-family: var(--sans); font-size: 16px; font-weight: 800; margin-top: 8px; }
.profile-form form { display: flex; flex-direction: column; gap: 14px; }
.textarea { height: auto; min-height: 76px; padding-block: 12px; resize: vertical; line-height: 1.4; }
.name-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.name-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 16px; background: var(--raised); }
.name-row.is-bad { box-shadow: inset 0 0 0 1.5px var(--danger); }
.name-row .field-error { grid-column: 1 / -1; }
.name-remove { justify-self: end; }
@media (min-width: 900px) { .name-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) 40px; align-items: start; } .name-remove { margin-top: 24px; } }
.profile-form .btn-sm { align-self: flex-start; }
.profile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--raised); cursor: pointer; }
.choice input { margin-top: 4px; accent-color: rgb(var(--accent-rgb)); flex: none; width: 18px; height: 18px; }
.choice b { display: block; font-weight: 800; }
.choice small { color: var(--muted); font-size: 13px; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.plan-card .btn-block { margin-top: auto; }
.plan-card .plan-facts { margin-bottom: 4px; }
.plan-signup { margin: auto 0 0; color: var(--accent); font-size: 14px; font-weight: 700; line-height: 1.35; }
.plan-signup + .btn-block { margin-top: 0; }
.plans-legal { margin: 12px 0 0; text-align: center; font-size: 13px; }
.code-prices { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 2px; font-size: 14px; }
.plans-extra { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
@media (min-width: 900px) { .plans-extra { grid-template-columns: 1fr 1fr; } }
.code-row { display: flex; gap: 8px; width: 100%; }
.code-row .input { flex: 1; min-width: 0; text-transform: uppercase; }
.code-result { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.code-result:empty { display: none; }
.code-ok { color: var(--accent); font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.nick-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; }

/* ---------- per-clip logo options (clip-extras.js) ---------- */
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; width: 100%; }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row .switch { margin-top: 2px; }
.opt-logo { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .opt-logo { grid-template-columns: auto 1fr; align-items: start; } }
.opt-logo[hidden] { display: none; }
.opt-mock-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.opt-dialog .phone-mock { position: relative; flex: none; width: 180px; height: 320px; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #2b3a2f, #3a2a1a 60%, #1c1915); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.opt-dialog .mock-zones i { position: absolute; background: repeating-linear-gradient(135deg, rgb(255 255 255 / .14) 0 4px, transparent 4px 9px); }
.mock-logo { position: absolute; display: grid; place-items: center; pointer-events: none; transition: left var(--t-base) var(--soft), top var(--t-base) var(--soft), width var(--t-base) var(--soft), height var(--t-base) var(--soft); }
.mock-logo img { width: 100%; height: 100%; }
.mock-spot { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .55); background: rgb(10 10 8 / .25); z-index: 1; }
.mock-spot[aria-checked="true"] { border-color: var(--accent); background: transparent; }
.mock-spot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.opt-controls .field { width: 100%; }
.opt-charge { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--r-field); background: var(--raised); width: 100%; }
.opt-charge b { margin-right: 8px; }
@media (prefers-reduced-motion: reduce) { .mock-logo { transition: none; } }
.extras { display: flex; flex-direction: column; gap: 14px; }
.extras-note { margin: -4px 0 4px; }
/* A switched-off mode brings nothing: its share fades. */
.switch-row:has(.switch:not(:checked)) .plus-min { opacity: .4; }
/* The badge mock-up has the size and place of the file's badge: 300×96 of 1080×1920 at y = 264 (BRANDING_ASSETS.md §3). */
/* The badge as the render draws it by default: 450 x 144 at (315, 264) of 1080 x 1920 (size «m», plan_settings). */
/* The corner mark of the render (576×144 at 252,264 of 1080×1920, opacity .85); the picture has the pill itself (mark-pill.svg). */
.stage-mark { position: absolute; z-index: 1; left: 23.33%; top: 13.75%; width: 53.33%; height: 7.5%; opacity: .85; pointer-events: none; }
.stage-mark img { display: block; width: 100%; height: 100%; }
.project-returned { color: var(--accent); font-size: 14px; font-weight: 700; }
.project-expiry { color: var(--muted); font-size: 14px; }
.project-expiry.is-soon { color: var(--text); font-weight: 700; }
.project-expiry.is-gone { color: var(--danger); font-weight: 700; }
.state-screen.load-failed { padding: 96px 16px; }
.load-failed p { max-width: 46ch; }

/* ---------- site footer and public pages (footer.js, legal.js) ---------- */
.site-foot { position: relative; z-index: 1; margin-top: auto; padding-block: 28px 32px; color: var(--muted); font-size: 13px; }
.site-foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.site-foot-mark { display: flex; align-items: center; gap: 14px; }
.site-foot .logo { text-decoration: none; font-size: 15px; color: var(--text); }
.site-foot .logo svg { width: 22px; height: 22px; }
.site-foot-copy { color: var(--faint); }
.site-foot-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.site-foot-links a, .site-foot .cm-cookie-link { color: var(--muted); text-decoration: none; transition: color var(--t-fast) var(--soft); }
.site-foot-links a:hover, .site-foot .cm-cookie-link:hover { color: var(--text); }
@media (max-width: 719px) { .site-foot-row { flex-direction: column; align-items: flex-start; } .site-foot-links { gap: 10px 18px; } }
/* Sticky footer: every layout is a column as tall as the window, the footer takes what is left below. */
#app { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
#app > * { width: 100%; min-width: 0; }
#app > .wrap { max-width: 1240px; }
.auth-page { display: flex; flex-direction: column; padding-bottom: 0; }
.auth-page > .wrap { width: 100%; }
.auth-page .site-foot { margin-top: auto; padding-top: 56px; }
.page-access .site-foot { margin-top: 0; }
.public-page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.public-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.public-main { flex: 1; min-width: 0; padding-block: 24px 48px; }
.public-page > * { min-width: 0; max-width: 100%; }
/* In the column flexbox «margin: auto» shrinks a .wrap to its content: the prices page came out narrower than the site. */
.public-page > .wrap { width: 100%; max-width: 1240px; }
.doc { max-width: 72ch; font-size: 16px; line-height: 1.65; color: var(--text); }
.doc h1 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; margin-bottom: 16px; overflow-wrap: anywhere; }
.doc h2 { font-size: clamp(19px, 2.6vw, 23px); line-height: 1.3; margin: 40px 0 12px; scroll-margin-top: 16px; }
.doc h3 { font-size: 17px; margin: 28px 0 8px; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc strong { font-weight: 800; }
.doc-table { max-width: 100%; margin: 4px 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-field); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc thead th { background: var(--surface); font-weight: 800; color: var(--text); }
.doc tbody th { font-weight: 700; color: var(--muted); white-space: nowrap; }
.doc tr:last-child > * { border-bottom: 0; }
@media (max-width: 559px) { .doc table { font-size: 14px; } .doc th, .doc td { padding: 8px 10px; } .doc tbody th { white-space: normal; } }
/* ---------- large uploads in parts ---------- */
.big-upload .tile-meta small { overflow-wrap: anywhere; }
.big-upload .tile-actions { flex-wrap: wrap; }
.upload-pill { padding: 0 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 419px) { .upload-pill { padding: 0 10px; font-size: 13px; } }
.big-upload .tile-more { top: 6px; bottom: auto; }
.big-upload .tile-meta b { padding-right: 0; }

/* ---------- legacy «Перед обработкой» dialog (clip-options.js), until branding v3 is released ---------- */
.opt-dialog { gap: 16px; }
.opt-dialog > * { flex-shrink: 0; }
.opt-logo { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .opt-logo { grid-template-columns: auto 1fr; align-items: start; } }
.opt-logo[hidden] { display: none; }
.opt-mock-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.opt-dialog .phone-mock { position: relative; flex: none; width: 180px; height: 320px; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #2b3a2f, #3a2a1a 60%, #1c1915); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.opt-dialog .mock-zones i { position: absolute; background: repeating-linear-gradient(135deg, rgb(255 255 255 / .14) 0 4px, transparent 4px 9px); }
.mock-logo { position: absolute; display: grid; place-items: center; pointer-events: none; transition: left var(--t-base) var(--soft), top var(--t-base) var(--soft), width var(--t-base) var(--soft), height var(--t-base) var(--soft); }
.mock-logo img { width: 100%; height: 100%; }
.mock-spot { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .55); background: rgb(10 10 8 / .25); z-index: 1; }
.mock-spot[aria-checked="true"] { border-color: var(--accent); background: transparent; }
.mock-spot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.opt-controls .field { width: 100%; }
.opt-charge { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--r-field); background: var(--raised); width: 100%; }
.opt-charge b { margin-right: 8px; }
@media (prefers-reduced-motion: reduce) { .mock-logo { transition: none; } }
.project-expiry { color: var(--muted); font-size: 14px; }
.project-expiry.is-soon { color: var(--text); font-weight: 700; }
.project-expiry.is-gone { color: var(--danger); font-weight: 700; }
.state-screen.load-failed { padding: 96px 16px; }
.load-failed p { max-width: 46ch; }

.extras-moment { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.extras-moment[hidden] { display: none; }
.insert-mark { position: absolute; top: -6px; bottom: -6px; width: 22px; margin-left: -11px; z-index: 3; cursor: grab; touch-action: none; }
.insert-mark::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.insert-mark::after { content: ""; position: absolute; left: 4px; top: -4px; width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }
.insert-mark.is-auto { cursor: default; opacity: .7; }
.insert-mark.is-auto::before { background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 7px); }
.insert-mark:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.extras-all { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.extras-all[hidden] { display: none; }
.extras-styles { display: flex; flex-direction: column; gap: 10px; }
.extras-styles[hidden] { display: none; }
.style-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.style-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 6px 10px; border-radius: 16px; background: var(--raised); text-align: left; min-width: 0; }
.style-card[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.style-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-preview { width: 100%; aspect-ratio: 9 / 16; border-radius: 11px; background: #000; object-fit: cover; pointer-events: none; }
.style-name { font-size: 13px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.style-card .chip { min-height: 0; padding: 1px 7px; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.insert-mark-row { position: relative; height: 22px; margin-bottom: 2px; }
.insert-mark-row[hidden] { display: none; }
.insert-mark-label { position: absolute; bottom: 0; transform: translateX(-50%); padding: 1px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.insert-mark-label.is-auto { background: var(--raised); color: var(--text); }
.project-states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.project-states .chip { font-weight: 800; }
.build-ready { background: var(--accent-soft); color: var(--accent); }
.build-building, .build-changed, .build-notBuilt { background: var(--raised); color: var(--text); }
.build-failed { background: var(--danger-soft); color: var(--danger); }

/* Processing line: «Загрузка → Расшифровка → Поиск клипов → Сборка N из M». */
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 18px; }
.pipe-steps { display: flex; flex-wrap: wrap; gap: 6px 4px; list-style: none; margin: 0; padding: 0; }
.pipe-step { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.pipe-step + .pipe-step::before { content: ''; }
.pipe-step.is-done { color: var(--text); }
.pipe-step.is-active { color: var(--bg); background: var(--accent); }
.pipe-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .45; display: inline-grid; place-items: center; }
.pipe-step.is-done .pipe-dot { width: 14px; height: 14px; background: none; opacity: 1; }
.pipe-step.is-done .pipe-dot .icon { width: 14px; height: 14px; stroke-width: 3; }
.pipe-step.is-active .pipe-dot { opacity: 1; animation: pipe-pulse 1.2s ease-in-out infinite; }
@keyframes pipe-pulse { 50% { transform: scale(.55); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .pipe-step.is-active .pipe-dot { animation: none; } }
.pipe-eta { font-size: 13px; color: var(--muted); }
.pipe-video { font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 999px; border: 1.5px dashed var(--line-strong); }
.pipe-video.is-bad { color: var(--danger); border-color: var(--danger); }
/* Bonus minutes for the logo: always minutes, always green, next to what brings them. */
.plus-min { color: var(--accent); font-weight: 800; font-size: .86em; margin-left: 8px; white-space: nowrap; }
.seg .plus-min { margin-left: 6px; }
.seg[aria-pressed="true"] .plus-min { color: inherit; }
.extras-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.extras-all-title { font-weight: 800; font-size: 14px; }
.extras-all .segmented { flex-wrap: wrap; }
@media (max-width: 559px) {
  /* Four even buttons in two rows instead of a ragged pill (360 px). */
  .extras-all .segmented { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 18px; }
  .extras-all .seg { min-height: 44px; border-radius: 14px; }
}
.clip .acts .dl.build { width: auto; padding: 0 12px; font-weight: 800; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .boot-ring { display: none; } }
.tile-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }

/* «Текст»: undo for joins and splits; the caption fix button with what it does along the way. */
.cue-undo { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 6px 0; background: var(--surface); }
.cue-undo[hidden] { display: none; }
.content-run { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--raised); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }

/* Touch targets of at least 36 px (360 px audit, owner 2026-10-05): the visible part stays as drawn. */
.trim-handle { width: 36px; margin-left: -18px; background: none; }
.trim-handle::before { content: ""; position: absolute; inset: 0 7px; border-radius: 8px; background: var(--accent); }
.insert-mark { width: 36px; margin-left: -18px; }
.insert-mark::before { left: 17px; }
.insert-mark::after { left: 11px; }
.section-head .all-link { display: inline-flex; align-items: center; min-height: 36px; }
.title-rename { min-height: 36px; }
@media (pointer: coarse) {
  .switch { width: 60px; height: 36px; border-radius: 18px; }
  .switch::after { left: 4px; top: 4px; width: 28px; height: 28px; }
  .switch:checked::after { transform: translateX(24px); }
}

/* Caption fix and texts at work, inside their block. */
.content-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; padding: 12px; border-radius: 14px; background: var(--raised); font-size: 14px; }
.content-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.content-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s linear; }

.frame-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.stage-canvas.pannable { touch-action: none; cursor: grab; }
/* ---------- payments: plans, confirmation, result, history, minutes (docs/PAYMENTS.md) ---------- */
.plan-block { display: flex; flex-direction: column; gap: 16px; }
.plan-toolbar { display: flex; justify-content: center; }
.plan-toolbar:empty { display: none; }
.plan-year { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -6px; font-size: 14px; }
.plan-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; padding: 16px 20px; border-radius: var(--r-card); background: var(--surface); }
.plan-status-main, .plan-status-side { display: flex; flex-direction: column; gap: 2px; }
.plan-status-side { align-items: flex-end; text-align: right; }
.plan-status-name { display: flex; align-items: center; gap: 8px; }
.plan-status-name b { font: 500 22px/1.2 var(--display); font-variant-numeric: tabular-nums; }
@media (max-width: 559px) { .plan-status-side { align-items: flex-start; text-align: left; } }
.pack-card { gap: 10px; }
.pack-card .plan-head { width: 100%; }
.pack-card .plan-facts { flex: none; }
.pay-test { display: inline-flex; align-self: flex-start; margin-bottom: 16px; padding: 6px 12px; border-radius: var(--r-field); background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 700; }

/* confirmation dialog and the result page share the summary sheet */
.pay-kicker { color: var(--accent) !important; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.pay-sheet { width: 100%; margin: 16px 0 4px; border-radius: var(--r-field); background: var(--bg); padding: 4px 16px; }
.pay-sheet-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-sheet-row:last-child { border-bottom: 0; }
.pay-sheet dt { color: var(--muted); font-size: 14px; flex: none; }
.pay-sheet dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.pay-total dd { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
.pay-total dd b { font: 500 24px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.pay-total dd :is(b, s) { white-space: nowrap; }
@media (max-width: 419px) { .pay-sheet-row { flex-wrap: wrap; gap: 2px 12px; } .pay-sheet dd { margin-left: auto; } .pay-total dd b { font-size: 22px; } }
.pay-notes { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.pay-notes li { position: relative; padding-left: 18px; }
.pay-notes li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pay-confirm .pay-test { margin: 12px 0 0; }
.pay-offer { margin-top: 12px; font-size: 14px; }
.pay-confirm .dlg-actions .btn-primary { flex: 1 1 auto; }
@media (max-width: 419px) { .pay-confirm .dlg-actions { flex-direction: column-reverse; } .pay-confirm .dlg-actions .btn { width: 100%; } }

.pay-page { display: flex; justify-content: center; padding: 32px 0 64px; }
.pay-result { width: 100%; max-width: 520px; border-radius: var(--r-panel); background: var(--surface); padding: 32px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.pay-result h1 { font-size: clamp(24px, 4vw, 32px); }
.pay-result > p { color: var(--muted); max-width: 44ch; }
.pay-result .pay-lead { color: var(--text); font-weight: 700; font-size: 17px; }
.pay-result .pay-sheet { text-align: left; }
.pay-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--muted); margin-bottom: 4px; }
.pay-mark .icon { width: 30px; height: 30px; }
.pay-mark.is-ok { background: var(--accent); color: var(--accent-ink); animation: pop var(--t-base) var(--spring) both; }
.pay-mark.is-fail { background: var(--danger-soft); color: var(--danger); }
.pay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
@media (max-width: 419px) { .pay-actions { flex-direction: column; width: 100%; } .pay-actions .btn { width: 100%; } }

/* history: a table from 720 px, two-line rows below */
.pay-history { gap: 8px; }
.pay-table, .pay-list { width: 100%; }
.pay-list { list-style: none; padding: 0; margin: 0; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what sum" "date date" "state state"; gap: 4px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pay-list .pay-row:last-child { border-bottom: 0; }
.pay-row-head { display: none; }
.pay-date { grid-area: date; color: var(--muted); font-size: 13px; }
.pay-what { grid-area: what; display: flex; flex-direction: column; min-width: 0; }
.pay-what b { overflow-wrap: anywhere; }
.pay-what small { font-size: 13px; }
.pay-sum { grid-area: sum; justify-self: end; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-state { grid-area: state; justify-self: start; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px; }
.pay-row > .field-error:empty { display: none; }
.pay-row > .field-error, .pay-admin, .pay-refund { grid-column: 1 / -1; }
.pay-refund { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.chip.quiet { background: var(--raised); color: var(--danger); }
.pay-pages { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (min-width: 720px) {
  .pay-row { grid-template-columns: 190px minmax(0, 1fr) 110px 220px; grid-template-areas: "date what sum state"; }
  .pay-row-head { display: grid; padding: 4px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
  .pay-row-head span:nth-child(1) { grid-area: date; } .pay-row-head span:nth-child(2) { grid-area: what; }
  .pay-row-head span:nth-child(3) { grid-area: sum; justify-self: end; } .pay-row-head span:nth-child(4) { grid-area: state; justify-self: end; }
  .pay-date { font-size: 14px; }
  .pay-state { justify-self: end; justify-content: flex-end; }
}

/* minutes: one bar split by source, a legend under it */
.minutes-bar { display: flex; }
.minutes-bar i { flex: none; transform: none; transition: width var(--t-base) var(--soft); }
.minutes-bar i + i { box-shadow: -2px 0 0 var(--surface); }
.minutes-plan, .minutes-bar i.minutes-plan { background: var(--accent); }
.minutes-pack, .minutes-bar i.minutes-pack { background: var(--minutes-pack); }
.minutes-bonus, .minutes-bar i.minutes-bonus { background: var(--minutes-bonus); }
.minutes-bar.is-low i[class] { background: var(--danger); }
.minutes-split { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.minutes-line { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; }
.minutes-note { grid-column: 2 / -1; font-size: 13px; }
.minutes-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.minutes-name { min-width: 0; }
.minutes-value { white-space: nowrap; font-variant-numeric: tabular-nums; }

.studio-offer:empty { display: none; }
.studio-offer { margin: 16px 0 8px; }
.minutes-out { width: 100%; border-radius: var(--r-card); background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.account-card .minutes-out { background: var(--bg); box-shadow: none; padding: 16px; }
.minutes-out-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.minutes-out-head :is(h2, h3) { font-size: 20px; margin-bottom: 4px; }
.minutes-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.minutes-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-radius: var(--r-field); background: var(--raised); padding: 14px 16px; }
.minutes-option-price { font: 500 18px/1.3 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.minutes-option .muted-note { font-size: 13px; }
.minutes-option .btn-soft { background: var(--line); }
.minutes-option .btn-soft:not(:disabled):hover { background: var(--line-strong); }
.minutes-out-wait { font-size: 13px; }
.pack-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; border-radius: var(--r-card); background: var(--surface); padding: 16px 20px; }
.pack-line > div { flex: 1 1 220px; min-width: 0; }
.pack-line-price { font: 500 22px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }

@font-face{font-family:CMGoogle;src:url('/ui/icons/google-sans.ttf') format('truetype');font-weight:500;font-style:normal;font-display:swap}
.oauth-choices{display:grid;gap:14px;margin:20px 0 0}.oauth-choices[hidden],.account-card[hidden]{display:none}
.oauth-row{display:grid;grid-template-columns:1fr;gap:10px}
.oauth-choice{display:flex;align-items:center;justify-content:center;gap:10px;height:48px;padding:0 14px;border-radius:12px;font-size:15px;font-weight:700;cursor:pointer;width:100%;transition:filter var(--t-fast) var(--soft)}
.oauth-choice:not(:disabled):hover{filter:brightness(.94)}
.oauth-mark{flex:none;width:20px;height:20px;object-fit:contain}
.oauth-google{background:#fff;color:#1f1f1f;border:1px solid #747775;font-family:CMGoogle,Arial,sans-serif;font-weight:500}
.oauth-twitch{background:#9146ff;color:#fff;border:1px solid #9146ff}.oauth-choice:disabled{opacity:.6;cursor:wait}.oauth-choice:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.oauth-or{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--muted)}.oauth-or:before,.oauth-or:after{content:'';flex:1;height:1px;background:var(--line)}
.consent-line{margin-top:14px}.consent-line p{font-size:13px;line-height:1.45;text-align:center}
.oauth-finish{display:grid;place-items:center;padding:24px}.oauth-finish .card{width:min(440px,100%)}.oauth-method{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}

/* ---------- Projects (owner, 2026-10-06) ---------- */
/* The upload tile takes what the row leaves: the whole row without videos, then less with each one,
   down to its usual width (the row scrolls from there and the tile stays at its end). */
.queue .add-tile { flex: 1 0 220px; width: auto; min-width: 220px; }
.queue.is-empty .add-tile { min-height: 200px; position: relative; box-shadow: none; }
.add-tile.has-link .link-form { width: 100%; max-width: 440px; margin: 0 auto; }
.section-head h1 { font-size: clamp(22px, 2.4vw, 28px); }
.section-head .all-link[hidden] { display: none; }
@media (max-width: 719px) { .queue .add-tile { flex-basis: 168px; min-width: 168px; } }
/* «Все проекты»: a grid of tiles of the queue's size, scrolled down. */
.project-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (min-width: 720px) { .project-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (min-width: 1100px) { .project-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 479px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The project head: name on the left, one row of actions on the right. */
.project-head { align-items: center; }
.project-actions { flex-wrap: nowrap; gap: 10px; }
.logo-switch { display: flex; flex-direction: column; gap: 2px; max-width: 260px; }
.logo-switch .toggle-row { min-height: 40px; padding: 0 10px 0 14px; gap: 12px; justify-content: space-between; }
.logo-switch .toggle-label { font-weight: 800; font-size: 14px; }
.logo-switch small { font-size: 12px; line-height: 1.3; padding-left: 4px; }
@media (max-width: 1099px) { .project-actions { flex-wrap: wrap; } }
.note.unapplied { color: var(--accent); text-decoration: none; }
.note.unapplied span { background: var(--accent-soft); padding: 2px 8px; border-radius: 10px; }
.note.unapplied:hover span { text-decoration: underline; }

/* ---------- Settings (owner, 2026-10-06) ---------- */
.account-grid { align-items: start; }
.account-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 15px; }
.account-facts dt { color: var(--muted); }
.account-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.account-changes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.account-changes .btn.is-on { background: var(--line); }
.account-panels:not(:empty), .mail-change { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--bg); }
.account-panel { display: flex; flex-direction: column; gap: 4px; }
.account-panel .btn { align-self: flex-start; margin-top: 6px; }
.account-logout { display: block; margin: 16px 0 0 -14px; }
.method-rows { display: flex; flex-direction: column; gap: 8px; }
.method-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 10px; border-radius: 14px; background: var(--raised); }
.method-mark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.method-mark.oauth-google { background: #fff; border: 0; }
.method-mark.oauth-twitch { background: #9146ff; border: 0; color: #fff; }
.method-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 15px; }
.method-on { color: var(--accent); font-weight: 700; }
.content-columns { display: grid; gap: 24px; }
@media (min-width: 900px) { .content-columns { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; } }
.language-block h3 { font-size: 17px; margin-bottom: 10px; }
.language-block .choices { display: flex; flex-direction: column; gap: 8px; }
.account-card > .method-rows, .account-card > .account-panels, .account-card > .content-columns, .account-card > .account-facts { align-self: stretch; }
.account-panels:empty { display: none; }

/* ---------- Editor (owner, 2026-10-06) ---------- */
/* The playhead on the strip of «Границы»: drag it to choose the frame of the preview. */
.trim-playhead { position: absolute; top: -6px; bottom: -6px; width: 16px; margin-left: -8px; z-index: 3; cursor: ew-resize; touch-action: none; }
.trim-playhead::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .45); }
.trim-playhead::after { content: ""; position: absolute; left: 3px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .45); }
.trim-playhead:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Where a paid plan may move the insert: 20–60 % of the clip, shown while choosing. */
.insert-range { position: absolute; top: 0; bottom: 0; background: rgb(255 255 255 / .14); border-left: 1px dashed rgb(255 255 255 / .5); border-right: 1px dashed rgb(255 255 255 / .5); pointer-events: none; }
.scrub-row { justify-content: space-between; }
.content-saved { min-height: 1.4em; }
.hero-speed { margin-top: 10px; color: var(--accent); font-size: 14px; font-weight: 700; }
.method-text > span { white-space: nowrap; }
@media (max-width: 479px) { .method-text { flex-direction: column; align-items: flex-start; gap: 0; } }
.project-building { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--accent); }

/* «Авто (по говорящему)»: the segments of the clip with the face in each, and the choice for one of them. */
.speaker-segs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.speaker-seg { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px; border-radius: 8px; border: 2px solid transparent; background: var(--surface); color: inherit; cursor: pointer; }
.speaker-seg[aria-pressed="true"] { border-color: var(--accent); }
.speaker-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.speaker-edited { font-size: 11px; color: var(--accent); }
.face-pair { display: flex; gap: 2px; }
.face-thumb { width: 44px; height: 44px; border-radius: 6px; background: rgba(127,127,127,.25); display: block; }
.face-pair .face-thumb { width: 30px; height: 30px; }
.face-thumb.wide { width: 44px; height: 44px; background: linear-gradient(transparent 30%, var(--muted) 30%, var(--muted) 70%, transparent 70%); opacity: .6; }
.speaker-choices { margin-top: 8px; }
.speaker-choice { gap: 6px; }
