/* Family Habit Race — warm paper + steppe-sky blue + sun gold (from the Kazakh flag) */
:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #EFECE5;
  --ink: #1A1C20;
  --ink-2: #5F646C;
  --ink-3: #8D9199;
  --line: #E6E2D9;
  --off: #D3CFC6;
  --blue: #0B77C2;
  --blue-soft: #E1EFFA;
  --gold: #E9A800;
  --gold-ink: #8A6300;
  --gold-soft: #FDF1CF;
  --good: #1E9461;
  --good-soft: #DDF3E8;
  --bad: #D2483F;
  --bad-soft: #FBE4E2;
  --shadow: 0 1px 2px rgb(20 20 10 / .04), 0 6px 20px rgb(20 20 10 / .05);
  --radius: 20px;
  --h0: #ECE9E2; --h1: #C6E0F3; --h2: #8CC2E8; --h3: #3D97D6; --h4: #0B77C2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1014;
    --surface: #171A20;
    --surface-2: #20242C;
    --ink: #ECEEF2;
    --ink-2: #A0A6B0;
    --ink-3: #6E747E;
    --line: #262A33;
    --off: #3B414C;
    --blue: #4DB2F2;
    --blue-soft: #13324A;
    --gold: #F5C531;
    --gold-ink: #F5C531;
    --gold-soft: #3A3114;
    --good: #3DCB8D;
    --good-soft: #12352A;
    --bad: #F07067;
    --bad-soft: #3D1D1C;
    --shadow: none;
    --h0: #22262E; --h1: #133A57; --h2: #1A5E8F; --h3: #2D8ACC; --h4: #4DB2F2;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 24px; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 750; }
h2, h3 { margin: 0; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }
.sub { color: var(--ink-2); font-size: 15px; }
.sub .ic { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.center { text-align: center; margin-top: 8px; }
.empty { color: var(--ink-3); text-align: center; padding: 24px 16px; }

/* icons */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.gold { color: var(--gold); fill: var(--gold); stroke: var(--gold); width: 16px; height: 16px; vertical-align: -2px; margin-right: 6px; }
.ic.good { color: var(--good); width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }

/* header */
.top { margin: 4px 0 18px; }
.top .sub { margin-top: 6px; }
.eyebrow { color: var(--ink-3); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

/* surfaces */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
@media (prefers-color-scheme: light) { .card { border-color: transparent; } }
.card.pad { padding: 18px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }

/* buttons */
button { font: inherit; color: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: 14px; border: 0;
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow);
  transition: transform .12s ease, opacity .12s ease;
}
@media (prefers-color-scheme: dark) { .btn { background: var(--surface-2); } }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgb(11 119 194 / .25); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #06263C; box-shadow: none; } }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.dashed { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); color: var(--ink-2); }
.btn.danger { background: transparent; box-shadow: none; color: var(--bad); }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-3);
}
.icon-btn:active { background: var(--surface-2); }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: var(--blue); font-weight: 600; font-size: 15px; padding: 10px 2px 2px; min-height: 44px;
}
.text-btn .ic { width: 18px; height: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink);
  font-weight: 650; font-size: 14px; margin-top: 10px;
}
.pill .ic { width: 16px; height: 16px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* rings, bars, avatars */
.ring { position: relative; width: var(--size); height: var(--size); display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-2); }
.ring-fg { fill: none; stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring.complete .ring-fg { stroke: var(--good); }
.ring-in { position: relative; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring-in small { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.good i { background: var(--good); }
.bar.thin { height: 4px; margin-top: 10px; }
.av {
  --av: #888; display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--av) 18%, var(--surface)); color: var(--av);
  font-weight: 750; font-size: 18px;
}
.av.sm { width: 32px; height: 32px; font-size: 14px; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.av.xl { width: 68px; height: 68px; font-size: 27px; }
.av.fam { background: var(--blue-soft); color: var(--blue); }
.av.fam .ic { width: 18px; height: 18px; }

/* notices */
.notice {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 10px 0;
  border-radius: 16px; font-size: 15px; line-height: 1.4; color: var(--ink);
}
.notice > span { flex: 1; }
.notice .ic { width: 22px; height: 22px; }
.notice .ic.end { width: 18px; height: 18px; opacity: .6; }
.n-good { background: var(--good-soft); } .n-good > .ic:first-child { color: var(--good); }
.n-gold { background: var(--gold-soft); } .n-gold > .ic:first-child { color: var(--gold-ink); }
.n-blue { background: var(--blue-soft); } .n-blue > .ic:first-child { color: var(--blue); }
.n-muted { background: var(--surface-2); } .n-muted > .ic:first-child { color: var(--ink-2); }

/* today: hero */
.hero {
  display: flex; align-items: center; gap: 18px; padding: 20px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); margin-bottom: 6px;
}
.hero .ring-in b { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.hero .ring-in small { font-size: 13px; margin-top: 2px; }
.hero-text { display: flex; flex-direction: column; min-width: 0; }
.hero-text strong { font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }
.hero-text > span { color: var(--ink-2); font-size: 14px; margin-top: 4px; }

.one {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 10px 0;
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--gold);
}
.one > .ic { color: var(--gold); fill: var(--gold); width: 22px; height: 22px; }
.one small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.one strong { font-size: 16px; }

/* today: habits */
.habits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.habit {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 6px 14px 14px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
  transition: background .25s ease;
}
.habit .check {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); color: transparent;
  display: grid; place-items: center; padding: 0; transition: all .2s ease;
}
.habit .check .ic { width: 24px; height: 24px; stroke-width: 2.6; }
.habit .check:hover { border-color: var(--blue); }
.habit.done { background: color-mix(in srgb, var(--good-soft) 70%, var(--surface)); }
.habit.done .check { background: var(--good); border-color: var(--good); color: #fff; animation: pop .35s cubic-bezier(.2,.8,.2,1.4); }
@media (prefers-color-scheme: dark) { .habit.done .check { color: #08241A; } }
.habit .body { flex: 1; min-width: 0; padding-top: 2px; }
.habit .title { font-weight: 650; font-size: 16.5px; line-height: 1.3; }
.habit .key .ic { color: var(--gold); fill: var(--gold); width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.habit .cue { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.habit .meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-width: 0; }
.streak {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-size: 13px; font-weight: 700; color: var(--gold-ink); background: var(--gold-soft);
  padding: 3px 9px 3px 7px; border-radius: 999px;
}
.streak .ic { width: 14px; height: 14px; }
.streak.zero { color: var(--ink-3); background: var(--surface-2); }
.goal-link { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink-3); font-size: 13px; }
.goal-link .ic { width: 14px; height: 14px; }
.goal-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.alt {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 550;
}
.alt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt .ic { width: 15px; height: 15px; color: var(--good); }
.burst { position: absolute; left: 18px; top: 4px; font-size: 26px; pointer-events: none; animation: burst .9s ease-out forwards; }
@keyframes burst { from { transform: translateY(0) scale(.5); opacity: 1; } to { transform: translateY(-56px) scale(1.3); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.fold { margin-top: 12px; }
.fold > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 4px; color: var(--ink-2); font-weight: 600; font-size: 15px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .end { margin-left: auto; width: 18px; height: 18px; transition: transform .2s; }
.fold[open] > summary .end { transform: rotate(90deg); }
.fold .count { background: var(--surface-2); border-radius: 99px; padding: 1px 8px; font-size: 13px; }
.help p { color: var(--ink-2); font-size: 14.5px; padding: 0 4px 8px; }

/* today: family */
.fam-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; padding: 18px 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.fam-grid li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.fam-grid .ring .av { width: 46px; height: 46px; font-size: 18px; }
.fam-grid .nm { font-size: 13.5px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fam-grid small { color: var(--ink-3); font-size: 11.5px; margin-top: -4px; white-space: nowrap; }
.fam-grid li.me .nm { color: var(--blue); }

/* goals */
.people { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.people::-webkit-scrollbar { display: none; }
.people > button {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; scroll-snap-align: start;
  padding: 5px 14px 5px 5px; min-height: 44px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; color: var(--ink-2);
}
.people > button.on { background: var(--ink); color: var(--bg); }
.people > button.on .av { background: color-mix(in srgb, var(--av) 35%, var(--ink)); color: #fff; }
.people > button.on .av.fam { background: var(--blue); color: #fff; }
.periods > button { padding: 8px 16px; flex-direction: column; align-items: flex-start; gap: 0; border-radius: 16px; }
.periods > button small { font-size: 11.5px; opacity: .7; font-weight: 500; }
.due-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

.visions { display: grid; gap: 14px; }
.vision { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 6px 16px 10px; }
.vision.done { opacity: .75; }
.vision-head { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; background: none; padding: 12px 0; }
.vh-text { flex: 1; min-width: 0; }
.vision-head h3 { font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; margin-top: 3px; }
.lvl { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.identity { color: var(--ink-2); font-style: italic; font-size: 14.5px; margin-top: 4px; }
.identity::before { content: '“'; } .identity::after { content: '”'; }
.ladder { position: relative; margin: 2px 0 0; padding: 4px 0 0; border-top: 1px solid var(--line); }
.ladder li { --d: 1; padding-left: calc((var(--d) - 1) * 16px); }
.step { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; }
.step .dot { position: relative; width: 10px; height: 10px; flex: none; border-radius: 50%; border: 2px solid var(--blue); background: var(--surface); }
.step.done .dot { background: var(--good); border-color: var(--good); }
.step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.step .lvl { font-size: 10.5px; color: var(--ink-3); }
.step .st { font-size: 15px; font-weight: 600; line-height: 1.3; }
.step .bar { margin-top: 4px; height: 5px; }
.step .pc { font-size: 13px; font-weight: 700; color: var(--ink-2); min-width: 38px; text-align: right; }

/* race */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 10px 0 18px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod-av { position: relative; margin-bottom: 4px; }
.pod b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.medal {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  border: 2px solid var(--bg);
}
.medal { background: var(--m); }
.block { width: 100%; border-radius: 14px 14px 4px 4px; margin-top: 6px; border-top: 3px solid var(--m); background: linear-gradient(180deg, color-mix(in srgb, var(--m) 14%, var(--surface)), transparent 95%); }
.p1 { --m: #E9A800; } .p2 { --m: #9AA3AE; } .p3 { --m: #C47A45; }
.p1 .block { height: 92px; } .p2 .block { height: 64px; } .p3 .block { height: 44px; }
.pod.me b { color: var(--blue); }
.board { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; }
.board li { display: grid; grid-template-columns: 22px 32px minmax(0, 1fr) 70px 30px; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .rk { color: var(--ink-3); font-weight: 700; text-align: center; }
.board .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board b { text-align: right; }
.board li.me .nm { color: var(--blue); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; }
.tile { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .ic { width: 22px; height: 22px; margin-bottom: 6px; }
.tile small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.tile strong { font-size: 17px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles.three .tile strong { font-size: 22px; }
.tile.gold .ic { color: var(--gold); } .tile.blue .ic { color: var(--blue); } .tile.good .ic { color: var(--good); }

/* me */
.profile { display: flex; align-items: center; gap: 16px; margin: 4px 0 4px; }
.profile h1 { font-size: 26px; }
.profile .sub { margin-top: 4px; font-size: 14px; }
.heat-card { padding: 16px; }
.heat { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--h0); }
.heat i.off { background: color-mix(in srgb, var(--h0) 45%, transparent); }
.heat i.future { background: transparent; }
.heat i.now { box-shadow: 0 0 0 2px var(--ink); }
.l0 { background: var(--h0) !important; } .l1 { background: var(--h1) !important; } .l2 { background: var(--h2) !important; }
.l3 { background: var(--h3) !important; } .l4 { background: var(--h4) !important; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; color: var(--ink-3); font-size: 12px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend span { margin: 0 4px; }
.rows > li { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows.plain > li { padding: 10px 0; }
.hs-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hs-top strong { font-size: 15.5px; }
.hs-sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.hs-sub.good { color: var(--good); }
.pause-row, .mini-row { display: flex; align-items: center; gap: 10px; }
.pause-row span, .mini-row span { flex: 1; min-width: 0; }
.pause-row .ic { color: var(--ink-3); }
.mini-row small { color: var(--ink-3); }
.mini-row .ic { color: var(--good); width: 18px; height: 18px; }
.mini-row .num { flex: none; font-weight: 700; color: var(--good); min-width: 56px; }
.pause-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.pause-form input { min-width: 0; }
.pause-form input[name=reason] { grid-column: 1 / -1; }
.pause-form .btn { grid-column: 1 / -1; min-height: 46px; }
.card.pad > .sub { font-size: 14px; }

.settings { overflow: hidden; }
.set-group { padding: 18px 16px 6px; color: var(--ink-3); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.set-row > span:first-child { flex: 1; display: flex; align-items: center; }
.settings > .set-row:first-child { border-bottom: 0; min-height: 44px; padding-top: 14px; font-weight: 600; }
.set-pad { padding: 4px 16px 16px; }
.set-row.boxed { border: 0; background: var(--surface-2); border-radius: 14px; margin: 14px 0 0; }
.time-pair { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.time-pair input { width: auto; min-height: 38px; padding: 6px 8px; font-size: 15px; }
.inline-select { width: auto; max-width: 55%; min-height: 38px; padding: 6px 30px 6px 10px; font-size: 14.5px; text-align: right; }

/* switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 51px; height: 31px; min-height: 0; padding: 0; border: 0; border-radius: 99px; background: var(--off); margin: 0; cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.switch:checked { background: var(--good); box-shadow: none; }
.switch:focus { border: 0; background: var(--off); }
.switch:checked:focus { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

/* segmented */
.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #343A45; } }

/* forms */
.form { display: grid; gap: 14px; }
.card.form { padding: 18px; margin-top: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding-left: 2px; }
.field > small { color: var(--ink-3); font-size: 12.5px; }
input, select, textarea {
  font: inherit; width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); background: var(--surface); }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D9199' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two input { min-width: 0; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; inset: 0; min-height: 0; cursor: pointer; }
.days span { display: grid; place-items: center; height: 42px; border-radius: 12px; background: var(--surface-2); font-weight: 650; font-size: 13.5px; color: var(--ink-2); transition: all .15s; }
.days input:checked + span { background: var(--blue); color: #fff; }
.days input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.error { color: var(--bad); font-size: 14px; min-height: 0; }
.error:empty { display: none; }

/* review */
.results li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.rt { flex: 1; min-width: 0; }
.rdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ink-3); }
.rdot.good { background: var(--good); } .rdot.gold { background: var(--gold); } .rdot.bad { background: var(--bad); }
.tip { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); font-size: 14px; color: var(--ink); }
.tip .ic { color: var(--gold-ink); }
.answer { padding: 16px; margin-bottom: 10px; }
.answer header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.answer p { margin-top: 10px; white-space: pre-wrap; font-size: 15px; }
.tag { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.tag.good { color: var(--good); } .tag.bad { color: var(--bad); } .tag.blue { color: var(--blue); }

/* login */
.login { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 12px; }
.login .logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 6px; box-shadow: 0 10px 30px rgb(11 119 194 / .3); }
.login h1 { font-size: 28px; }
.login .form { text-align: left; margin-top: 10px; padding: 18px; }
.login .seg { margin-top: 8px; }

/* tab bar */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
#tabs a { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.tab-ic { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 99px; transition: background .2s; }
.tab-ic .ic { width: 23px; height: 23px; }
#tabs a.on { color: var(--blue); }
#tabs a.on .tab-ic { background: var(--blue-soft); }

/* bottom sheet */
dialog {
  border: 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); margin: auto auto 0;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink);
}
dialog[open] { animation: sheet .32s cubic-bezier(.2,.8,.2,1); }
dialog::backdrop { background: rgb(10 12 16 / .45); animation: fade .25s ease; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 640px) { dialog { margin: auto; border-radius: 28px; padding-bottom: 24px; } }
.grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 2px auto 6px; }
.dlg-close { position: absolute; top: 10px; right: 10px; }
.sheet-title { font-size: 23px; line-height: 1.2; letter-spacing: -0.015em; margin: 4px 44px 6px 0; }
dialog > .lvl { margin-top: 14px; }
dialog > .sub { margin-bottom: 4px; font-size: 14.5px; }
dialog .form { margin-top: 16px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; margin: 6px 0 4px; }
.crumbs .ic { width: 15px; height: 15px; }
.sheet-progress { display: flex; align-items: center; gap: 16px; padding: 16px; margin: 14px 0 4px; border-radius: 18px; background: var(--surface-2); }
.sheet-progress .ring-in b { font-size: 17px; }
.sheet-progress strong { display: block; font-size: 17px; }
.sheet-block { margin-top: 16px; }
.sheet-block h3 { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sheet-actions .btn { flex: 1 1 auto; min-height: 46px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .2); animation: sheet .25s ease;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
