/* Дашборд отчётов (вид — одобренный макет design/maket.html): три предприятия, один менеджер в день,
   план — только если директор его поставил. Строка «Смотреть как» — только у разработчика. */
:root {
  --bg: #F6F5F3; --surface: #FFFFFF; --chip: #F1EFEC; --line: #ECE8E3; --track: #EDEAE6;
  --ink: #1C1B1A; --ink-2: #57534F; --ink-3: #8A8580;
  --orange: #F57A1F; --orange-2: #FFA04D; --red: #E2382B; --red-2: #F4644F;
  --green: #2E9E4E; --green-2: #74CC84; --gold: #F2B000;
  --green-soft: #E6F4E9; --yellow-soft: #FFF1D9; --yellow-ink: #BF6A00; --orange-soft: #FFEBDD; --orange-ink: #D2600E;
  --glow: rgba(255, 140, 64, .32);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 22px rgba(60, 40, 20, .07);
  --on-accent: #FFFFFF;
  --av1: #FFE3CC; --av2: #DDF1E1; --av3: #FCE0DC; --av4: #E5E4FA; --av-ink: #3A2A1C;
  --s1: #2a78d6; --s2: #eb6834; --s1-soft: #E3EEFB; --s2-soft: #FDE7DC;
  --kaspi: #eb6834; --halyk: #1baf7a; --own: #C4BDB4;
  --h1: #EEF7F0; --h2: #CBEBD3; --h3: #96D5A6; --h4: #4FB26A; --h5: #258441; --h-ink-hi: #FFFFFF;
  --area: rgba(245, 122, 31, .10);
  --stage: #E7E3DD; --stage-2: #F6EEE6; --frame: #1A1917; --island: #000000;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210; --surface: #1F1D1A; --chip: #2A2724; --line: #33302C; --track: #34302B;
    --ink: #F3F0EC; --ink-2: #BDB6AE; --ink-3: #8D867E;
    --orange: #FF8A3D; --orange-2: #FFAD66; --red: #FF5B4D; --red-2: #FF7A66;
    --green: #4CC26A; --green-2: #2F8F4A; --gold: #FFC933;
    --green-soft: #183323; --yellow-soft: #3A2C13; --yellow-ink: #F5B84E; --orange-soft: #3A2414; --orange-ink: #FFAD66;
    --glow: rgba(255, 128, 48, .20);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --on-accent: #FFFFFF;
    --av1: #4A2F1A; --av2: #1D3A26; --av3: #45231F; --av4: #2C2B4A; --av-ink: #F3F0EC;
    --s1: #3987e5; --s2: #d95926; --s1-soft: #1B2A3F; --s2-soft: #3A2116;
    --kaspi: #d95926; --halyk: #199e70; --own: #5F5951;
    --h1: #1C2A20; --h2: #214530; --h3: #2A6A40; --h4: #3E9A58; --h5: #74CC84; --h-ink-hi: #10140F;
    --area: rgba(255, 138, 61, .12);
    --stage: #0B0A09; --stage-2: #1A1410; --frame: #2B2926; --island: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210; --surface: #1F1D1A; --chip: #2A2724; --line: #33302C; --track: #34302B;
  --ink: #F3F0EC; --ink-2: #BDB6AE; --ink-3: #8D867E;
  --orange: #FF8A3D; --orange-2: #FFAD66; --red: #FF5B4D; --red-2: #FF7A66;
  --green: #4CC26A; --green-2: #2F8F4A; --gold: #FFC933;
  --green-soft: #183323; --yellow-soft: #3A2C13; --yellow-ink: #F5B84E; --orange-soft: #3A2414; --orange-ink: #FFAD66;
  --glow: rgba(255, 128, 48, .20);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --on-accent: #FFFFFF;
  --av1: #4A2F1A; --av2: #1D3A26; --av3: #45231F; --av4: #2C2B4A; --av-ink: #F3F0EC;
  --s1: #3987e5; --s2: #d95926; --s1-soft: #1B2A3F; --s2-soft: #3A2116;
  --kaspi: #d95926; --halyk: #199e70; --own: #5F5951;
  --h1: #1C2A20; --h2: #214530; --h3: #2A6A40; --h4: #3E9A58; --h5: #74CC84; --h-ink-hi: #10140F;
  --area: rgba(255, 138, 61, .12);
  --stage: #0B0A09; --stage-2: #1A1410; --frame: #2B2926; --island: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.35; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
b, strong { font-variant-numeric: tabular-nums; }
svg { flex: none; }
h1, h2, h3, p { margin: 0; }

/* ---------- phone shell ---------- */
.device { position: relative; min-height: 100vh; background: var(--bg); }
.screen { position: relative; overflow-x: clip; }
.glow { position: absolute; top: 0; right: 0; width: min(78vw, 360px); height: 300px; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 62%); }
.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px calc(108px + env(safe-area-inset-bottom, 0px)); }
.app.solo { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

/* ---------- «смотреть как» (только у разработчика) ---------- */
.viewas { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-radius: 18px; background: var(--chip); }
.viewas-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.viewas-l small { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.vchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.vchips::-webkit-scrollbar { display: none; }
.vchips button { flex: none; font-size: 13.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.vchips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.viewas p { font-size: 13px; color: var(--ink-2); }

/* ---------- header ---------- */
.top { display: flex; flex-direction: column; gap: 3px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.demo { font-size: 11.5px; font-weight: 700; color: var(--yellow-ink); background: var(--yellow-soft); padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.top h1 { font-size: 31px; line-height: 1.08; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
.sub { font-size: 14.5px; color: var(--ink-2); }
.sub b { color: var(--ink); font-weight: 700; }

.nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.nav h2 { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.back { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); }

/* ---------- period + date strip ---------- */
/* лента месяцев — как переключатель предприятий внизу, но листается вбок */
.months { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--chip); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.months::-webkit-scrollbar { display: none; }
.months button { flex: none; min-width: 104px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 6px 12px; border-radius: 16px; text-align: center; color: var(--ink-2); scroll-snap-align: end; }
.months button b { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.months button small { font-size: 12px; font-weight: 600; opacity: .85; white-space: nowrap; }
.months button[aria-selected="true"] { background: linear-gradient(160deg, var(--orange-2), var(--orange)); color: var(--on-accent); box-shadow: 0 6px 16px rgba(245, 122, 31, .35); }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--chip); }
.seg3 button { min-height: 38px; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--ink-2); text-align: center; }
.seg3 button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 10px rgba(60, 40, 20, .08); }

.strip { position: relative; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px -16px 0; padding: 4px 16px 10px; }
.strip::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.dchip small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.dchip small.we { color: var(--red); }
.dchip b { font-size: 18px; font-weight: 800; line-height: 1.15; }
.dchip.in { background: var(--orange-soft); box-shadow: none; }
.dchip.on { background: linear-gradient(160deg, var(--orange-2), var(--orange)); color: var(--on-accent); box-shadow: 0 6px 14px rgba(245, 122, 31, .35); }
.dchip.on small { color: var(--on-accent); opacity: .9; }
.mon { flex: none; align-self: center; font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; writing-mode: vertical-rl; transform: rotate(180deg); padding: 0 2px; }

/* ---------- plan ring + tiles ---------- */
.hero { display: grid; grid-template-columns: 128px repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.hero.np { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ring-wrap { position: relative; width: 128px; height: 128px; align-self: center; }
.ring { width: 100%; height: 100%; display: block; }
.ring-track { stroke: var(--track); }
.stop-a { stop-color: var(--orange); } .stop-b { stop-color: var(--green); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px; }
.ring-text small { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ring-text b { font-size: 29px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.ring-text em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.c-good { color: var(--green); } .c-mid { color: var(--orange); }
.mini { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 13px 8px 11px; border-radius: 18px; min-height: 120px; text-align: center; }
.mini span { font-size: 14px; font-weight: 700; color: var(--ink); }
.mini b { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.mini b.l { font-size: 30px; } .mini b.xl { font-size: 24px; }
.mini small { font-size: 13px; font-weight: 700; }
.t-orange { background: var(--orange-soft); } .t-orange b { color: var(--orange-ink); }
.t-green { background: var(--green-soft); } .t-green b { color: var(--green); }
.t-yellow { background: var(--yellow-soft); } .t-yellow b { color: var(--yellow-ink); }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-3); margin: -6px 2px 0; }
.daynote { font-size: 14px; color: var(--ink-2); background: var(--chip); border-radius: 14px; padding: 10px 12px; }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; gap: 12px; width: 100%; background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.t small { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.pct { font-size: 22px; font-weight: 800; }
.note { font-size: 15px; color: var(--ink-2); }
.note b { color: var(--ink); }
.lbl { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: -4px; }

.stack { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--track); }
.stack i { display: block; min-width: 4px; }
.stack .kaspi { background: var(--kaspi); } .stack .halyk { background: var(--halyk); }
.stack .cash { background: var(--s1); } .stack .unsplit { background: var(--own); }
.stack .ad { background: var(--orange); } .stack .own { background: var(--own); }
.banks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bank { display: grid; grid-template-columns: 10px 1fr; gap: 2px 8px; align-items: center; }
.bank i { width: 10px; height: 10px; border-radius: 3px; }
.bank i.kaspi { background: var(--kaspi); } .bank i.halyk { background: var(--halyk); }
.bank i.cash { background: var(--s1); } .bank i.unsplit { background: var(--own); }
.bank i.ad { background: var(--orange); } .bank i.own { background: var(--own); }
.bank span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.bank b { grid-column: 2; font-size: 17px; font-weight: 800; }

.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kind { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 14px; background: var(--chip); min-width: 0; }
/* Слова не рвутся посередине («Предоплат-а»): на узком экране шрифт меньше, длинное — многоточием. */
.kind span { font-size: clamp(10.5px, 3vw, 12.5px); font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind b { font-size: 24px; font-weight: 800; line-height: 1.1; }

.bar { position: relative; height: 12px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transform-origin: left; background: linear-gradient(90deg, var(--orange-2), var(--orange)); }
.bar i.lead, .bar i.done { background: linear-gradient(90deg, var(--green-2), var(--green)); }
.bar i.plan { background: linear-gradient(90deg, var(--green) 0%, var(--green-2) 55%, var(--orange-2) 85%, var(--orange) 100%); }
.bar i.soft { background: var(--own); }
.who .bar { height: 10px; }
.legend { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .ln { width: 18px; height: 3px; border-radius: 2px; }
.ln.a { background: var(--s1); } .ln.b { background: var(--s2); } .ln.up { background: var(--green); } .ln.down { background: var(--red); }

/* rows with a bar: plan by period, promos */
.prows { display: flex; flex-direction: column; }
.prows > * + * { border-top: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 11px 0; }
.prow:first-child { padding-top: 2px; } .prow:last-child { padding-bottom: 2px; }
.prow > span { font-size: 15.5px; font-weight: 700; min-width: 0; }
.prow > span small { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.prow > b { font-size: 17px; font-weight: 800; text-align: right; }
.prow .bar { grid-column: 1 / -1; height: 9px; }
.prow > em { grid-column: 1 / -1; font-style: normal; font-size: 14px; color: var(--ink-2); margin-top: -2px; }
.prow > em b { color: var(--ink); }

/* weeks of advertising */
.wk { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 14px; font-size: 15px; }
.wk > * { padding: 9px 0; border-top: 1px solid var(--line); }
.wk > .h { border-top: 0; padding-top: 0; font-size: 12px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wk .n { text-align: right; font-weight: 700; }
.wk .sel { font-weight: 800; color: var(--orange-ink); }
.wk .wait { color: var(--ink-3); font-weight: 600; }

/* metric chips */
.mchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.mchips::-webkit-scrollbar { display: none; }
.mchips button { flex: none; font-size: 14.5px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.mchips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* line charts */
.lc svg { display: block; width: 100%; height: auto; touch-action: pan-y; overflow: visible; }
.lc .gl { stroke: var(--line); stroke-width: 1; }
.lc text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font); }
.lc text.xd { fill: var(--ink-2); font-weight: 700; font-size: 11px; }
.lc text.xd.on { fill: var(--orange-ink); font-weight: 800; }
.lc text.vl { fill: var(--ink); font-weight: 800; font-size: 11px; }
.lc text.vl.on { fill: var(--orange-ink); }
.lc .area { fill: var(--area); }
.lc .sg { stroke-width: 2.5; stroke-linecap: round; }
.lc .sg.up { stroke: var(--green); } .lc .sg.down { stroke: var(--red); } .lc .sg.flat { stroke: var(--ink-3); }
.lc .pt { stroke: var(--surface); stroke-width: 2; }
.lc .pt.up { fill: var(--green); } .lc .pt.down { fill: var(--red); } .lc .pt.flat { fill: var(--ink-3); }
.lc .pt-ring { fill: none; stroke: var(--orange); stroke-width: 2.5; }
.lc .ln-a { stroke: var(--s1); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.lc .ln-b { stroke: var(--s2); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.lc .dt-a { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.lc .dt-b { fill: var(--s2); stroke: var(--surface); stroke-width: 2; }
.lc .xh { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.lc .hit { fill: transparent; cursor: crosshair; }
.info { font-size: 14.5px; color: var(--ink-2); background: var(--chip); border-radius: 12px; padding: 10px 12px; min-height: 42px; }
.info b { color: var(--ink); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--chip); min-width: 0; }
.fact span { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.fact b { font-size: 18px; font-weight: 800; }
.fact small { font-size: 13px; color: var(--ink-2); }

/* managers */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.who { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; padding: 12px 0; width: 100%; }
.who:first-child { padding-top: 2px; } .who:last-child { padding-bottom: 2px; }
.who .bar { grid-column: 2 / 4; }
.av { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--av-ink); }
.who.one .av { grid-row: auto; }
.av1 { background: var(--av1); } .av2 { background: var(--av2); } .av3 { background: var(--av3); } .av4 { background: var(--av4); }
.who-name { font-size: 16.5px; font-weight: 800; min-width: 0; display: flex; flex-direction: column; }
.who-name span { display: inline-flex; align-items: center; gap: 5px; }
.who-name small { font-size: 14px; font-weight: 600; color: var(--ink); }
.who-name small em { font-style: normal; font-weight: 500; color: var(--ink-2); }
.cnt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.cnt b { font-size: 26px; font-weight: 800; }
.cnt small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.crown path { fill: var(--gold); }
.off-note { font-size: 14px; color: var(--ink-3); }
.cmt { padding: 10px 12px; border-radius: 14px; background: var(--yellow-soft); font-size: 15px; color: var(--ink); }
.cmt span { display: block; font-size: 12.5px; font-weight: 800; color: var(--yellow-ink); margin-bottom: 2px; }
.btn2 { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 16px; background: var(--chip); font-weight: 700; font-size: 15.5px; color: var(--ink); }
.btn2 svg { color: var(--orange); }

/* manager × day table */
.heat-wrap { overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.heat-wrap::-webkit-scrollbar { display: none; }
.heat { display: grid; gap: 3px; align-items: center; }
.hn { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; padding-right: 4px; white-space: nowrap; }
.av.sm { grid-row: auto; width: 20px; height: 20px; font-size: 11px; }
.hc { display: grid; place-items: center; height: 28px; border-radius: 6px; width: 100%; font-size: 12.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.hc.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.h1 { background: var(--h1); } .h2 { background: var(--h2); } .h3 { background: var(--h3); } .h4 { background: var(--h4); color: var(--h-ink-hi); } .h5 { background: var(--h5); color: var(--h-ink-hi); }
.hc.ax { outline: 2px solid var(--orange); outline-offset: 1px; }
.hc.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.hd { font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; padding-top: 2px; }
.hd.ax { color: var(--orange-ink); font-weight: 800; }

/* profile & compare */
.prof { display: grid; grid-template-columns: 64px 1fr; gap: 4px 14px; align-items: center; }
.prof .av { width: 64px; height: 64px; font-size: 26px; grid-row: auto; }
.prof h3 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.rank { justify-self: start; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: var(--yellow-soft); color: var(--yellow-ink); }
.quad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.tile > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.tile > b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.shift { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 11px 0; width: 100%; }
.shift b { font-size: 15.5px; font-weight: 700; }
.shift strong { font-size: 15.5px; font-weight: 800; text-align: right; }
.shift small { font-size: 13.5px; color: var(--ink-2); grid-column: 1 / -1; }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick-l { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.pick-l i { width: 10px; height: 10px; border-radius: 50%; }
.pick-l i.a { background: var(--s1); } .pick-l i.b { background: var(--s2); }
.pchips { display: grid; gap: 6px; }
.pchips button { min-height: 40px; border-radius: 12px; background: var(--chip); font-weight: 700; font-size: 14.5px; text-align: center; color: var(--ink-2); border: 1.5px solid transparent; }
.pchips button.sel-a { background: var(--s1-soft); border-color: var(--s1); color: var(--ink); }
.pchips button.sel-b { background: var(--s2-soft); border-color: var(--s2); color: var(--ink); }
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs-head b { font-size: 18px; font-weight: 800; }
.vs-head b:last-child { text-align: right; }
.vs-head span { font-size: 12.5px; font-weight: 800; color: var(--ink-3); padding: 4px 8px; border-radius: 999px; background: var(--chip); text-align: center; }
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 4px 8px; padding: 11px 0 10px; border-top: 1px solid var(--line); }
.vs-row > span { font-size: 13.5px; color: var(--ink-3); font-weight: 600; text-align: center; }
.vs-row > b { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.vs-row > b:nth-of-type(2) { text-align: right; }
.vs-row > b.win { color: var(--ink); font-weight: 800; }
.vs-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; }
.vs-bar i { display: block; min-width: 3px; }
.vs-bar .a { background: var(--s1); } .vs-bar .b { background: var(--s2); }

/* bottom project switch */
.switch { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.switch[hidden] { display: none; }
.switch-in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 20px; background: var(--chip); }
.switch button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 4px; border-radius: 16px; text-align: center; color: var(--ink-2); min-width: 0; }
.switch button b { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.switch button small { font-size: 12px; font-weight: 600; opacity: .85; }
.switch button[aria-pressed="true"] { background: linear-gradient(160deg, var(--orange-2), var(--orange)); color: var(--on-accent); box-shadow: 0 6px 16px rgba(245, 122, 31, .35); }

.foot-note { font-size: 13px; color: var(--ink-3); text-align: center; padding: 4px 8px 0; }

/* motion */
.anim .ring-arc { animation: ring 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ring { from { stroke-dasharray: 0 999; } }
.anim .bar i { animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.anim > * { animation: fade .45s ease-out both; }
@keyframes fade { from { opacity: .35; transform: translateY(6px); } }

@media (max-width: 370px) {
  .hero { grid-template-columns: 112px repeat(2, minmax(0, 1fr)); }
  .ring-wrap { width: 112px; height: 112px; }
  .ring-text b { font-size: 25px; }
  .mini b { font-size: 30px; } .mini b.l { font-size: 25px; } .mini b.xl { font-size: 20px; }
  .top h1 { font-size: 27px; }
  .switch button b { font-size: 13px; }
  .kind b { font-size: 21px; }
}
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
@media (prefers-reduced-motion: reduce) { .anim *, .anim > * { animation: none !important; } }
