/* Малыш рядом — Mini App.
   Layout: one phone column. The 24-hour dial is the hero of «Сегодня»; actions sit under the thumb;
   the ledger follows. Three palettes: light, dark (follows Telegram) and warm «night» for 3 a.m. feeds. */
:root {
  --bg: #F2F1F7; --surface: #FFFFFF; --surface-2: #F7F6FB; --ink: #15172A; --ink-2: #3A3D55; --muted: #6E7189; --line: #E5E4EE;
  --accent: #3D4BE0; --accent-ink: #FFFFFF;
  --feed: #E5824F; --sleep: #6A62E3; --diaper: #2F9B78; --pump: #D2528C; --tummy: #C49317; --care: #2C84C4; --note: #8A8DA3;
  --warn: #D8443A; --ok: #2F9B78; --gold: #C48A1E;
  --night-band: rgb(106 98 227 / .08); --scrim: rgb(15 17 30 / .45);
  --shadow: 0 1px 2px rgb(21 23 42 / .04), 0 10px 30px rgb(21 23 42 / .06);
  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 22px; --r-sm: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D0F17; --surface: #161925; --surface-2: #1C2030; --ink: #EDEEF7; --ink-2: #C9CBDD; --muted: #9094AE; --line: #262A3B;
  --accent: #8F9BFF; --accent-ink: #0D0F17;
  --feed: #F29F72; --sleep: #A7A0FF; --diaper: #63CFA6; --pump: #F08ABA; --tummy: #E8C152; --care: #6FB8EA; --note: #9A9DB4;
  --warn: #FF7E70; --ok: #63CFA6; --gold: #E9BC5A;
  --night-band: rgb(167 160 255 / .07); --scrim: rgb(0 0 0 / .6); --shadow: 0 0 0 1px rgb(255 255 255 / .03);
  color-scheme: dark;
}
:root[data-theme="night"] {
  --bg: #0A0705; --surface: #15100C; --surface-2: #1B140F; --ink: #EBC9A6; --ink-2: #D2AE8B; --muted: #977A60; --line: #2A2018;
  --accent: #E0A060; --accent-ink: #0A0705;
  --feed: #D88E58; --sleep: #B08868; --diaper: #95A160; --pump: #BE7769; --tummy: #C29A44; --care: #A38E70; --note: #8A7560;
  --warn: #E6805A; --ok: #95A160; --gold: #D7A65A;
  --night-band: rgb(224 160 96 / .06); --scrim: rgb(0 0 0 / .72); --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 15.5px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; transition: background .35s, color .35s; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
/* Telegram reports its own header / notch zone through --tg-*-safe-area-inset-* (Bot API 8.0+); browsers use env(). */
:root { --top-inset: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))); }
.app { max-width: 480px; margin: 0 auto; padding: calc(12px + var(--top-inset)) max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; }
section, .stack { display: flex; flex-direction: column; gap: 10px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font: 600 18px/1.25 var(--f-display); letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .warn-t { color: var(--warn); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* splash */
.splash { min-height: 70dvh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); }
.splash-ring { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* icons */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.glyph { --c: var(--accent); width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: var(--surface); display: grid; place-items: center; flex: none; }
.glyph .ic { width: 19px; height: 19px; stroke-width: 2.1; }
.glyph.sm { width: 28px; height: 28px; } .glyph.sm .ic { width: 15px; height: 15px; }
.t-feed, .t-bottle { --c: var(--feed); } .t-sleep { --c: var(--sleep); } .t-diaper { --c: var(--diaper); } .t-pump { --c: var(--pump); }
.t-tummy { --c: var(--tummy); } .t-temp, .t-med, .t-bath { --c: var(--care); } .t-note { --c: var(--note); }

/* header */
.top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(140deg, var(--sleep), var(--accent)); color: #fff; display: grid; place-items: center; font: 700 19px var(--f-display); flex: none; }
.who { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.who h1 { font: 700 21px/1.15 var(--f-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.who h1 .nm { overflow: hidden; text-overflow: ellipsis; }
.who h1 .plus-chip { margin-left: 0; flex: none; }
.who .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; color: var(--ink); }
.iconbtn.on { background: var(--accent); color: var(--accent-ink); }
.plus-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--gold); vertical-align: 2px; margin-left: 6px; }

/* cards */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.banner { --c: var(--accent); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--c) 11%, var(--surface)); font-size: 14px; }
.banner .ic { color: var(--c); flex: none; margin-top: 1px; }
.banner b { font-weight: 700; }
.banner.warn { --c: var(--warn); } .banner.gold { --c: var(--gold); } .banner.ok { --c: var(--ok); }
.banner .actions-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* buttons */
.btn { --c: var(--accent); border: 0; border-radius: 14px; padding: 12px 18px; min-height: 46px; background: var(--c); color: var(--accent-ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { --c: var(--warn); color: #fff; }
.btn.gold { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 92%, #fff), var(--gold)); color: #fff; }
.btn.sm { min-height: 36px; padding: 7px 12px; border-radius: 11px; font-size: 14px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 6px 0; text-align: left; }
.chip-btn { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--surface-2); font-weight: 600; font-size: 14px; }
.chip-btn.sel { background: var(--ink); color: var(--surface); }

/* dial */
.dial-card { position: relative; padding: 14px 14px 16px; overflow: hidden; }
.dial-card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(closest-side, var(--sky, transparent), transparent); opacity: .7; pointer-events: none; }
.dial-wrap { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; }
.dial-wrap svg { width: 100%; height: 100%; overflow: visible; }
.dial-center { position: absolute; inset: 24%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.dial-center .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.dial-center .v { font: 700 clamp(26px, 9vw, 36px)/1.05 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dial-center .s { font-size: 12.5px; color: var(--muted); max-width: 150px; }
.dial-center .s.alert { color: var(--warn); font-weight: 700; }
.legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; }
.fact { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.fact .s { font-size: 12px; color: var(--muted); }
.fact .s.alert { color: var(--warn); font-weight: 700; }

/* running timers */
.run { --c: var(--accent); background: var(--c); color: #fff; border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px color-mix(in srgb, var(--c) 35%, transparent); }
:root[data-theme="night"] .run { color: var(--bg); box-shadow: none; }
.run .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; }
.run .clock { font: 700 34px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.run .split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.run .side { border: 0; border-radius: 14px; padding: 10px 12px; background: rgb(255 255 255 / .16); color: inherit; text-align: left; }
.run .side.cur { background: rgb(255 255 255 / .3); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .7); }
.run .side b { display: block; font: 700 18px var(--f-display); font-variant-numeric: tabular-nums; }
.run .side span { font-size: 12.5px; opacity: .9; }
.run .btns { display: flex; gap: 8px; }
.run .btns button { flex: 1; border: 0; border-radius: 14px; padding: 12px; font-weight: 700; background: #fff; color: #15172A; }
:root[data-theme="night"] .run .btns button { background: var(--bg); color: var(--ink); }
.run .btns button.alt { flex: 0 0 auto; background: rgb(255 255 255 / .18); color: inherit; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: pulse 1.6s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .25; } } }

/* quick actions */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act { --c: var(--accent); border: 0; border-radius: var(--r); padding: 14px 12px 12px; min-height: 112px; background: linear-gradient(165deg, color-mix(in srgb, var(--c) 13%, var(--surface)), var(--surface) 65%); box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: transform .12s; }
.act:active { transform: scale(.97); }
.act b { display: block; font-size: 15px; font-weight: 700; }
.act small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { --c: var(--accent); border: 0; flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }

/* ledger */
.dayhead { display: flex; align-items: center; gap: 8px; }
.dayhead h2 { flex: 1; }
.dayhead .date { font: 500 13px var(--f-body); color: var(--muted); }
.navbtn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
.navbtn:disabled { opacity: .35; cursor: default; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r-sm); padding: 10px; min-width: 0; }
.stat b { display: block; font: 700 19px/1.2 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--muted); line-height: 1.2; display: block; }
.stat i { font-style: normal; font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.stat i.low { color: var(--warn); font-weight: 700; }
.timeline { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r); padding: 4px 14px; }
.ev { display: grid; grid-template-columns: 44px 28px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.ev:last-child { border-bottom: 0; }
.ev:disabled { cursor: default; }
.ev time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .what { min-width: 0; } .ev .what b { font-weight: 600; } .ev .what span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ev .by { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ev.pending { opacity: .6; }
.empty { color: var(--muted); padding: 22px 6px; text-align: center; font-size: 14px; }

/* misc cards */
.tip { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.tip b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; }
.li .t { font-weight: 600; min-width: 0; } .li .t span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.chk { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line); background: none; padding: 0; display: grid; place-items: center; color: #fff; }
.chk.on { background: var(--ok); border-color: var(--ok); }
.chk .ic { width: 15px; height: 15px; stroke-width: 3; }
.pill { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.pill.due { background: color-mix(in srgb, var(--feed) 22%, var(--surface)); color: var(--ink); }
.pill.done { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ink); }
.pill.gold { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: var(--gold); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.sel { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.chart svg { width: 100%; height: auto; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 130px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .col { width: 100%; max-width: 32px; border-radius: 8px 8px 4px 4px; background: var(--c); min-height: 3px; }
.bar.today .col { opacity: .5; }
.bar .v { color: var(--ink); font-weight: 700; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px; }
.tile b { display: block; font: 700 20px/1.2 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--muted); }

/* premium */
.locked { position: relative; overflow: hidden; }
.locked .preview { filter: blur(6px) saturate(.7); opacity: .55; pointer-events: none; }
.locked .gate { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 20px; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface) 85%, transparent) 40%); }
.plus-card { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface) 60%); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent); }
.perks { display: grid; gap: 10px; }
.perk { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; font-size: 14px; }
.perk b { display: block; font-size: 15px; }
.perk span { color: var(--muted); font-size: 13px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { border: 0; border-radius: 18px; padding: 14px; background: var(--surface-2); text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s; }
.plan.sel { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.plan .p { font: 700 22px var(--f-display); letter-spacing: -.02em; }
.plan .badge { position: absolute; top: -9px; right: 10px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.plan small { color: var(--muted); font-size: 12.5px; }

/* dad mode */
.dad-hero { background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--sleep))); color: var(--accent-ink); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 30%, transparent); }
.dad-hero .big { font: 700 26px/1.15 var(--f-display); letter-spacing: -.02em; }
.dad-hero .bar-track { height: 8px; border-radius: 4px; background: rgb(255 255 255 / .25); overflow: hidden; }
.dad-hero .bar-track i { display: block; height: 100%; background: currentColor; border-radius: 4px; }
.dad-hero .row button { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; background: var(--accent-ink); color: var(--accent); }
.dad-hero .row button.alt { background: rgb(255 255 255 / .2); color: inherit; }
.mood { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood button { border: 0; border-radius: 14px; padding: 12px 6px; font-weight: 700; font-size: 13.5px; background: var(--surface); box-shadow: var(--shadow); }
.mood button.sel { background: var(--ok); color: #fff; }
.mood button.sel.tired { background: var(--tummy); } .mood button.sel.help { background: var(--warn); }
.cry { width: 100%; border: 0; border-radius: var(--r); padding: 16px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); text-align: left; display: flex; gap: 14px; align-items: center; }
.cry b { display: block; font-size: 16.5px; } .cry span { font-size: 13px; color: var(--muted); }
.plan-list .it { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-list .it:last-child { border-bottom: 0; }
.plan-list time { font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-list .it span { display: block; font-size: 12.5px; color: var(--muted); }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.faq:last-of-type { border-bottom: 0; }
details.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--sleep); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.step.danger .n { background: var(--warn); }
.step b { display: block; } .step p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.step .hot { color: var(--warn); font-weight: 600; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge-i { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.badge-i b { display: block; font-size: 13.5px; } .badge-i span { font-size: 12px; color: var(--muted); }
.badge-i.on { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.badge-i.on b::before { content: "★ "; color: var(--gold); }
.member { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; }
.member .ph { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); overflow: hidden; }
.member .ph img { width: 100%; height: 100%; object-fit: cover; }
.member .n { min-width: 0; font-weight: 600; } .member .n span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.contrib { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 8px 12px; font-size: 14px; align-items: center; font-variant-numeric: tabular-nums; }
.contrib .h { color: var(--muted); font-size: 12px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; width: 100%; min-width: 0; min-height: 48px; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picks { display: flex; gap: 8px; flex-wrap: wrap; }
.picks button { border: 0; background: var(--surface-2); border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.picks button.sel { background: var(--ink); color: var(--surface); }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; } .opts.four { grid-template-columns: repeat(4, 1fr); }
.opt { --c: var(--accent); border: 0; border-radius: 16px; padding: 14px 8px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); font-weight: 700; font-size: 14.5px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.opt small { font-weight: 500; color: var(--muted); font-size: 12px; }
.opt.sel { background: var(--c); color: #fff; } .opt.sel small { color: inherit; }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 999px; border: 0; background: var(--line); flex: none; transition: background .2s; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .2s; }
.toggle.on { background: var(--ok); } .toggle.on::after { transform: translateX(20px); }

/* onboarding */
.hero { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.hero h1 { font: 700 30px/1.1 var(--f-display); letter-spacing: -.03em; }
.hero p { color: var(--muted); font-size: 16px; }
.hero .app-logo { align-self: center; border-radius: 16px; }
.hero-dial { width: 180px; margin: 6px auto 4px; }
.points { display: grid; gap: 12px; }
.point { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; }
.point b { display: block; } .point span { font-size: 13px; color: var(--muted); }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 12px; max-width: 120px; margin: 0 auto; width: 100%; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-selected="true"] { color: var(--accent); }
.tabbar button[aria-selected="true"] svg { stroke-width: 2.3; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 10; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; max-height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--top-inset) - 12px); overflow-y: auto; overscroll-behavior: contain; border-radius: 26px 26px 0 0; display: flex; flex-direction: column; gap: 14px;
  padding: 8px max(18px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); touch-action: pan-y; }
.sheet > * { flex-shrink: 0; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 6px; flex: none; }
.sheet h2 { font-size: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet-wrap { animation: fade .2s ease-out; } .sheet { animation: up .28s cubic-bezier(.2, .9, .3, 1); }
  @keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(40%); } }
  .pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); } @keyframes pop { from { transform: scale(.6); opacity: 0; } }
}
.toast { position: fixed; z-index: 30; left: 50%; top: calc(12px + var(--top-inset)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; padding: 0; }
.copybox { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.success { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.success .medal { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, var(--gold), color-mix(in srgb, var(--gold) 60%, #fff)); color: #fff; }
.success .medal .ic { width: 40px; height: 40px; stroke-width: 2.4; }

@media (max-width: 370px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .actions .act { min-height: 100px; padding: 12px 10px; }
  .facts { grid-template-columns: 1fr; }
}

/* picture guide */
.guide-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(-1 * max(18px, env(safe-area-inset-left))); }
.guide-track::-webkit-scrollbar { display: none; }
.guide-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; padding: 14px max(18px, env(safe-area-inset-left)) 22px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
/* Phone frame: dark bezel with an inner gap so the screenshot's rounded corners never clip the app header. */
.guide-slide .phone { --h: clamp(200px, calc(var(--tg-viewport-stable-height, 100dvh) - var(--top-inset) - 400px), 460px);
  height: var(--h); aspect-ratio: 390 / 844; max-width: 100%; padding: calc(var(--h) * .022); border-radius: calc(var(--h) * .075);
  background: #15172A; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent), 0 14px 32px rgb(0 0 0 / .18); }
.guide-slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: calc(var(--h) * .055); background: var(--surface-2); }
.guide-slide figcaption { text-align: center; display: grid; gap: 4px; max-width: 360px; }
.guide-slide figcaption b { font: 600 17px/1.25 var(--f-display); }
.guide-slide figcaption span { color: var(--muted); font-size: 14px; }
.guide-dots { display: flex; justify-content: center; gap: 6px; }
.guide-dots button { width: 7px; height: 7px; border-radius: 4px; border: 0; padding: 0; background: var(--line); transition: width .2s, background .2s; }
.guide-dots button.on { width: 20px; background: var(--accent); }

@media (max-width: 360px) {
  .who .sub .bd { display: none; }
  .top { gap: 10px; }
  .avatar { width: 42px; height: 42px; border-radius: 14px; }
  .iconbtn { width: 38px; height: 38px; border-radius: 12px; }
}
