/* ============================================================================
   lito · студія — робочий інструмент для перекладу та нарізок BL-серіалів.
   Родина nyro (морський, спокійний настрій), але це ІНСТРУМЕНТ, не іграшка:
   світлий, тихий, зосереджений — один фокус за раз, багато повітря, нейтральні
   панелі й ОДИН приглушений морський акцент. Скат — делікатний фірмовий знак
   (де fuco має зорю, lito має ската), не сцена. Темна тема + авто.
   ============================================================================ */

:root {
  /* Світлий профі-інструмент. Нейтральні поверхні, один акцент. */
  --bg:        #f6f8f9;
  --bg-2:      #eceff1;
  --surface:   #ffffff;
  --surface-2: #f2f5f6;
  --field:     #ffffff;
  --border:    #e4e8ea;
  --border-strong: #d1d8db;

  --ink:       #1b2a2d;
  --ink-soft:  #4f6469;
  --ink-faint: #869599;
  --title:     #10201f;

  --sea:       #1f8a86;   /* ЄДИНИЙ акцент — дія/лінки/активне */
  --sea-deep:  #156f6c;
  --sea-tint:  #e6f1f0;   /* майже нейтральна підкладка активного стану */

  --ok:   #2f8a67; --ok-tint:  #e8f3ee;
  --warn: #927536; --warn-tint:#f3efe6;
  --bad:  #b0574a; --bad-tint: #f6ebe9;

  --r:    10px;
  --r-sm: 8px;
  --r-lg: 14px;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sh-1: 0 1px 2px rgba(16,40,42,.05), 0 4px 14px rgba(16,40,42,.05);
  --sh-2: 0 2px 6px rgba(16,40,42,.06), 0 14px 34px rgba(16,40,42,.10);

  --step--1: clamp(0.82rem, 0.80rem + 0.12vw, 0.90rem);
  --step-0:  clamp(0.96rem, 0.94rem + 0.14vw, 1.03rem);
  --step-1:  clamp(1.12rem, 1.06rem + 0.30vw, 1.28rem);
  --step-2:  clamp(1.40rem, 1.28rem + 0.58vw, 1.76rem);

  --sb-w: 244px;
}

:root[data-theme="dark"], :root:not([data-theme="light"]) {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121a1b; --bg-2: #0d1516;
  --surface: #192425; --surface-2: #202d2e; --field: #16211f;
  --border: #293738; --border-strong: #384a4b;
  --ink: #e4efed; --ink-soft: #a6bbb8; --ink-faint: #7d9391; --title: #f0f7f5;
  --sea: #45b3ad; --sea-deep: #37938e; --sea-tint: rgba(69,179,173,.14);
  --ok: #52a583; --ok-tint: rgba(82,165,131,.14);
  --warn: #b09a5e; --warn-tint: rgba(176,154,94,.14);
  --bad: #c58975; --bad-tint: rgba(197,137,117,.14);
  --sh-1: 0 1px 2px rgba(0,0,0,.24), 0 4px 14px rgba(0,0,0,.28);
  --sh-2: 0 2px 8px rgba(0,0,0,.3), 0 16px 40px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121a1b; --bg-2: #0d1516;
    --surface: #192425; --surface-2: #202d2e; --field: #16211f;
    --border: #293738; --border-strong: #384a4b;
    --ink: #e4efed; --ink-soft: #a6bbb8; --ink-faint: #7d9391; --title: #f0f7f5;
    --sea: #45b3ad; --sea-deep: #37938e; --sea-tint: rgba(69,179,173,.14);
    --ok: #52a583; --ok-tint: rgba(82,165,131,.14);
    --warn: #b09a5e; --warn-tint: rgba(176,154,94,.14);
    --bad: #c58975; --bad-tint: rgba(197,137,117,.14);
    --sh-1: 0 1px 2px rgba(0,0,0,.24), 0 4px 14px rgba(0,0,0,.28);
    --sh-2: 0 2px 8px rgba(0,0,0,.3), 0 16px 40px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--bg);
  font-size: var(--step-0); line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
/* whisper of sea at the very bottom edge — quiet brand touch, never distracting */
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--sea) 7%, transparent));
  pointer-events: none; z-index: -1;
}
h1, h2, h3 { font-family: var(--sans); font-weight: 800; color: var(--title); letter-spacing: -.01em; line-height: 1.25; margin: 0; }
::selection { background: var(--sea-tint); color: var(--sea-deep); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 6px; }
a { color: var(--sea-deep); }
.muted { color: var(--ink-faint); font-size: .88rem; }
.sprite { position: absolute; width: 0; height: 0; }

.ico { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -0.16em; }
.ico.fill { fill: currentColor; stroke: none; }

/* ═══ Сайдбар — панель керування ══════════════════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sb-w); z-index: 40;
  display: flex; flex-direction: column;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface); border-right: 1px solid var(--border);
  transition: transform .28s var(--ease-out);
}
.sb-brand { display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer;
  padding: 6px 8px; margin-bottom: 12px; border-radius: var(--r-sm); align-self: flex-start; }
.sb-brand:hover { background: var(--surface-2); }
.brand-mark { display: inline-flex; width: 22px; height: 22px; color: var(--sea); }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-family: var(--sans); font-weight: 800; font-size: 1.3rem; color: var(--title); letter-spacing: -.02em; }

.sb-cta { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; width: 100%;
  margin-bottom: 16px; cursor: pointer; font-family: var(--sans); font-size: .96rem; font-weight: 800;
  padding: 11px 16px; min-height: 44px; border-radius: 10px; border: 1px solid transparent;
  background: var(--sea); color: #fff; transition: background .15s, transform .05s; }
.sb-cta:hover { background: var(--sea-deep); }
.sb-cta:active { transform: translateY(.5px); }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-group { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin: 18px 8px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 12px;
  border-radius: 9px; border: 0; background: transparent; color: var(--ink-soft); font: inherit;
  font-family: var(--sans); font-size: .95rem; font-weight: 700; cursor: pointer; min-height: 40px;
  transition: background .15s, color .15s; }
.nav-item .ico { width: 18px; height: 18px; opacity: .75; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--sea-tint); color: var(--sea-deep); }
.nav-item.active .ico { color: var(--sea); opacity: 1; }

.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.who-line { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 9px;
  border: 1px solid var(--border); color: var(--ink); font-size: .86rem; overflow: hidden; }
.who-line .ico { color: var(--sea); }
.who-line b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-row { display: flex; align-items: center; gap: 6px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 9px; cursor: pointer; background: transparent; border: 1px solid var(--border); color: var(--ink-soft);
  transition: border-color .18s, color .18s; flex: none; }
.iconbtn:hover { border-color: var(--border-strong); color: var(--ink); }
.linklike { background: none; border: 0; cursor: pointer; color: var(--ink-faint); font: inherit;
  font-family: var(--sans); font-size: .9rem; padding: 8px 6px; min-height: 40px; display: inline-flex; align-items: center; transition: color .15s; }
.linklike:hover { color: var(--ink); }

/* Мобільний бар */
.mobilebar { display: none; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
  padding: 8px clamp(12px,4vw,20px); padding-top: calc(env(safe-area-inset-top) + 8px);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.hamb { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 9px; background: transparent; border: 1px solid var(--border); color: var(--ink); cursor: pointer; flex: none; }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(10,25,26,.4); }

/* ═══ Робочий простір ═════════════════════════════════════════════════════════ */
.workspace { margin-left: var(--sb-w); padding: 12px clamp(20px,4vw,56px) 120px; }
.page-head, .views { max-width: 1000px; margin-inline: auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin: 26px auto 6px; }
.page-head h1 { font-size: var(--step-2); margin: 0 auto 0 0; }
.views { width: 100%; }
.prompt { font-size: 1.06rem; color: var(--ink-soft); line-height: 1.6; margin: .3rem 0 1.8rem; max-width: 58ch; }
.point { font-family: var(--serif); font-style: italic; font-size: 1.16rem; color: var(--title); margin: 0 0 1rem; line-height: 1.4; }
.back { background: none; border: 0; cursor: pointer; color: var(--ink-faint); font: inherit; font-family: var(--sans);
  font-size: .9rem; padding: 8px 2px; margin: 8px 0 2px; min-height: 40px; display: inline-flex; align-items: center; gap: .3rem; transition: color .15s; }
.back:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ═══ Дашборд ═════════════════════════════════════════════════════════════════ */
.search { display: flex; align-items: center; gap: 8px; background: var(--field); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 7px 14px; max-width: 360px; color: var(--ink-faint); }
.search .ico { width: 16px; height: 16px; }
.search input { border: 0; background: none; padding: 2px 0; font-size: .95rem; color: var(--ink); }
.search input:focus { outline: none; box-shadow: none; }

.series { margin: 8px 0 22px; }
.series-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.series-head h2 { font-weight: 800; font-size: 1.14rem; color: var(--title); }
.series-head .slink { cursor: pointer; }
.series-head .slink:hover { color: var(--sea-deep); text-decoration: underline; text-underline-offset: 3px; }
.series-count { font-size: .8rem; font-weight: 700; color: var(--ink-faint); }

/* Картка серіалу — hero */
.series-hero { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-1); padding: 16px; }
@media (max-width: 620px) { .series-hero { grid-template-columns: 1fr; } }
.hero-cover { aspect-ratio: 16/10; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); display: grid; place-items: center; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-cover .ph { color: var(--ink-faint); opacity: .5; }
.hero-info h1 { font-size: var(--step-2); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 0;
  box-shadow: var(--sh-1); transition: transform .16s var(--ease-out), border-color .2s, box-shadow .2s; }
.project:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--sh-2); }
.pthumb { position: relative; aspect-ratio: 16/10; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .ph { color: var(--ink-faint); opacity: .5; }
.pthumb .ep { position: absolute; top: 8px; left: 8px; background: var(--sea); color: #fff; font-size: .72rem;
  font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: .45rem; }
.project h3 { font-weight: 800; font-size: .96rem; margin: 0; color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-faint); font-size: .8rem; }

/* Модалка */
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(10,25,26,.5); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh-2); padding: 20px 22px; animation: pop .2s var(--ease-out) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { font-weight: 800; font-size: 1.1rem; }

.empty { text-align: center; color: var(--ink-faint); padding: 40px 16px; }
.empty .big { display: inline-flex; width: 52px; height: 52px; color: var(--sea); opacity: .7; margin-bottom: .4rem; }

/* ═══ Значки станів ═══════════════════════════════════════════════════════════ */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  font-weight: 700; border: 1px solid var(--border); color: var(--ink-soft); white-space: nowrap; }
.chip .ico { width: .95em; height: .95em; }
.chip.work   { color: var(--sea-deep); border-color: transparent; background: var(--sea-tint); }
.chip.review { color: var(--warn);     border-color: transparent; background: var(--warn-tint); }
.chip.done   { color: var(--ok);       border-color: transparent; background: var(--ok-tint); }
.chip.fail   { color: var(--bad);      border-color: transparent; background: var(--bad-tint); }
.chip.work .ico { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Картки, форми, кнопки ═══════════════════════════════════════════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-1); padding: 22px 24px; margin-bottom: 18px; }
.card h2 { font-weight: 800; font-size: 1.18rem; margin: 0 0 .5rem; }
.card .sub { color: var(--ink-faint); font-size: .9rem; margin: 0 0 1rem; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px;
  background: var(--sea-tint); color: var(--sea-deep); font-size: .8rem; font-weight: 800; margin-right: .5rem; }

label.field { display: block; margin: 1rem 0; }
label.field span { display: block; font-size: .8rem; color: var(--ink-faint); margin-bottom: .35rem; font-weight: 700; }
input, select, textarea { width: 100%; font-family: inherit; font-size: 16px; color: var(--ink); background: var(--field);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 10px 12px; transition: border-color .16s, box-shadow .16s; }
textarea { resize: vertical; min-height: 3em; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-tint); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.tight > * { flex: 0 1 auto; }

.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { flex: 1; min-width: 150px; text-align: left; cursor: pointer; display: grid; gap: .15rem; padding: 12px 15px;
  border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft);
  font-size: .9rem; transition: border-color .15s, background .15s; }
.pill strong { font-weight: 800; font-size: .95rem; color: var(--ink); }
.pill small { font-size: .77rem; color: var(--ink-faint); line-height: 1.35; }
.pill:hover { border-color: var(--sea); }
.pill[aria-pressed="true"] { border-color: var(--sea); background: var(--sea-tint); }
.pill[aria-pressed="true"] strong { color: var(--sea-deep); }

/* Конфігуратор: формат-картки + групи опцій */
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.fmt { display: grid; gap: .25rem; text-align: left; cursor: pointer; padding: 14px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); transition: border-color .15s, background .15s; }
.fmt .fmt-ic { color: var(--ink-faint); }
.fmt strong { font-weight: 800; font-size: .98rem; color: var(--ink); }
.fmt small { font-size: .78rem; color: var(--ink-faint); line-height: 1.35; }
.fmt:hover { border-color: var(--sea); }
.fmt.on { border-color: var(--sea); background: var(--sea-tint); }
.fmt.on strong, .fmt.on .fmt-ic { color: var(--sea-deep); }
.optgroup { margin-top: 14px; }
.optlabel { font-size: .8rem; font-weight: 700; color: var(--ink-faint); margin-bottom: 7px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; width: auto; cursor: pointer;
  font-family: var(--sans); font-size: .94rem; font-weight: 700; padding: 9px 16px; min-height: 40px; border-radius: 8px;
  border: 1px solid transparent; background: var(--sea); color: #fff; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .2s, transform .05s; }
.btn:hover:not([disabled]) { background: var(--sea-deep); }
.btn:active:not([disabled]) { transform: translateY(.5px); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn .ico { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); }
.btn.ghost:hover:not([disabled]) { background: var(--surface-2); border-color: var(--sea); color: var(--sea-deep); }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: .85rem; border-radius: 7px; }
.linkbtn { background: none; border: 0; cursor: pointer; color: var(--sea-deep); font: inherit; font-family: var(--sans);
  font-weight: 700; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { opacity: .8; }

.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--r); padding: 30px 18px; text-align: center;
  color: var(--ink-soft); cursor: pointer; transition: background .18s, border-color .18s; display: flex;
  flex-direction: column; align-items: center; gap: .4rem; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--sea); background: var(--sea-tint); }
.drop .big { width: 34px; height: 34px; color: var(--sea); }
.drop .drop-title { font-size: 1.02rem; color: var(--ink); font-weight: 800; }

.render { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.render:first-child { border-top: none; }
.render .thumb { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; color: var(--sea);
  background: var(--sea-tint); flex: none; }
.render .name { font-weight: 700; font-size: .94rem; }
.render .meta { color: var(--ink-faint); font-size: .8rem; }

/* Редактор субтитрів: відео + репліки поруч */
.subedit { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .subedit { grid-template-columns: 1fr; } }
.vwrap { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
.subvideo { width: 100%; border-radius: var(--r); background: #000; max-height: 62vh; box-shadow: var(--sh-1); }
.shift { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cuelist { display: flex; flex-direction: column; gap: 8px; max-height: 72vh; overflow: auto; padding-right: 4px; }
.keys { font-size: .74rem; margin: 2px 0 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.keys .ico { width: 13px; height: 13px; }
.cue { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); transition: border-color .15s, background .15s; }
.cue.active { border-color: var(--sea); background: var(--sea-tint); }
.cue.sel { box-shadow: inset 3px 0 0 var(--sea); }
.cue-time { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cue-t { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; cursor: pointer; padding: 2px;
  color: var(--sea-deep); font: inherit; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.cue-t .ico { width: 14px; height: 14px; }
.cue-sync { display: flex; align-items: center; gap: 4px; }
.cue-sync .tend { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--ink-faint); }
.mini { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border); color: var(--ink-faint); cursor: pointer; flex: none; transition: all .12s; }
.mini .ico { width: 15px; height: 15px; }
.mini:hover { border-color: var(--sea); color: var(--sea-deep); background: var(--sea-tint); }
.mini[data-op="del"]:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-tint); }
.cue-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cue-src { font-size: .86rem; color: var(--ink-faint); line-height: 1.4; }
.cue-tr { width: 100%; font-size: .92rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 7px 9px; resize: vertical; min-height: 2.6em; background: var(--field); color: var(--ink); }
.cue-tr:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-tint); }
.cue-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cue-ops { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 64px; }
.tm-hint { display: block; width: 100%; text-align: left; background: var(--sea-tint); border: 1px solid transparent;
  color: var(--sea-deep); font: inherit; font-size: .78rem; padding: 5px 9px; border-radius: 7px; cursor: pointer; margin-top: 2px; }
.tm-hint .ico { width: 13px; height: 13px; }
.tm-hint:hover { border-color: var(--sea); }
.tm-hint b { font-weight: 700; }
.prev-wrap { min-height: 120px; display: grid; place-items: center; }
.cps { font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 6px; align-self: flex-end; }
.cps.ok { color: var(--ok); background: var(--ok-tint); }
.cps.warn { color: var(--warn); background: var(--warn-tint); }
.cps.bad { color: var(--bad); background: var(--bad-tint); }

/* Прогрес аплоаду */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--sea), var(--sea-deep)); transition: width .2s var(--ease-out); }

/* Плеєр перегляду */
.player { margin: 10px 0 4px; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: var(--sh-1); }
.player video { display: block; width: 100%; max-height: 70vh; background: #000; }
.render .play .playdot { position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  background: rgba(8,24,26,.32); opacity: 0; transition: opacity .15s; }
.render .play:hover .playdot { opacity: 1; }
.render .play .playdot .ico { width: 18px; height: 18px; }

.log { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .78rem; color: var(--ink-soft);
  max-height: 180px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px; margin-top: 12px; }
.log div { padding: 1px 0; white-space: pre-wrap; }

/* ═══ Auth ════════════════════════════════════════════════════════════════════ */
.auth { max-width: 400px; margin: 12vh auto 0; padding: 0 18px; }
.auth .brand-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 8px; }
.auth .brand-mark { width: 30px; height: 30px; }
.auth .brand-name { font-size: 1.7rem; }
.auth .point { text-align: center; margin-bottom: 22px; }
.auth .tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth .tabs button { flex: 1; padding: 9px; border-radius: 7px; border: 0; background: transparent; color: var(--ink-soft); font-weight: 700; cursor: pointer; font-family: var(--sans); }
.auth .tabs button[aria-selected="true"] { background: var(--surface); color: var(--sea-deep); box-shadow: var(--sh-1); }

/* ═══ Тости ═══════════════════════════════════════════════════════════════════ */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface); border: 1px solid var(--border); color: var(--ink); padding: 10px 16px;
  border-radius: 10px; box-shadow: var(--sh-2); font-size: .9rem; font-weight: 700; animation: pop .28s var(--ease-out) both; }
.toast.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.toast.ok { color: var(--ok); }
@keyframes pop { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ═══ Мобілка ═════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .mobilebar { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--sh-2); }
  .sidebar.open { transform: none; }
  .workspace { margin-left: 0; }
  .page-head { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .chip.work .ico { animation: none; }
}
