/* Showrunner — calm, one typeface, one accent. */
:root {
  --bg: #fafaf9; --surface: #ffffff; --fg: #18181a; --fg-2: #4b4b50; --mute: #8a8a90; --faint: #c6c6cb;
  --line: #ececea; --wash: #f2f2f0; --wash-2: #e9e9e6;
  --accent: #2f66e6; --accent-ink: #1f4fc2; --accent-wash: #e8efff; --accent-wash-2: #d9e5ff;
  --green: #e6f4ea; --green-ink: #1f7a3e; --red: #fdeceb; --red-ink: #b3332b; --amber: #fff4dc; --amber-ink: #8a5a00;
  --player: #0d0d0f;
  --r: 12px; --r-lg: 16px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20,20,20,.04), 0 6px 20px rgba(20,20,20,.05);
  --shadow-lg: 0 10px 40px rgba(20,20,20,.12);
  --top-h: 60px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent-wash-2); }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.mute { color: var(--mute); } .small { font-size: 13px; } .fg2 { color: var(--fg-2); }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--wash); padding: 2px 6px; border-radius: 5px; }
pre { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--wash); padding: 14px 16px; border-radius: var(--r); overflow: auto; white-space: pre-wrap; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: var(--top-h); padding: 0 22px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-mid { display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 0; }
.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -.01em; font-size: 15px; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--fg); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 7px; top: 5px; border-left: 6px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--mute); }
.back:hover { background: var(--wash); color: var(--fg); }
.title-edit { font-weight: 600; font-size: 15px; letter-spacing: -.01em; padding: 4px 8px; border-radius: 7px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-edit:hover { background: var(--wash); }
.title-edit:focus { outline: 2px solid var(--accent); background: #fff; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 500; font-size: 14px; background: var(--wash); color: var(--fg); transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--wash-2); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--fg); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); }
.btn.quiet { background: transparent; color: var(--fg-2); }
.btn.quiet:hover { background: var(--wash); color: var(--fg); }
.btn.danger { color: var(--red-ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.btn.more { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--wash); color: var(--fg-2); }
.chip.working { background: var(--amber); color: var(--amber-ink); }
.chip.failed { background: var(--red); color: var(--red-ink); }
.chip.ready { background: var(--green); color: var(--green-ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.working .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

/* ---------- forms ---------- */
.field { display: block; margin: 0 0 18px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--fg-2); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.input, textarea.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 13px; line-height: 1.45; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #ddd; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea.input { resize: vertical; min-height: 64px; }
.input.lg { font-size: 20px; font-weight: 600; letter-spacing: -.015em; padding: 12px 14px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%238a8a90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ---------- pages ---------- */
main { padding: 0 22px 60px; max-width: 1480px; margin: 0 auto; }
.page { padding-top: 14px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 20px; }
.page-head p { margin: 4px 0 0; }

/* projects */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px 20px; }
.card { display: block; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #ededeb, #e2e2e0 60%, #d9d9d8); background-size: cover; background-position: center; position: relative; }
.card .thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b8b8bc; }
.card .thumb .len { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 500; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.card .thumb .chip { position: absolute; left: 10px; top: 10px; }
.card .body { padding: 13px 16px 15px; }
.card h3 { margin: 0 0 3px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .by { color: var(--mute); font-size: 13px; }
.empty { text-align: center; padding: 110px 20px 80px; max-width: 420px; margin: 0 auto; }
.empty .art { width: 72px; height: 72px; border-radius: 20px; background: var(--wash); margin: 0 auto 22px; display: flex; align-items: center; justify-content: center; color: var(--mute); }
.empty p { color: var(--fg-2); margin: 8px 0 22px; }
.foot { margin-top: 36px; color: var(--mute); font-size: 12.5px; }

/* new video */
.new { max-width: 720px; margin: 0 auto; }
.new h1 { margin-bottom: 20px; }
.drop { position: relative; border: 1.5px dashed #d9d9d6; border-radius: var(--r-lg); background: #fff; padding: 30px 24px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop .big { font-weight: 500; }
.drop .big b { color: var(--accent); font-weight: 500; }
.drop .hint { color: var(--mute); font-size: 13px; margin-top: 6px; }
.files { list-style: none; margin: 10px 0 0; padding: 0; }
.files li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.files .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.files .sub { color: var(--mute); font-size: 12.5px; }
.files .bar { height: 4px; border-radius: 2px; background: var(--wash-2); overflow: hidden; margin-top: 6px; }
.files .bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.files .rm { color: var(--mute); width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; }
.files .rm:hover { background: var(--wash); color: var(--red-ink); }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 30px 0 12px; }
.path-row { display: flex; gap: 8px; margin-top: 10px; }
.path-row .input { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 18px 0 8px; margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }

/* progress */
.progress { max-width: 520px; margin: 90px auto 0; text-align: center; }
.progress .bar { height: 6px; border-radius: 3px; background: var(--wash-2); overflow: hidden; margin: 26px 0 18px; }
.progress .bar > i { display: block; height: 100%; background: var(--accent); transition: width .8s ease; }
.progress.failed .bar > i { background: var(--red-ink); }
.steps { display: flex; justify-content: space-between; gap: 8px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.step .ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--faint); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.step.done { color: var(--fg-2); } .step.done .ck { background: var(--fg); border-color: var(--fg); color: #fff; }
.step.on { color: var(--fg); font-weight: 500; } .step.on .ck { border-color: var(--accent); color: var(--accent); }
.step.on .ck::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.progress .detail { margin: 22px 0 4px; color: var(--fg-2); }
.progress .eta { color: var(--mute); font-size: 13px; }
.progress .err { text-align: left; margin-top: 18px; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 11fr) minmax(360px, 8fr); gap: 26px; height: calc(100vh - var(--top-h)); padding-top: 6px; }
.left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.player { position: relative; background: var(--player); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow); flex: none; }
.player video { width: 100%; height: 100%; display: block; background: var(--player); }
.player .wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #9a9aa0; font-size: 14px; background: var(--player); }
.player .wait .btn { background: rgba(255,255,255,.12); color: #fff; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 18px; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 2px 2px 6px; }
.msg { display: grid; grid-template-columns: 28px 1fr; gap: 10px; max-width: 92%; }
.msg.user { align-self: flex-end; grid-template-columns: 1fr 28px; }
.msg.user .bubble { order: -1; background: var(--accent-wash); }
.msg.system { align-self: center; grid-template-columns: 1fr; color: var(--mute); font-size: 13px; max-width: 100%; text-align: center; }
.bubble { background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 10px 14px; min-width: 0; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul { margin: 4px 0 8px; padding-left: 18px; } .bubble li { margin: 2px 0; }
.bubble .who { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--mute); margin-bottom: 3px; }
.bubble .who b { color: var(--fg-2); font-weight: 500; }
.bubble .vlink { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; color: var(--accent); font-weight: 500; }
.bubble .vlink:hover { text-decoration: underline; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--wash-2); color: var(--fg-2); flex: none; user-select: none; }
.avatar.agent { background: var(--fg); color: #fff; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 13px; min-height: 24px; padding: 6px 2px 0; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--mute); animation: bounce 1.2s infinite; } .dots i:nth-child(2) { animation-delay: .15s } .dots i:nth-child(3) { animation-delay: .3s }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity: .5 } 40% { transform: translateY(-3px); opacity: 1 } }
.compose { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s; }
.compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.compose textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 8px 0; min-height: 24px; max-height: 160px; line-height: 1.5; outline: none; }
.compose .send { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .15s; }
.compose .send:hover { background: var(--accent-ink); }
.compose .send:disabled { background: var(--accent-wash-2); color: #fff; opacity: 1; }

.right { min-width: 0; min-height: 0; overflow: auto; padding: 0 6px 60px 0; overscroll-behavior: contain; }
.script .summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--mute); font-size: 13px; padding: 4px 12px 10px; }
.script .summary .by { color: var(--fg-2); }
.script h4 { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin: 26px 12px 8px; }
.script h4:first-of-type { margin-top: 6px; }
.para { position: relative; padding: 10px 12px 10px 12px; border-radius: 12px; cursor: pointer; transition: background .25s; }
.para:hover { background: var(--wash); }
.para.on { background: var(--accent-wash); }
.para.added { background: var(--green); }
.para.removed { background: var(--red); color: var(--red-ink); cursor: default; }
.para.removed .words { text-decoration: line-through; text-decoration-color: rgba(179,51,43,.5); }
.para.fade { animation: fadeout 7s forwards; }
@keyframes fadeout { 0%,65% { } 100% { background: transparent } }
.para .meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); margin-bottom: 3px; min-height: 20px; }
.para .meta .sp { font-weight: 500; color: var(--fg-2); }
.para .meta .t { font-variant-numeric: tabular-nums; }
.para .tag { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--wash-2); color: var(--fg-2); }
.para .tag.ov { background: var(--amber); color: var(--amber-ink); }
.para .words { font-size: 15.5px; line-height: 1.6; }
.para .pause { color: var(--mute); font-size: 13px; white-space: nowrap; }
.para .tools { position: absolute; right: 8px; top: 6px; display: none; gap: 2px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 2px; }
.para:hover .tools, .para:focus-within .tools { display: inline-flex; }
.para .tools button { width: 28px; height: 28px; border-radius: 6px; color: var(--mute); display: inline-flex; align-items: center; justify-content: center; }
.para .tools button:hover { background: var(--wash); color: var(--fg); }
.para .tools button.x:hover { color: var(--red-ink); }
.para .cc { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); }
.para.dragging { opacity: .4; }
.para.drop-before::before, .para.drop-after::after { content: ""; position: absolute; left: 12px; right: 12px; height: 2px; background: var(--accent); border-radius: 1px; }
.para.drop-before::before { top: -3px; } .para.drop-after::after { bottom: -3px; }
.thread { margin: 6px 0 0 0; padding: 8px 0 0 10px; border-left: 2px solid var(--wash-2); display: flex; flex-direction: column; gap: 8px; }
.cmt { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 13.5px; }
.cmt .h { display: flex; gap: 8px; align-items: baseline; color: var(--mute); font-size: 12px; } .cmt .h b { color: var(--fg-2); font-weight: 500; }
.cmt .b { color: var(--fg); }
.cmt .acts { display: flex; gap: 10px; margin-top: 3px; } .cmt .acts button { font-size: 12px; color: var(--mute); } .cmt .acts button:hover { color: var(--fg); }
.cmt.reply { margin-left: 30px; }
.cmt-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
.cmt-compose textarea { flex: 1; font-size: 13.5px; min-height: 38px; }
.resolved-note { font-size: 12px; color: var(--mute); margin-top: 4px; }
.misses { margin: 24px 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--amber); color: var(--amber-ink); font-size: 13px; }
.misses b { display: block; margin-bottom: 4px; }

/* version strip + presence */
.vstrip { display: flex; align-items: center; gap: 3px; overflow: auto; max-width: 48vw; scrollbar-width: none; padding: 2px; }
.vstrip::-webkit-scrollbar { display: none; }
.vstrip button { height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vstrip button:hover { color: var(--fg); background: var(--wash); }
.vstrip button.on { background: #fff; color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }
.presence { display: flex; align-items: center; margin-right: 6px; }
.presence .avatar { width: 26px; height: 26px; font-size: 10px; border: 2px solid var(--bg); margin-left: -7px; }
.presence .avatar:first-child { margin-left: 0; }

/* segmented (mobile) */
.seg { display: none; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(15,15,18,.28); display: flex; justify-content: flex-end; animation: dim .18s ease; }
@keyframes dim { from { background: transparent } }
.panel { width: min(540px, 100%); height: 100%; background: #fff; overflow: auto; padding: 28px 30px 40px; box-shadow: var(--shadow-lg); animation: slide .22s cubic-bezier(.2,.8,.2,1); position: relative; }
@keyframes slide { from { transform: translateX(28px); opacity: 0 } }
.panel .close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 9px; color: var(--mute); display: inline-flex; align-items: center; justify-content: center; }
.panel .close:hover { background: var(--wash); color: var(--fg); }
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel .lead { color: var(--fg-2); margin: 0 0 22px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--wash); margin: 10px 0; transition: background .15s; }
a.opt:hover, button.opt:hover { background: var(--wash-2); }
button.opt { width: 100%; text-align: left; }
.opt b { display: block; font-weight: 600; }
.opt span { display: block; color: var(--mute); font-size: 13px; margin-top: 2px; }
.opt.primary { background: var(--fg); color: #fff; } .opt.primary span { color: #bbb; } .opt.primary:hover { background: #000; }
.opt.dis { opacity: .5; pointer-events: none; }
.opt .arrow { color: var(--mute); }
.opt.primary .arrow { color: #fff; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border: 0; }

/* popover */
.pop { position: fixed; z-index: 40; background: var(--fg); color: #fff; border-radius: 10px; padding: 4px; display: flex; gap: 2px; box-shadow: var(--shadow-lg); animation: popin .12s ease; }
@keyframes popin { from { transform: translateY(4px); opacity: 0 } }
.pop button { height: 30px; padding: 0 10px; border-radius: 7px; color: #fff; font-size: 13px; font-weight: 500; }
.pop button:hover { background: rgba(255,255,255,.14); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow-lg); max-width: 90vw; }

/* login (server page) */
.login-body { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; }
.login { width: 100%; max-width: 400px; margin: 14vh auto 0; padding: 0 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06); }
.login-mark { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin-bottom: 22px; }
.login h1 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; }
.login p.mute { color: var(--fg-2); margin: 0 0 20px; font-size: 14px; line-height: 1.5; }
.login label { display: block; font-size: 13px; font-weight: 500; color: var(--fg-2); margin: 0 0 12px; }
.login input { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: inherit; font-size: 16px; background: #fff; }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.login button, .login .btn { margin-top: 8px; width: 100%; height: 44px; border-radius: 10px; background: var(--fg); color: #fff; font-weight: 500; border: 0; font: inherit; cursor: pointer; }
.login-err { color: #b42318; font-size: 14px; margin: 12px 0 0; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  :root { --top-h: 54px; }
  main { padding: 0 14px 40px; }
  .top { padding: 0 12px; grid-template-columns: auto 1fr auto; }
  .top .brand span.txt { display: none; }
  .vstrip { max-width: 50vw; }
  .title-edit { max-width: 40vw; }
  .btn { height: 40px; } .btn.sm { height: 34px; }
  .top-right .btn:not(.accent):not(.primary):not(.icon-btn) { display: none; }
  .btn.more { display: inline-flex; width: 40px; height: 40px; }
  .presence, #restore { display: none; }
  .vstrip button:not(.on) { display: none; }
  .top-mid { justify-content: flex-start; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .editor { display: flex; flex-direction: column; height: auto; gap: 0; padding-top: 0; }
  .left { position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 4px 0 8px; }
  .player { border-radius: 12px; }
  .seg { display: flex; margin: 10px 0 0; background: var(--wash); border-radius: 10px; padding: 3px; }
  .seg button { flex: 1; height: 34px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--mute); }
  .seg button.on { background: #fff; color: var(--fg); box-shadow: var(--shadow); }
  .chat { margin-top: 0; }
  .chat .msgs { display: none; }
  .editor[data-tab="chat"] .right { display: none; }
  .editor[data-tab="chat"] .chat { margin-top: 10px; } .editor[data-tab="chat"] .chat .msgs { display: flex; padding-bottom: 90px; }
  .editor[data-tab="script"] .chat .thinking { display: none; }
  .compose { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; box-shadow: var(--shadow-lg); }
  .compose .send { width: 42px; height: 42px; }
  .right { overflow: visible; padding: 8px 0 110px; }
  .para .tools { display: flex; justify-content: flex-end; position: static; box-shadow: none; background: transparent; margin-top: 2px; }
  .para .tools button { width: 40px; height: 34px; color: var(--faint); }
  .para .words { font-size: 16px; }
  .panel { width: 100%; padding: 22px 18px 40px; }
  .progress { margin-top: 50px; }
  .steps .step { font-size: 12px; }
  .sticky-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.sheet h3.sub { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); margin: 26px 0 4px; }
.lead.small { font-size: 13px; }

/* people */
.people { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; }
.person:hover { background: var(--bg-2, #f4f4f2); }
.person.off { opacity: .55; }
.person .av { width: 32px; height: 32px; border-radius: 50%; background: #e8e8e4; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.person .av.dim { background: transparent; color: var(--fg-2); font-size: 16px; }
.person .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person .who b { font-weight: 500; }
.person .who span { font-size: 13px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input.sel { width: auto; padding-right: 28px; }
.ok { color: #067647; font-size: 14px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 14px; } .login-foot a { color: var(--fg-2); }
.login form label { display: block; }

/* what's new */
.wn { display: grid; gap: 10px; margin-bottom: 22px; }
.wn-card { padding: 14px 16px; border-radius: 12px; background: var(--wash); }
.wn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wn-head b { font-weight: 600; }
.wn-head span { color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.wn-card p { margin: 4px 0 0; color: var(--fg-2); font-size: 14px; }
.foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* the brief: production doc + speakers */
.doc-row { display: flex; align-items: center; gap: 10px; }
.doc-row .input { flex: 1; }
.doc-state { font-size: 13px; color: var(--fg-2); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.doc-state.ok { color: #067647; } .doc-state.err { color: #b42318; white-space: normal; }
.section-title .optional-tag { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fg-3, #9a9a97); margin-left: 6px; font-size: 12px; }
.speakers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.speaker { display: flex; align-items: center; gap: 10px; }
.speaker .role { width: 52px; font-size: 13px; color: var(--fg-2); }
.speaker .input { flex: 1; }
