@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-500.woff2) format("woff2"); }

:root {
  --ground: #0d1214; --card: #161e21; --raise: #1d272b; --line: #26333a; --text: #e8f0f2; --muted: #8fa3aa;
  --red: #ff5d6c; --green: #3ddc97; --yellow: #f2c14e; --purple: #b48cff; --focus: #b9e3ff; --lime: #c6ff3d;
  --ui: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --gut: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--text); font-family: var(--ui); -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- common bits ---------- */
.screen { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 8px) var(--gut) calc(env(safe-area-inset-bottom) + 12px); max-width: 720px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.top h1, .top h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); padding: 7px 11px; font-size: 14px; white-space: nowrap; }
.ghost:active { background: var(--raise); }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 14px;
       border: 2px solid var(--focus); background: var(--card); color: var(--focus); font-weight: 700; font-size: 15px; text-align: center; }
.btn.quiet { border-color: var(--line); color: var(--text); border-width: 1px; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .4; cursor: default; }
.count { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.pbar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.pbar i { display: block; height: 100%; width: 0; background: var(--focus); transition: width .25s; }

/* ---------- home ---------- */
.hero { display: flex; align-items: center; gap: 14px; padding: 18px 0 6px; }
.hero img { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.hero h1 { margin: 0; font-size: 24px; line-height: 1.1; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.actions .btn { min-height: 54px; font-size: 14px; }
.actions .wide { grid-column: 1 / -1; }
.section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; font-weight: 700; }
.decks { display: grid; gap: 10px; }
.deckrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; width: 100%; }
.deckrow b { font-size: 16px; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.deckrow .sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deckrow .pbar { grid-column: 1 / -1; }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.empty b { color: var(--text); }
.foot-note { color: var(--muted); font-size: 12px; text-align: center; margin: 28px 0 8px; line-height: 1.6; }
.foot-note a, .foot-note .link-btn { color: var(--focus); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- swipe screen ---------- */
.deckscreen { height: 100dvh; display: flex; flex-direction: column; gap: 6px; overflow: hidden; padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
.tally { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); flex: none; }
.tally b { font-weight: 500; }
.question { font-weight: 700; font-size: clamp(16px, 4.4vw, 19px); line-height: 1.3; margin: 2px 0 0; flex: none;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-family: var(--mono); color: var(--text); }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.chip.on { border-color: var(--focus); color: var(--focus); }
.stage { flex: 1; min-height: 120px; position: relative; display: flex; align-items: center; justify-content: center; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
        will-change: transform; display: flex; flex-direction: column; }
.card canvas { display: block; background: #000; flex: none; }
.card.fly { transition: transform .22s ease-in, opacity .22s ease-in; }
.card.back { transition: transform .2s cubic-bezier(.2, 1.4, .4, 1); }
.card.enter { animation: enter .16s ease-out; }
@keyframes enter { from { transform: scale(.94); opacity: .4; } }
.cardfoot { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 5px 10px 6px; border-top: 1px solid var(--line); height: 26px; white-space: nowrap; }
.cardfoot span { overflow: hidden; text-overflow: ellipsis; }
.cardfoot.two { flex-wrap: wrap; height: 58px; row-gap: 2px; align-content: center; }
.cardfoot.two .caption { flex: 1 0 100%; white-space: normal; line-height: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cardfoot.two > span:last-child { margin-left: auto; }
.cardfoot .caption { cursor: pointer; flex: 1; min-width: 0; }
.cardfoot > span:last-child { flex: none; max-width: 45%; }
.question { cursor: pointer; }
.zoom-info { margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: var(--text); white-space: pre-wrap; }
.frames { display: flex; gap: 4px; padding: 4px 6px; border-top: 1px solid var(--line); height: 36px; align-items: center; }
.frames button { flex: 1; min-width: 0; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frames button[aria-pressed="true"] { border-color: var(--focus); color: var(--focus); }
.frames .play { flex: none; width: 36px; color: var(--text); font-size: 12px; }
.frames.chanbar { overflow-x: auto; scrollbar-width: none; }
.frames.chanbar::-webkit-scrollbar { display: none; }
.frames.chanbar button { flex: 1 0 auto; overflow: visible; text-overflow: clip; padding: 0 8px; }
.chipset { display: inline-flex; gap: 6px; flex: none; }
.frames button i, .chip.frame i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: currentColor; vertical-align: 1px; }
.frames button[aria-pressed="false"] { opacity: .55; }
.stamp { position: absolute; top: 14px; left: 50%; translate: -50% 0; padding: 4px 12px; border: 3px solid; border-radius: 10px; font: 800 clamp(18px, 6vw, 26px) var(--ui);
         text-transform: uppercase; letter-spacing: .04em; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.zoomhint { position: absolute; right: 8px; top: 8px; font: 500 10px var(--mono); color: var(--focus); background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 3px; pointer-events: none; }
.answers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; flex: none; }
.ans { grid-column: span 2; min-width: 0; height: 52px; border-radius: 14px; border: 2px solid; background: var(--card); padding: 0 6px;
       font: 700 clamp(12px, 3.5vw, 15px)/1.1 var(--ui); text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.ans .arrow { font-size: 1.1em; opacity: .8; flex: none; }
.ans .lbl { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.ans.big { grid-column: span 3; }
.ans.undo { border-color: var(--line); color: var(--muted); }
.ans:active { filter: brightness(1.3); }
.ans:disabled { opacity: .35; }
.hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; flex: none; min-height: 17px; }
.done { text-align: center; padding: 20px; display: grid; gap: 14px; justify-items: center; }
.done .big-emoji { font-size: 54px; }
.done h3 { margin: 0; font-size: 20px; }
.notice { border: 1px solid var(--yellow); color: var(--yellow); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.45; }
/* many answers: compact buttons, one-line tally, two-line question */
.answers.compact { grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 6px; }
.answers.compact .ans { height: 44px; border-radius: 12px; font-size: clamp(11px, 3.1vw, 13px); padding: 0 4px; gap: 3px; }
.answers.compact .ans.undo { font-size: 11px; }
.answers.compact .ans.undo.alone { height: 34px; }
.deckscreen.compact .tally { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.deckscreen.compact .tally::-webkit-scrollbar { display: none; }
.deckscreen.compact .question { -webkit-line-clamp: 2; font-size: clamp(15px, 4.1vw, 17px); }
.deckscreen.compact .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.deckscreen.compact .chips::-webkit-scrollbar { display: none; }
.deckscreen.compact .chip { flex: none; min-height: 30px; white-space: nowrap; }
.deckscreen.compact .hint { display: none; }
.deckscreen.scroll { height: auto; min-height: 100dvh; overflow: visible; }
.deckscreen.scroll .stage { flex: none; }
.frames button { min-width: 0; }
@media (max-height: 700px) {
  .ans { height: 46px; border-radius: 12px; }
  .hint { display: none; }
  .deckscreen { gap: 5px; }
}
@media (max-height: 600px) { .tally { display: none; } }

/* ---------- celebration ---------- */
.yay { position: fixed; left: 50%; top: 42%; z-index: 30; pointer-events: none; }
.yay i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: pop .9s ease-out forwards; }
@keyframes pop { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* ---------- review ---------- */
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: #000 no-repeat; padding: 0; }
.thumb .tag { position: absolute; left: 0; right: 0; bottom: 0; font: 700 11px var(--ui); text-transform: uppercase; padding: 3px 6px; background: rgba(0,0,0,.72); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .tag.none { color: var(--muted); font-weight: 400; text-transform: none; }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; background: var(--ground); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
         padding: 18px var(--gut) calc(env(safe-area-inset-bottom) + 18px); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet h3 { margin: 0 0 6px; font-size: 19px; }
.sheet p { margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sheet .row { display: flex; gap: 10px; margin-top: 14px; }
.sheet .row > * { flex: 1; }
.sheet .stack { display: grid; gap: 10px; margin-top: 14px; }
.sheet textarea, .sheet input[type=text], .sheet input[type=url] { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.sheet textarea { min-height: 150px; font: 13px/1.5 var(--mono); resize: vertical; }
.errors { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.errors li { font: 12px/1.45 var(--mono); background: var(--card); border-left: 3px solid var(--red); padding: 8px 10px; border-radius: 4px; word-break: break-word; }
.errors.warn li { border-left-color: var(--yellow); }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-top: 10px; }
.menu { display: grid; gap: 8px; margin-top: 10px; }
.menu button { text-align: left; justify-content: flex-start; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 14px 0 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--focus); transition: width .15s; }
.example { display: grid; gap: 2px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: 100%; }
.example b { font-size: 15px; }
.example span { font-size: 13px; color: var(--muted); }

/* answer editor */
.defs { display: grid; gap: 8px; margin-top: 12px; }
.def { display: grid; grid-template-columns: 64px 1fr 40px; gap: 6px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: 10px; padding: 8px; }
.def select, .def input { min-width: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 14px; }
.def .meta { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.def .meta input[type=text] { width: 120px; padding: 5px 8px; font: 12px var(--mono); }
.def .meta input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--focus); }
.def .meta label { display: inline-flex; gap: 6px; align-items: center; }
.def.hidden-def { opacity: .5; }

/* ---------- zoom viewer ---------- */
.zoom { position: fixed; inset: 0; z-index: 15; background: #000; display: flex; flex-direction: column; }
.zoom .bar { display: flex; gap: 8px; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: var(--ground); flex-wrap: wrap; }
.zoom canvas { flex: 1; min-height: 0; width: 100%; touch-action: none; display: block; }
.zoom .bottom { padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px); background: var(--ground); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); translate: -50% 0; z-index: 40; background: var(--raise); border: 1px solid var(--line); color: var(--text);
         padding: 10px 14px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

/* ---------- mask editor ---------- */
.editor { position: fixed; inset: 0; z-index: 16; background: var(--ground); display: flex; flex-direction: column; padding-bottom: calc(env(safe-area-inset-bottom) + 6px); }
.editor .bar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 6px; flex: none; }
.editor .bar h3 { flex: 1; min-width: 0; margin: 0; font-size: 15px; text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor .bar h3 small { display: block; font: 500 11px var(--mono); color: var(--muted); }
.editor canvas { flex: 1; min-height: 0; width: 100%; touch-action: none; display: block; background: #000; }
.editor .rowx { display: flex; gap: 6px; padding: 6px 12px 0; overflow-x: auto; scrollbar-width: none; align-items: center; flex: none; }
.editor .rowx::-webkit-scrollbar { display: none; }
.editor .rowx .chip { flex: none; }
.editor .tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px 12px 0; flex: none; }
.tool { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font: 700 12px var(--ui); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--text); }
.tool b { font-size: 16px; line-height: 1; font-weight: 400; }
.tool[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); background: #1b2316; }
.tool.small { width: 44px; height: 38px; flex: none; font-size: 18px; }
.tool:disabled { opacity: .35; }
.editor .sizes input[type=range] { flex: 1; min-width: 80px; accent-color: var(--lime); }
@media (max-height: 680px) { .tool { height: 40px; } .tool b { font-size: 14px; } }

/* ---------- editor: canvas hint, tool rows, channels ---------- */
.editor .cwrap { position: relative; flex: 1; min-height: 0; }
.editor .cwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ehint { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.ehint span { font-size: 12px; line-height: 1.3; color: var(--text); background: rgba(13,18,20,.78); padding: 4px 8px; border-radius: 8px; max-width: 100%; }
.ehint span.warn { color: var(--yellow); }
.ehint .chip { pointer-events: auto; min-height: 30px; background: var(--ground); }
.editor .tools.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.editor .tools.t5 { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-top: 6px; }
.editor .tool { font-size: 11px; }
.editor .sep { width: 1px; height: 22px; background: var(--line); flex: none; margin: 0 2px; }
.editor .chip.frame[aria-pressed="true"] { border-color: var(--focus); color: var(--focus); }
.editor .chip.frame[aria-pressed="false"] { opacity: 1; text-decoration: none; }
@media (max-width: 380px) { .editor .tool { font-size: 10px; } .editor .tool b { font-size: 14px; } }

/* ---------- contrast panel ---------- */
.cpanel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 640px; margin: 0 auto; background: var(--ground); border: 1px solid var(--line); border-bottom: 0;
          border-radius: 16px 16px 0 0; padding: 12px var(--gut) calc(env(safe-area-inset-bottom) + 12px); display: grid; gap: 8px; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
.cp-head { display: flex; align-items: center; gap: 8px; }
.cp-head b { flex: 1; }
.cp-row { display: grid; grid-template-columns: 56px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.cp-row input { width: 100%; accent-color: var(--focus); }
.cp-row .mono { font-size: 12px; text-align: right; color: var(--text); }
.cp-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.cp-inv { display: inline-flex; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--focus); }

/* ---------- dopamine blast ---------- */
.yay.blast i { animation: burst var(--d, .9s) cubic-bezier(.15, .8, .3, 1) forwards; }
.yay.blast b { position: absolute; left: 0; top: 0; translate: -50% -50%; font-size: 56px; animation: boom .9s ease-out forwards; }
@keyframes burst { 60% { opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
@keyframes boom { 0% { scale: .2; opacity: 0; } 25% { scale: 1.25; opacity: 1; } 70% { scale: 1; opacity: 1; } to { scale: 1.1; opacity: 0; } }

/* ---------- banners, fields, notes, guide ---------- */
.banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--yellow); color: var(--yellow); background: rgba(242,193,78,.06);
          border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; font-size: 14px; line-height: 1.4; }
.banner .btn { min-height: 38px; flex: none; border-color: var(--yellow); color: var(--yellow); }
.banner.install { border-color: var(--focus); color: var(--text); background: rgba(185,227,255,.06); }
.banner.install .btn { border-color: var(--focus); color: var(--focus); }
.steps { margin: 12px 0; padding-left: 22px; line-height: 1.5; }
.steps li { margin: 8px 0; }
ul.steps { padding-left: 18px; }
.video-link { display: grid; gap: 4px; text-align: left; text-decoration: none; padding: 12px 14px; height: auto; }
.video-link b { color: var(--text); font-size: 15px; }
.video-link b .mono { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.video-link > span { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.live-row { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.live-row > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.live-row b { font-size: 14px; color: var(--text); }
.live-row span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.live-row .btn { min-height: 38px; flex: none; padding: 0 12px; font-size: 13px; }
.section-title .tabs { display: inline-flex; text-transform: none; letter-spacing: 0; }
.section-title .tabs button { font-size: 13px; }
.section-title .sec-act { float: right; font: 500 12px var(--font, inherit); letter-spacing: 0; text-transform: none; color: var(--focus); }
.section-sub { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.deckrow.cloud { border-style: dashed; }
.deckrow.cloud .count { color: var(--focus); }
.loadmark { background: transparent; border: 0; color: var(--focus); font: 500 11px var(--mono); padding: 2px 4px; flex: none; cursor: pointer; white-space: nowrap; }
.loadnote { color: var(--focus); font-weight: 500; }
.card-note { margin: auto; max-width: 420px; padding: 24px 18px; text-align: center; color: var(--muted); line-height: 1.45; }
.card-note b { display: block; color: var(--text); font-size: 17px; margin-bottom: 8px; }
.card-note .row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.live-mark { background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--green); font: 500 12px var(--mono); padding: 4px 6px; flex: none; cursor: pointer; }
.live-mark[data-s="saving"], .live-mark[data-s="offline"] { color: var(--muted); }
.live-mark[data-s="paused"], .live-mark[data-s="error"] { color: var(--yellow); border-color: var(--yellow); }
.field { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; color: var(--text); }
.field .seg { justify-self: start; }
.note-btn { background: transparent; border: 0; color: var(--muted); font: 500 11px var(--mono); padding: 0 4px; flex: none; cursor: pointer; }
.note-btn.has { color: var(--yellow); }
.cardfoot { align-items: center; }
.guide { color: var(--muted); font-size: 14px; line-height: 1.6; padding-left: 18px; margin: 8px 0; }
.guide b { color: var(--text); }
.editor .tools.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- sharing, photos ---------- */
.share-link { display: grid; gap: 10px; justify-items: center; margin-top: 8px; }
.share-link .qr { background: #fff; border-radius: 12px; padding: 8px; line-height: 0; }
.share-link .qr svg { width: 220px; height: 220px; }
.share-link input { width: 100%; font: 12px var(--mono); }
.share-link .row { width: 100%; }
.ph-ans { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; }
.ph-ans span { color: var(--muted); text-align: center; }
.sheet input[type=text] { min-width: 0; }

/* ---------- results ---------- */
.results .r-sub { margin: 0 0 6px; }
.r-hero { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; color: var(--muted); font-size: 14px; }
.r-hero b { font-size: 34px; color: var(--text); font-weight: 500; }
.r-duel { font-size: 15px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.r-duel b { color: var(--text); }
.r-bars { display: grid; gap: 14px; }
.r-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.r-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-label i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.r-num { font-size: 13px; color: var(--text); }
.r-track { grid-column: 1 / -1; position: relative; height: 12px; background: var(--card); border-radius: 0 4px 4px 0; }
.r-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.r-ci { position: absolute; top: 50%; height: 2px; translate: 0 -50%; background: var(--text); opacity: .55; }
.r-ci::before, .r-ci::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: var(--text); }
.r-ci::before { left: 0; } .r-ci::after { right: 0; }
.r-ci-text { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.r-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.r-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.r-stats b { font-size: 20px; font-weight: 500; }
.r-stats span { font-size: 12px; color: var(--muted); }
.r-table-wrap { overflow-x: auto; margin-top: 10px; }
.r-table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.r-table th, .r-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
.r-table thead th { color: var(--muted); font-weight: 500; }
.r-table tbody th { text-align: left; color: var(--muted); font-weight: 500; }
.r-table td { font-family: var(--mono); }
.r-table td.diag { color: var(--green); background: rgba(61,220,151,.08); }
.r-table td.off { color: var(--yellow); }
.r-diffs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- home: compact hero, folder line, one list ---------- */
.hero.compact { gap: 10px; padding: 12px 0 4px; }
.hero.compact img { width: 32px; height: 32px; border-radius: 9px; }
.hero.compact h1 { font-size: 18px; }
.banner .btn { min-height: 44px; }
.banner .x { flex: none; width: 44px; height: 44px; background: transparent; border: 0; color: var(--muted); font-size: 16px; }
.folder-line { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 10px; padding: 8px 12px;
               background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-size: 13px; text-align: left; }
.folder-line > span { flex: 1; min-width: 0; line-height: 1.35; }
.folder-line > b { flex: none; color: var(--focus); font-size: 15px; }
.folder-line.warn { border-color: var(--yellow); color: var(--yellow); }
.folder-line.warn > b { color: var(--yellow); font-size: 13px; }
.folder-line.busy { border-color: var(--focus); }
.folder-line .btn { min-height: 36px; flex: none; padding: 0 12px; font-size: 13px; }
.folder-errs { display: block; margin-top: 6px; color: var(--yellow); font-size: 12px; }
.folder-log { display: block; margin-top: 6px; font-size: 12px; }
.folder-line .fl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.folder-line .fl-main > b { flex: none; color: var(--muted); font-size: 18px; }
.fl-step { flex: 1; min-width: 0; display: grid; gap: 3px; line-height: 1.35; }
.fl-sub { color: var(--muted); font-size: 12px; }
.fl-sub .mono { color: var(--text); }
.fl-bar { display: block; height: 4px; margin-top: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fl-bar > i { display: block; height: 100%; background: var(--focus); transition: width .2s; }
.folder-line .fl-ico { flex: none; }
.folder-line > .fl-step { flex: 1; }
.card-note .fl-card { margin-top: 6px; text-align: left; }
.card-note .fl-card .fl-what { color: var(--text); }
.activity { list-style: none; padding: 0; margin: 10px 0; max-height: 40vh; overflow-y: auto; display: grid; gap: 4px; }
.activity li { font: 12px/1.45 var(--mono); color: var(--muted); background: var(--card); padding: 6px 8px; border-radius: 4px; word-break: break-word; }
.tabs-row { margin: 18px 0 8px; }
.seg.tabs button { min-height: 44px; padding: 0 16px; font-size: 13px; }
.list-div { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 8px 2px 0; }
.deckrow .sub .warn { color: var(--yellow); font-weight: 500; }
.deckitem { position: relative; }
.deckitem .deckrow { padding-right: 52px; }
.rowmenu { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 44px; height: 44px; background: transparent;
           border: 0; border-radius: 10px; color: var(--muted); font-size: 20px; line-height: 1; }
.rowmenu:active { background: var(--raise); }
.add-deck { width: 100%; min-height: 48px; margin-top: 10px; }
.start { display: grid; gap: 10px; margin: 16px 0; }
.start .btn { min-height: 52px; }
.start .link-btn { min-height: 44px; color: var(--focus); }
.start small, .add-menu small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.add-menu .btn { min-height: 56px; display: block; text-align: left; }
.start .btn.two { display: block; text-align: center; padding: 10px 14px; }
.menu a.btn { text-decoration: none; display: flex; align-items: center; }
.menu small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
