:root{
  --bg:#eef1f5; --surface:#ffffff; --surface-2:#f4f6f9; --line:#dce1e9; --fg:#141a22; --muted:#5b6676;
  --accent:#1d4f91; --accent-fg:#ffffff; --accent-soft:#e2ebf8;
  --ok:#1b7447; --ok-soft:#def2e6; --warn:#8f5a00; --warn-soft:#fbeed2; --bad:#b3261e; --bad-soft:#fbe3e1;
  --chat:#c9d6e5; --bubble:#ffffff; --shadow:0 1px 2px rgba(20,26,34,.06),0 10px 28px rgba(20,26,34,.10);
  --font-display:"Geologica","Onest",system-ui,sans-serif;
  --font-body:"Onest",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-num:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
  --r:14px;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#0d1116; --surface:#161b22; --surface-2:#1d232c; --line:#2a323d; --fg:#e7ebf1; --muted:#96a1b1;
  --accent:#7fb1f1; --accent-fg:#0a1525; --accent-soft:#1a2a41;
  --ok:#63c591; --ok-soft:#14301f; --warn:#e7b552; --warn-soft:#33280e; --bad:#f18b81; --bad-soft:#3a1916;
  --chat:#0a0e13; --bubble:#1b222b; --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px rgba(0,0,0,.45);
  color-scheme:dark } }
:root[data-theme="dark"]{
  --bg:#0d1116; --surface:#161b22; --surface-2:#1d232c; --line:#2a323d; --fg:#e7ebf1; --muted:#96a1b1;
  --accent:#7fb1f1; --accent-fg:#0a1525; --accent-soft:#1a2a41;
  --ok:#63c591; --ok-soft:#14301f; --warn:#e7b552; --warn-soft:#33280e; --bad:#f18b81; --bad-soft:#3a1916;
  --chat:#0a0e13; --bubble:#1b222b; --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px rgba(0,0,0,.45);
  color-scheme:dark }

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.45 var(--font-body);-webkit-font-smoothing:antialiased}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0;text-align:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
h1,h2,h3,p,ol,ul{margin:0;padding:0}
ol,ul{list-style:none}
.num{font-family:var(--font-num);font-variant-numeric:tabular-nums;font-size:.92em}
.muted{color:var(--muted)}
.pad{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}

.app{height:100%;max-width:460px;margin:0 auto;display:flex;flex-direction:column;position:relative;overflow:hidden;background:var(--bg)}
@media (min-width:500px){ .app{border-left:1px solid var(--line);border-right:1px solid var(--line)} }

/* header */
.top{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding-block:14px 10px}
.eyebrow{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.top h1{font:600 26px/1.1 var(--font-display);letter-spacing:-.01em}
.state{display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border-radius:999px;background:var(--ok-soft);color:var(--ok);font-weight:600;font-size:13px;white-space:nowrap}
.state::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}
.state.paused{background:var(--warn-soft);color:var(--warn)}
.state.off{background:var(--bad-soft);color:var(--bad)}

/* screen */
main{flex:1;min-height:0;overflow-y:auto;padding-block:4px 20px;display:flex;flex-direction:column;gap:14px}
h2{font:600 17px/1.2 var(--font-display)}
h3{font:600 12px/1.2 var(--font-body);letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.hint{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}

/* next post */
.next{display:flex;align-items:center;gap:16px;padding:16px}
.next .dial{width:86px;height:86px;flex:none}
.next .label{font-size:12px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.next .big{font:600 22px/1.2 var(--font-display);margin-block:2px 4px}
.rehearse{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid var(--line);font-size:14px;color:var(--muted)}
.rehearse p{min-width:0}
.stock{padding:12px 16px;display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line)}
.bar{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);border-radius:3px}
.bar.low i{background:var(--warn)}
.notice{display:flex;align-items:center;gap:10px;padding:11px 14px;border-radius:var(--r);background:var(--warn-soft);color:var(--warn);font-size:14px;width:100%}
.notice b{font-weight:600}
.notice span:last-child{margin-left:auto;font-weight:600;white-space:nowrap}

/* queue */
.sechead{display:flex;flex-direction:column;gap:3px}
.queue{display:flex;flex-direction:column;gap:8px}
.qrow{display:flex;align-items:stretch;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);transition:transform .12s ease}
.qrow.dragging{transition:none;box-shadow:var(--shadow);position:relative;z-index:2;border-color:var(--accent)}
.qmain{flex:1;min-width:0;display:flex;align-items:center;gap:12px;padding:10px 0 10px 12px}
.qdate{flex:none;width:44px;display:flex;flex-direction:column;align-items:center;line-height:1.15}
.qdate b{font-weight:600;font-size:12px;text-transform:uppercase;color:var(--muted);letter-spacing:.04em}
.qdate .num{font-size:14px}
.qrow.first .qdate b,.qrow.first .qdate .num{color:var(--accent)}
.thumb{flex:none;width:48px;height:48px;border-radius:11px;background:var(--surface-2);display:grid;place-items:center;overflow:hidden}
.thumb svg{width:40px;height:40px}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb.none{border:1.5px dashed var(--warn);color:var(--warn);font-weight:600}
.qtext{min-width:0;font-size:14px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.qtext .num{color:var(--muted);margin-right:4px}
.handle{flex:none;width:44px;display:grid;place-items:center;color:var(--muted);touch-action:none;cursor:grab}
.more{align-self:center;padding:9px 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-weight:500}

/* facts */
.search input{width:100%;padding:11px 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface)}
.chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin-inline:-16px;padding-inline:16px}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;white-space:nowrap;padding:7px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:13px;font-weight:500}
.chip .num{color:var(--muted);margin-left:4px}
.chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.chip.on .num{color:inherit;opacity:.8}
.flist{display:flex;flex-direction:column;gap:8px}
.frow{display:flex;gap:12px;padding:11px 12px;width:100%;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.frow .thumb{width:56px;height:56px}
.frow .thumb svg{width:46px;height:46px}
.fbody{min-width:0;display:flex;flex-direction:column;gap:4px}
.fmeta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.pill{display:inline-block;white-space:nowrap;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:600;background:var(--surface-2);color:var(--muted)}
.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.q{background:var(--accent-soft);color:var(--accent)}
.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.cta{background:transparent;color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.field textarea.short{min-height:72px}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}
.fab{position:sticky;bottom:4px;align-self:flex-end;margin-top:auto;display:inline-flex;align-items:center;gap:8px;padding:13px 18px;border-radius:999px;background:var(--accent);color:var(--accent-fg);font-weight:600;box-shadow:var(--shadow)}

/* log */
.lrow{display:flex;gap:12px;align-items:center;padding:11px 12px}
.lrow + .lrow{border-top:1px solid var(--line)}
.lwhen{flex:none;width:62px;line-height:1.2}
.lwhen b{display:block;font-weight:600;font-size:13px}
.ltext{min-width:0;flex:1;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link{color:var(--accent);font-weight:600;font-size:13px;white-space:nowrap}

/* forms */
.group{padding:14px;display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field > span:first-child{font-size:13px;font-weight:600}
.field input[type=text],.field input[type=url],.field input[type=time],.field input[type=number],.field textarea{width:100%;padding:10px 12px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2)}
.field textarea{resize:vertical;min-height:108px;line-height:1.45}
.counter{font-size:12.5px;color:var(--muted);align-self:flex-end}
.counter.over{color:var(--bad);font-weight:600}
.rowline{display:flex;align-items:center;justify-content:space-between;gap:12px}
.rowline p{min-width:0}
.switch{flex:none;width:46px;height:28px;border-radius:14px;background:var(--line);position:relative;transition:background .15s}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.switch[aria-checked=true]{background:var(--accent)}
.switch[aria-checked=true]::after{transform:translateX(18px)}
.seg{display:flex;padding:3px;border-radius:11px;background:var(--surface-2);border:1px solid var(--line)}
.seg button{flex:1;padding:8px 6px;border-radius:8px;text-align:center;font-weight:500;font-size:14px;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.btn{display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:11px 14px;border-radius:11px;border:1px solid var(--line);background:var(--surface);font-weight:600;text-align:center}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.btn.danger{color:var(--bad)}
.btn.small{padding:8px 13px}
.btns{display:flex;flex-direction:column;gap:8px}
.btns.two{flex-direction:row}
.btns.two .btn{flex:1}

/* sheet */
.sheet{position:absolute;inset:0;z-index:5;background:var(--bg);display:flex;flex-direction:column}
.sheethead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-block:12px;border-bottom:1px solid var(--line);background:var(--surface)}
.sheethead h2{flex:1;text-align:center}
.sheethead .ghost{color:var(--accent);font-weight:600;padding:8px 2px}
.sheetbody{flex:1;min-height:0;overflow-y:auto;padding-block:16px 28px;display:flex;flex-direction:column;gap:16px}
.sheetbody > *,main > *{flex-shrink:0}
.photo{position:relative;border-radius:var(--r);overflow:hidden;background:#1a2028;aspect-ratio:16/10;max-width:100%;display:grid;place-items:center}
.photo svg{width:46%;max-height:86%}
.photo img{width:100%;height:100%;object-fit:cover}
.photo .btn{position:absolute;right:10px;bottom:10px}
.drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:26px 16px;border:1.5px dashed var(--line);border-radius:var(--r);background:var(--surface);text-align:center;cursor:pointer}
.drop b{color:var(--accent)}
.drop input{position:absolute;opacity:0;width:1px;height:1px}

/* telegram-like preview */
.chat{background:var(--chat);border-radius:var(--r);padding:12px;display:flex;flex-direction:column;gap:5px}
.bubble{background:var(--bubble);border-radius:14px 14px 14px 4px;overflow:hidden;max-width:340px;box-shadow:0 1px 1px rgba(0,0,0,.12)}
.bimg{aspect-ratio:16/10;background:#1a2028;display:grid;place-items:center}
.bimg svg{width:44%;max-height:86%}
.bimg img{width:100%;height:100%;object-fit:cover}
.btxt{padding:9px 12px 10px;display:flex;flex-direction:column;gap:9px;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.btxt b{font-weight:600}
.ibtn{max-width:340px;padding:9px;border-radius:8px;text-align:center;font-weight:600;font-size:14px;background:var(--bubble);color:var(--accent);box-shadow:0 1px 1px rgba(0,0,0,.12)}
.report{display:flex;flex-direction:column}
.report li{display:flex;gap:10px;padding:10px 14px;font-size:14px}
.report li + li{border-top:1px solid var(--line)}
.report .mark{flex:none;width:22px;font-weight:700}
code{font-family:var(--font-num);font-size:.88em;background:var(--surface-2);padding:1px 5px;border-radius:5px}

/* tabs + toast */
.tabs{display:flex;border-top:1px solid var(--line);background:var(--surface);padding-block:6px 8px}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 2px;font-size:11.5px;font-weight:500;color:var(--muted);border-radius:10px}
.tab svg{width:24px;height:24px}
.tab.on{color:var(--accent)}

/* --- production additions (states the prototype does not show; no inline styles: CSP style-src 'self') --- */
.eyebrow:empty{display:none}
.notice.bad{background:var(--bad-soft);color:var(--bad)}
.notice.info{background:var(--accent-soft);color:var(--accent)}
.thumb.lg{width:56px;height:56px}
.drop img{max-height:180px;border-radius:10px}
.spacer64{width:64px}
.mark.ok{color:var(--ok)} .mark.muted{color:var(--muted)} .mark.bad{color:var(--bad)} .mark.warn{color:var(--warn)}
.pill.bad{background:var(--bad-soft);color:var(--bad)}
.rehearsal{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-top:1px solid var(--line);font-size:14px}
.rehearsal .btn{align-self:flex-start}
.lrow .acts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.lrow.col{flex-wrap:wrap}
.lmeta{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.ltext.wrap{white-space:normal;overflow:visible;display:flex;flex-direction:column;gap:5px}
.ltext.wrap > button{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.35}
.chatline{display:flex;flex-direction:column;gap:8px}
.chatline + .chatline{border-top:1px solid var(--line);padding-top:12px}
.progress{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}
.progress i{display:block;height:100%;width:0;background:var(--accent);transition:width .15s}
.toast{position:absolute;left:16px;right:16px;bottom:84px;z-index:9;padding:12px 14px;border-radius:12px;background:var(--fg);color:var(--bg);font-weight:500;text-align:center;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;gap:12px}
.toast button{color:inherit;font-weight:700;text-decoration:underline}
.denied{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:40px 24px;text-align:center}
.denied h1{font:600 22px/1.2 var(--font-display)}
.skel{background:linear-gradient(90deg,var(--surface) 0%,var(--surface-2) 50%,var(--surface) 100%);background-size:200% 100%;animation:skel 1.2s ease-in-out infinite;border:1px solid var(--line);border-radius:var(--r)}
.skel.h1{height:150px} .skel.h2{height:64px}
@keyframes skel{0%{background-position:100% 0}100%{background-position:-100% 0}}
.warnline{color:var(--warn);font-weight:600;font-size:13px}
.field input[type=number].short{max-width:120px}
.report .why{color:var(--muted);font-size:13px}
@media (prefers-reduced-motion:reduce){ .skel{animation:none} }

/* --- UX pass 2026-11-11 --- */
.fielderr{color:var(--bad);font-size:13px;font-weight:600}
.field .invalid{border-color:var(--bad)}
.btn.go{border-color:var(--accent);color:var(--accent)}
.btns.sep{margin-top:8px;padding-top:16px;border-top:1px solid var(--line)}
.qdate .ord{font-family:var(--font-num);font-size:14px;color:var(--muted)}
.lmeta .why{color:var(--bad)}
