/* Ankles of Steel - app styles. Mobile first; the responsive block at the end widens it for tablets and adds a side rail on desktop. */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f1eee8;
  --ink: #1f1d1a;
  --ink-2: #5c5853;
  --ink-3: #8a857d;
  --line: #e4e0d8;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefc;
  --warm: #eb6834;
  --warm-soft: #fde9df;
  --good: #0ca30c;
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --seq-0: #ece9e3;
  --seq-1: #cde2fb;
  --seq-2: #86b6ef;
  --seq-3: #3987e5;
  --seq-4: #1c5cab;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 29, 26, 0.06), 0 8px 24px rgba(31, 29, 26, 0.06);
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151715; --surface: #1e211f; --surface-2: #262a28; --ink: #f2f1ed; --ink-2: #b8b5ae; --ink-3: #85827b;
    --line: #313532; --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1d2f47; --warm: #d95926; --warm-soft: #3a2419;
    --good: #35b935; --chart-1: #3987e5; --chart-2: #d95926;
    --seq-0: #262a28; --seq-1: #1c3550; --seq-2: #1c5cab; --seq-3: #3987e5; --seq-4: #86b6ef;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151715; --surface: #1e211f; --surface-2: #262a28; --ink: #f2f1ed; --ink-2: #b8b5ae; --ink-3: #85827b;
  --line: #313532; --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1d2f47; --warm: #d95926; --warm-soft: #3a2419;
  --good: #35b935; --chart-1: #3987e5; --chart-2: #d95926;
  --seq-0: #262a28; --seq-1: #1c3550; --seq-2: #1c5cab; --seq-3: #3987e5; --seq-4: #86b6ef;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.hide { display: none !important; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding: calc(16px + var(--safe-t)) 16px calc(var(--tabbar) + 24px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 36px; }
.topbar .back { background: none; border: 0; padding: 6px 8px 6px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.topbar h1 { flex: 1; font-size: 22px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.accent { background: var(--accent); color: var(--accent-ink); }
.card.accent .muted, .card.accent .eyebrow { color: rgba(255,255,255,0.78); }
.card h2 { margin-bottom: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 600; font-size: 16px;
  background: var(--accent); color: var(--accent-ink); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); filter: brightness(0.96); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.warm { background: var(--warm); color: #fff; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.on-accent { background: #fff; color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
/* the five card categories, in the deck's colours */
:root { --c-movement: #178f8f; --c-movement-soft: #ddf3f3; --c-strength: #2b5aa0; --c-strength-soft: #e2eaf7; --c-balance: #b0124f; --c-balance-soft: #fae2ec; --c-mobility: #5f8f0e; --c-mobility-soft: #eaf4d6; --c-stretch: #5a2fd1; --c-stretch-soft: #ebe5fb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-movement: #5fd0d0; --c-movement-soft: #123838; --c-strength: #8fb4ee; --c-strength-soft: #1a2a46; --c-balance: #f08ab0; --c-balance-soft: #3d1024; --c-mobility: #a8d44a; --c-mobility-soft: #26350f; --c-stretch: #ad96f0; --c-stretch-soft: #241a45; } }
:root[data-theme="dark"] { --c-movement: #5fd0d0; --c-movement-soft: #123838; --c-strength: #8fb4ee; --c-strength-soft: #1a2a46; --c-balance: #f08ab0; --c-balance-soft: #3d1024; --c-mobility: #a8d44a; --c-mobility-soft: #26350f; --c-stretch: #ad96f0; --c-stretch-soft: #241a45; }
.chip.movement, .ic.movement { background: var(--c-movement-soft); color: var(--c-movement); }
.chip.strength, .ic.strength { background: var(--c-strength-soft); color: var(--c-strength); }
.chip.balance, .ic.balance { background: var(--c-balance-soft); color: var(--c-balance); }
.chip.mobility, .ic.mobility { background: var(--c-mobility-soft); color: var(--c-mobility); }
.chip.stretch, .ic.stretch { background: var(--c-stretch-soft); color: var(--c-stretch); }
.catdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.catdot.movement { background: var(--c-movement); } .catdot.strength { background: var(--c-strength); } .catdot.balance { background: var(--c-balance); } .catdot.mobility { background: var(--c-mobility); } .catdot.stretch { background: var(--c-stretch); }
/* difficulty meter: easy green, medium yellow, hard red, always with the word */
.chip.diff { background: var(--surface-2); color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.chip.diff i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.diff.easy i { background: #1fb11f; } .chip.diff.medium i { background: #f0b400; } .chip.diff.hard i { background: #e02020; }
.seg.mini { padding: 2px; } .seg.mini button { min-height: 30px; font-size: 13px; padding: 0 10px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
.tile .n { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; border: 0; width: 100%; text-align: left; -webkit-tap-highlight-color: transparent;
}
.item.locked { opacity: 0.55; }
.item .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.item .t { font-weight: 600; }
.item .s { font-size: 13px; color: var(--ink-2); }
.item .chev { color: var(--ink-3); flex: none; }
.num { font-variant-numeric: tabular-nums; }
.step-list { padding-left: 0; margin: 0; list-style: none; counter-reset: s; }
.step-list li { position: relative; padding-left: 36px; margin-bottom: 10px; counter-increment: s; }
.step-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin-bottom: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .card { margin: 0; }

/* progress ring */
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,0.25); }
.ring .bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.ring .lab { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.ring .lab small { display: block; font-size: 10px; font-weight: 600; opacity: 0.8; text-align: center; }

/* board diagram */
/* board diagram, drawn like the cards: wood boards, dark mats, teal bars */
.board { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.board .panel { fill: #e2c48f; stroke: #b08d5a; stroke-width: 1.5; }
.board .mat { fill: #3b3f45; }

.board .bar { fill: #1a9f9f; stroke: #0f7d7d; stroke-width: 1.5; }
.board .bar.ghost { fill: rgba(26,159,159,0.12); stroke: #1a9f9f; stroke-dasharray: 5 4; }
.board .lock rect { fill: #ffffff; } .board .lock path { stroke: #ffffff; }
.board .cap { font-size: 9.5px; fill: var(--ink-2); font-family: inherit; font-weight: 700; letter-spacing: 0.05em; }
.board-note { font-size: 14px; margin-top: 8px; text-align: center; }

/* player */
.player { text-align: center; }
.player .phase { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.player .phase.work { color: var(--accent); }
.player .phase.rest { color: var(--warm); }
.player .bigring { position: relative; width: 240px; height: 240px; margin: 12px auto; }
.player .bigring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.player .bigring .track { stroke: var(--line); }
.player .bigring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.player .bigring.rest .bar { stroke: var(--warm); }
.player .bigring .lab { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; }
.player .time { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.player .sub { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.player .cue { min-height: 44px; font-size: 17px; font-weight: 500; margin: 6px 0 14px; }
.player .next { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.player .board { max-width: 260px; margin: 0 auto; }
.player .side { display: inline-block; margin: 6px 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 10px; fill: var(--ink-3); font-family: inherit; }
.chart .val { font-size: 11px; fill: var(--ink-2); font-family: inherit; font-weight: 600; }
.chart .lbl { font-size: 11px; fill: var(--ink-2); font-family: inherit; font-weight: 600; }
.chart .bar { fill: var(--chart-1); }
.chart .bar.dim { fill: var(--seq-2); }
.chart .line1 { stroke: var(--chart-1); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .line2 { stroke: var(--chart-2); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot1 { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.chart .dot2 { fill: var(--chart-2); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tip { position: fixed; pointer-events: none; z-index: 50; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 8px; transform: translate(-50%, -120%); white-space: nowrap; box-shadow: var(--shadow); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--seq-0); display: block; }
.heat i.l1 { background: var(--seq-1); } .heat i.l2 { background: var(--seq-2); } .heat i.l3 { background: var(--seq-3); } .heat i.l4 { background: var(--seq-4); }
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat-key { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.heat-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--seq-0); }
.heat-key i.l1 { background: var(--seq-1); } .heat-key i.l2 { background: var(--seq-2); } .heat-key i.l3 { background: var(--seq-3); } .heat-key i.l4 { background: var(--seq-4); }
details.table { margin-top: 8px; font-size: 13px; }
details.table summary { color: var(--ink-3); cursor: pointer; }
details.table table { width: 100%; border-collapse: collapse; margin-top: 6px; }
details.table td, details.table th { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="time"], .field select, .field textarea {
  min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); width: 100%;
}
.field textarea { min-height: 90px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 44px; height: 26px; accent-color: var(--accent); }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; min-height: 40px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.days { display: flex; gap: 6px; }
.days button { flex: 1; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.days button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 20;
}
.tabbar .inner { display: flex; width: 100%; max-width: 520px; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.show { opacity: 1; }

.video { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }
.video iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; }

.onboard { min-height: calc(100vh - 40px); display: flex; flex-direction: column; justify-content: center; }
.onboard .logo { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 18px; }
.goal { display: flex; flex-direction: column; gap: 10px; }
.goal button { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.goal button.on { border-color: var(--accent); background: var(--accent-soft); }
.goal b { display: block; }
.goal span { font-size: 13px; color: var(--ink-2); }

.pr { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pr:last-child { border-bottom: 0; }

.bigtime { font-size: 72px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; margin: 10px 0; }

/* ---------- responsive: every screen from a 320 px phone to a desktop ---------- */
#app { min-height: 100dvh; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
img, svg, video, iframe { max-width: 100%; }
.item .chip, .item .ic, .item .chev { flex: none; }
.item .t, .topbar h1, .board-note { overflow-wrap: anywhere; }
.topbar .back { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.topbar .back[aria-label] { min-width: 44px; justify-content: center; padding: 0; }
details.table summary { padding: 9px 0; }
.seg.mini button { min-height: 36px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.narrow, .onboard { max-width: 520px; margin-left: auto; margin-right: auto; }
.wide-only, .pointer-only, .tabbar .brand { display: none !important; }
.pboard { max-width: 220px; margin: 14px auto 10px; }
.player.has-board .bigring { width: 168px; height: 168px; } .player.has-board .time { font-size: 46px; }
@supports not (aspect-ratio: 1) { .video { min-height: 200px; } }

/* small phones (320 to 359 px wide) */
@media (max-width: 359px) {
  #app { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  h1 { font-size: 23px; } .topbar h1 { font-size: 20px; }
  .card { padding: 14px; } .item { padding: 10px 12px; gap: 10px; } .item .ic { width: 40px; height: 40px; }
  .tile .n { font-size: 23px; } .btn { padding: 0 14px; } .days { gap: 4px; }
  .player .bigring { width: 208px; height: 208px; } .player .time { font-size: 54px; } .bigtime { font-size: 60px; }
  .tabbar a { font-size: 10px; }
}
@media (max-width: 339px) { .two { grid-template-columns: 1fr; } }

/* large phones in landscape and tablets */
@media (min-width: 600px) {
  #app { max-width: 760px; padding-top: calc(24px + var(--safe-t)); padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .tabbar .inner { max-width: 560px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (min-width: 760px) {
  .wide-only { display: block !important; } .btn.wide-only { display: flex !important; } .compact-only { display: none !important; }
  .home-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 16px; align-items: stretch; }
  .home-top .card.accent { display: flex; flex-direction: column; justify-content: space-between; }
  .home-top .tiles { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
  .cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  .rows2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: stretch; }
  .module { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .module > * { grid-column: 2; }
  .module > .m-side { grid-column: 1; grid-row: 1 / span 30; position: -webkit-sticky; position: sticky; top: 20px; }
}

/* tablets in landscape and desktop: the tab bar becomes a side rail */
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .tabbar { grid-column: 1; grid-row: 1; position: -webkit-sticky; position: sticky; top: 0; left: auto; right: auto; bottom: auto; width: 232px; height: 100vh; height: 100dvh; padding: 0;
    border-top: 0; border-right: 1px solid var(--line); flex-direction: column; justify-content: flex-start; }
  .tabbar .brand { display: flex !important; align-items: center; gap: 10px; padding: 22px 20px 14px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
  .tabbar .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .tabbar .inner { flex-direction: column; max-width: none; padding: 8px 12px; gap: 4px; }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 12px 14px; border-radius: 12px; }
  .tabbar a.on { background: var(--accent-soft); }
  #app { grid-column: 2; grid-row: 1; width: 100%; max-width: 1080px; padding: 32px 36px 56px; }
  h1 { font-size: 30px; } .topbar h1 { font-size: 26px; } .topbar { margin-bottom: 20px; }
  .list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .toast { bottom: 24px; }
  /* session player: timer ring, text and board diagram side by side */
  .narrow.play { max-width: 880px; }
  .player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 32px; align-items: center; margin-top: 24px; }
  .player > * { grid-column: 2; } .player > .side { justify-self: center; }
  .player > .bigring, .player.has-board > .bigring { grid-column: 1; grid-row: 1 / span 12; width: 260px; height: 260px; margin: 0; }
  .player.has-board .time { font-size: 64px; }
  .player > .pboard { grid-column: 3; grid-row: 1 / span 12; width: 210px; margin: 0; }
}

/* phones held sideways: the timer ring, the text and the board diagram sit side by side */
@media (orientation: landscape) and (max-height: 520px) {
  #app { padding-top: calc(8px + var(--safe-t)); }
  .topbar { margin-bottom: 4px; }
  .narrow.play { max-width: 820px; }
  .player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; align-items: center; margin-top: 0; }
  .player > * { grid-column: 2; } .player > .side { justify-self: center; }
  .player > .bigring, .player.has-board > .bigring { grid-column: 1; grid-row: 1 / span 12; width: 190px; height: 190px; margin: 0; }
  .player > .pboard { grid-column: 3; grid-row: 1 / span 12; width: 118px; margin: 0; }
  .player .time, .player.has-board .time { font-size: 50px; } .player .cue { min-height: 0; margin: 4px 0 8px; font-size: 15px; }
  .onboard { min-height: 0; }
}

/* mouse and trackpad */
@media (hover: hover) and (pointer: fine) {
  .pointer-only { display: block !important; }
  button.item { transition: transform 0.12s ease, box-shadow 0.12s ease; }
  button.item:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(31, 29, 26, 0.08), 0 12px 28px rgba(31, 29, 26, 0.12); }
  .btn:hover { filter: brightness(1.06); } .btn.ghost:hover, .btn.outline:hover { filter: brightness(0.97); }
  .tabbar a:hover { color: var(--ink); } .tabbar a.on:hover { color: var(--accent); }
  .seg button:hover { color: var(--ink); } .goal button:hover, .days button:hover { border-color: var(--accent); }
  .topbar .back:hover { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
