/* монтаж-AI — tokens and components from docs/DESIGN.md */
:root {
  --bg: #0E0E10; --surface: #17171A; --surface-2: #121214; --surface-3: #1F1F23;
  --line: #2A2A30; --line-strong: #3A3A42; --text: #F2EFE9; --text-2: #C9C5BD;
  --muted: #A39F97; --dim: #8A877F; --accent: #F5B83D; --accent-hover: #FFD27A;
  --on-accent: #141414; --success: #7FD39B; --danger: #FF8A7E; --rec: #FF6B5E;
  --rec-paper: #D93A2E; --paper: #F2EFE9; --paper-ink: #141414; --paper-muted: #4A4740;
  --head: Unbounded, system-ui, sans-serif; --ui: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.ok { color: var(--success); }
.bad { color: var(--danger); }
.accent { color: var(--accent); }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* stripes */
.stripes { height: 16px; background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, var(--surface) 12px 24px); }
.stripes-top { height: 12px; background: repeating-linear-gradient(-45deg, var(--accent) 0 16px, var(--bg) 16px 32px); }
.stripes-paper { height: 30px; background: repeating-linear-gradient(-45deg, var(--paper) 0 16px, var(--surface) 16px 32px); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px;
  border-radius: 12px; padding: 14px 22px; font-weight: 600; font-size: 16px; text-decoration: none;
  cursor: pointer; border: 0; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; font-size: 14px; padding: 11px 16px; border-radius: 10px; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--line); color: var(--muted); cursor: not-allowed; font-size: 15px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 10px 0; font-size: 14px; }

/* header (desktop) */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 14px 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo span { font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text-2); border-radius: 10px; padding: 11px 14px; font-size: 15px; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); font-weight: 500; }
.nav a:hover { color: var(--text); }
.top-right { display: flex; gap: 10px; align-items: center; }
.chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.topup { text-decoration: none; color: var(--on-accent); background: var(--accent); border-radius: 10px; padding: 11px 14px; font-size: 14px; font-weight: 600; }
.topup:hover { color: var(--on-accent); background: var(--accent-hover); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; border: 0; color: var(--text); cursor: pointer; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 200px; z-index: 10; }
.menu-pop .who { font-size: 14px; color: var(--text-2); padding: 4px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; word-break: break-all; }
.menu-pop button { width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 4px; cursor: pointer; font-size: 15px; }

/* mobile header + tab bar */
.mtop, .tabbar { display: none; }

/* page */
.main { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }
.main-wide { padding: 40px 32px 80px; }
.pagehead { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
h1.h1 { margin: 0; font-family: var(--head); font-weight: 500; font-size: 30px; letter-spacing: -.02em; }
h1.h1-big { margin: 8px 0 0; font-family: var(--head); font-weight: 500; font-size: 34px; letter-spacing: -.02em; }
.done-title { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; }
.done-title h1 { color: var(--accent); font-weight: 700; }
.done-title span { font-size: 18px; color: var(--text-2); }

/* steps */
.steps { margin: 0; padding: 0; list-style: none; display: flex; gap: 6px; align-items: center; font-size: 14px; }
.steps li.dash { color: var(--dim); }
.steps li.st { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.steps li.st.passed { color: var(--text-2); }
.steps li.st.current { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; padding: 7px 12px; }
.msteps { display: none; }

/* montage layout */
.desk { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.monitor { flex: 999 1 620px; min-width: 0; min-height: 620px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.monitor-head { display: flex; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.panel { flex: 1 1 340px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.panel-in { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.panel h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.panel-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.fine { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* drop zone and upload states */
.drop { flex: 1; margin: 18px; border: 2px dashed #4A4A52; border-radius: 16px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 40px 24px; }
.drop.dragover { border-color: var(--accent); background: rgba(245, 184, 61, .05); }
.drop.error { border-color: var(--danger); }
.drop-title { margin-top: 20px; font-family: var(--head); font-weight: 500; font-size: 26px; letter-spacing: -.02em; }
.drop.error .drop-title { font-size: 22px; margin-top: 16px; }
.drop-sub { margin-top: 10px; font-size: 16px; color: var(--muted); }
.drop.error .drop-sub { font-size: 15px; color: var(--text-2); }
.req { margin-top: 22px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.mpick { display: none; }
.transfer { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.transfer-in { width: 100%; max-width: 520px; }
.file-row { display: flex; gap: 14px; align-items: center; }
.file-thumb { width: 40px; height: 70px; flex: none; border-radius: 6px; background: #26262B; }
.file-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pct-row { margin-top: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pct-big { font-family: var(--head); font-weight: 700; font-size: 56px; letter-spacing: -.03em; color: var(--accent); }
.bar { margin-top: 12px; height: 10px; border-radius: 5px; background: #26262B; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.paused .pct-big { color: var(--dim); }
.paused .bar > div { background: var(--dim); }
.bar-meta { margin-top: 10px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.upload-note { margin-top: 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.upload-note span { font-size: 14px; line-height: 1.5; color: var(--text-2); max-width: 360px; }
.broken { margin-top: 22px; background: var(--surface-3); border-radius: 14px; padding: 16px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.broken b { display: block; font-size: 15px; }
.broken span span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.preview { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0B0B0D; }
.preview video { max-width: 100%; max-height: 520px; border-radius: 12px; background: #1A1A1E; }
.ph-phone { width: 240px; height: 426px; border-radius: 12px; background: #1A1A1E; position: relative; overflow: hidden; }
.ph-phone::before { content: ""; position: absolute; top: 110px; left: 50%; transform: translateX(-50%); width: 70px; height: 70px; border-radius: 50%; background: #2E2E34; }
.ph-phone::after { content: ""; position: absolute; top: 150px; left: 50%; transform: translateX(-50%); width: 116px; height: 150px; border-radius: 58px 58px 18px 18px; background: #26262B; }
.uploaded-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); }
.resume-hint { margin: 0 18px 18px; background: var(--surface-3); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.5; color: var(--text-2); }

/* option toggles */
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 14px; padding: 14px 16px; color: var(--text); cursor: pointer; min-height: 44px; }
.opt[aria-pressed="true"] { border-color: var(--accent); }
.opt-txt { flex: 1; min-width: 0; }
.opt-title { display: block; font-size: 15px; font-weight: 600; }
.opt-set { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.sw { flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-strong); position: relative; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: left .15s; }
.opt[aria-pressed="true"] .sw { background: var(--accent); }
.opt[aria-pressed="true"] .sw::after { left: 21px; }
.opt[disabled] { cursor: default; }

/* clapper status card */
.clap-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px; }
.clap { width: 100%; max-width: 640px; border-radius: 18px; overflow: hidden; background: var(--paper); color: var(--paper-ink); }
.clap-stripes { height: 40px; background: repeating-linear-gradient(-45deg, var(--paper-ink) 0 22px, var(--paper) 22px 44px); }
.clap-cells { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--paper-ink); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.clap-cells > div { flex: 1 1 100px; padding: 10px 18px; border-right: 2px solid var(--paper-ink); }
.clap-cells > div:first-child { flex: 2 1 200px; }
.clap-cells > div:last-child { border-right: 0; }
.clap-cells b { display: block; margin-top: 3px; font-size: 16px; font-weight: 400; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clap-cells b.ui { font-family: var(--ui); font-weight: 600; }
.clap-body { padding: 28px 24px 26px; }
.rec { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: #B3261E; }
.rec::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rec-paper); animation: rec 1.2s infinite; }
.rec.stopped::before { animation: none; }
@keyframes rec { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .rec::before { animation: none; } .bar > div { transition: none; } }
.live { margin-top: 10px; font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -.03em; }
.clap.failed .live { color: #B3261E; }
.clap-bar { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.clap-bar .track { flex: 1; height: 12px; border-radius: 6px; background: #D9D4CA; overflow: hidden; }
.clap-bar .track > div { height: 100%; width: 0; background: var(--paper-ink); transition: width .4s; }
.clap-bar .mono { font-size: 18px; }
.formal { margin-top: 10px; font-size: 14px; color: var(--paper-muted); }
.clap .btn-dark { margin-top: 20px; display: inline-block; text-decoration: none; color: var(--paper); background: var(--paper-ink); border-radius: 12px; padding: 14px 22px; font-size: 15px; font-weight: 600; }
.clap .btn-dark:hover { color: var(--paper); }
.fixed-opts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fixed-opts > div { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.fixed-opts > div:last-child { border-bottom: 0; }
.fixed-opts .on { font-size: 13px; color: var(--accent); }
.fixed-opts .off { font-size: 13px; color: var(--dim); }
.note { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.note b { font-size: 15px; }
.note p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* done */
.player { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; background: #0B0B0D; }
.player video { max-width: 100%; max-height: 560px; border-radius: 12px; background: #1A1A1E; }
.plan { padding: 14px 18px 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: flex; gap: 12px; align-items: center; }
.plan-row > span { width: 76px; flex: none; color: var(--muted); }
.plan-row > span.accent { color: var(--accent); }
.plan-track { flex: 1; display: flex; gap: 2px; height: 28px; min-width: 0; }
.plan-track .keep { flex: 1; background: var(--line-strong); border-radius: 5px; }
.plan-track .out { flex: 1; background: var(--accent); border-radius: 5px; padding: 7px 8px; color: var(--on-accent); }
.was { display: flex; gap: 10px; }
.was > div { flex: 1; background: var(--surface-2); border-radius: 14px; padding: 14px; }
.was .mono { margin-top: 4px; font-size: 22px; }
.did { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 14px; }
.did > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.did > div:last-child { border-bottom: 0; }
.dl { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 12px; padding: 14px 16px; }
.dl b { display: block; font-size: 15px; }
.dl small { display: block; font-size: 12px; }
.dl-main { color: var(--on-accent); background: var(--accent); }
.dl-main:hover { color: var(--on-accent); background: var(--accent-hover); }

/* lists, cards */
.stats { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat .mono { margin-top: 6px; font-size: 26px; }
.rows { margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.row:last-child { border-bottom: 0; }
.thumb { width: 54px; height: 96px; flex: none; border-radius: 8px; background: #26262B; position: relative; }
.thumb span { position: absolute; left: 4px; right: 4px; bottom: 5px; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--text); background: var(--bg); border-radius: 4px; padding: 2px 0; }
.row-main { flex: 1 1 260px; min-width: 0; }
.row-title { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.row-meta { margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; color: var(--text-2); background: var(--surface-3); border-radius: 6px; padding: 4px 8px; }
.row-state { flex: 1 1 260px; min-width: 0; --c: var(--text-2); }
.row-state .st-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--c); }
.row-state .st-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.row-state .mini { margin-top: 10px; height: 6px; border-radius: 3px; background: #26262B; overflow: hidden; }
.row-state .mini > div { height: 100%; width: 0; background: var(--c); }
.row-state .sub { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.st-processing { --c: var(--accent); } .st-queued { --c: var(--text-2); } .st-done { --c: var(--success); } .st-failed { --c: var(--danger); } .st-uploaded, .st-expired { --c: var(--dim); }
.row-act { flex: none; text-decoration: none; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 16px; font-size: 14px; min-width: 120px; text-align: center; }
.row-act:hover { color: var(--text); border-color: var(--muted); }
.empty { margin-top: 28px; border: 1px dashed var(--line-strong); border-radius: 16px; padding: 40px 24px; text-align: center; color: var(--text-2); }
.empty p { margin: 0 0 16px; }

/* balance */
.bal { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.bal-left { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.bal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; }
.bal-big { margin-top: 6px; font-family: var(--mono); font-size: 52px; letter-spacing: -.02em; }
.packs { display: flex; flex-wrap: wrap; gap: 12px; }
.pack { flex: 1 1 180px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 20px; color: var(--text); cursor: pointer; }
.pack[aria-pressed="true"] { border-color: var(--accent); }
.pack .mono { margin-top: 12px; font-size: 26px; }
.pack .muted { margin-top: 4px; font-size: 14px; }
.hist { flex: 1 1 340px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.hist ul { margin: 12px 0 0; padding: 0; list-style: none; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #222226; }
.hist li:last-child { border-bottom: 0; }
.hist .k { display: block; font-size: 15px; }
.hist .w { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.hist .a { font-family: var(--mono); font-size: 15px; color: var(--text-2); white-space: nowrap; }
.hist .a.plus { color: var(--success); }

/* login */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-head { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 32px; }
.login-head .logo span { font-size: 20px; }
.login-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 32px 56px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero { flex: 1 1 520px; min-width: 0; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-txt { flex: 1 1 260px; min-width: 0; }
.slate-tag { display: flex; gap: 12px; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.slate-tag .r { display: flex; align-items: center; gap: 6px; color: var(--rec); }
.slate-tag .r::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rec); }
.hero h1 { margin: 18px 0 0; font-family: var(--head); font-weight: 700; font-size: 48px; line-height: 1.08; letter-spacing: -.03em; }
.hero p { margin: 18px 0 0; font-size: 17px; line-height: 1.55; color: var(--text-2); max-width: 420px; }
.phone { flex: 0 0 auto; margin: 0 auto; width: 250px; height: 444px; border-radius: 34px; border: 7px solid #26262B; background: #1A1A1E; position: relative; overflow: hidden; }
.phone .dash { position: absolute; inset: 12px; border: 1px dashed var(--line-strong); border-radius: 20px; }
.phone .ph-top { position: absolute; top: 22px; left: 22px; right: 22px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.phone .ph-top .r { display: flex; align-items: center; gap: 5px; }
.phone .ph-top .r::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rec); }
.phone .head { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: 66px; height: 66px; border-radius: 50%; background: #2E2E34; }
.phone .body { position: absolute; top: 132px; left: 50%; transform: translateX(-50%); width: 106px; height: 130px; border-radius: 53px 53px 18px 18px; background: #26262B; }
.phone .take { position: absolute; right: 18px; top: 220px; transform: rotate(6deg); background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: 10px; font-weight: 500; padding: 7px 9px; border-radius: 7px; }
.phone .cap { position: absolute; left: 24px; right: 24px; bottom: 74px; text-align: center; }
.phone .cap span { background: var(--bg); color: var(--text); font-weight: 600; font-size: 16px; line-height: 1.5; padding: 4px 8px; border-radius: 6px; }
.login-box { flex: 0 1 400px; min-width: 0; margin: 0 auto; }
.login-card { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.login-card form, .login-card .card-in { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { margin: 0; font-family: var(--head); font-weight: 500; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.field input { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px; color: var(--text); font-size: 16px; min-height: 44px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.msg-bad { background: rgba(255, 138, 126, .1); color: var(--danger); }
.msg-info { background: var(--surface-3); color: var(--text-2); }
.demo-card { background: var(--paper); color: var(--paper-ink); border-radius: 16px; overflow: hidden; }
.demo-card .cap { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--paper-muted); }

/* ---- phone ---- */
@media (max-width: 640px) {
  .topbar { display: none; }
  .mtop { display: flex; height: 56px; padding: 0 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
  .mtop .logo span { font-size: 15px; }
  .mtop .chip { border-radius: 999px; padding: 9px 12px; font-size: 13px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 72px; padding-bottom: 8px; background: var(--surface-2); border-top: 1px solid var(--line); z-index: 20; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  body.app { padding-bottom: 80px; }
  .main, .main-wide { padding: 16px 16px 24px; }
  h1.h1 { font-size: 21px; }
  h1.h1-big { font-size: 24px; }
  .steps { display: none; }
  .msteps { display: flex; flex-direction: column; gap: 8px; width: 100%; }
  .msteps .cap { align-self: flex-end; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: -32px; }
  .msteps .bars { display: flex; gap: 4px; }
  .msteps .bars span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
  .msteps .bars span.on { background: var(--accent); }
  .desk { margin-top: 14px; gap: 14px; }
  .monitor { min-height: 0; border-radius: 16px; flex-basis: 100%; }
  .panel { border-radius: 16px; flex-basis: 100%; }
  .panel .stripes { display: none; }
  .panel-in { padding: 14px; }
  .drop { display: none; }
  .drop.error { display: flex; margin: 12px; padding: 14px; align-items: flex-start; text-align: left; }
  .drop.error svg { display: none; }
  .drop.error .drop-title { margin-top: 0; font-family: var(--ui); font-weight: 600; font-size: 15px; color: var(--danger); }
  .drop.error .drop-sub { font-size: 13px; margin-top: 4px; }
  .drop.error .req { margin-top: 10px; font-size: 12px; }
  .mpick { display: block; padding: 12px; }
  .mpick button { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1.5px dashed #4A4A52; background: var(--surface-2); border-radius: 16px; padding: 16px; color: var(--text); cursor: pointer; }
  .mpick .ico { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
  .mpick b { display: block; font-size: 16px; }
  .mpick small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
  .mpick .req { margin-top: 8px; font-size: 12px; }
  .monitor-head { display: none; }
  .transfer { padding: 14px; }
  .pct-row { margin-top: 12px; }
  .pct-big { font-size: 22px; }
  .bar { height: 6px; margin-top: 8px; }
  .preview { padding: 12px; }
  .preview video, .player video { max-height: 300px; }
  .ph-phone { width: 120px; height: 213px; }
  .ph-phone::before, .ph-phone::after { display: none; }
  .clap-wrap { padding: 0; }
  .clap { border-radius: 16px; }
  .clap-stripes { height: 28px; }
  .clap-cells > div { padding: 8px 12px; }
  .clap-body { padding: 18px 16px; }
  .live { font-size: 25px; }
  .player { padding: 12px; }
  .plan { padding: 10px 12px 12px; }
  .done-title span { font-size: 15px; }
  .bal-big { font-size: 36px; }
  .row { gap: 12px; padding: 14px; }
  .thumb { width: 36px; height: 64px; }
  .row-act { min-width: 0; flex: 1 1 100%; }
  .login-head { padding: 16px; }
  .login-main { padding: 8px 16px 32px; gap: 24px; }
  .hero { gap: 16px; }
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 15px; margin-top: 10px; }
  .phone { display: none; }
  .login-card form, .login-card .card-in { padding: 20px; gap: 14px; }
}
.minw0 { min-width: 0; }
.h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.topup-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.bal-card .mono.accent-none { margin-top: 6px; font-size: 24px; color: var(--text-2); }
.bal-card > div:last-child { text-align: right; }
.panel-foot .msg { margin-top: 4px; }
.uploaded-wrap { flex: 1; display: flex; flex-direction: column; }
@media (max-width: 640px) { .bal-card > div:last-child { text-align: left; } }
.panel-foot a { text-decoration: none; }
@media (max-width: 640px) {
  .panel-in { gap: 0; }
  .panel h2 { margin-bottom: 6px; font-size: 14px; }
  .opt { border: 0; border-bottom: 1px solid #222226; border-radius: 0; background: transparent; padding: 12px 2px; }
  .opt[aria-pressed="true"] { border-color: #222226; }
  .opt-title { font-weight: 500; }
  .opt-set { font-size: 12px; margin-top: 2px; }
  .panel-foot { padding-top: 12px; gap: 6px; }
  .panel-foot .btn { margin-top: 6px; padding: 14px; }
  .uploaded-wrap .preview { display: none; }
  .uploaded-bar { border-top: 0; padding: 12px; }
  .clap-cells > div { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .clap-cells > div:first-child { flex: 1.6 1 0; }
  .clap-cells b { font-size: 14px; }
  .live { font-size: 22px; }
  .clap-bar { margin-top: 14px; }
  .fixed-opts > div { padding: 10px 12px; font-size: 14px; }
  .note { padding: 12px 14px; margin-top: 8px; }
  .panel .note:first-of-type { margin-top: 10px; }
}
.m-only { display: none !important; }
@media (max-width: 640px) {
  .d-only { display: none !important; }
  .m-only { display: block !important; }
  .clap-cells > .m-only { display: block !important; }
  .m-status { width: 100%; }
  .m-status .tags { margin: 0 0 12px; }
  .m-note { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.45; }
  .m-note b { font-weight: 600; }
  .m-note .kv { padding-top: 8px; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  /* uploading */
  .file-thumb { width: 28px; height: 50px; }
  .file-name { font-size: 15px; }
  .upload-note { margin-top: 8px; flex-wrap: nowrap; gap: 10px; }
  .upload-note span { font-size: 12px; color: var(--muted); }
  .upload-note .btn-ghost { border: 0; padding: 10px 4px; text-decoration: underline; color: var(--text-2); font-size: 13px; }
  .broken { margin-top: 10px; padding: 10px 12px; flex-wrap: nowrap; }
  .broken b { font-size: 13px; }
  .broken span span { font-size: 12px; }
  .broken .btn { padding: 10px 12px; font-size: 13px; min-height: 40px; }
  .bar-meta { margin-top: 6px; }
  /* done */
  .done-title h1 { font-size: 24px; }
  .player video { max-height: 220px; }
  .was > div { padding: 10px 12px; }
  .was .muted { font-size: 12px; }
  .was .mono { font-size: 20px; }
  .panel-in > h2 { margin-top: 10px; }
  .did { font-size: 13px; }
  .did > div { padding: 8px 12px; }
  .dl { padding: 12px 14px; margin-top: 2px; }
  .plan { font-size: 10px; }
  .plan-track { height: 22px; }
  .plan-track .out { padding: 4px 6px; }
  /* videos */
  #videos-page .pagehead .btn { display: none; }
  #videos-page .label, #balance-page .label { display: none; }
  .stats { margin-top: 14px; gap: 8px; }
  .stat { flex: 1 1 0; padding: 12px 14px; }
  .stat:nth-child(3) { display: none; }
  .stat .muted { font-size: 13px; }
  .stat .mono { font-size: 16px; margin-top: 4px; }
  .rows { margin-top: 14px; }
  .row { flex-wrap: nowrap; align-items: flex-start; }
  .row-main { flex: 1 1 auto; }
  .row-title { font-size: 15px; }
  .row-meta { font-size: 11px; }
  .row .tags { display: none; }
  .row-state { display: none; }
  .row-act { flex: none; min-width: 0; padding: 10px 12px; font-size: 13px; }
  .row-sub-m { display: block !important; margin-top: 6px; font-size: 13px; color: var(--c); }
  /* balance */
  .bal { margin-top: 14px; gap: 14px; }
  .bal-left { gap: 14px; }
  .bal-card { padding: 16px; gap: 12px; }
  .bal-card .muted { font-size: 13px; }
  .bal-card .bal-big + .muted { display: none; }
  .bal-big { font-size: 34px; }
  .bal-card .mono.accent-none { font-size: 17px; }
  .h2 { font-size: 14px; margin-bottom: 8px; }
  .packs { flex-wrap: nowrap; gap: 8px; }
  .pack { flex: 1 1 0; padding: 12px 10px; border-radius: 14px; }
  .pack svg { display: none; }
  .pack .mono { margin-top: 0; font-size: 17px; }
  .pack .muted { font-size: 11px; }
  .topup-row { margin-top: 10px; gap: 8px; }
  .topup-row .btn { width: 100%; }
  .topup-row .muted { font-size: 12px; }
  .hist { padding: 14px 16px; }
  .hist li { padding: 9px 0; }
  .hist .k { font-size: 14px; }
  .hist .w { font-size: 12px; }
  .hist .a { font-size: 14px; }
}
.row-sub-m { display: none; }
@media (max-width: 640px) {
  .panel-foot .fine { display: none; }
  .panel-foot .kv { font-size: 13px; }
  .player video { max-height: 180px; }
  .plan { gap: 6px; }
  .pagehead { gap: 10px; }
}
/* login v2 (DESIGN 27.11: demo access card) */
.demo-block { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.demo-btn { width: 100%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); border-radius: 12px; padding: 15px; font-weight: 600; font-size: 15px; cursor: pointer; min-height: 44px; }
.demo-btn:hover { background: var(--surface-3); }
.fine.center { text-align: center; }
.login-card .card-in { gap: 14px; }
.demo-card { border-radius: 14px; }
.demo-card .clap-stripes { height: 14px; background: repeating-linear-gradient(-45deg, var(--paper-ink) 0 10px, var(--paper) 10px 20px); }
.demo-card .in { padding: 6px 16px 10px; gap: 0; }
.cred { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.cred + .cred { border-top: 1px solid #D9D4CA; }
.cred .cap { display: block; }
.cred .val { display: block; margin-top: 2px; font-family: var(--mono); font-size: 18px; overflow-wrap: anywhere; }
.demo-card .copy { flex: none; min-width: 44px; height: 44px; border: 1px solid #BDB7AC; background: transparent; border-radius: 10px; color: var(--paper-ink); font-weight: 500; font-size: 13px; padding: 0 10px; cursor: pointer; }
.demo-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.have-login { display: block; text-align: center; color: var(--text-2); padding: 12px; font-weight: 500; font-size: 14px; }
.have-login:hover { color: var(--text); }
@media (max-width: 640px) { .cred .val { font-size: 16px; } }
.drop-note { margin-top: 6px; font-size: 14px; color: var(--muted); }
.err-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.err-actions .btn-ghost { font-size: 15px; font-weight: 600; padding: 14px 22px; border-radius: 12px; }
.drop.error .drop-sub { max-width: 520px; line-height: 1.5; }
.drop.error .req { margin-top: 20px; }
@media (max-width: 640px) {
  .drop-note { font-size: 13px; margin-top: 4px; }
  .err-actions { margin-top: 10px; justify-content: flex-start; }
  .err-actions .btn, .err-actions .btn-ghost { padding: 10px 14px; font-size: 14px; min-height: 40px; }
}
.drop-note { margin-top: 6px; font-size: 14px; color: var(--muted); }
.err-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.err-actions .btn-ghost { font-size: 15px; font-weight: 600; padding: 14px 22px; border-radius: 12px; }
.drop.error .drop-sub { max-width: 520px; line-height: 1.5; }
.drop.error .req { margin-top: 20px; }
@media (max-width: 640px) {
  .drop-note { font-size: 13px; margin-top: 4px; }
  .err-actions { margin-top: 10px; justify-content: flex-start; }
  .err-actions .btn, .err-actions .btn-ghost { padding: 10px 14px; font-size: 14px; min-height: 40px; }
}
.clap.failed .live { color: var(--paper-ink); }
.clap.failed .clap-bar .track > div { background: #B3261E; }
.fixed-opts > div.is-off > span:first-child { color: var(--dim); }
.tags span.is-off { color: var(--dim); }
.clap .btn-dark[hidden] { display: none; }
.did > div.is-off > span:first-child { color: var(--dim); }
.login-card .card-in form { padding: 0; }
.cred > .minw0 { flex: 1; }
.note[hidden], .m-note > div[hidden] { display: none !important; }
