/* Anna Swims — one stylesheet. The look is the approved design canvas
   (README § Design): iOS grouped gray, white cards, large titles, a floating
   tab bar, medal coins and Fitness-style rings. System fonts only, so it looks
   native on the family's iPhones and iPads and makes no third-party request. */

:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --ink: #111114;
  --ink2: #3A3A3F;
  --muted: #6C6C72;
  --soft: #8E8E93;
  --hair: #F0F0F4;
  --line: #E3E3E8;
  --accent: #0A72CC;
  --accent-ink: #085EA7;
  --accent-tint: rgba(10, 114, 204, 0.12);
  --accent-soft: #91C0E9;
  --good: #248A3D;
  --avatar: linear-gradient(140deg, #2E8FE0 0%, #0A5FAA 100%);
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --round: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Medal levels: every coin, ring, cut line and cell reads its colours here. */
.l0 { --mark: #A0561E; --track: #F3E4D6; --coin: linear-gradient(140deg, #EDBB91 0%, #A0561E 100%); }
.l1 { --mark: #7389A9; --track: #E5EAF1; --coin: linear-gradient(140deg, #F5F7FA 0%, #8A9CB5 100%); }
.l2 { --mark: #BF9A00; --track: #F7EECB; --coin: linear-gradient(140deg, #FFE699 0%, #C49A00 100%); }
.l3 { --mark: #6B3FD6; --track: #E9E1FC; --coin: linear-gradient(140deg, #C0AAFF 0%, #6B3FD6 100%); }
.lx { --mark: #C7C7CC; --track: #ECECF0; --coin: #FFFFFF; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; text-align: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin: 0; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.i.fill { fill: currentColor; stroke: none; }
.i.chev { width: 14px; height: 14px; stroke: #AEAEB2; stroke-width: 3; }
.i.ok { width: 16px; height: 16px; stroke: var(--good); stroke-width: 3; }

.num { font-variant-numeric: tabular-nums; }
.num-r { font-family: var(--round); }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 15px; }
.sub.small { font-size: 13px; }
.sub.xsmall { font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }

/* ---------- phone frame ---------- */

.phone { max-width: 600px; margin: 0 auto; padding: calc(var(--top) + 20px) 16px calc(var(--bottom) + 120px); }
.screen { display: flex; flex-direction: column; gap: 20px; }
.title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.title h1 { font-size: 34px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.1; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 24px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 50%; background: var(--avatar); color: #FFFFFF; font-weight: 700;
}
.avatar.s26 { width: 26px; height: 26px; font-size: 13px; }
.avatar.s40 { width: 40px; height: 40px; font-size: 18px; }
.avatar.s44 { width: 44px; height: 44px; font-size: 20px; }

.notice {
  align-self: flex-start; padding: 6px 12px; border-radius: 12px;
  background: #FFF4D6; color: #6B4E00; font-size: 13px; font-weight: 600;
}

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 24px; background: var(--line); }
.seg button { height: 44px; border-radius: 22px; text-align: center; font-size: 15px; font-weight: 500; transition: background 0.15s; }
.seg button[aria-pressed="true"] { background: var(--card); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }

.card { background: var(--card); border-radius: 24px; }
.hr { height: 1px; background: #EDEDF1; }

.coin { display: inline-block; flex-shrink: 0; border-radius: 50%; background: var(--coin); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.12); }
.coin.lx { box-shadow: inset 0 0 0 1.5px #C7C7CC; }
.coin.s12 { width: 12px; height: 12px; }
.coin.s14 { width: 14px; height: 14px; }
.coin.s18 { width: 18px; height: 18px; }
.coin.s26 { width: 26px; height: 26px; }
.coin.s28 { width: 28px; height: 28px; }
.coin.s34 { width: 34px; height: 34px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.14); }
.coin.s44 { width: 44px; height: 44px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.18); }

.ring { flex-shrink: 0; display: block; }
.ring .track { fill: none; stroke: var(--track); }
.ring .bar { fill: none; stroke: var(--mark); stroke-linecap: round; }

/* ---------- Events ---------- */

.summary { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.tallies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tally { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.count { font-size: 24px; font-weight: 700; line-height: 1; }
.count.zero { color: var(--soft); }
.tally-name { font-size: 12px; color: var(--muted); }
.closest { display: flex; align-items: center; gap: 12px; min-height: 44px; text-align: left; }
.closest-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.closest-title { font-size: 17px; font-weight: 600; }
.closest-gap { font-size: 22px; font-weight: 700; white-space: nowrap; }

.stroke { display: flex; flex-direction: column; gap: 10px; }
.stroke h2 { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 44px; padding: 14px;
  border-radius: 22px; background: var(--card); text-align: left; transition: transform 0.12s;
}
.tile:active, .closest:active, .ct-row:active, .side-row:active { transform: scale(0.98); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-name { font-size: 15px; font-weight: 600; }
.tile-time { font-size: 30px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.15; }
.tile-level { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.tile-next { font-size: 12px; color: var(--muted); }

.footnote { padding: 0 8px; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: center; }

/* ---------- One event ---------- */

.navrow { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.round-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 22px; background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
.round-btn.gray { background: var(--line); box-shadow: none; color: var(--ink2); }
.round-btn.gray .i { width: 16px; height: 16px; stroke-width: 2.6; }
.pill-btn { display: inline-flex; align-items: center; height: 44px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 18px; background: var(--accent-tint); color: var(--accent-ink); font-size: 15px; font-weight: 600;
  white-space: nowrap;
}
.pill .i { width: 18px; height: 18px; }

.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.hero { display: flex; align-items: center; gap: 18px; padding: 18px; }
.hero-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.hero-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.hero-ring-value { font-size: 24px; font-weight: 700; line-height: 1; }
.hero-ring-cap { font-size: 11px; line-height: 1.2; color: var(--muted); text-align: center; }
.hero-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-pb { font-size: 46px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.08; }
.hero-level { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 600; }

.list { display: flex; flex-direction: column; padding: 6px 0; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 16px 8px; }
.list-head h2, .chart-card h2 { font-size: 17px; font-weight: 700; }

.lrow { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; }
.lrow.sep { border-top: 1px solid var(--hair); }
.lrow.you { background: var(--accent-tint); color: var(--accent-ink); }
.lrow.you .strong { font-weight: 700; }
.lrow.next .strong { font-weight: 700; }
.lrow-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 16px; }
.lrow-time { font-size: 16px; font-weight: 600; }
.lrow-note { width: 86px; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow.next .lrow-note { color: var(--ink); font-weight: 700; }

.chart-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.chart { display: block; overflow: visible; max-width: 100%; height: auto; }
.chart .grid { fill: none; stroke: #ECECF0; stroke-width: 1; }
.chart .cutline { fill: none; stroke: var(--mark); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .step { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .halo { fill: #FFFFFF; }
.chart .dot.best { fill: var(--accent); }
.chart .dot.other { fill: var(--accent-soft); }
.chart .dot.sel { stroke: var(--ink); stroke-width: 2; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .cl-dot { fill: var(--mark); }
.chart .cl-name { font-size: 11px; fill: var(--muted); }
.chart .cl-time { font-size: 11px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .flag rect { fill: var(--accent); }
.chart .flag.picked rect { fill: var(--ink); }
.chart .flag text { font-size: 11px; font-weight: 700; fill: #FFFFFF; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: pointer; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.key-dot.best { background: var(--accent); }
.key-dot.other { background: var(--accent-soft); }
.key-dash { display: inline-block; width: 16px; border-top: 2px dashed #7389A9; }
.key-fill { display: inline-block; width: 16px; height: 12px; border-radius: 4px; background: #E5EAF1; }
.key-next { display: inline-block; width: 16px; height: 12px; border-radius: 4px; border: 1.5px dashed #7389A9; }

.srow { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 16px; }
.srow.sep { border-top: 1px solid var(--hair); }
.srow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow-date { font-size: 16px; font-weight: 500; }
.srow-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.srow-time { font-size: 17px; font-weight: 600; }
.tag { font-size: 12px; line-height: 16px; border-radius: 7px; white-space: nowrap; }
.tag.pb { padding: 1px 7px; background: var(--accent-tint); color: var(--accent-ink); font-weight: 700; }
.tag.first { padding: 1px 7px; background: #EFEFF4; color: #55555B; font-weight: 600; }
.tag.plain { color: var(--muted); font-weight: 500; }
.empty { padding: 8px 16px 14px; font-size: 15px; color: var(--muted); }

/* ---------- Cuts ---------- */

.cuts-table { padding: 6px 0; }
.ct-head, .ct-row { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); gap: 4px; align-items: center; padding: 4px 10px 4px 16px; }
.ct-head { align-items: end; padding-top: 8px; padding-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ct-level { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink2); }
.ct-row { width: 100%; min-height: 54px; border-top: 1px solid var(--hair); text-align: left; }
.ct-event { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 15px; }
.cell {
  height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 10px; border: 1.5px solid transparent; font-size: 12.5px; color: var(--muted);
}
.cell.got { background: var(--track); color: var(--ink); font-weight: 600; }
.cell.next { border: 1.5px dashed var(--mark); color: var(--ink); font-weight: 600; }
.cell-gap { font-size: 10px; font-weight: 700; color: var(--ink); }

/* ---------- Meets ---------- */

.season { display: flex; flex-direction: column; gap: 8px; }
.season .eyebrow { padding: 0 4px; font-size: 13px; }
.mrow { display: flex; gap: 14px; padding: 14px 16px; }
.mrow.sep { border-top: 1px solid var(--hair); }
.mdate { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.mmon { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent-ink); }
.mday { font-size: 24px; font-weight: 700; line-height: 1.1; }
.mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mtitle { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 16px; line-height: 1.25; }
.mhead .tag.pb { padding: 3px 8px; border-radius: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 10px; background: var(--bg); font-size: 13px; line-height: 18px; color: #55555B; }
.chip .strong { color: var(--ink); }
.chip.pb { background: var(--accent-tint); }
.chip.pb .strong { color: var(--accent-ink); }

/* ---------- Heat sheet ---------- */

.mrow.tap { width: 100%; align-items: center; text-align: left; transition: transform 0.12s; }
.mrow.tap .mdate { align-self: flex-start; }
.tag.hs { padding: 3px 8px; border-radius: 9px; background: var(--accent); color: #FFFFFF; font-weight: 700; }
.hs-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hs-day { padding: 4px 4px 0; font-size: 13px; }
.hs-card { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 16px; text-align: left; transition: transform 0.12s; }
.mrow.tap:active, .hs-card.tap:active { transform: scale(0.98); }
.hs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hs-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-event { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.hs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr); gap: 8px; }
.hs-cell { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.hs-label { font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.hs-value { font-size: 26px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.hs-small { font-size: 14px; font-weight: 600; color: var(--muted); }
.hs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.hs-foot .strong { color: var(--ink); }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; padding: 24px 20px calc(var(--bottom) + 14px);
  background: linear-gradient(rgba(242, 242, 247, 0), rgba(242, 242, 247, 0.92) 45%);
  pointer-events: none;
}
.tabbar nav {
  pointer-events: auto; width: 100%; max-width: 420px; height: 62px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: 31px; background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.tab { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 27px; color: #55555B; text-align: center; }
.tab span { font-size: 11px; font-weight: 600; }
.tab .i { width: 24px; height: 24px; stroke-width: 2; }
.tab.on { background: var(--accent-tint); color: var(--accent); }

/* ---------- Check a time ---------- */

.sheet-backdrop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.3); }
.sheet {
  width: 100%; max-width: 600px; height: min(780px, calc(100vh - var(--top) - 24px)); height: min(780px, calc(100dvh - var(--top) - 24px));
  overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 8px 16px calc(var(--bottom) + 20px); border-radius: 28px 28px 0 0; background: var(--bg);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}
.sheet-backdrop.enter { animation: fade 0.2s ease-out; }
.sheet-backdrop.enter .sheet { animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
.grabber { align-self: center; width: 36px; height: 5px; flex-shrink: 0; border-radius: 3px; background: #C7C7CC; }
.sheet-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.sheet-title { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sheet-title h2 { font-size: 17px; font-weight: 700; }
.display { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 2px; }
.display-value { font-size: 64px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.display-value.empty { color: #AEAEB2; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--track); }
.banner-coin { position: relative; width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.spark { position: absolute; color: var(--mark); animation: twinkle 1.6s ease-in-out infinite; }
.spark .i { width: 14px; height: 14px; }
.spark.a { right: -5px; top: -4px; }
.spark.b { left: -4px; bottom: 1px; animation-delay: 0.5s; }
.spark.b .i { width: 9px; height: 9px; }
.banner-text { display: flex; flex-direction: column; gap: 2px; }
.banner-title { font-size: 20px; font-weight: 800; }
.banner-sub { font-size: 13px; color: var(--ink2); }
.lines { display: flex; flex-direction: column; }
.cline { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; }
.cline + .cline { border-top: 1px solid var(--hair); }
.cline-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 16px; }
.cline-value { font-size: 20px; font-weight: 700; white-space: nowrap; }
.cline-value.good { color: var(--accent-ink); }
.cline-value.muted { color: var(--muted); }
.star-badge { width: 28px; height: 28px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.star-badge .i { width: 16px; height: 16px; }
.keypad { margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key {
  height: 54px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; background: var(--card); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  font-size: 26px; font-weight: 600; text-align: center;
}
.key:active { background: var(--line); }
.key.word { font-size: 17px; }
.key .i { width: 26px; height: 26px; stroke-width: 1.8; }

@keyframes fade { from { background: rgba(0, 0, 0, 0); } }
@keyframes rise { from { transform: translateY(48px); opacity: 0.6; } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* ---------- Empty state ---------- */

.empty-state { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: center; }
.empty-state h1 { font-size: 28px; font-weight: 700; }
.empty-state p { max-width: 320px; color: var(--muted); }
.app-mark { width: 96px; height: 96px; border-radius: 22%; background: url(../img/icon-180.png) center / cover; box-shadow: 0 12px 30px rgba(10, 60, 120, 0.25); }

/* ---------- iPad: sidebar + main (same queries as app.js) ---------- */

@media (min-width: 768px) and (min-height: 540px) {
  .split { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
  .sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
    padding: calc(var(--top) + 24px) 12px calc(var(--bottom) + 24px);
    background: var(--card); border-right: 1px solid var(--line);
  }
  .side-head { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
  .side-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .side-name { font-size: 28px; font-weight: 700; line-height: 1.1; }
  .side-group { display: flex; flex-direction: column; gap: 2px; }
  .side-group .eyebrow { padding: 0 12px 4px; font-size: 13px; }
  .side-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; text-align: left; }
  .side-row.on { background: var(--accent); color: #FFFFFF; }
  .side-row.on .coin { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
  .side-ev { flex: 1; font-size: 16px; font-weight: 500; }
  .side-time { font-size: 16px; font-weight: 600; color: var(--muted); }
  .side-row.on .side-time { color: #FFFFFF; }
  .main { min-width: 0; padding: 0 28px calc(var(--bottom) + 40px); }
  .main .screen { max-width: 1100px; margin: 0 auto; }
  .main .ev-grid { max-width: 640px; }
  .hs-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .topbar {
    position: sticky; top: 0; z-index: 5;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
    height: calc(var(--top) + 80px); margin: 0 -28px 4px; padding: var(--top) 28px 0;
    background: rgba(242, 242, 247, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .tabs-top { display: flex; gap: 2px; padding: 3px; border-radius: 25px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
  .tabs-top button { height: 44px; padding: 0 20px; border-radius: 22px; font-size: 15px; font-weight: 600; color: #55555B; }
  .tabs-top button.on { background: var(--accent-tint); color: var(--accent); }
  .topbar-end { display: flex; justify-content: flex-end; }
  .sheet-backdrop { align-items: center; }
  .sheet { width: 460px; height: min(760px, calc(100vh - 48px)); border-radius: 28px; }
  .grabber { display: none; }
}

/* iPad under 1000 px wide (the 11-inch and smaller iPads in portrait, or a split
   screen): beside the centred tabs there's no room for the pill's label, so it
   shrinks to its stopwatch. The label stays as hidden text, so the button keeps
   its name (D15). */
@media (min-width: 768px) and (max-width: 999px) and (min-height: 540px) {
  .topbar-end .pill-btn { width: 44px; justify-content: center; }
  .topbar-end .pill { width: 36px; padding: 0; justify-content: center; }
  .topbar-end .pill > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

@media (min-width: 1100px) and (min-height: 540px) {
  .main .ev-grid { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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