/* Tobiaswim. Minimal pool-tile palette, one family (Archivo) in two widths.
   Motif: the T at the end of a lane line on the pool floor. */

:root {
  --bg: #F4F8FA;
  --surface: #FFFFFF;
  --ink: #0D2436;
  --muted: #5E7385;
  --line: #DCE6EC;
  --soft: #EAF1F5;
  --fryd: #E2457A;
  --otto: #2D6BEF;
  --mamma: #B98510;
  --good: #0E9466;
  --danger: #C8364A;
  --r-lg: 24px;
  --r-md: 14px;
  --gut: 20px;
  --nav-h: 64px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06131D; --surface: #0C1E2B; --ink: #E9F2F7; --muted: #8AA2B3; --line: #183244; --soft: #0F2433;
    --fryd: #FF6E9C; --otto: #5C92FF; --mamma: #E2AE3A; --good: #3ACB91; --danger: #FF6F7F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06131D; --surface: #0C1E2B; --ink: #E9F2F7; --muted: #8AA2B3; --line: #183244; --soft: #0F2433;
  --fryd: #FF6E9C; --otto: #5C92FF; --mamma: #E2AE3A; --good: #3ACB91; --danger: #FF6F7F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45; font-weight: 400;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 34px; line-height: 1.05; font-stretch: 78%; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 19px; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.num { font-stretch: 72%; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -0.005em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--otto); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot ---------- */
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash svg { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; transform: translateY(2px); } }

/* ---------- shell ---------- */
.app { max-width: 600px; margin: 0 auto; min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) var(--gut) 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.wordmark { font-stretch: 72%; font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.top .wordmark { display: none; }
@media (min-width: 400px) { .top .wordmark { display: inline; } }

.switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 999px; }
.switch button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--muted);
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(13 36 54 / .08), 0 0 0 1px var(--line); }
.sw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); opacity: .45; transition: opacity .2s, transform .2s; }
.switch button[aria-pressed="true"] .sw-dot { opacity: 1; transform: scale(1.15); }

.view { padding: 8px var(--gut) calc(var(--nav-h) + env(safe-area-inset-bottom) + 40px); outline: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 600px; margin: 0 auto;
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.nav a {
  display: grid; justify-items: center; align-content: center; gap: 3px; height: 52px;
  text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 550; border-radius: 12px;
}
.nav a[aria-current] { color: var(--ink); }
.nav a .ic { width: 22px; height: 22px; }
.nav-lane { position: relative; width: 22px; height: 22px; display: block; }
.nav-lane::before, .nav-lane::after { content: ""; position: absolute; background: var(--c); border-radius: 2px; opacity: .55; transition: opacity .2s; }
.nav-lane::before { left: 10px; top: 2px; width: 2.4px; height: 17px; }
.nav-lane::after { left: 5px; top: 17.5px; width: 12.4px; height: 2.4px; }
.nav a[aria-current] .nav-lane::before, .nav a[aria-current] .nav-lane::after { opacity: 1; }

.banner { margin: 4px var(--gut) 0; padding: 10px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--mamma) 14%, var(--surface)); font-size: 14px; }

/* ---------- common blocks ---------- */
.greet { padding: 18px 0 22px; display: grid; gap: 6px; }
.greet h1 { font-size: 44px; }
.block { margin-top: 44px; display: grid; gap: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lead { font-size: 15px; max-width: 60ch; }
.note { font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--line); }
.foot { margin-top: 40px; font-size: 15px; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }
.big-empty { padding: 60px 0; display: grid; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); font-size: 16px; font-weight: 600;
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn.quiet { background: var(--soft); color: var(--ink); }
.btn.full { width: 100%; }
.linkish { background: none; border: 0; padding: 8px 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); cursor: pointer; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 999px; flex: none; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 550; color: var(--muted); transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(13 36 54 / .08), 0 0 0 1px var(--line); }
.seg.small button { padding: 6px 12px; font-size: 14px; }
.seg.fill { display: flex; }
.seg.fill button { flex: 1; }

.chips { display: flex; gap: 8px; }
.scroller { overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gut) * -1); padding: 2px var(--gut) 4px; scroll-padding: var(--gut); }
.scroller::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 550; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }

.bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar.thin { height: 4px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .8s cubic-bezier(.2, .8, .2, 1); }

/* ---------- overview ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles.one { grid-template-columns: 1fr; margin-top: 44px; }
.tile {
  display: grid; gap: 14px; align-content: start; padding: 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none; position: relative; overflow: hidden; transition: transform .15s;
}
.tile:active { transform: scale(.98); }
.tile::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 14px; }
.tile-name { font-size: 24px; font-weight: 700; font-stretch: 78%; color: var(--c); letter-spacing: -0.01em; }
.tile-big { display: grid; }
.tile-big .num { font-size: 40px; line-height: 1; color: var(--good); }
.tile-big small { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.tile-meta b { font-size: 18px; color: var(--ink); margin-right: 2px; }
.tile-last { font-size: 13px; line-height: 1.35; }
.tile-m { grid-template-columns: 1fr auto; align-items: center; }
.tile-m .tile-top { grid-column: 1 / -1; }

.goals { list-style: none; margin: 0; padding: 0; display: grid; }
.goals li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.goals li:first-child { border-top: 1px solid var(--line); }
.goal-l { display: grid; gap: 1px; }
.goal-l span { font-size: 14px; color: var(--muted); }
.goal-r { font-size: 26px; line-height: 1; color: var(--c); align-self: center; }
.goal-r small { font-size: 14px; color: var(--muted); font-weight: 500; }
.goals .bar { grid-column: 1 / -1; margin-top: 8px; }

.mv { list-style: none; margin: 0; padding: 0; }
.mv li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mv li:first-child { border-top: 1px solid var(--line); }
.mv-ev { display: grid; }
.mv-ev span, .mv-t small { font-size: 13px; color: var(--muted); }
.mv-t { display: grid; justify-items: end; text-align: right; min-width: 84px; }
.mv-t .num { font-size: 22px; line-height: 1.1; }

/* ---------- kid page ---------- */
.kid-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 0 18px; }
.kid-name { font-size: 52px; line-height: .9; color: var(--c); }
.kid-head p { margin-top: 8px; font-size: 14px; }

.hero { position: relative; padding: 34px 0 30px; display: grid; gap: 6px; }
.hero-ev { font-size: 16px; font-weight: 600; }
.hero-t {
  font-size: clamp(96px, 33vw, 176px); line-height: .82; font-stretch: 64%; font-weight: 700;
  letter-spacing: -0.025em; color: var(--c); margin: 6px 0 18px -4px;
}
/* lane line ending in a T, under the time */
.hero-lane { position: relative; height: 5px; margin: 0 0 18px; border-radius: 3px; background: var(--c); transform-origin: left; }
.hero-lane::after { content: ""; position: absolute; right: 0; top: -14px; width: 5px; height: 33px; border-radius: 3px; background: var(--c); }
@media (prefers-reduced-motion: no-preference) {
  .hero-lane { animation: swim .9s cubic-bezier(.3, .7, .2, 1) both; }
  .hero-lane::after { animation: fade .3s .8s both; }
  @keyframes swim { from { transform: scaleX(0); } }
}
.hero-sub { font-size: 15px; line-height: 1.4; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fact { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 550; }
.fact.good { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }

.next { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 18%, var(--line)); }
.next-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.next p { font-size: 14px; margin-top: 2px; }
.next-gap { font-size: 40px; line-height: .9; color: var(--c); white-space: nowrap; }
.next-gap small { font-size: 15px; font-weight: 500; color: var(--muted); font-stretch: 100%; }

/* chart */
.chart { position: relative; margin: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .ref { stroke-width: 1; stroke-dasharray: 3 4; }
.chart .ref-t { font-size: 11px; font-family: var(--font); font-weight: 550; }
.r-usa { stroke: var(--ink); fill: var(--ink); opacity: .55; }
.r-no { stroke: var(--muted); fill: var(--muted); }
.r-mamma { stroke: var(--mamma); fill: var(--mamma); }
.chart .pbline { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.chart .dot { stroke-width: 2; cursor: pointer; transition: r .15s; }
.chart .dot.pb { stroke-width: 3; }
.chart .dot:focus { outline: none; r: 8; }
.chart figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.chart .tip {
  position: absolute; width: 180px; transform: translateY(calc(-100% - 12px)); pointer-events: none;
  display: grid; gap: 1px; padding: 8px 11px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 13px;
  opacity: 0; transition: opacity .15s;
}
.chart .tip.on { opacity: 1; }
.chart .tip b { font-stretch: 72%; font-size: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .chart .pbline { animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) both; }
  .chart .area { animation: fade .8s .5s both; }
  @keyframes draw { from { stroke-dashoffset: 1; } }
  @keyframes fade { from { opacity: 0; } }
}

/* ladder as a lane */
.lane { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; }
.lane::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.lane li { position: relative; display: grid; grid-template-columns: 1fr auto 64px; gap: 10px; align-items: center; padding: 9px 12px; margin-left: -12px; border-radius: var(--r-md); }
.lane li::before { content: ""; position: absolute; left: -12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.lane-l { display: grid; min-width: 0; }
.lane-l b { font-weight: 550; font-size: 15px; }
.lane-l span { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.lane-t { font-size: 20px; text-align: right; }
.lane-d { font-size: 15px; text-align: right; color: var(--muted); }
.lane li.behind { opacity: .62; }
.lane li.mamma::before { border-color: var(--mamma); background: var(--mamma); }
.lane li.mamma .lane-l b { color: var(--mamma); }
.lane li.me { background: var(--c); color: #fff; opacity: 1; margin: 6px 0 6px -12px; padding: 13px 12px; }
.lane li.me::before { left: -21px; width: 14px; height: 14px; margin-top: -7px; background: var(--c); border: 3px solid var(--bg); }
.lane li.me .lane-l span, .lane li.me .lane-d { color: #fff; opacity: .85; }
.lane li.me .lane-l b { font-weight: 700; }
.lane li.me .lane-t { font-size: 24px; }

/* rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li:first-child { border-top: 1px solid var(--line); }
.row, .row-btn { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; width: 100%; }
.row-btn { border: 0; background: none; text-align: left; cursor: pointer; }
.row-btn.cur .r-main { color: var(--c); }
.r-main { display: grid; min-width: 0; font-weight: 550; }
.r-main small { font-weight: 400; font-size: 13px; color: var(--muted); }
.r-t { font-size: 21px; text-align: right; min-width: 64px; }
.lvl { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.pbtag { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.pct { font-size: 13px; }
.flag { display: inline-block; font-style: normal; font-size: 11.5px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--mamma) 15%, transparent); color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: baseline; }
.timeline b { font-size: 20px; color: var(--mamma); }

.prose { margin: 0; padding-left: 18px; display: grid; gap: 10px; max-width: 64ch; }
.links { list-style: none; margin: 0; padding: 0; }
.links li { border-bottom: 1px solid var(--line); }
.links a { display: block; padding: 12px 0; text-decoration: none; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.lbl { font-size: 14px; font-weight: 550; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select {
  font: inherit; font-size: 17px; width: 100%; min-height: 50px; padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus { outline: none; border-color: var(--ink); }
input[type="date"] { display: flex; align-items: center; }
.status { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.drop { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 84px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); cursor: pointer; font-weight: 600; color: var(--muted); }
.drop:hover { border-color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.checks:empty { display: none; }
.checks li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checks li.new { color: var(--ink); }
.checks li.new .ic { color: var(--good); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; align-content: center; gap: 44px; padding: 40px 28px calc(env(safe-area-inset-bottom) + 40px); max-width: 420px; margin: 0 auto; }
.login-brand { display: grid; justify-items: center; gap: 14px; }
.login-brand .wordmark { font-size: 38px; }
.login-form { gap: 14px; }

/* ---------- PIN sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgb(6 19 29 / 0); transition: background-color .22s; }
.sheet-wrap.on { background: rgb(6 19 29 / .42); }
.sheet { width: 100%; max-width: 440px; background: var(--surface); border-radius: 28px 28px 0 0; padding: 22px 28px calc(env(safe-area-inset-bottom) + 18px); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: grid; gap: 18px; justify-items: center; }
.sheet-wrap.on .sheet { transform: none; }
.pin-head { display: flex; align-items: center; gap: 8px; }
.pin-msg { color: var(--muted); font-size: 15px; }
.pin-dots { display: flex; gap: 16px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); transition: background-color .12s, border-color .12s; }
.pin-dots span.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 24px; }
.pin-key { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--soft); font-size: 28px; font-weight: 500; font-stretch: 80%; cursor: pointer; transition: background-color .1s, transform .1s; }
.pin-key:active { background: var(--line); transform: scale(.94); }

/* ---------- toast + skeleton ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); z-index: 60;
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px;
  transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1); white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--good); color: #fff; }
.skel { display: grid; gap: 14px; padding-top: 24px; }
.skel i { display: block; height: 22px; border-radius: 10px; background: linear-gradient(90deg, var(--soft) 30%, var(--line) 50%, var(--soft) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
.skel i:first-child { width: 55%; height: 40px; }
.skel i.tall { height: 160px; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -150% 0; } }

/* view transition on route change */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 640px) {
  :root { --gut: 28px; }
}

/* ---------- generic sheet ---------- */
.form-sheet { justify-items: stretch; max-height: 92dvh; overflow-y: auto; gap: 16px; padding-top: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 22px; }

/* ---------- meets ---------- */
.gap-top { margin-top: 44px; }
.meets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.meets li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.meets li.first { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.meets li.first .meet-main span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.meet-when { font-size: 20px; line-height: 1; min-width: 72px; }
.meets li.first .meet-when { font-size: 26px; }
.meet-main { display: grid; min-width: 0; }
.meet-main b { font-weight: 600; }
.meet-main span { font-size: 13px; color: var(--muted); }
.meet-who { display: flex; gap: 4px; }
.meet-who i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; background: var(--c); color: #fff; }
.remind { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--mamma) 13%, var(--surface)); }
.remind div { display: grid; gap: 2px; }
.remind span { font-size: 14px; color: var(--muted); }
.sc-frame { width: 100%; height: 500px; border: 0; border-radius: var(--r-lg); background: #fff; }

/* ---------- training ---------- */
.week { display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.greet + .week { margin-top: -4px; }
.week-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-dots { display: flex; gap: 8px; }
.week-dots i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); transition: background-color .3s, border-color .3s, transform .3s; }
.week-dots i.on { background: var(--c); border-color: var(--c); }
.streak { font-size: 18px; color: var(--c); }
.week-msg { font-size: 15px; font-weight: 550; }
.log-btn { background: var(--c); color: #fff; margin-top: 4px; }
.kid-head + .week { margin-top: -2px; }
.tile-week { font-size: 13px; color: var(--muted); margin-top: -6px; }
.tile-week b { font-size: 18px; color: var(--c); margin-right: 2px; }
.chips.wrap { flex-wrap: wrap; }
.feel { display: flex; justify-content: space-between; gap: 6px; }
.feel button { flex: 1; aspect-ratio: 1; max-width: 62px; border-radius: 50%; border: 2px solid transparent; background: var(--soft); font-size: 28px; cursor: pointer; filter: grayscale(.6); opacity: .75; transition: transform .15s, filter .15s, opacity .15s, border-color .15s; }
.feel button[aria-pressed="true"] { filter: none; opacity: 1; transform: scale(1.12); border-color: var(--ink); background: var(--surface); }
.feel-txt { font-size: 14px; text-align: center; }
.feel-s { font-size: 20px; }
.fab {
  position: fixed; z-index: 21; right: max(16px, calc(50vw - 300px + 16px)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  display: inline-flex; align-items: center; gap: 6px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c, var(--ink)); color: #fff; font-size: 16px; font-weight: 650;
  box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--c, #000) 60%, transparent);
  transition: transform .15s;
}
.fab:active { transform: scale(.95); }
.fab[hidden] { display: none; }

/* ---------- goals ---------- */
.small-btn { min-height: 38px; padding: 0 14px 0 10px; font-size: 14px; gap: 4px; }
.goals.mine li { position: relative; padding-right: 30px; }
.goals.mine li.done .goal-r { color: var(--good); }
.goals.mine li.done .bar i { background: var(--good); }
.goals.mine .bar { height: 8px; }
.goal-x { position: absolute; right: 0; top: 14px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }

/* ---------- badges ---------- */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; }
.badges li { display: grid; justify-items: center; text-align: center; gap: 4px; }
.badges b { font-size: 13px; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.badges li > span:not(.medal) { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.badges li.locked b { color: var(--muted); }
.medal {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-stretch: 70%; font-weight: 750; font-size: 26px; letter-spacing: -0.02em;
  background: var(--soft); color: var(--muted); border: 2px dashed var(--line);
}
.medal.tight { font-size: 19px; }
.medal.on { background: var(--c); color: #fff; border: 0; box-shadow: inset 0 0 0 4px color-mix(in srgb, #fff 28%, transparent), 0 6px 16px -6px color-mix(in srgb, var(--c) 70%, transparent); }
.medal.mini { width: 38px; height: 38px; font-size: 15px; }
.medal.mini.tight { font-size: 12px; }

/* ---------- celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--c) 0%, transparent); transition: background-color .3s; overflow: hidden; }
.celebrate.on { background: color-mix(in srgb, var(--c) 92%, #000); }
.cel-card { position: relative; z-index: 2; width: 100%; max-width: 360px; display: grid; justify-items: center; gap: 12px; text-align: center; padding: 28px 24px 22px; border-radius: 28px; background: var(--surface); transform: scale(.85); opacity: 0; transition: transform .45s cubic-bezier(.2, 1.4, .4, 1), opacity .25s; }
.celebrate.on .cel-card { transform: none; opacity: 1; }
.cel-kicker { font-weight: 650; color: var(--c); }
.cel-card .medal { width: 120px; height: 120px; font-size: 48px; }
.cel-card .medal.tight { font-size: 36px; }
.cel-card .medal.mini { width: 38px; height: 38px; font-size: 15px; }
.cel-card h2 { font-size: 26px; font-stretch: 80%; }
.cel-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 15px; border-radius: 2px; background: #fff; opacity: .9; transform: rotate(var(--r)); }
.confetti i:nth-child(3n) { background: var(--fryd); }
.confetti i:nth-child(3n+1) { background: var(--otto); }
.confetti i:nth-child(4n) { background: #FFD24A; }
@media (prefers-reduced-motion: no-preference) {
  .celebrate.on .confetti i { animation: fall 2.6s var(--d) cubic-bezier(.3, .4, .6, 1) both; }
  .celebrate.on .cel-card .medal:not(.mini) { animation: pop .7s .2s cubic-bezier(.2, 1.6, .4, 1) both; }
  @keyframes fall { to { transform: translateY(110vh) rotate(calc(var(--r) + 540deg)); } }
  @keyframes pop { from { transform: scale(.3) rotate(-20deg); } }
}

/* ---------- PB card button ---------- */
.fact.share { border: 0; cursor: pointer; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }

/* ---------- race vs Mamma ---------- */
.r-track { display: grid; gap: 10px; padding: 16px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--otto) 8%, var(--surface)); border: 1px solid var(--line); }
.r-lane { display: grid; grid-template-columns: 64px 1fr 58px; gap: 10px; align-items: center; }
.r-name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.r-water { position: relative; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--otto) 10%, var(--bg)); overflow: hidden; }
.r-water::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.r-wall { position: absolute; right: 8px; top: 9px; width: 3px; height: 16px; border-radius: 2px; background: color-mix(in srgb, var(--c) 45%, transparent); }
.r-swimmer { position: absolute; left: 6px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.r-time { font-size: 18px; text-align: right; }
.r-track.go .r-swimmer { left: calc(100% - 30px); transition: left var(--dur) cubic-bezier(.35, .05, .55, 1); }
.r-result { font-weight: 600; min-height: 1.4em; }
@media (prefers-reduced-motion: reduce) { .r-track.go .r-swimmer { transition: none; } }

/* ---------- family + weekly summary + forecast ---------- */
.fam-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.fam-big { font-size: 64px; line-height: .85; background: linear-gradient(90deg, var(--fryd), var(--otto)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fam-how { text-align: right; max-width: 15ch; }
.fam-goal { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.fam-goal-top { display: flex; justify-content: space-between; gap: 12px; }
.fam-goal-top .num { font-size: 18px; }
.bar.stack { display: flex; }
.bar.stack i { border-radius: 0; }
.bar.stack i:first-child { border-radius: 999px 0 0 999px; }
.wsum { list-style: none; margin: 0; padding: 0; display: grid; }
.wsum li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wsum li:first-child { border-top: 1px solid var(--line); }
.wsum b { color: var(--c); }
.forecast { font-size: 15px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 8%, transparent); }
.forecast b { color: var(--c); font-size: 18px; }
.tiles.one.solo { margin-top: 0; }
.tiles.one.solo.gap-top { margin-top: 44px; }

/* ---------- shared session sheet ---------- */
.seg button .sw-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.seg button[aria-pressed="true"] .sw-dot { opacity: 1; }
.feel-rows { display: grid; gap: 14px; }
.feel-row { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 7%, transparent); }
.feel-name { color: var(--c); font-size: 15px; }
.feel-row .feel button { max-width: 54px; font-size: 24px; }
.feel-row .feel button[aria-pressed="true"] { border-color: var(--c); }
.neutral .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Swimcloud + folds ---------- */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.fold { border-top: 1px solid var(--line); }
.fold:last-of-type { border-bottom: 1px solid var(--line); }
.fold summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); transition: transform .2s; }
.fold[open] summary::after { transform: rotate(45deg); }
.fold-body { display: grid; gap: 12px; padding-bottom: 18px; }
.fold.big { margin-top: 32px; }
.fold.big + .fold.big, .block + .fold.big { margin-top: 32px; }
.fold.big summary { font-size: 19px; }
.fold-body > .block:first-child { margin-top: 0; }
.bm { align-self: start; justify-self: start; }
textarea { font: inherit; font-size: 15px; width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
a.btn { text-decoration: none; }
