@font-face { font-family: "Golos Heading"; src: url("/fonts/GolosText-ExtraBold.ttf") format("truetype"); font-weight: 800; }

:root {
  --paper: #F6F1E6; --paper-2: #EFE8D8; --card: #FFFFFF; --ink: #16181D; --muted: #6B6A66; --line: #E2DACB;
  --blue: #2A4AA0; --blue-2: #3C5FC4; --blue-soft: #E6ECFA; --yellow: #FFD23F; --yellow-soft: #FFF4CC;
  --green: #1F8A5B; --green-soft: #E2F4EA; --red: #C23B32; --red-soft: #FBE7E5; --amber: #B7791F;
  --radius: 14px; --shadow: 0 1px 2px rgba(22,24,29,.06), 0 6px 20px rgba(22,24,29,.06);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { font-family: "Golos Heading", "Segoe UI", sans-serif; font-weight: 800; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--ink); color: #E9E6DF; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; padding: 4px 6px 14px; }
.brand svg, .brand .lys-mark { width: auto; height: 34px; flex: none; }
.brand b { font-family: "Golos Heading", sans-serif; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #CFCBC2; padding: 8px 10px; border-radius: 9px; font-weight: 600; }
.nav a:hover { background: #262932; color: #fff; }
.nav a.active { background: var(--blue); color: #fff; }
.side-label { margin: 16px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8C897F; }
.side-projects { display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1; }
.side-projects a { display: flex; align-items: center; gap: 8px; color: #D8D4CB; padding: 7px 10px; border-radius: 9px;
  font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-projects a:hover { background: #262932; }
.side-projects a.active { background: #2E323C; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5B5E66; flex: none; }
.dot.ok { background: #3DBB7E; } .dot.run { background: var(--yellow); animation: pulse 1.2s infinite; } .dot.warn { background: #F0A33A; }
@keyframes pulse { 50% { opacity: .35; } }
.side-foot { padding-top: 10px; border-top: 1px solid #2B2E36; }
.pill { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #CFCBC2; padding: 6px 8px; border-radius: 9px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5B5E66; }
.pill.on::before { background: #3DBB7E; } .pill.off::before { background: var(--red); }
.pill button { margin-left: auto; }

.main { padding: 28px 34px 60px; min-width: 0; }
.loading { color: var(--muted); padding: 40px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .grow { flex: 1; min-width: 240px; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .12s; }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.yellow { background: var(--yellow); border-color: #E9BD26; color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.dark { background: #2E323C; border-color: #3A3E49; color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pcard { overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: transform .12s; }
.pcard:hover { transform: translateY(-2px); }
.pcard .thumb { aspect-ratio: 16/9; background: var(--paper-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard .title { font-weight: 700; line-height: 1.3; }
.steps-mini { display: flex; gap: 4px; }
.steps-mini i { flex: 1; height: 5px; border-radius: 3px; background: var(--paper-2); }
.steps-mini i.ok { background: var(--blue); }
.new-card { display: grid; place-items: center; min-height: 250px; border: 2px dashed var(--line-2); background: transparent;
  box-shadow: none; cursor: pointer; color: var(--muted); font-weight: 700; gap: 6px; }
.new-card:hover { border-color: var(--blue); color: var(--blue); }
.new-card .plus { font-size: 40px; line-height: 1; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.run { background: var(--yellow-soft); color: var(--amber-ink); }
.badge.warn { background: var(--amber-soft); color: var(--amber-ink); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

.pipeline { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.step { position: relative; padding: 12px 10px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.step .n { font-size: 11px; color: var(--muted); font-weight: 700; }
.step .t { font-weight: 700; font-size: 13.5px; }
.step .d { font-size: 12px; color: var(--muted); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.ok { border-color: var(--blue-line); background: linear-gradient(180deg, var(--surface-2), var(--card)); }
.step.ok .n { color: var(--blue); }
.step.run { border-color: #E9BD26; background: var(--yellow-soft); }
.step .acts { display: flex; gap: 4px; margin-top: 4px; }
.step .acts .btn { padding: 3px 8px; font-size: 12px; }

.jobbox { padding: 16px 18px; margin-bottom: 18px; }
.jobtop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar { height: 8px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin: 12px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--blue); transition: width .4s; }
.bar.indet > i { width: 30% !important; animation: slide 1.3s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.log { font: 12.5px/1.45 var(--mono); background: #15171C; color: #D6D3CB; border-radius: 10px; padding: 12px 14px;
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin-top: 10px; }
.log .w { color: #F4C35A; } .log .e { color: #FF8A80; } .log .ok { color: #7EE2A8; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-color: var(--yellow); }
.tabs .count { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 4px; }

.scenes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.scene { overflow: hidden; display: flex; flex-direction: column; }
.scene .img { aspect-ratio: 16/9; background: var(--paper-2) center/cover no-repeat; position: relative; cursor: zoom-in; }
.scene .img.empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; cursor: default; }
.scene .tag { position: absolute; left: 8px; top: 8px; background: rgba(22,24,29,.78); color: #fff; font-size: 12px;
  font-weight: 700; padding: 2px 8px; border-radius: 7px; }
.scene .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.scene .narr { font-size: 13.5px; line-height: 1.45; }
.scene textarea { width: 100%; min-height: 74px; resize: vertical; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; font-size: 13px; background: var(--surface-2); }
.scene textarea:focus, .field:focus, select:focus { outline: 2px solid var(--blue-line); border-color: var(--blue); }
.scene .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field, select { border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; background: var(--card); font-size: 13px; }
.scene .row .field { flex: 1; min-width: 90px; }
.saved { font-size: 12px; color: var(--green); opacity: 0; transition: opacity .3s; }
.saved.show { opacity: 1; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.editor { width: 100%; min-height: 62vh; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  font: 14px/1.65 var(--mono); background: var(--surface-2); resize: vertical; box-shadow: var(--shadow); }

.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { padding: 16px 18px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin-bottom: 12px; }
video { width: 100%; border-radius: 12px; background: #000; display: block; }
.kv { display: flex; flex-direction: column; gap: 12px; }
.kv label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 8px; }
.kv .val { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface-2); font-size: 13.5px;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.thumbimg { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--line); }
.md { font-size: 14.5px; line-height: 1.6; }
.md h1 { font-size: 22px; margin: 6px 0 10px; } .md h2 { font-size: 17px; margin: 18px 0 8px; } .md h3 { font-size: 15px; margin: 14px 0 6px; }
.md ul { padding-left: 20px; margin: 6px 0; } .md p { margin: 8px 0; }
.md code { font-family: var(--mono); background: var(--paper-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.md blockquote { border-left: 3px solid var(--yellow); margin: 8px 0; padding: 4px 12px; color: var(--muted); background: var(--yellow-soft); border-radius: 0 8px 8px 0; }
.qa li.okl::marker { color: var(--green); }

.topics { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.topic { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.topic .hook { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.topic .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.sect { margin: 26px 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 600; }
details.more .md { font-size: 13px; margin-top: 8px; max-height: 320px; overflow: auto; }

.sysgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin-bottom: 8px; }
.hint { background: var(--yellow-soft); border: 1px solid var(--amber-line); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.hint.blue { background: var(--blue-soft); border-color: var(--blue-line); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow); max-width: 420px;
  font-size: 14px; animation: pop .18s ease-out; }
.toast.err { background: var(--red); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(22,24,29,.45); }
.modal form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal label { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.modal .field { font-size: 15px; padding: 10px 12px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(10,10,12,.86); display: grid; place-items: center; z-index: 60; cursor: zoom-out; padding: 30px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; }
.lightbox .cap { color: #eee; margin-top: 12px; text-align: center; max-width: 900px; font-size: 14px; }

@media (max-width: 1200px) { .pipeline { grid-template-columns: repeat(5, minmax(0, 1fr)); } .two { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .main { padding: 18px 16px 40px; } .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.scene.selected { outline: 3px solid var(--yellow); outline-offset: -1px; }
.scene .pick { position: absolute; right: 8px; top: 8px; background: rgba(255,255,255,.92); border-radius: 7px;
  padding: 3px 5px; display: flex; cursor: pointer; }
.scene .pick input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--blue); }
.scene .stale { position: absolute; left: 8px; bottom: 8px; background: #F0A33A; color: #fff; font-size: 11.5px;
  font-weight: 700; padding: 2px 8px; border-radius: 7px; }
.scene .noimg { color: var(--muted); font-size: 13px; }
.scene .img.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 5px var(--yellow); } to { box-shadow: inset 0 0 0 0 transparent; } }
.selbar { position: sticky; bottom: 16px; margin-top: 18px; display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 20; }
.selbar.show { display: flex; }
.selbar .sub { color: #BDB9AF; }
.selbar .btn.ghost { color: #ddd; }
.lightbox { grid-template-columns: 60px 1fr 60px; gap: 10px; }
.lightbox .lb-body { display: flex; flex-direction: column; align-items: center; cursor: default; }
.lightbox .lb-prompt { color: #9A968C; font-size: 12.5px; margin-top: 6px; }
.lightbox .lb-acts { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.lightbox .nav-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer; }
.lightbox .nav-btn:hover { background: rgba(255,255,255,.28); }

.scene .rv { position: absolute; right: 44px; top: 8px; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 7px; color: #fff; }
.scene .rv.ok { background: var(--green); } .scene .rv.bad { background: var(--red); }
.scene .problem { font-size: 12.5px; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 6px 8px; }
.scene .lintw { font-size: 12px; color: var(--amber-ink); background: var(--amber-soft); border-radius: 8px; padding: 6px 8px; }

table.plan{width:100%;border-collapse:collapse}table.plan td,table.plan th{padding:6px 8px;border-bottom:1px solid rgba(0,0,0,.08);text-align:left;vertical-align:top}table.plan tr.past{opacity:.5}pre.log{max-height:320px;overflow:auto;font-size:12px;white-space:pre-wrap}

/* ===================== v2: calm Claude/Notion-like look (30.09.2026) ===================== */
:root {
  --paper: #FAF9F5; --paper-2: #F0EEE6; --card: #FFFFFF; --ink: #1F1E1C; --muted: #77736A; --line: #E6E2D8;
  --blue: #1F3A6E; --blue-2: #2C4D8F; --blue-soft: #E8EDF8; --accent: #1F3A6E;
  --radius: 12px; --shadow: 0 1px 2px rgba(31,30,28,.05);
}
body { font: 15px/1.55 -apple-system, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { font-family: -apple-system, "Segoe UI", system-ui, sans-serif; font-weight: 650; letter-spacing: -.01em; }
h1 { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 500; font-size: 30px; }
.side { background: var(--side-bg); color: var(--ink); border-right: 1px solid var(--line); }
.brand { color: var(--ink); }
.nav a { color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--active-bg); color: var(--ink); font-weight: 600; }
.side-label { color: var(--muted); }
.side-projects a { color: var(--text-2); }
.side-projects a:hover { background: var(--hover); }
.side-projects a.active { background: var(--active-bg); color: var(--ink); }
.side-foot { border-top: 1px solid var(--line); }
.pill { color: var(--text-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); }
.bar > i { background: var(--accent); }
.main { padding: 30px 40px 60px; max-width: 1400px; }
.sec { font-size: 15px; font-weight: 650; margin: 26px 0 10px; color: var(--ink); }
.muted { color: var(--muted); }
.pill-l { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.pill-l::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #B9B5AC; }
.pill-l.on::before { background: #3DA56E; } .pill-l.off::before { background: #D2533F; }

.now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.now { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.now-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.now-ico { font-size: 14px; }
.now-lane { font-weight: 600; color: var(--ink); }
.live { margin-left: auto; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.live.on { background: var(--green-soft); color: var(--green); }
.live.on::before { content: "● "; animation: pulse 1.4s infinite; }
.now-what { font-size: 18px; font-weight: 600; margin-top: 4px; }
.now-what.muted { font-size: 15px; font-weight: 400; }
.now-video a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.now-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.now-meta span:last-child { margin-left: auto; }
.now-next { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.now-next .lbl { font-size: 12px; color: var(--muted); }
.nx { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.nx span { color: var(--muted); white-space: nowrap; }
.nx b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.soon { padding: 6px 0; }
.srow { display: grid; grid-template-columns: 110px 105px minmax(0, 1fr) 190px; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.srow:last-of-type { border-bottom: 0; }
.sdate { color: var(--muted); }
.skind { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--paper-2); color: var(--text-2); justify-self: start; }
.skind.k-N { background: #E6F0FB; color: #2B5C9E; } .skind.k-R { background: #F4EBDD; color: #8A5A1C; }
.skind.k-C, .skind.k-S { background: #EFE8F7; color: #6A4A9A; }
.stitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitle a { color: var(--ink); }
.sphase { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.more { display: block; padding: 10px 16px 6px; font-size: 13px; color: var(--muted); }

.ph { width: 9px; height: 9px; border-radius: 3px; background: #CFCAC0; display: inline-block; flex: none; }
.ph-script { background: #B9B5AC; } .ph-voice { background: #8FB3E0; } .ph-images { background: #E0B45A; }
.ph-review { background: #D98B5F; } .ph-build { background: #A58BD6; } .ph-ready { background: #5FB88A; } .ph-out { background: #2F8A5B; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--side-bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: 72vh; overflow-y: auto; }
.col-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 2px 4px; }
.col-h .cnt { margin-left: auto; color: var(--muted); font-weight: 500; }
.col-hint { font-size: 12px; color: var(--muted); padding: 0 4px 4px; }
.kcard { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .12s; }
.kcard:hover { border-color: var(--line-2); }
.kcard.busy { border-color: #E0B45A; box-shadow: 0 0 0 2px var(--amber-soft); }
.kthumb { aspect-ratio: 16/9; border-radius: 6px; background: var(--paper-2) center/cover no-repeat; }
.kt { font-size: 13.5px; font-weight: 550; line-height: 1.35; }
.kmeta { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--paper-2); color: var(--text-2); }
.chip.run { background: var(--amber-soft); color: var(--amber-ink); }
.chip.muted { color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 4px; }

@media (max-width: 900px) {
  .main { padding: 18px 16px 50px; }
  .now-grid { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 1fr auto; grid-template-areas: "d k" "t t" "p p"; gap: 4px 10px; }
  .sdate { grid-area: d; } .skind { grid-area: k; justify-self: end; } .stitle { grid-area: t; white-space: normal; } .sphase { grid-area: p; }
  .board { grid-auto-columns: 78%; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  h1 { font-size: 26px; }
}
@media (max-width: 900px) { table.plan { font-size: 13px; } table.plan td, table.plan th { padding: 6px 5px; } .sysgrid { grid-template-columns: minmax(0,1fr) !important; } }
@media (max-width: 640px) {
  table.plan thead { display: none; }
  table.plan, table.plan tbody, table.plan tr, table.plan td { display: block; width: 100%; }
  table.plan tr { padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.plan td { border: 0; padding: 2px 0; }
  table.plan td:nth-child(1), table.plan td:nth-child(2) { display: inline-block; width: auto; margin-right: 8px; color: var(--muted); }
}

/* ---- users / friends / login ---- */
.userbox { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0; font-size: 13px; }
.userbox .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pill[hidden] { display: none; }
.hint.nextstep { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.hint.ok { background: var(--green-soft); border-color: var(--green-line); }
.step.next { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.fq { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fq-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fq-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.gpuq { margin-top: 22px; max-width: 640px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; height: auto; }
.login-card { width: 100%; max-width: 380px; padding: 26px 24px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand svg, .login-brand .lys-mark { width: auto; height: 40px; flex: none; }
.login-brand { flex-wrap: wrap; }
.login-long { flex-basis: 100%; margin: 0; color: var(--muted, #6b6b6b); font-size: 14px; }
.login-brand h1 { font-size: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.login-card .field { font-size: 16px; padding: 11px 12px; min-height: 44px; font-weight: 400; }
.login-btn { justify-content: center; min-height: 46px; font-size: 16px; }
.login-err { background: var(--red-soft); border-color: var(--red-line); margin: 0; }
.login-err[hidden] { display: none; }

/* ---- responsive: tap targets, no horizontal scroll ---- */
html { -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; }
@media (max-width: 900px) {
  .btn, .tabs button, .nav a { min-height: 44px; }
  .btn.sm { min-height: 44px; padding: 8px 12px; }
  .step .acts .btn { min-height: 44px; padding: 6px 12px; }
  .nav a { display: inline-flex; align-items: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { white-space: nowrap; }
  .toolbar .btn, .head .btn { flex: 0 0 auto; }
  .head > .btn { flex: 1 1 auto; justify-content: center; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step .d { white-space: normal; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  pre, textarea, .editor, table { max-width: 100%; }
  .toasts { left: 12px; right: 12px; max-width: none; }
  .toast { max-width: none; }
  .modal { width: calc(100vw - 24px); max-width: 520px; }
  input.field, select, textarea { font-size: 16px; }
  .userbox { padding: 0 0 0 8px; margin-left: auto; }
}
@media (max-width: 520px) {
  .main { padding: 14px 12px 40px; }
  h1 { font-size: 23px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
}

/* ---- live status line + pulsing dots ---- */
.statusbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.statusbar .st-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statusbar .st-extra { color: var(--muted); white-space: nowrap; }
.statusbar.busy { background: var(--yellow-soft); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #B9B5AC; flex: none; vertical-align: middle; }
.live-dot.on { background: #E0A800; animation: pulse 1.2s infinite; }
.statusbar:not(.busy) .live-dot { background: #3DA56E; }
.qbadge { position: absolute; left: 8px; bottom: 8px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.qbadge .live-dot.on { background: #fff; }
.noimg .live-dot { margin-right: 4px; }
@media (max-width: 900px) { .statusbar { padding: 6px 12px; } .st-extra { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on, .dot.run { animation: none; } .scene .img.flash { animation: none; } }
@media (max-width: 900px) {
  select, input.field, textarea { min-height: 44px; }
  .scene .pick { padding: 8px; }
}

.langsw { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-left: auto; }
.langsw button { border: 0; background: transparent; padding: 6px 10px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); min-height: 32px; }
.langsw button.on { background: var(--blue); color: #fff; }
.side-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.side-foot .pill { flex: 1 1 100%; } .side-foot .userbox { flex: 1 1 auto; }
.login-lang { position: fixed; top: 12px; right: 12px; background: var(--card); }
.statusbar .btn { min-height: 32px; padding: 3px 10px; }
@media (max-width: 900px) { .langsw button { min-height: 44px; padding: 6px 14px; } .statusbar .btn { min-height: 36px; } .statusbar { min-height: 44px; } }

/* member quota in the top bar, scene action row, "Make animation" panel */
.statusbar .st-quota { color: var(--ink); font-weight: 700; white-space: nowrap; }
@media (max-width: 900px) { .statusbar { flex-wrap: wrap; } .statusbar .st-quota { flex-basis: 100%; order: 3; font-size: 12.5px; white-space: normal; } }
.scene .scene-acts { gap: 8px; }
.scene .scene-acts .btn .live-dot { margin-right: 2px; }
.animp { max-height: 86vh; overflow: auto; }
.animp .an-narr { font-size: 13px; }
.animp .an-fields { display: flex; flex-direction: column; gap: 10px; }
.animp .af { display: flex; flex-direction: column; gap: 4px; }
.animp .af-bool { flex-direction: row; align-items: center; gap: 8px; }
.animp .af-bool input { width: 20px; height: 20px; accent-color: var(--blue); }
.animp .af-l { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.animp .af-obj { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.animp .af-list { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.animp .af-item { display: flex; gap: 6px; align-items: flex-start; width: 100%; }
.animp .af-item > :first-child { flex: 1; min-width: 0; }
.animp .an-row { display: flex; gap: 8px; flex-wrap: wrap; }
.animp .an-prev { aspect-ratio: 16/9; background: var(--paper-2); border-radius: 10px; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 8px; }
.animp .an-prev img { width: 100%; height: 100%; object-fit: contain; }
.modal:has(.animp) { width: min(640px, 94vw); }

/* ===================== v3: usability pass (01.10.2026) ===================== */
/* focus: one visible ring everywhere */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.btn.primary:focus-visible, .btn.dark:focus-visible, .selbar :focus-visible, .lightbox :focus-visible { outline-color: var(--blue); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.selbar :focus-visible, .lightbox :focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #fff; outline-color: #fff; }
.field:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 8px; }
html.signed-out body { visibility: hidden; }
#main:focus { outline: none; }

/* buttons: one primary (navy), one secondary (white), one danger (red) */
.btn.dark, .btn.yellow { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.dark:hover, .btn.yellow:hover { background: var(--blue-2); }
.btn.light { background: var(--card); border-color: var(--card); color: var(--ink); }
.btn.light:hover { background: var(--paper-2); }
.btn.danger { color: var(--red); border-color: var(--red-line); background: var(--card); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary-outline { background: var(--card); border-color: var(--blue); color: var(--blue); }
.btn.primary-outline:hover { background: var(--blue-soft); }
.btn.big { padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn .live-dot { margin-right: 2px; }
.new-card { font: inherit; width: 100%; text-align: center; }
.req { color: var(--red); font-style: normal; }

/* sidebar: full-height background even when the page is taller than the screen */
.side-menu { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.menu-btn { display: none; }
.side-projects .sp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dot.bad { background: var(--red); }

/* status line: one line, title + progress, a thin fill line under it */
.statusbar { position: sticky; flex-wrap: nowrap; }
.statusbar .st-text { display: flex; align-items: baseline; gap: 0; min-width: 0; }
.statusbar .st-link { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 4ch; }
.statusbar .st-link:hover { text-decoration: underline; }
.statusbar .st-sep { white-space: pre; }
.statusbar .st-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; color: var(--text-2); }
.statusbar .st-fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blue); transition: width .5s; }
.statusbar .st-extra { flex: none; }

/* quota, queue and waiting cards */
.quota { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.quota.full { background: var(--yellow-soft); border-color: var(--amber-line); }
.quota .q-main { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.quota .q-main span { color: var(--text-2); }
.quota .q-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.waitcard { padding: 14px 16px; margin-bottom: 16px; border-color: #E9BD26; background: var(--surface-2); }
.qi { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.qi:last-of-type { border-bottom: 0; }
.qi-main { flex: 1; min-width: 0; }
.qi-title { font-weight: 650; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-line { font-size: 14px; }
.qi.fail .qi-line { color: var(--red); }
.qi .bar { margin: 6px 0 2px; }
.qi-eta { font-size: 13px; color: var(--muted); padding-top: 4px; }
.rule { margin-top: 8px; font-size: 13px; }
.bar.thin { height: 5px; margin: 6px 0 0; }
.gpuq { max-width: 720px; margin: 0 0 18px; }
.fq-hist { margin-top: 8px; }

/* acts + tabs */
.tabs { overflow: visible !important; flex-wrap: wrap !important; }
.tabs button { min-height: 44px; }
.tabs.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 0; margin: 4px 0 16px; }
.tabs.acts button { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 10px 12px; margin: 0; color: var(--ink); font-weight: 600; white-space: normal; }
.tabs.acts button.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); background: var(--card); }
.act-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--paper-2); color: var(--muted); }
.tabs.acts button.active .act-n { background: var(--blue); color: #fff; }
.act-n.done { background: var(--green); color: #fff; }
.act-head { margin: 4px 0 14px; } .act-head h2 { font-size: 22px; }
.act-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.act-foot .grow { flex: 1; min-width: 200px; }
.details { margin-top: 24px; } .details summary { cursor: pointer; font-weight: 650; min-height: 32px; display: flex; align-items: center; }
.tips { margin-top: 12px; } .tips summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* script editor */
.editor { min-height: 46vh; font: 15px/1.65 -apple-system, "Segoe UI", system-ui, sans-serif; }
.sc-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.sc-stats { flex: 1; min-width: 220px; font-size: 14px; }
.sc-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-acts { display: inline-flex; gap: 8px; margin-left: 8px; flex-wrap: wrap; vertical-align: middle; }
.err-line { background: var(--red-soft); border-color: var(--red-line); }
.hint.err-line[hidden] { display: none; }

/* pipeline tiles with labelled buttons */
.pipeline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.step { min-height: 128px; }
.step .acts { flex-direction: column; margin-top: auto; padding-top: 6px; }
.step .acts .btn { width: 100%; justify-content: center; padding: 6px 8px; }
.step .d { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step.run .n { color: var(--amber-ink); }
.tile-warn { font-size: 12px; color: var(--red); }
.tile-owner { font-size: 12px; }
.jobbox.failed { border-color: var(--red-line); }

/* scene cards */
.scene .lbl-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.scene .lbl-f textarea { font-weight: 400; color: var(--ink); }
.scene .saved { font-size: 12.5px; color: var(--muted); opacity: 0; min-height: 1.2em; }
.scene .saved.show { opacity: 1; } .scene .saved.ok { color: var(--green); font-weight: 600; } .scene .saved.dirty { color: var(--amber); }
.scene .img.is-replacing { background-blend-mode: luminosity; }
.scene .img.is-replacing::after { content: ""; position: absolute; inset: 0; background: rgba(250,249,245,.62); }
.scene .replacing { position: absolute; z-index: 2; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); background: rgba(22,24,29,.85); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 9px; text-align: center; }
.scene .replacing .live-dot { background: #fff; margin-right: 6px; }
.scene .qbadge { z-index: 2; }
.scene .animtag { position: absolute; left: 8px; bottom: 8px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; z-index: 1; }
.scene .stale { z-index: 1; left: auto; right: 8px; bottom: 8px; }
.scene .img:focus-visible { outline-offset: -3px; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-kb { display: none; } .hint-touch { display: block; } }
.selbar .btn.light { color: var(--ink); }

/* generic dialogs */
.modal label .fhint { font-weight: 400; font-size: 12.5px; }
.modal .dlg-body { margin: -6px 0 0; }
.modal h2 { font-size: 20px; }
.modal textarea.field { resize: vertical; }

/* animation dialog: picture first, fields beside it in landscape */
dialog.modal:has(.animp) { width: min(720px, 96vw); max-height: 94vh; overflow: hidden; }
.animp { padding: 0 !important; gap: 0 !important; max-height: 94vh; display: flex !important; flex-direction: column; overflow: hidden; }
.animp .an-head { padding: 18px 22px 10px; } .animp .an-head h2 { font-size: 19px; }
.animp .an-body { padding: 0 22px 12px; overflow: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.animp .an-left, .animp .an-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.animp .an-ask { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 12px; padding: 12px 14px; }
.animp .an-ask > div { flex: 1; min-width: 180px; }
.animp .an-prev { width: 100%; aspect-ratio: 16 / 9; min-height: 150px; background: var(--paper-2); border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; overflow: hidden; padding: 0; }
.animp .an-prev img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--card); }
.animp .an-prev > span { padding: 8px; }
.animp .an-lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.animp .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.animp .tpl { text-align: left; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 11px; cursor: pointer; min-height: 44px; }
.animp .tpl b { font-size: 14px; } .animp .tpl span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.animp .tpl:hover { border-color: var(--line-2); }
.animp .tpl.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); background: var(--surface-2); }
.animp .an-foot { padding: 12px 22px 16px; margin: 0; border-top: 1px solid var(--line); background: var(--card); flex: none; }
.animp .an-narr { font-size: 13px; }
@media (min-width: 700px) { dialog.modal:has(.animp) { width: min(900px, 94vw); } .animp .an-body { flex-direction: row; align-items: flex-start; } .animp .an-left { flex: 0 0 42%; position: sticky; top: 0; } .animp .an-right { flex: 1; } }
@media (max-height: 500px) and (orientation: landscape) {
  dialog.modal:has(.animp) { width: 98vw; max-height: 98vh; }
  .animp { max-height: 98vh; }
  .animp .an-head { padding: 8px 14px 4px; } .animp .an-head .an-narr { display: none; }
  .animp .an-body { padding: 0 14px 8px; flex-direction: row; align-items: flex-start; gap: 12px; }
  .animp .an-left { flex: 0 0 40%; position: sticky; top: 0; } .animp .an-right { flex: 1; }
  .animp .an-foot { padding: 6px 14px 8px; }
  .animp .an-prev { min-height: 100px; }
  .animp .an-ask { padding: 8px 10px; } .animp .an-ask .sub { display: none; }
}

/* friends (owner) */
.fr-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fr-top .panel + .panel { margin-top: 0; }
.inv-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.inv-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; min-width: 160px; }
.invite-link { margin-top: 14px; padding: 12px; border: 1px solid var(--green-line); background: var(--green-soft); border-radius: 12px; }
.il-row { display: flex; gap: 8px; margin: 8px 0 6px; } .il-row .field { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 28px; margin: 0; cursor: pointer; }
.sw-track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: .15s; flex: none; }
.sw-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .sw-track { background: var(--blue); } .switch input:checked + .sw-track::after { left: 21px; }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--blue); outline-offset: 2px; }
.sw-l { font-weight: 600; }
.ulist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.ucard { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; } .ucard.off { opacity: .8; background: var(--surface-2); }
.u-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .u-name { font-size: 16px; }
.u-tier { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.u-use { display: flex; flex-wrap: wrap; gap: 6px; }
.meter { display: inline-flex; align-items: baseline; gap: 5px; background: var(--paper-2); border-radius: 8px; padding: 3px 9px; font-size: 13px; } .meter span { color: var(--muted); font-size: 12px; }
.meter.full { background: var(--amber-soft); } .meter.full b { color: var(--amber-ink); }
.u-sub { margin: 0; } .u-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.jhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; } .jhead h2 { margin: 0 8px 0 0; }
.jlist { display: flex; flex-direction: column; margin-top: 8px; }
.jrow { display: grid; grid-template-columns: 90px 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.jrow:last-child { border-bottom: 0; } .j-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.j-what { min-width: 0; display: flex; flex-direction: column; } .j-what a { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.log-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); } .lf-grow { flex: 1; min-width: 180px; }
.alog { display: flex; flex-direction: column; margin-top: 8px; }
.arow { display: grid; grid-template-columns: 140px 110px 200px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.arow.warn .a-a { color: var(--amber); font-weight: 600; } .a-t, .a-ip { color: var(--muted); } .a-d { overflow-wrap: anywhere; } .a-u { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.now-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.checks .dot { background: #B9B5AC; }

/* ---- phones and tablets: a visible menu button, 44px targets, compact landscape ---- */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 600; cursor: pointer; margin-left: auto; }
  .burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; content: ""; }
  .burger::before { position: absolute; top: -6px; } .burger::after { position: absolute; top: 6px; }
  .side-foot { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; margin-top: 4px; }
  .side-foot .userbox { margin-left: auto; padding: 0; }
  .side-foot .langsw { margin-left: 0; }
  .btn, .btn.sm, .tabs button, .langsw button, .statusbar .btn, .step .acts .btn { min-height: 44px; }
  .statusbar { min-height: 44px; flex-wrap: nowrap; } .statusbar .st-extra { display: none; }
  .statusbar .st-link { max-width: 45%; }
  .tabs.acts { grid-template-columns: 1fr; }
  .tabs.acts button { min-height: 52px; }
  .fr-top { grid-template-columns: 1fr; }
  .ulist { grid-template-columns: 1fr; }
  .jrow { grid-template-columns: 1fr auto; } .jrow .badge, .jrow .j-who { grid-column: 1; } .j-what { grid-column: 1; } .jrow > :last-child { grid-column: 2; grid-row: 1 / span 3; }
  .arow { grid-template-columns: 1fr 1fr; } .a-d { grid-column: 1 / -1; }
  .scene .pick { padding: 10px; }
  .scene .pick input { width: 24px; height: 24px; }
  .editor { min-height: 42vh; }
  .act-foot .btn.big { width: 100%; justify-content: center; }
  .sc-btns .btn.big { flex: 1; justify-content: center; }
  .quota .q-main { flex-direction: column; gap: 2px; }
  .selbar { padding: 10px 12px; }
  .toasts { bottom: 12px; }
}
@media (min-width: 560px) and (max-width: 900px) { .tabs.acts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .ucard .u-tier { margin-left: 0; }
  #fr-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #fr-tabs button { white-space: normal; min-width: 0; padding: 0 4px; font-size: 14px; line-height: 1.2; text-align: center; justify-content: center; }
  .inv-form label { min-width: 0; flex: 1 1 100%; } .inv-form .btn, .il-row .btn { flex: 1 1 100%; justify-content: center; }
  .il-row { flex-wrap: wrap; }
  .u-acts { flex-direction: column; } .u-acts .btn { width: 100%; justify-content: center; }
  .switch { align-items: flex-start; padding: 6px 0; } .sw-l { min-width: 0; }
}
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape), (max-height: 500px) and (orientation: landscape) {
  .statusbar { position: static; min-height: 34px; padding: 3px 12px; font-size: 13px; }
  .side { min-height: 46px; padding: 2px 12px; }
  .menu-btn { min-height: 40px; }
  .brand { font-size: 15px; } .brand svg, .brand .lys-mark { width: auto; height: 28px; }
  .main { padding: 8px 12px 24px; }
  h1 { font-size: 21px; }
  .head { margin-bottom: 10px; }
  .modal form { padding: 14px 18px; gap: 10px; }
  .toasts { bottom: 6px; }
}

/* login / invite */
.pw-row { display: flex; gap: 6px; } .pw-row .field { flex: 1; min-width: 0; } .pw-toggle { min-height: 44px; font-weight: 600; }
.fhint { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.meter-bar { display: block; height: 4px; background: var(--paper-2); border-radius: 3px; overflow: hidden; } .meter-bar i { display: block; height: 100%; width: 0; background: #E0A800; transition: width .15s; } .meter-bar i.ok { background: var(--green); }
.login-lang button { min-height: 44px; min-width: 44px; }
.login-page { grid-template-columns: minmax(0, 1fr); } .login-card { min-width: 0; margin: 0 auto; }
.login-card .field { min-width: 0; width: 100%; }
.switch { position: relative; }
.animp .an-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.animp .an-foot .btn { flex: 1 1 auto; justify-content: center; }
@media (min-width: 700px) { .animp .an-foot .btn { flex: 0 0 auto; } }
@media (max-width: 900px) {
  .quota .q-main { flex-direction: row; gap: 2px 14px; font-size: 13.5px; }
  .statusbar .st-text { flex-wrap: wrap; row-gap: 0; } .statusbar .st-sep { display: none; }
  .statusbar .st-link { max-width: 100%; flex: 0 0 100%; } .statusbar .st-line { flex: 0 0 100%; font-size: 12.5px; }
  .statusbar { padding-top: 4px; padding-bottom: 6px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .statusbar .st-text { flex-wrap: nowrap; } .statusbar .st-sep { display: inline; white-space: pre; }
  .statusbar .st-link { flex: 0 1 auto; max-width: 40%; } .statusbar .st-line { flex: 0 1 auto; }
}
@media (max-width: 900px) { .statusbar .st-line { white-space: normal; } }

/* ---- team: board, video card, feed, topics */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.mine-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); margin-left: 4px; }
.now-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.now-panel .now-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; font-size: 14px; }
.bf-row, .bf-note { padding: 6px 0; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.bf-row:first-of-type { border-top: 0; }
.tboard { display: grid; grid-template-columns: repeat(7, minmax(160px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.tcol { background: var(--side-bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tcol-empty { padding: 6px 4px; }
.tcard { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: inherit; box-shadow: var(--shadow); }
.tcard:hover { border-color: var(--line-2); }
.tcard.busy { border-color: var(--yellow); }
.tc-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--paper-2); }
.tc-t { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tc-chs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.tc-live { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--amber-ink); }
.badge.ch { background: var(--paper-2); color: var(--ink); }
.badge.chc0 { background: var(--blue-soft); color: var(--blue); } .badge.chc1 { background: var(--amber-soft); color: var(--amber-ink); }
.badge.chc2 { background: #E2F4EA; color: #1F8A5B; } .badge.chc3 { background: #F1E4F6; color: #7B3C93; }
.badge.ch.mine { box-shadow: inset 0 0 0 2px var(--yellow); }
.back { display: inline-block; margin-bottom: 10px; font-weight: 700; min-height: 24px; }
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-strip { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.stage-strip li { padding: 5px 12px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.stage-strip li.done { background: var(--green-soft); color: var(--green); }
.stage-strip li.cur { background: var(--ink); color: var(--on-ink); }
.script-ro { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 420px; overflow: auto; font: 14px/1.55 "Segoe UI", system-ui, sans-serif; margin: 8px 0; }
.script-ed { width: 100%; min-height: 320px; font-size: 14px; line-height: 1.5; margin: 8px 0; }
.tframes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tframe { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.tframe.flagged { border-color: var(--red); }
.tframe img, .tframe .noimg { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--paper-2); display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.tframe figcaption { padding: 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.tf-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.fd-line { overflow-wrap: anywhere; } .fd-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.tp-ch { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.tp-c { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; min-height: 32px; }
.tp-list { display: flex; flex-direction: column; gap: 10px; }
.tp-item { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tp-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.u-ch { border: 0; padding: 0; margin: 6px 0; }
.u-ch legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; }
@media (max-width: 700px) {
  .tboard { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .tcol { scroll-snap-align: start; }
  .tp-c { min-height: 44px; } .chip { min-height: 44px; }
}

.side-projects[hidden], .side-label[hidden] { display: none; }
#tp-form label:not(.tp-c) { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-weight: 600; }
#tp-form .field { width: 100%; }
.tp-item .btn, .tp-item .acts { align-self: flex-start; }
.tp-item .acts { display: flex; gap: 8px; }

/* cash page */
.cash-note { border-left: 4px solid var(--yellow, #E0A800); margin-bottom: 14px; }
.cash-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 0 0 14px; }
.cash-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; min-width: 0; }
.cash-filters .btn { align-self: flex-end; }
.cash-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 14px; }
.cash-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cash-nums div { display: flex; flex-direction: column; min-width: 0; } .cash-nums b { font-size: 19px; overflow-wrap: anywhere; }
.cash-me { margin-top: 8px; } .cash-per { margin-top: 8px; } .cash-per summary { cursor: pointer; min-height: 32px; font-weight: 700; }
.cash-pm { list-style: none; margin: 6px 0 0; padding: 0; } .cash-pm li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-top: 1px solid var(--line); }
.cash-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.cash-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.cash-form .cf-wide { grid-column: 1 / -1; }
table.cash-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.cash-t th { text-align: left; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.cash-t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.cash-t td.num { white-space: nowrap; } .cash-t tr.cash-rev td:not(.act) { opacity: .6; }
@media (max-width: 1099px) {
  .cash-t thead { display: none; } .cash-t, .cash-t tbody, .cash-t tr, .cash-t td { display: block; width: 100%; }
  .cash-t tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .cash-t td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .cash-t td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; flex: 0 0 auto; }
  .cash-t td.act { justify-content: flex-end; } .cash-nums b { font-size: 17px; }
}
@media (min-width: 1100px) { .cash-t td:nth-child(-n+2), .cash-t td:nth-child(5) { white-space: nowrap; } .cash-cards { align-items: start; } }

.test-banner { position: static; padding: 8px 16px; background: #B3261E; color: #fff; font-weight: 700; font-size: 14px;
  line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.test-banner.readonly-banner { background: #1F3A5F; }
.badge.ch-none { background: var(--paper-2); color: var(--text-2); }
.warn-card { border-left: 4px solid #E0A800; }
.warn-card code { overflow-wrap: anywhere; }
.warn-card .sub { overflow-wrap: anywhere; }

/* ---- LYS closed-studio login, refusal page ---- */
.login-closed { margin: 6px 0 14px; font-size: 14.5px; }
.login-note { margin: 0 0 12px; }
.login-note[hidden] { display: none; }
.google-btn { width: 100%; padding: 8px 14px; justify-content: center; gap: 10px; background: var(--card); color: var(--ink); font-weight: 600; min-height: 46px; font-size: 16px; text-decoration: none; }
.google-btn:hover { border-color: var(--blue); }
.google-btn .g-logo { flex: none; }
.login-alt { margin: 18px 0 0; text-align: center; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 8px 4px; color: var(--blue); cursor: pointer; font-size: 14px; text-decoration: underline; min-height: 44px; }
.login-foot { margin-top: 18px; text-align: center; }
.login-card form[hidden], .login-card [hidden] { display: none; }
.refused-h { font-size: 21px; margin: 6px 0 10px; }
.refused section p { margin: 0 0 16px; overflow-wrap: anywhere; }
.refused-mail { overflow-wrap: anywhere; }
.fr-ginvite { margin-bottom: 16px; }
.gi-days select { min-height: 44px; }
.gi-h { margin: 16px 0 6px; }
.gi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.gi-mail { font-weight: 600; overflow-wrap: anywhere; flex: 1 1 200px; min-width: 0; }
.gi-meta { margin: 0; }
.fr-ginvite code { overflow-wrap: anywhere; }
@media (max-width: 700px) { .gi-row .btn { width: 100%; justify-content: center; } }

/* ===================== redesign (03.10.2026): shell, Home, Library, video page ===================== */
:root { --tb-h: 56px; --side-w: 232px; --tabbar-h: 64px; --ink-2: #1B2A4A; --accent: #F2B84B; --soft: #C9D3E6; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; }
.statusbar { position: static; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; height: var(--tb-h); padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .brand { padding: 0; flex: none; color: var(--ink-2); font-size: 17px; gap: 10px; min-height: 44px; }
.topbar .brand .lys-mark { height: 30px; width: auto; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--ink); padding: 0 8px; }
.tb-btn:hover { background: var(--paper-2); }
.gsearch { position: relative; flex: 1 1 auto; min-width: 0; max-width: 560px; margin-right: auto; }
.gs-input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 34px 0 40px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377736A' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5'/%3E%3C/svg%3E") 11px 50% / 20px no-repeat; font-size: 15px; }
.gs-input::-webkit-search-cancel-button { display: none; }
.gs-key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; font: 12px var(--mono); color: var(--muted); background: var(--paper); pointer-events: none; }
.gs-input:focus + .gs-key { display: none; }
@media (pointer: coarse) { .gs-key { display: none; } }
.gs-res { position: absolute; top: 50px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(27,42,74,.16); max-height: min(70vh, 520px); overflow: auto; z-index: 60; padding: 6px; }
.gs-g { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }
.gs-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 9px; color: var(--ink); }
.gs-row:hover, .gs-row.on { background: var(--blue-soft); }
.gs-img { width: 64px; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--soft); overflow: hidden; flex: none; }
.gs-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gs-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gs-t .sub { margin: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-none { padding: 14px; color: var(--muted); }
.tb-ask { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--soft); color: var(--ink-2); font-weight: 650; flex: none; }
.tb-ask:hover { background: var(--hover); }
#tb-lang .langsw { margin-left: 0; }
.umenu { position: relative; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-2); color: var(--on-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.um-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-pop { position: absolute; right: 0; top: 50px; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(27,42,74,.16); padding: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.um-who { display: flex; flex-direction: column; }
.um-pop .pill { color: var(--ink); padding: 0; }
.um-lang { display: none; }
.um-out { justify-content: center; }

/* sidebar */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--tb-h)); background: none; }
.side { position: sticky; top: var(--tb-h); height: calc(100vh - var(--tb-h)); overflow-y: auto; overflow-x: hidden; padding: 12px 10px 20px; background: var(--side-bg); border-right: 1px solid var(--line); display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--active-bg); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.nav .nl { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.nav .side-label { margin: 14px 12px 4px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nbadge { background: var(--accent); color: var(--ink-2); font-size: 11.5px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.chdot { width: 22px; height: 22px; border-radius: 7px; background: var(--c, #1F3A6E); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chdot-s { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.mine-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
body.side-min { --side-w: 68px; }
body.side-min .side { padding: 12px 8px; }
body.side-min .nav .nl, body.side-min .nav .nbadge { display: none; }
body.side-min .nav a { justify-content: center; padding: 0; }
body.side-min .nav .side-label { font-size: 0; height: 1px; background: var(--line); margin: 10px 10px; padding: 0; }
.main { padding: 28px 40px 60px; max-width: 1440px; min-width: 0; }
.tabbar { display: none; }
@media (min-width: 768px) and (max-width: 1099px) {            /* tablet: icons only; the toggle opens the labels over the page */
  :root { --side-w: 68px; }
  .side { padding: 12px 8px; }
  .nav .nl, .nav .nbadge { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .nav .side-label { font-size: 0; height: 1px; background: var(--line); margin: 10px 10px; padding: 0; }
  body.side-open .side { position: fixed; left: 0; top: var(--tb-h); width: 232px; z-index: 55; box-shadow: 8px 0 30px rgba(27,42,74,.18); padding: 12px 10px 20px; }
  body.side-open .nav .nl, body.side-open .nav .nbadge:not([hidden]) { display: inline-flex; }
  body.side-open .nav a { justify-content: flex-start; padding: 0 12px; }
  body.side-open .nav .side-label { font-size: 11px; height: auto; background: none; margin: 14px 12px 4px; }
  .main { padding: 24px 28px 50px; }
}
@media (max-width: 1099px) { .um-name { display: none; } }
@media (max-width: 767px) {                                       /* phone: bottom bar with 5 items */
  :root { --tb-h: 56px; }
  .side, .side-toggle, #tb-lang { display: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-name { display: none; }
  .ask-l { display: none; }
  .tb-ask { padding: 0; width: 44px; justify-content: center; }
  .um-lang { display: block; }
  .main { padding: 16px 16px calc(var(--tabbar-h) + 32px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--paper); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; border: 0; background: none; color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .tabbar .active { color: var(--ink-2); }
  .tabbar .active .ic { stroke-width: 2.4; }
  .tabbar .tb-plus { align-self: center; justify-self: center; width: 52px; height: 52px; min-height: 52px; border-radius: 50%; background: var(--accent); color: var(--ink-2); box-shadow: 0 4px 14px rgba(27,42,74,.22); }
  .tabbar .nbadge { position: absolute; top: 6px; right: calc(50% - 22px); }
  .toasts { bottom: calc(var(--tabbar-h) + 12px); }
  .selbar { bottom: calc(var(--tabbar-h) + 8px); }
}
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 520px; margin: auto auto 0; border-radius: 18px 18px 0 0; background: var(--card); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(27,42,74,.38); }
@media (min-width: 768px) { dialog.sheet { margin: auto; border-radius: 18px; } }
.sheet-in { padding: 8px 14px 18px; max-height: 86vh; overflow: auto; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: 12px; color: var(--ink); font-size: 16px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.sheet-a:hover { background: var(--paper-2); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.sheet-x { font-size: 26px; min-width: 44px; }

/* chips, filters, view switch */
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: thin; }
.chipb { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; cursor: pointer; white-space: nowrap; }
.chipb:hover { border-color: var(--line-2); }
.chipb.on { background: var(--ink-2); color: var(--on-ink); border-color: var(--ink-2); }
.chipb .cnt, .vtab .cnt, .col-t .cnt { font-size: 12px; opacity: .72; font-weight: 700; }
.chipb input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.lib-filters { position: sticky; top: var(--tb-h); z-index: 20; background: var(--paper); margin: 0 -40px 14px; padding: 2px 40px 8px; border-bottom: 1px solid var(--line); }
.lib-sel { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.lib-sel .lib-count { margin-left: auto; font-size: 13px; }
.lib-l { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lib-l .field { min-height: 36px; padding-top: 4px; padding-bottom: 4px; width: auto; max-width: 200px; }
.viewsw { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.vsw { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; color: var(--muted); font-weight: 600; }
.vsw.on { background: var(--ink-2); color: var(--on-ink); }
.vsw .ic { width: 18px; height: 18px; }
.lib-foot { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 22px 0; }
.lib-count { color: var(--muted); }
.lib-empty { text-align: center; padding: 40px 0; grid-column: 1 / -1; }

/* video cards (Library, shelves) */
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.vcard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); min-width: 0; transition: box-shadow .15s, border-color .15s; }
.vcard:hover { border-color: var(--line-2); box-shadow: 0 6px 20px rgba(27,42,74,.09); }
.vcard.busy { border-color: var(--accent); }
.vc-img { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--soft); overflow: hidden; }
.vc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 40px/1 "Golos Heading", sans-serif; color: var(--ink-2); opacity: .35; }
.vc-live { position: absolute; left: 8px; bottom: 8px; background: rgba(27,42,74,.88); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 7px; }
.vc-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; min-width: 0; }
.vc-t { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.vc-chs { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.chp { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--c); color: var(--ink); max-width: 100%; }
.chp i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.badge.ch[style] { background: var(--card); box-shadow: inset 0 0 0 1px var(--c); color: var(--ink); }
.badge.ch.mine[style] { box-shadow: inset 0 0 0 1px var(--c), 0 0 0 2px var(--accent); }
.vc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.vc-st { background: var(--blue-soft); color: var(--ink-2); padding: 1px 8px; border-radius: 6px; font-weight: 650; }
.vc-st.st-ready { background: var(--green-soft); color: var(--green); }
.vc-st.st-uploaded { background: var(--paper-2); color: var(--muted); }
.vlist { display: flex; flex-direction: column; gap: 8px; }
.vcard.row { flex-direction: row; align-items: center; }
.vcard.row .vc-img { width: 144px; flex: none; }
.vcard.row .vc-body { flex: 1; padding: 8px 14px; }
.vcard.row .vc-t { min-height: 0; -webkit-line-clamp: 1; }
.appr-card { background: var(--yellow-soft); justify-content: center; }
@media (max-width: 1319px) { .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) { .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .vgrid { gap: 10px; }
  .vc-body { padding: 8px 10px 10px; gap: 4px; }
  .vc-t { font-size: 13.5px; }
  .vc-ph { font-size: 28px; }
  .vcard.row .vc-img { width: 104px; }
  .lib-filters { position: static; margin: 0 0 12px; padding: 0; border: 0; }
  .chipb { min-height: 44px; }
  .vsw span { display: none; }
  .vsw { min-width: 44px; justify-content: center; }
  .lib-l .field { max-width: 150px; min-height: 44px; }
  .shelf-all { min-height: 44px; }
}
@media (max-width: 1099px) and (min-width: 768px) { .lib-filters { margin: 0 -28px 14px; padding: 6px 28px 10px; } }

/* Home */
.status-strip { padding: 10px 16px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.st-row { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; min-width: 0; }
.st-l { flex: none; width: 128px; font-weight: 650; }
.st-v { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#cl-strip .st-v { white-space: normal; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.cl-ch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--paper-2); border-radius: 8px; padding: 2px 8px; }
.cl-tot, .cl-pod { font-weight: 600; }
.shelf { margin: 16px 0 0; }
.shelf-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.shelf-h h2 { font-size: 19px; }
.shelf-h h2 .sub { font-weight: 400; font-size: 13px; margin-left: 6px; }
.shelf-all { font-weight: 650; display: inline-flex; align-items: center; white-space: nowrap; }
.shelf-row { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.shelf-card { flex: 0 0 214px; scroll-snap-align: start; }
.shelf-card .vc-body { padding: 8px 10px 10px; gap: 4px; }
.shelf-card .vc-t { font-size: 14px; }
.shelf-empty { padding: 4px 0; }
@media (max-width: 767px) { .shelf-card { flex-basis: 184px; } .st-l { width: 84px; } .st-row { min-height: 28px; font-size: 13.5px; } .shelf-h h2 .sub { display: none; } .status-strip { padding: 8px 12px; } .gs-key { display: none; } }

/* cloud panel, tasks, cash tiles */
.cloud-panel { margin: 0 0 14px; }
.cl-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.cl-t th, .cl-t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 767px) { .cl-t thead { display: none; } .cl-t tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); } .cl-t td { display: flex; gap: 10px; border: 0; padding: 2px 0; } .cl-t td::before { content: attr(data-l); color: var(--muted); flex: 0 0 120px; } }
.task-sec { margin-bottom: 14px; }
.task-row { display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.cnt { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.hint-card { margin-bottom: 14px; background: var(--yellow-soft); }
.cash-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cash-tiles .tile { background: var(--paper-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cash-tiles .tile b { font-size: 22px; overflow-wrap: anywhere; }
.cash-tiles .cash-bal { background: var(--blue-soft); }
.cash-per h3 { margin: 14px 0 2px; }
.pop-panel { margin-bottom: 14px; }
@media (max-width: 767px) { .cash-tiles .tile b { font-size: 17px; } .cash-tiles { gap: 8px; } .cash-tiles .tile { padding: 10px; } }

/* Board */
.tcol.collapsed { padding: 6px 10px; }
.col-t { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0; color: inherit; }
.tcol-more { display: flex; align-items: center; justify-content: center; min-height: 40px; font-weight: 650; border-radius: 8px; background: var(--paper-2); }
.bstages { margin-bottom: 10px; }
@media (max-width: 767px) { .tboard { display: block; overflow: visible; } .tcol.one { background: none; padding: 0; } .tcard { padding: 10px; } .chips .chip { min-height: 44px; } .tcol-more { min-height: 44px; } }

@media (min-width: 768px) {
  .tboard { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; }
  .tboard .tcol { flex: 1 1 150px; min-width: 140px; }
  .tboard .tcol.collapsed { flex: 0 0 132px; min-width: 0; }
}
/* Feed */
.fd-day { margin: 18px 0 4px; font-size: 14px; color: var(--muted); text-transform: capitalize; }

/* Video page */
.vhead { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; margin: 6px 0 16px; align-items: start; }
.vprev img, .vprev-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; display: block; background: var(--soft); }
.vprev-ph { display: flex; align-items: center; justify-content: center; font: 800 56px/1 "Golos Heading", sans-serif; color: var(--ink-2); opacity: .5; }
.vfacts h1 { margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0 0 12px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.vtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 14px 0; scrollbar-width: thin; }
.vtab { flex: none; border: 0; background: none; padding: 0 16px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; font-size: 15px; }
.vtab:hover { color: var(--ink); }
.vtab.on, .vtab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.fr-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tf-img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tf-img img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.rv-wrap { display: flex; flex-direction: column; }
.rvb { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; border: 0; padding: 0 12px; font-weight: 700; font-size: 13px; cursor: pointer; color: #fff; text-align: left; }
.rvb.rv-ok { background: var(--green); } .rvb.rv-weak { background: #B7791F; } .rvb.rv-fail { background: var(--red); }
.rvb.rv-none { background: var(--paper-2); color: var(--muted); }
.rv-reason { padding: 8px 12px; font-size: 13px; background: var(--paper-2); overflow-wrap: anywhere; }
dialog.fviewer { width: min(1100px, 96vw); max-height: 94vh; border: 0; border-radius: 14px; padding: 0; background: #16181D; color: #fff; overflow: auto; }
dialog.fviewer::backdrop { background: rgba(0,0,0,.7); }
.fv-top { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.fv-top .sub { color: #BDB9AF; margin: 0; }
.fv-x { margin-left: auto; color: #fff; font-size: 26px; min-width: 44px; }
.fv-body { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; }
.fv-pic { display: flex; justify-content: center; }
.fv-pic img { max-width: 100%; max-height: 62vh; border-radius: 8px; }
.fv-nav { width: 44px; height: 64px; justify-self: center; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 30px; cursor: pointer; }
.fv-nav:disabled { opacity: .25; cursor: default; }
.fv-cap { padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.fv-cap .rv-wrap { max-width: 520px; border-radius: 8px; overflow: hidden; }
.fv-cap .rv-reason { color: var(--ink); }
.fv-narr { color: #E5E2DA; }
@media (max-width: 767px) {
  .vhead { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .facts { grid-template-columns: 96px minmax(0, 1fr); }
  .rvb { min-height: 44px; }
  .fv-body { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .fv-nav { width: 40px; }
  .tframes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .lib-head .grow { min-width: 0; } .lib-head .grow .sub { display: none; }
  .vprev img, .vprev-ph { aspect-ratio: auto; height: 150px; }
  .stage-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .stage-strip li { flex: none; }
  .vfacts h1 { font-size: 24px; margin-bottom: 6px; }
  .facts { gap: 2px 10px; margin-bottom: 8px; }
  .tabbar .nbadge { right: calc(50% - 30px); top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .vcard { transition: none; } }
@media (max-width: 767px) { #cl-strip .st-v { flex-basis: 0; } .st-l { width: 100px; } }
@media (max-width: 1099px) { .lib-l .field, .rvb { min-height: 44px; } }
@media (max-width: 1099px) { .chipb, .col-t { min-height: 44px; } }
/* chips wrap instead of overflowing (phone): long review/cloud lines break between words, names stay whole */
.cl-ch, .cl-tot, .cl-pod { white-space: normal; overflow-wrap: normal; max-width: 100%; }
.cl-ch b { flex: none; }
#rv-strip .st-v { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.cl-ch[class*="rv-"] { display: block; flex: 1 1 100%; }
.cl-ch[class*="rv-"] b { margin-right: 4px; }
@media (max-width: 767px) { .st-row .cl-ch, .st-row .cl-tot { overflow-wrap: anywhere; } .st-l { width: 84px; } }

/* ---- channel requests: questionnaire, "My channel", "Choose" (channel.js) */
.chb-form { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.chb-fld { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.chb-lbl { font-weight: 700; font-size: 14.5px; padding: 0; }
.chb-fld .field, .chb-cm .field { width: 100%; font-size: 16px; padding: 10px 12px; min-height: 44px; }
.chb-fld textarea.field, .chb-cm textarea.field { resize: vertical; font-family: inherit; }
.chb-cnt { align-self: flex-end; margin: 0; font-size: 12px; }
.chb-fld .field + .field { margin-top: 8px; }
.chb-radios { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.chb-r { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; }
.chb-r input { width: 18px; height: 18px; margin: 0; }
.chb-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.chb-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chb-acts .btn { min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }
.chb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.chb-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; color: inherit; text-decoration: none; }
.chb-card:hover { border-color: var(--line-2); }
.chb-card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.chb-card-go { color: var(--blue); font-weight: 700; margin-top: 4px; }
.chb-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 6px 0 14px; flex-wrap: wrap; }
.chb-steps li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chb-steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--line); margin-right: 2px; }
.chb-steps i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--paper-2); color: var(--muted); }
.chb-steps li.done { color: var(--ink); } .chb-steps li.done i { background: var(--green); color: #fff; }
.chb-steps li.cur { color: var(--ink); font-weight: 700; } .chb-steps li.cur i { background: var(--yellow); color: var(--ink); }
.chb-brief { margin: 10px 0 0; display: grid; gap: 8px; }
.chb-kv { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 10px; }
.chb-kv dt { color: var(--muted); font-size: 13px; } .chb-kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chb-briefbox { margin-bottom: 16px; } .chb-briefbox summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.chb-group { margin-bottom: 18px; }
.chb-opts { display: grid; gap: 12px; margin: 12px 0; }
.chb-styles { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.chb-voices, .chb-names, .chb-topics { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.chb-opt { border: 2px solid var(--line); border-radius: 12px; padding: 10px; background: var(--card); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chb-opt.on { border-color: var(--blue); background: var(--blue-soft); }
.chb-pick { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.chb-pick input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--blue); }
.chb-desc { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; padding-left: 32px; }
.chb-frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chb-th { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper-2); cursor: zoom-in; aspect-ratio: 16 / 9; min-height: 44px; }
.chb-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chb-opt audio { width: 100%; min-height: 40px; }
.chb-cm { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.chb-savebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.chb-savebar .sub { margin: 0; flex: 1; min-width: 160px; }
.chb-sum { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.chb-owner { margin-bottom: 16px; }
.chb-contract { margin: 12px 0; padding: 10px 12px; background: var(--paper-2); border-radius: 10px; font-size: 14px; }
.chb-contract ul { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.chb-contract li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chb-contract code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.chb-task { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--card); }
.chb-task > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; min-height: 44px; flex-wrap: wrap; }
.chb-task-t { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.chb-task-body { padding: 4px 14px 14px; }
.chb-home { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; border-left: 4px solid var(--yellow); }
.chb-home .btn { min-height: 44px; }
dialog.chb-zoom { border: 0; padding: 0; background: #14161b; color: #fff; width: min(960px, 96vw); max-height: 94vh; border-radius: 14px; overflow: hidden; }
dialog.chb-zoom::backdrop { background: rgba(10, 10, 12, .8); }
dialog.chb-zoom .fv-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
dialog.chb-zoom .fv-top .fv-x { margin-left: auto; min-width: 44px; min-height: 44px; color: #fff; }
dialog.chb-zoom .fv-body { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; }
dialog.chb-zoom .fv-nav { min-height: 56px; background: transparent; border: 0; color: #fff; font-size: 30px; cursor: pointer; }
dialog.chb-zoom .fv-nav:disabled { opacity: .25; cursor: default; }
dialog.chb-zoom .fv-pic img { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
@media (max-width: 767px) {
  .chb-two { grid-template-columns: 1fr; } .chb-kv { grid-template-columns: 1fr; gap: 2px; }
  .chb-styles, .chb-voices, .chb-names, .chb-topics { grid-template-columns: minmax(0, 1fr); }
  .chb-savebar .btn, .chb-acts .btn { flex: 1 1 100%; justify-content: center; }
  .chb-steps li span { display: none; } .chb-steps li.cur span, .chb-steps li.done:last-child span { display: inline; }
  dialog.chb-zoom .fv-body { grid-template-columns: 40px minmax(0, 1fr) 40px; }
}

/* Remarks (remarks.js): form sheet, list, status badges, script paragraphs */
dialog.rm-dlg { width: min(520px, 100%); }
.rm-form { display: flex; flex-direction: column; gap: 12px; }
.rm-to { overflow-wrap: anywhere; }
.rm-pic { width: 100%; max-height: 150px; object-fit: contain; border-radius: 10px; background: var(--paper-2); }
.rm-quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--yellow); background: var(--paper-2); border-radius: 0 10px 10px 0; font-size: 14px; overflow-wrap: anywhere; }
.rm-l { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.rm-l .field { width: 100%; font-weight: 400; }
.rm-types { border: 0; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rm-types legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.rm-type { position: relative; flex: 1 1 0; min-width: 96px; }
.rm-type input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rm-type span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 600; text-align: center; }
.rm-type input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.rm-type input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.rm-foot { display: flex; justify-content: flex-end; margin: -6px 0 0; }
.rm-foot .sub, .rm-note { margin: 0; }
.rm-form .acts { display: flex; gap: 10px; justify-content: flex-end; }
.rm-form .acts .btn { min-height: 44px; }
.rm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rm-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; border-left: 4px solid var(--blue); }
.rm-item.rm-s-in_progress { border-left-color: #E9BD26; } .rm-item.rm-s-done { border-left-color: var(--green); } .rm-item.rm-s-rejected { border-left-color: var(--red); }
.rm-item.rm-fresh { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.rm-item.hl, .sp.hl, .tframe.hl { outline: 3px solid var(--yellow); outline-offset: 2px; }
.rm-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rm-label { font-weight: 700; margin-right: auto; overflow-wrap: anywhere; }
.rm-st.rm-new { background: var(--blue-soft); color: var(--blue); } .rm-st.rm-in_progress { background: var(--yellow-soft); color: var(--amber-ink); }
.rm-st.rm-done { background: var(--green-soft); color: var(--green); } .rm-st.rm-rejected { background: var(--red-soft); color: var(--red); }
.rm-ty { background: var(--paper-2); color: var(--muted); }
.rm-where { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; overflow-wrap: anywhere; }
.rm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rm-meta { margin: 0; }
.rm-answer { background: var(--green-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.rm-answer p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rm-item.rm-s-rejected .rm-answer { background: var(--red-soft); }
.rm-own { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) auto; gap: 10px; align-items: end; border-top: 1px dashed var(--line); padding-top: 10px; }
.rm-own label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.rm-own .field { width: 100%; font-weight: 400; color: var(--ink); }
.rm-own .btn { align-self: end; min-height: 40px; }
.rm-filters { margin-bottom: 14px; }
.rm-chbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; background: var(--paper-2); border-radius: 12px; }
.rm-chbar .sub { margin: 0; }
.rm-acts { margin-top: 8px; }
.rm-n { text-decoration: none; }
.tf-acts { flex-wrap: wrap; }
.rm-shorts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rm-shorts .sh-main { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.rm-shorts .sh-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-cover { width: 48px; height: 85px; object-fit: cover; border-radius: 6px; flex: none; }
.sh-empty { margin-top: 12px; }
.rm-shorts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.sp-list { display: flex; flex-direction: column; gap: 6px; max-width: 820px; }
.sp-ch { margin: 14px 0 2px; }
.sp { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.sp p { margin: 0; overflow-wrap: anywhere; }
.sp-n { color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 3px; }
.sp-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sp-raw { margin-top: 14px; }
@media (max-width: 767px) {
  dialog.rm-dlg { max-width: 100%; }
  .rm-own { grid-template-columns: minmax(0, 1fr); }
  .rm-own .btn { width: 100%; justify-content: center; }
  .rm-form .acts .btn { flex: 1; justify-content: center; }
  .sp { grid-template-columns: 22px minmax(0, 1fr); }
  .sp-acts { grid-column: 2; justify-content: flex-start; }
  .rm-acts .btn, .rm-chbar .btn { flex: 1 1 auto; justify-content: center; }
  .rm-chbar { flex-direction: column; align-items: stretch; }
}
.rm-manage { border-top: 1px dashed var(--line); padding-top: 4px; }
.rm-manage > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; color: var(--blue); }
.rm-manage .rm-own { border-top: 0; padding-top: 4px; }
.chb-cardwrap { display: flex; flex-direction: column; gap: 8px; }
.chb-cardwrap .chb-card { flex: 1; }
.chb-fixed { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); overflow-wrap: anywhere; min-height: 44px; }
.chb-locked-note { margin: 0; }
.chb-edited { margin-bottom: 6px; }

/* script approval (PR C) */
.appr-block { margin: 12px 0; border-left: 4px solid var(--yellow); }
.appr-block.appr-approved { border-left-color: var(--green); }
.appr-block.appr-auto_approved { border-left-color: var(--blue); }
.appr-block .ap-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; }
.appr-block .ap-left { font-weight: 800; font-size: 19px; color: var(--amber); }
.appr-block .ap-d { margin-bottom: 10px; overflow-wrap: anywhere; }
.appr-block .ap-chg { margin: 0 0 10px; }
.appr-block .head-acts { margin-top: 2px; }
.ap-b { white-space: normal; text-align: left; }
.vcard.appr-wait .vc-date { color: var(--amber); font-weight: 700; }
@media (max-width: 767px) {
  .appr-block .head-acts .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- Results, weekly reports, breakdown (PR D) */
.rs-conn .rs-top, .brk-block h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-conn { margin-bottom: 16px; } .rs-conn .rs-linked { margin: 8px 0 2px; overflow-wrap: anywhere; } .rs-conn .hint { margin: 10px 0 0; }
.rs-conn .head-acts { margin-top: 12px; } .rs-conn.rs-expired { border-left: 4px solid var(--amber); }
.rs-chn { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 14px; font-weight: 400; }
.res-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 8px; align-items: start; }
.res-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.res-tile { background: var(--paper-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res-tile b { font-size: 21px; overflow-wrap: anywhere; } .res-neg { color: var(--red); }
.res-src { list-style: none; margin: 12px 0 0; padding: 0; } .res-src li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 14px; }
.res-vh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .res-vh .chiprow { overflow-x: visible; flex-wrap: wrap; }
.res-h3 { margin: 18px 0 8px; } .res-rule, .res-empty { margin: 10px 0; }
table.res-t { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.res-t th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.res-t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.res-t td.num { white-space: nowrap; text-align: right; } .res-t th:nth-child(n+2):nth-child(-n+5) { text-align: right; }
.res-t .res-srcs { font-size: 13px; color: var(--muted); } .res-t tr:last-child td { border-bottom: 0; }
@media (max-width: 1099px) {
  .res-t thead { display: none; } .res-t, .res-t tbody, .res-t tr, .res-t td { display: block; width: 100%; }
  .res-t { background: none; border: 0; } .res-t tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .res-t td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .res-t td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; flex: 0 0 auto; }
  .res-t td.res-title { font-weight: 700; text-align: left; justify-content: flex-start; flex-wrap: wrap; } .res-t td.res-title::before { display: none; }
  .res-t td.act { justify-content: flex-end; } .res-t td.act:empty { display: none; }
}
@media (max-width: 767px) { .res-tile b { font-size: 18px; } .res-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rep-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.rep-a { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); min-height: 44px; }
.rep-a:hover { border-color: var(--line-2); } .rep-w { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--blue); } .rep-t { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.rep-md { overflow-wrap: anywhere; line-height: 1.6; } .rep-md h2 { font-size: 20px; margin: 22px 0 8px; } .rep-md h2:first-child, .rep-md h3:first-child { margin-top: 0; }
.rep-md h3 { font-size: 17px; margin: 18px 0 6px; } .rep-md h4 { font-size: 15px; margin: 14px 0 4px; } .rep-md p { margin: 8px 0; }
.rep-md ul, .rep-md ol { margin: 8px 0; padding-left: 22px; } .rep-md li { margin: 3px 0; } .rep-md code { font-family: var(--mono); font-size: 13px; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }
.rep-md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; } .rep-md a { text-decoration: underline; }
.rq-id { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700; background: var(--blue-soft); color: var(--blue); border-radius: 6px; padding: 0 6px; }
.rp-form { margin-top: 16px; } .rp-q { margin: 16px 0; } .rp-q label { display: block; font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
.rp-q textarea { width: 100%; min-height: 84px; resize: vertical; } .rp-by { margin-top: 4px; min-height: 1em; }
.brk-block { margin-bottom: 16px; border-left: 4px solid var(--blue); } .brk-block h2 { margin-bottom: 6px; } .bk-src { margin-top: 8px; }
.res-grid > .card { margin: 0; } .res-tile b { font-size: 19px; }

/* help page (PR E) */
.help-wrap { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.help-sec { padding: 16px 18px; } .help-sec h2 { font-size: 18px; margin-bottom: 8px; }
.help-sec ul { margin: 0 0 12px; padding-left: 20px; } .help-sec li { margin: 5px 0; overflow-wrap: anywhere; }
.help-done { margin: 6px 0 24px; } .um-help { justify-content: flex-start; gap: 8px; }
@media (max-width: 767px) { .help-sec { padding: 14px; } .help-done .btn { width: 100%; white-space: normal; height: auto; min-height: 44px; } }

/* ---- channel voice (voice.js) */
.vp-chs { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.vp-chs .chipb { min-height: 44px; }
.vp-top { margin-bottom: 18px; }
.vp-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 32px; }
.vp-k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.vp-v { margin-top: 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vp-n { font-size: 20px; font-family: "Golos Heading", "Segoe UI", sans-serif; }
.vp-n.zero { color: var(--red); }
.vp-owner { margin-left: auto; }
.vp-owner .btn, .vp-top .btn { min-height: 44px; }
.vp-note { margin: 10px 0 0; }
.vp-locked, .vp-limit { margin: 12px 0 0; }
.vp-limit[hidden] { display: none; }
.vp-phrase { display: block; margin-top: 16px; }
.vp-phrase textarea { display: block; width: 100%; margin-top: 6px; min-height: 76px; padding: 10px 12px; font-size: 15px; resize: vertical; }
.vp-phrase-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.vp-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .vp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vp-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vp-card.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.vp-card-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vp-desc { margin: 0; }
.vp-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.vp-acts .btn { min-height: 44px; justify-content: center; flex: 1 1 130px; }
.vp-listen.busy { opacity: .6; }
.vp-player audio { width: 100%; height: 44px; }
.vp-player:empty { display: none; }
.vp-err { margin: 0; }
.vp-foot { margin-top: 16px; }
.vp-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; border-left: 4px solid var(--blue); }
.vp-banner h2 { margin-bottom: 2px; }
.vp-banner-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.vp-banner .btn { min-height: 44px; }
.vp-links { margin-bottom: 16px; }
.vp-links h2 { margin-bottom: 4px; }
.vp-linkrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.vp-linkrow .btn { min-height: 44px; }
.rm-chbar .vp-lnk { min-height: 44px; }

/* member voice credits on the "Voice" tile */
.tile-voice .bar { margin: 4px 0 2px; height: 6px; }
.tile-voice .sub, .tile-voice .tile-warn { font-size: 11.5px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; margin: 0; }
.tile-warn[data-voice-reason] { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.voice-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.voice-card .btn { min-height: 44px; }
.voice-card .tile-voice { flex: 1 1 220px; min-width: 0; }
.ai-box { margin-bottom: 14px; } .ai-box summary { cursor: pointer; font-weight: 650; min-height: 32px; display: flex; align-items: center; }
.ai-box .budget { margin-top: 10px; } .ai-l { display: block; margin-top: 10px; font-size: 13.5px; color: var(--muted); } .ai-l .field { display: block; width: 100%; margin-top: 4px; }
.ai-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; } .ai-acts > div { flex: 1 1 220px; min-width: 0; } .ai-acts .btn { width: 100%; min-height: 44px; } .ai-acts .sub { margin: 4px 0 0; }
.ai-box .tips { margin-top: 12px; }
/* ---- budget for paid steps (member card / Home) and the owner's top-up row on the Friends page ---- */
.budget { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.budget .b-main { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; font-size: 14px; margin-bottom: 6px; }
.budget .b-h { color: var(--muted); font-size: 12.5px; }
.budget .b-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.budget.low { background: var(--yellow-soft); border-color: var(--amber-line); }
.budget.out { background: var(--amber-soft); border-color: var(--amber-line); } .budget.out .b-sub { color: var(--amber-ink); font-weight: 600; }
.budget.off { background: var(--paper-2); } .budget.off .b-main { margin-bottom: 0; }
.budget .meter-bar { height: 6px; }
.budget.low .meter-bar i, .budget.out .meter-bar i { background: #E0A800; }
.u-budget { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.u-topup { display: inline-flex; align-items: center; gap: 6px; }
.u-topup .field { width: 96px; padding: 6px 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .u-topup .field { min-height: 44px; font-size: 16px; } }

/* ===================== "Ask Claude" chat panel (ask.js) ===================== */
button.tb-ask { border: 0; font: inherit; cursor: pointer; }
.head .head-acts { align-items: center; }
dialog.askp { border: 0; padding: 0; background: var(--card); color: var(--ink); width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; overflow: hidden; }
dialog.askp::backdrop { background: rgba(27,42,74,.38); }
.ak-in { display: flex; flex-direction: column; height: 100%; padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 10px; min-height: 0; }
.ak-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ak-h h2 { margin: 0; font-size: 19px; font-family: -apple-system, "Segoe UI", system-ui, sans-serif; }
.ak-sub { margin: -4px 0 0; font-size: 13px; line-height: 1.4; }
.ak-btns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.ak-x { min-width: 44px; min-height: 44px; font-size: 26px; line-height: 1; justify-content: center; padding: 0; flex: none; }
#ak-budget .budget { margin-bottom: 0; }
.ak-log { flex: 1 1 auto; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; overscroll-behavior: contain; }
.ak-empty h3 { margin: 6px 0 10px; font-size: 16px; }
.ak-chips { display: flex; flex-direction: column; gap: 8px; }
.ak-chip { min-height: 44px; text-align: left; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.ak-chip:hover:not(:disabled) { background: var(--blue-soft); border-color: var(--blue-2); }
.ak-chip:disabled { opacity: .55; cursor: default; }
.ak-msg { max-width: 92%; padding: 9px 13px; border-radius: 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.ak-msg.me { align-self: flex-end; background: var(--blue-soft); border-bottom-right-radius: 4px; }
.ak-msg.ai { align-self: flex-start; background: var(--paper-2); border-bottom-left-radius: 4px; }
.ak-msg.pending { color: var(--muted); font-style: italic; }
.ak-msg.err { align-self: stretch; max-width: 100%; background: var(--red-soft); color: var(--red); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ak-who { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.ak-txt { white-space: pre-wrap; }
.ak-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ak-state { padding: 10px 14px; border-radius: 12px; background: var(--paper-2); font-size: 14px; line-height: 1.45; border: 1px solid var(--line); }
.ak-state.out { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-ink); }
.ak-form { display: flex; gap: 8px; align-items: flex-end; }
.ak-form textarea { flex: 1 1 auto; min-width: 0; min-height: 48px; max-height: 150px; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.ak-form.off textarea { background: var(--paper-2); }
.ak-send { flex: none; min-height: 48px; justify-content: center; padding: 0 18px; }
.ak-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; justify-content: space-between; }
.ak-foot .sub { font-size: 12.5px; }
@media (min-width: 768px) {
  dialog.askp { width: 440px; max-width: 440px; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-radius: 18px 0 0 18px; box-shadow: -8px 0 30px rgba(27,42,74,.18); }
  .ak-in { padding: 18px 18px 16px; }
}
.ak-new[hidden], .ak-cnt[hidden], .ak-state[hidden] { display: none; }
/* director mode (stage 1): new-video form, "Your ideas", mode switch and approval gates */
dialog.modal.nv-modal { width: min(640px, 96vw); max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; }
.nv-modal form { gap: 12px; }
.nv-row { display: flex; flex-wrap: wrap; gap: 12px; } .nv-row > label { flex: 1 1 180px; min-width: 0; }
.nv-mode { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nv-mode legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 6px; }
.modal .nv-opt { flex-direction: row; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--ink); font-weight: 400; min-height: 44px; }
.nv-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.nv-opt input { margin: 3px 0 0; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--blue); }
.nv-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .nv-opt b { font-size: 14px; } .nv-opt small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.modal textarea.br-text { min-height: 160px; max-height: 50vh; font-size: 14.5px; line-height: 1.45; }
.br-cnt { align-self: flex-end; font-variant-numeric: tabular-nums; } .br-cnt.over { color: var(--red); font-weight: 700; }
.br-files { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .br-files > .br-files-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.modal .br-files .br-pick { align-self: flex-start; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; min-height: 44px; cursor: pointer; color: var(--ink); }
.br-input:focus-visible + .br-pick { outline: 2px solid var(--blue); outline-offset: 2px; }
.br-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.br-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px 6px 10px; min-width: 0; }
.br-list li.new { border-style: dashed; } .br-list .br-n { font-weight: 650; overflow-wrap: anywhere; min-width: 0; flex: 1 1 140px; } .br-list .sub { margin: 0; font-size: 12.5px; }
.br-list .btn { min-height: 36px; margin-left: auto; }
.dir-bar { margin: 0 0 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dir-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; } .dir-h { font-weight: 700; }
.dir-top .seg { display: inline-flex; gap: 4px; } .dir-top .btn { min-height: 36px; } .dir-ideas { margin-left: auto; }
.dir-d { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.dir-gates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; } .dir-gates .btn { min-height: 36px; }
.ai-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; } .ai-brief .btn { min-height: 36px; }
@media (max-width: 900px) {   /* phone + tablet: 44px tap targets */
  .dir-top .btn, .dir-gates .btn, .ai-brief .btn, .br-list .btn, .nv-modal .acts .btn { min-height: 44px; }
}
@media (max-width: 520px) {
  .nv-mode { grid-template-columns: minmax(0, 1fr); }
  .modal.nv-modal form { padding: 18px 16px; }
  .dir-ideas { margin-left: 0; }
  .dir-gates .btn { width: 100%; justify-content: center; }
  .nv-modal .acts .btn { flex: 1 1 0; justify-content: center; }
}
/* AI editor (stage 2): script edit by instruction, review by chapter, "ask to redo" notes on frames */
.ed-card { margin: 0 0 14px; } .ed-card > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ed-in { width: 100%; min-height: 84px; resize: vertical; margin-top: 4px; }
.ed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; } .ed-foot .sub { margin: 0; } .ed-foot .grow { flex: 1 1 0; }
.ed-rev { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ed-ask, .ed-sumry { font-size: 14px; overflow-wrap: anywhere; }
.ed-ch { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.ed-ck { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; cursor: pointer; min-height: 36px; }
.ed-ck input { width: 18px; height: 18px; accent-color: var(--blue); flex: 0 0 auto; margin: 0; } .ed-t { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.ed-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.ed-col { min-width: 0; border-radius: 9px; padding: 8px 10px; } .ed-col.old { background: var(--red-soft); } .ed-col.new { background: var(--green-soft); }
.ed-ct { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ed-tx { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; max-height: 360px; overflow-y: auto; }
.ed-tx del { background: rgba(194,59,50,.22); text-decoration: line-through; } .ed-tx ins { background: rgba(31,138,91,.28); text-decoration: none; }
.ed-hist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; } .ed-hist li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; overflow-wrap: anywhere; min-width: 0; }
.scene-acts [data-freq] { white-space: normal; }
@media (max-width: 900px) { .ed-foot .btn, .ed-ck { min-height: 44px; } .scene-acts [data-freq] { min-height: 44px; } }
@media (max-width: 700px) { .ed-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .ed-foot .btn { flex: 1 1 100%; justify-content: center; } .ed-tx { max-height: 280px; } }
/* director mode, stage 3: redraw the marked frames, re-voice after a script edit (status lines + cost preview) */
.rd-card { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.rd-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.rd-txt { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; } .rd-txt .sub { margin: 2px 0 0; }
.rd-st { font-size: 14px; padding: 8px 10px; border-radius: 9px; background: var(--paper-2); overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rd-st.done { background: var(--green-soft); } .rd-st.failed, .rd-st.waiting_prompts { background: var(--red-soft); } .rd-st.queued, .rd-st.running { background: var(--blue-soft); }
.ed-card .rd-st { margin-top: 8px; }
.rd-cost { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.dlg-body p { margin: 0; }
.rv-st { margin: 0 0 10px; }
.rd-modal .acts { flex-wrap: wrap; }
@media (max-width: 520px) { .rd-main .btn, .rd-modal .acts .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; } }

/* ---------------------------------------------------------------- LYS Studio extras (19.10): calm cards, one primary action */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xr-l { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
.xr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.xr-top output { font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.xr-h { font-weight: 400; }
.xrange { width: 100%; accent-color: var(--blue); height: 28px; margin: 0; }
.why { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; flex-basis: 100%; }
.why-wrap { display: inline-flex; }
.why-wrap .btn[disabled] { pointer-events: none; }
/* usage bars */
.usage { margin-top: 22px; }
.us-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.us-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.us-pct { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.us-bar { height: 8px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin: 8px 0 6px; }
.us-bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .3s; }
.us-high .us-bar i { background: var(--amber); } .us-full .us-bar i { background: var(--red); } .us-full .us-pct { color: var(--red); font-weight: 650; }
.us-sub { font-size: 12.5px; }
.us-off { margin: 12px 0 0; }
/* getting started checklist */
.ob { margin-bottom: 18px; }
.ob-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ob-head h2 { margin: 0; }
.ob-bar { margin: 12px 0 14px; }
.ob-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ob-step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-step:first-child { border-top: 0; }
.ob-ck { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--paper-2); color: var(--muted); }
.ob-step.done .ob-ck { background: var(--green-soft); color: var(--green); }
.ob-step.next .ob-ck { background: var(--blue); color: #fff; }
.ob-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-txt .sub { margin: 0; font-size: 13px; }
.ob-step.done .ob-txt b { color: var(--muted); font-weight: 600; }
/* music */
.mu-now { margin: 12px 0 4px; font-weight: 600; }
.mu-sec { margin-top: 16px; }
.mu-k { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.mu-k .sub { font-weight: 400; margin-left: 6px; }
.mu-moods { display: flex; flex-wrap: wrap; gap: 8px; }
.mu-moods .chipb[disabled] { opacity: .45; cursor: not-allowed; }
.mu-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mu-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px 6px 4px; background: var(--card); }
.mu-row.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; background: var(--blue-soft); }
.mu-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px; text-align: left; cursor: pointer; min-height: 44px; }
.mu-radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); }
.mu-row.on .mu-radio { border-color: var(--blue); background: radial-gradient(circle, var(--blue) 0 45%, transparent 50%); }
.mu-t { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.badge.ghost { background: var(--paper-2); color: var(--muted); }
.mu-play { flex: none; white-space: nowrap; }
.mu-play.busy { opacity: .7; }
.mu-acts { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.mu-after { margin-top: 10px; font-size: 13px; }
.mu-empty { margin-top: 12px; }
.mu-up { margin-top: 18px; }
.mu-up summary { cursor: pointer; font-weight: 650; }
/* video head: re-render + character */
.xr-acts { flex-wrap: wrap; align-items: center; }
.xr-acts .btn .ic { width: 16px; height: 16px; }
/* character (LoRA) requests */
dialog.lr-modal { width: min(720px, 96vw); max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; }
.lr-more { margin-top: 10px; }
dialog.lr-modal .acts { position: sticky; bottom: -1px; background: var(--card); padding: 12px 0 4px; margin-bottom: -4px; border-top: 1px solid var(--line); }
.lr-k { margin: 14px 0 8px; font-weight: 600; font-size: 14px; }
.lr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.lr-fr { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--paper-2); cursor: pointer; aspect-ratio: 16 / 9; position: relative; }
.lr-fr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lr-fr.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.lr-fr.on::after { content: "✓"; position: absolute; top: 4px; right: 6px; background: var(--blue); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.lr-lh { margin: 26px 0 12px; }
.lr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lr-item { padding: 16px 18px; }
.lr-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lr-txt { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lr-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lr-thumbs img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.lr-own { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.lr-own label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.lr-own .grow { flex: 1 1 220px; }
/* voice tone */
.vt2 { margin-top: 22px; }
.vt2-f { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.vt2-f[disabled] { opacity: .55; }
.vt2-pre { display: flex; flex-wrap: wrap; gap: 8px; }
.vt2-sl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
.vt2-v { max-width: 360px; }
.vt2-acts { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.vt2-player audio { width: 100%; max-width: 480px; margin-top: 12px; }
.vp-mine { margin-top: 2px; font-size: 12.5px; } .vp-mine.zero { color: var(--red); }
.nv-len { flex: 1 1 260px; min-width: 0; }
@media (max-width: 899px) {
  .vt2-sl { grid-template-columns: minmax(0, 1fr); }
  /* one page scroll on phones and tablets: no inner scroll boxes with their own max-height */
  .col, .script-ro, details.more .md, .ed-tx, pre.log, .sp-list { max-height: none !important; overflow: visible !important; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .tboard { display: block !important; overflow: visible !important; }
  .tboard .tcol { margin-bottom: 12px; }
  .us-list { grid-template-columns: minmax(0, 1fr); }
  .mu-acts .btn, .vt2-acts .btn, .mu-acts .why-wrap { flex: 1 1 100%; justify-content: center; }
  .mu-acts .why-wrap .btn { width: 100%; }
  .xrange { height: 36px; }
}
@media (max-width: 520px) {
  .mu-row { flex-wrap: wrap; padding: 6px; gap: 4px; }
  .mu-pick { flex: 1 1 100%; }
  .mu-play { margin: 0 0 6px 36px; }
  .ob-step { flex-wrap: wrap; }
  .ob-step .btn { margin-left: 42px; }
}

/* ===================== Claude-like theme + pipeline canvas (21.10.2026) =====================
   One accent (terracotta), warm neutrals, light + dark. Every colour above reads these tokens; dark mode = system setting
   unless the user picked one (html[data-theme], theme.js). */
:root {
  --paper: #FAF9F5; --paper-2: #F0EEE6; --card: #FFFFFF; --ink: #1F1E1D; --text-2: #4D4B45; --muted: #77736A;
  --line: #E8E5DC; --line-2: #D3CEC2; --surface-2: #FBFAF7; --side-bg: #F5F4EE; --hover: #ECE9E0; --active-bg: #E6E2D7;
  --blue: #C96442; --blue-2: #B4573A; --blue-soft: #F7EAE3; --blue-line: #EBCBBE; --accent: #C96442; --ink-2: #1F1E1D; --soft: #ECE9E0;
  --on-ink: #FAF9F5; --yellow: #E3A93C; --yellow-soft: #FBF3DF; --amber: #A86B12; --amber-soft: #FBECDA; --amber-ink: #87560F; --amber-line: #EAD39C;
  --green: #2F7D5B; --green-soft: #E6F2EA; --green-line: #BFE0CD; --red: #B8432F; --red-soft: #F9E6E2; --red-line: #EFC5BC;
  --radius: 14px; --shadow: 0 1px 2px rgba(31,30,28,.04), 0 2px 10px rgba(31,30,28,.04);
  --font: "Inter", ui-sans-serif, -apple-system, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --bp-bg: #F3F1EA; --bp-grid: rgba(31,30,29,.07); --bp-grid-2: rgba(31,30,29,.035); --bp-edge: #BDB7A9; --bp-edge-on: var(--accent);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #1F1E1D; --paper-2: #2A2926; --card: #262624; --ink: #ECEAE4; --text-2: #CBC7BD; --muted: #A09C92;
  --line: #3A3935; --line-2: #4B4943; --surface-2: #2B2A27; --side-bg: #1A1918; --hover: #2E2D2A; --active-bg: #353330;
  --blue: #D97757; --blue-2: #E2896B; --blue-soft: #3A2A23; --blue-line: #6A4335; --accent: #D97757; --ink-2: #ECEAE4; --soft: #353330;
  --on-ink: #1F1E1D; --yellow: #E3A93C; --yellow-soft: #352E1F; --amber: #E0A54A; --amber-soft: #3B2E1E; --amber-ink: #F0C27A; --amber-line: #6B5428;
  --green: #3F9E6E; --green-soft: #1E3128; --green-line: #2F5A43; --red: #D9604B; --red-soft: #3B2420; --red-line: #6E3A31;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 2px 12px rgba(0,0,0,.18);
  --bp-bg: #181716; --bp-grid: rgba(236,234,228,.07); --bp-grid-2: rgba(236,234,228,.03); --bp-edge: #5A5750;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1F1E1D; --paper-2: #2A2926; --card: #262624; --ink: #ECEAE4; --text-2: #CBC7BD; --muted: #A09C92;
    --line: #3A3935; --line-2: #4B4943; --surface-2: #2B2A27; --side-bg: #1A1918; --hover: #2E2D2A; --active-bg: #353330;
    --blue: #D97757; --blue-2: #E2896B; --blue-soft: #3A2A23; --blue-line: #6A4335; --accent: #D97757; --ink-2: #ECEAE4; --soft: #353330;
    --on-ink: #1F1E1D; --yellow: #E3A93C; --yellow-soft: #352E1F; --amber: #E0A54A; --amber-soft: #3B2E1E; --amber-ink: #F0C27A; --amber-line: #6B5428;
    --green: #3F9E6E; --green-soft: #1E3128; --green-line: #2F5A43; --red: #D9604B; --red-soft: #3B2420; --red-line: #6E3A31;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 2px 12px rgba(0,0,0,.18);
    --bp-bg: #181716; --bp-grid: rgba(236,234,228,.07); --bp-grid-2: rgba(236,234,228,.03); --bp-edge: #5A5750;
    color-scheme: dark;
  }
}
html, body { background: var(--paper); }
body { font: 15px/1.6 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: -.012em; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.01em; }
a { color: var(--blue); }
.card { border-color: var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.btn { border-radius: 10px; font-weight: 550; transition: background .15s, border-color .15s, color .15s, transform .15s; background: var(--card); color: var(--ink); border-color: var(--line); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.primary { color: #fff; }
.field, select, input, textarea { color: var(--ink); }
.field, select { background: var(--card); border-color: var(--line); }
.topbar { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); }
.topbar .brand, .brand { color: var(--ink); }
.tb-ask { background: var(--soft); color: var(--ink); font-weight: 600; }
.tb-ask:hover { background: var(--active-bg); }
.tb-ask .ic { color: var(--accent); }
.avatar { background: var(--accent); color: #fff; }
.nav a.active { box-shadow: none; background: var(--active-bg); }
.nbadge { background: var(--accent); color: #fff; }
.gs-input { background-color: var(--card); color: var(--ink); }
.gs-res, .um-pop { background: var(--card); }
.tabbar { background: var(--paper) !important; border-top: 1px solid var(--line); }
.tabbar .tb-plus { background: var(--accent); color: #fff; }
.tabbar .active { color: var(--accent); }
dialog { color: var(--ink); }
.modal, dialog.sheet, dialog.askp { background: var(--card); color: var(--ink); }
.langsw button.on { background: var(--ink); color: var(--on-ink); }
.vtab.on, .vtab[aria-selected="true"] { border-bottom-color: var(--accent); }
.tabs button.active { border-color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
@keyframes lys-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { .pc-work, .composer { animation: lys-in .25s ease-out both; } }
img { color: var(--muted); }

/* theme switch in the top bar */
.tb-theme .ic { width: 20px; height: 20px; }
.theme-sw { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.theme-sw button { border: 0; background: none; min-height: 36px; padding: 0 10px; cursor: pointer; color: var(--muted); font-size: 13px; }
.theme-sw button.on { background: var(--active-bg); color: var(--ink); font-weight: 600; }

/* sidebar: recent videos like a conversation list */
.side-recents { display: flex; flex-direction: column; gap: 1px; }
.side-recents a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; }
.side-recents a:hover { background: var(--hover); color: var(--ink); }
.side-recents a.active { background: var(--active-bg); color: var(--ink); font-weight: 600; }
.side-recents .rt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-recents .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.sdot.s-done { background: var(--green); } .sdot.s-run { background: var(--yellow); animation: pulse 1.2s infinite; } .sdot.s-error { background: var(--red); }
body.side-min .side-recents, body.side-min .side-recents-l { display: none; }
@media (min-width: 768px) and (max-width: 1099px) { .side-recents, .side-recents-l { display: none; } body.side-open .side-recents { display: flex; } body.side-open .side-recents-l { display: block; } }

/* "What should we do with this video?" composer */
.composer { position: relative; display: flex; align-items: flex-end; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 16px; box-shadow: 0 1px 2px rgba(31,30,28,.04), 0 6px 24px rgba(31,30,28,.05); transition: border-color .15s, box-shadow .15s; margin: 4px 0 16px; }
.composer:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), 0 6px 24px rgba(31,30,28,.06); }
.composer textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font: 16px/1.5 var(--font); color: var(--ink); min-height: 28px; max-height: 160px; padding: 4px 0; }
.composer textarea::placeholder { color: var(--muted); }
.composer .cp-send { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .15s, transform .15s; }
.composer .cp-send:disabled { opacity: .35; cursor: default; }
.composer .cp-send .ic { width: 20px; height: 20px; }
.cp-row { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; }
.cp-chip { border: 1px solid var(--line); background: var(--card); color: var(--text-2); border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cp-chip:hover { border-color: var(--line-2); color: var(--ink); }

/* ---- pipeline workspace: blueprint canvas + side panel */
.pc-work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 0 18px; }
.pc-canvas { position: relative; height: clamp(440px, calc(100vh - var(--tb-h) - 150px), 760px); border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background-color: var(--bp-bg);
  background-image: linear-gradient(var(--bp-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px),
    linear-gradient(var(--bp-grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--bp-grid-2) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pc-canvas.drag { cursor: grabbing; }
.pc-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.pc-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.pc-edges path { fill: none; stroke: var(--bp-edge); stroke-width: 2; }
.pc-edges path.on { stroke: var(--green); stroke-opacity: .55; }
.pc-edges path.flow { stroke: var(--accent); stroke-dasharray: 6 8; animation: pc-flow 1s linear infinite; stroke-opacity: 1; }
@keyframes pc-flow { to { stroke-dashoffset: -14; } }
.pc-edges circle { fill: var(--bp-bg); stroke: var(--bp-edge); stroke-width: 2; }
.pc-node { position: absolute; width: 208px; text-align: left; padding: 0; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(31,30,28,.07); cursor: pointer; font: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pc-node:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pc-node.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 8px 24px rgba(31,30,28,.10); }
.pc-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pc-node .pn-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; height: 40px; }
.pc-node .pn-n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; width: 16px; flex: none; }
.pc-node .pn-t { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-node .pn-b { padding: 0 12px 11px; display: flex; flex-direction: column; gap: 5px; }
.pn-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.st-done .pn-dot { background: var(--green); } .st-done .pn-st { color: var(--green); }
.st-run .pn-dot { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: pc-ping 1.4s infinite; } .st-run .pn-st { color: var(--accent); }
.st-error .pn-dot { background: var(--red); } .st-error .pn-st { color: var(--red); }
.st-wait .pn-dot { background: var(--line-2); }
@keyframes pc-ping { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pc-node.st-run { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pc-node.st-error { border-color: var(--red-line); }
.pn-f { font-size: 12.5px; color: var(--text-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pn-bar { height: 4px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.pn-bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width .4s; }
.st-run .pn-bar i { background: var(--accent); } .st-error .pn-bar i { background: var(--red); } .st-wait .pn-bar i { background: var(--line-2); }
.pn-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-2); border-top: 1px solid var(--line); }
.pn-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; border-top: 1px solid var(--line); background: var(--line); }
.pn-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--paper-2); }
.pc-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); z-index: 3; }
.pc-tools button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.pc-tools button:hover { background: var(--hover); }
.pc-tools .pc-z { min-width: 48px; width: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-top { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.pc-sum { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 13px; box-shadow: var(--shadow); max-width: 100%; }
.pc-sum b { font-weight: 600; }
.pc-sum .pn-bar { width: 80px; }
.pc-mini { position: absolute; right: 12px; bottom: 12px; width: 168px; height: 64px; background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--line); border-radius: 10px; z-index: 3; overflow: hidden; cursor: pointer; }
.pc-mini i { position: absolute; border-radius: 2px; background: var(--line-2); }
.pc-mini i.st-done { background: var(--green); opacity: .7; } .pc-mini i.st-run { background: var(--accent); } .pc-mini i.st-error { background: var(--red); }
.pc-mini .vp { position: absolute; border: 1.5px solid var(--accent); border-radius: 3px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pc-hint { position: absolute; right: 12px; top: 12px; z-index: 3; font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
/* side panel with the stage's existing controls */
.pc-drawer { min-width: 0; }
.pc-dh { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pc-dh h2 { font-size: 17px; margin: 0; }
.pc-dh .pd-facts { color: var(--text-2); font-size: 13.5px; margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.pc-dh .pd-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pc-dx { margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.pc-dx:hover { background: var(--hover); color: var(--ink); }
.pc-db { padding: 4px 16px 18px; }
.pc-db > .vtabs:first-child, .pc-db > .tabs:first-child { margin-top: 6px; }
@media (min-width: 1100px) {
  .pc-work.open { grid-template-columns: minmax(0, 1fr) clamp(400px, 38%, 600px); align-items: start; }
  .pc-work.open .pc-drawer { position: sticky; top: calc(var(--tb-h) + 12px); height: clamp(440px, calc(100vh - var(--tb-h) - 150px), 760px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overscroll-behavior: contain; }
  .pc-work.open .pc-drawer .vhead { grid-template-columns: 1fr; }
  .pc-work:not(.open) .pc-dh .pc-dx { display: none; }
  .pc-work:not(.open) .pc-dh { display: none; }
}
@media (max-width: 1099px) {
  .pc-dx { display: none; }
  .pc-drawer { scroll-margin-top: calc(var(--tb-h) + 8px); }
  .pc-dh { padding: 12px 0; }
  .pc-db { padding: 4px 0 0; }
}
/* phone: vertical list of steps instead of the canvas */
.pc-list { display: none; list-style: none; margin: 0; padding: 0; position: relative; }
@media (max-width: 699px) {
  .pc-canvas { display: none; }
  .pc-list { display: flex; flex-direction: column; gap: 0; }
}
.pc-list li { position: relative; padding-left: 26px; }
.pc-list li::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.pc-list li:first-child::before { top: 22px; } .pc-list li:last-child::before { bottom: calc(100% - 22px); }
.pc-list li.st-done::before { background: color-mix(in srgb, var(--green) 45%, var(--line)); }
.pc-list .pl-dot { position: absolute; left: 4px; top: 16px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--paper); background: var(--line-2); z-index: 1; }
.pc-list .st-done .pl-dot { background: var(--green); } .pc-list .st-run .pl-dot { background: var(--accent); animation: pc-ping 1.4s infinite; } .pc-list .st-error .pl-dot { background: var(--red); }
.pc-li { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 14px; padding: 10px 12px; margin: 4px 0; cursor: pointer; font: inherit; min-height: 56px; }
.pc-li.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.pc-li .pl-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pc-li .pl-t { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pc-li .pl-t b { font-weight: 600; }
.pc-li .pn-f { -webkit-line-clamp: 1; }
.pc-li img { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; background: var(--paper-2); }
/* the video page head is compact when the canvas is the main thing */
.vhead.compact { grid-template-columns: 200px minmax(0, 1fr); gap: 18px; }
.vhead.compact h1 { font-size: 28px; margin-bottom: 8px; }
.vhead.compact .facts { grid-template-columns: 110px minmax(0, 1fr); font-size: 14px; }
@media (max-width: 699px) { .vhead.compact { grid-template-columns: 1fr; } .vhead.compact .vprev { max-width: 280px; } }
.stage-strip.pc-hidden { display: none; }
@media (max-width: 1099px) { .pc-canvas { height: clamp(400px, 52vh, 500px); } }
