/* Velo — VELO Sports Center brand theme.
   Token-driven: light (:root) + dark ([data-theme="dark"]) share one set of
   variable names, so the runtime toggle just flips one attribute on <html>.
   Brand: blue #1F74C4 (primary/action), green #5BB330 (positive/PR),
   navy #0A1B2D (dark ground). Theme is set by web/templates/_theme.html. */

:root {
  --font:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono:  'SF Mono', 'JetBrains Mono', 'Consolas', monospace;

  --bg:        #f4f6f8;
  --surface:   #ffffff;
  --surface2:  #f7f9fb;
  --border:    #e4e9ef;
  --border2:   #eef2f6;
  --text:      #16202b;
  --muted:     #6b7785;
  --muted2:    #93a0ad;

  --primary:      #1f74c4;
  --primary-dark: #185fa5;
  --primary-tint: #eef5fb;

  --green:      #5bb330;
  --green-text: #3f8a1f;
  --green-tint: #eaf3ec;

  --amber:      #c77a12;
  --amber-tint: #fbf1df;

  --red:     #b3322c;
  --red-bg:  #fbe9e7;

  --th:   #e7f0f9;   /* table header fill (brand-tinted) */
  --th2:  #eef5fb;

  --shadow: 0 1px 2px rgba(16,32,43,.04), 0 4px 16px rgba(16,32,43,.06);
  --radius: 12px;
  --radius-lg: 18px;
}

[data-theme="dark"] {
  --bg:        #0a1b2d;
  --surface:   #11283f;
  --surface2:  #0f2236;
  --border:    #1c3650;
  --border2:   #163049;
  --text:      #ffffff;
  --muted:     #9fb3c6;
  --muted2:    #7f97ad;

  --primary:      #3a8af3;
  --primary-dark: #6fb2ec;
  --primary-tint: rgba(58,138,243,.16);

  --green:      #5bb330;
  --green-text: #8ed35f;
  --green-tint: rgba(91,179,48,.18);

  --amber:      #e0a24a;
  --amber-tint: rgba(224,162,74,.16);

  --red:     #f0664b;
  --red-bg:  rgba(240,102,75,.16);

  --th:   #163049;
  --th2:  #11283f;

  --shadow: 0 1px 2px rgba(0,0,0,.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

h1, h2, h3 { font-weight: 600; color: var(--text); }

/* ---------- Floating theme toggle (injected by _theme.html) ---------- */
.velo-theme-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.velo-theme-btn:hover { border-color: var(--primary); color: var(--primary); }
.velo-theme-btn.has-tabbar { bottom: 74px; }

/* ---------- Classifier UI (sidebar + report) ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 234px; min-width: 234px; background: var(--surface);
  border-right: 1px solid var(--border2); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { padding: 0 8px 16px; font-size: 20px; font-weight: 700;
  margin-bottom: 10px; letter-spacing: -.01em; }
.sidebar-logo span { color: var(--green); }
.sidebar-viewas { padding: 0 8px 14px; margin-bottom: 8px; }
.sidebar-viewas label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted2); margin-bottom: 6px; }
.sidebar-viewas select { width: 100%; padding: 8px 10px; font-size: 13px; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); }
.sidebar-section { padding: 14px 8px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted2); }
.sidebar-item { display: block; padding: 9px 12px; color: var(--text); font-size: 14px;
  border-radius: 10px; margin-bottom: 2px; transition: background-color .15s ease, color .15s ease; }
.sidebar-item:hover { background: var(--surface2); text-decoration: none; }
.sidebar-item.active { color: var(--primary-dark); background: var(--primary-tint); font-weight: 600; }
.sidebar-item .badge { float: right; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 999px; padding: 0 8px; font-size: 11px; color: var(--muted); }

.main { flex: 1; overflow-x: hidden; }
.topbar { padding: 16px 28px; border-bottom: 1px solid var(--border2); display: flex; align-items: center;
  gap: 12px; background: var(--surface); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.topbar .muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 28px; max-width: 1100px; }
.muted { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Cards / report blocks */
.card, .report-header, .label-form { background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); margin-bottom: 16px; box-shadow: var(--shadow); }
.card { overflow: hidden; }
.card-header { padding: 10px 14px; border-bottom: 1px solid var(--border2); display: flex;
  align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--surface2); }
.card-header.timed { background: var(--th); }
.card-header.rollout { opacity: .7; }
.report-header { padding: 16px 20px; }
.report-header h2 { font-size: 22px; margin-bottom: 6px; }
.report-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.report-entry-ref { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border2);
  font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.report-entry-ref .val { color: var(--text); font-family: var(--mono); }

/* Split tables */
.split-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.split-table th { padding: 8px 10px; text-align: right; background: var(--th); color: var(--primary-dark);
  font-weight: 600; font-size: 12px; border: 1px solid var(--border2); white-space: nowrap; }
.split-table th:first-child { text-align: left; }
.split-table td { padding: 8px 10px; text-align: right; border: 1px solid var(--border2); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.split-table td:first-child { text-align: left; font-weight: 600; }
.split-table tbody tr:nth-child(even) td { background: var(--surface2); }
.split-table td.timed-val { color: var(--primary); font-weight: 700; }
.split-table td.key-val   { color: var(--primary-dark); font-weight: 700; }
.split-table td.bold-val  { font-weight: 700; }
.split-table td.null-val  { color: var(--muted); }

/* Block list */
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-item { display: flex; align-items: center; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: var(--radius-lg); gap: 14px; color: var(--text);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .18s ease; }
.block-item:hover { text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16,32,43,.05), 0 8px 22px rgba(16,32,43,.09); }
.block-item:active { transform: translateY(0); }
.block-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.block-dot.labeled { background: var(--green); }
.block-dot.unlabeled { background: var(--amber); }
.block-time { font-weight: 700; min-width: 52px; font-variant-numeric: tabular-nums; }
.block-meta { color: var(--muted); font-size: 13px; flex: 1; }
.block-label.unlabeled { color: var(--amber); font-weight: 600; }
.block-label.labeled { color: var(--green-text); font-weight: 600; }
.block-arrow { color: var(--muted2); margin-left: auto; }

/* Forms / buttons */
.label-form { padding: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 600; }
select, input[type=number], input[type=text], input[type=password], input[type=email] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  padding: 8px 10px; font-size: 14px; width: 100%; font-family: inherit; }
select:focus, input:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint); }
.gear-row { display: flex; gap: 8px; align-items: center; }
.gear-row input { flex: 1; }
.gear-calc { font-family: var(--mono); color: var(--primary); min-width: 60px; text-align: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; background: var(--surface2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); }
.lap-selector { margin: 14px 0; }
.lap-options { display: flex; flex-wrap: wrap; gap: 8px; }
.lap-option { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.lap-option.selected { border-color: var(--primary); background: var(--primary-tint); }

/* ===================== Athlete mobile app ===================== */
.phone { max-width: 460px; margin: 0 auto; min-height: 100dvh; background: var(--bg);
  padding: 8px 16px 88px; position: relative; }
.app-top { display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 4px 18px; }
.app-top .who { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.app-top .who span { color: var(--green); }
.app-top .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.app-sectlabel { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted2); margin: 6px 4px 10px; }
.app-sectlabel.need { color: var(--amber); }
.app-link { color: var(--primary); font-size: 14px; font-weight: 600; }
.pill-need { background: var(--amber-tint); color: var(--amber); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600; }
.pill-ok { background: var(--green-tint); color: var(--green-text); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600; }

/* Inbox: date grouping + filter toggle */
.filter-toggle { display: inline-flex; gap: 2px; padding: 3px; margin: 4px 2px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; }
.ft-opt { border: none; background: transparent; color: var(--muted); padding: 7px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 999px; }
.ft-opt.sel { background: var(--primary); color: #fff; }
.day-group { margin-bottom: 8px; }
.day-head { display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 4px 8px;
  font-size: 13px; font-weight: 600; color: var(--text); }
.phone.filter-need .ecard[data-labeled="1"] { display: none; }
.phone.filter-need .day-group[data-need="0"] { display: none; }

/* Inbox select / multi-label mode */
.ecard { position: relative; }
.ecard-body { display: block; }
.ecard .check { display: none; }
.phone.selecting .ecard { padding-left: 44px; cursor: pointer; }
.phone.selecting .ecard .check { display: block; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface); }
.phone.selecting .ecard.sel { border-color: var(--primary); background: var(--primary-tint); }
.phone.selecting .ecard.sel .check { border-color: var(--primary); background: var(--primary); }
.phone.selecting .ecard.sel .check::after { content: "✓"; position: absolute; inset: 0;
  color: #fff; font-size: 14px; line-height: 18px; text-align: center; }

.batchbar { position: fixed; bottom: 49px; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px; background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; display: none; z-index: 40; box-shadow: 0 -2px 10px rgba(16,32,43,.06); }
.batchbar.show { display: block; }
.batchbar-head { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.batchbar-head b { color: var(--text); }
.batchbar-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ecard { display: block; background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 15px 16px; margin-bottom: 10px; color: var(--text);
  box-shadow: var(--shadow); }
.ecard:hover { text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16,32,43,.05), 0 8px 22px rgba(16,32,43,.09); }
.ecard:active { transform: translateY(0); }
.ecard.need { border-left: 3px solid var(--amber); }
.ecard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ecard-row + .ecard-row { margin-top: 6px; }
.ecard .time { font-size: 13px; font-weight: 600; color: var(--text); }
.ecard .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ecard .type { font-size: 15px; font-weight: 600; color: var(--primary); }
.ecard .type.guess { color: var(--amber); }
.ecard .type.ok { color: var(--green-text); }
.ecard .chev { color: var(--muted2); font-size: 18px; flex-shrink: 0; }
.ecard .meta { color: var(--muted2); font-size: 12px; }

.app-back { display: inline-flex; align-items: center; gap: 4px; color: var(--primary);
  margin: 4px 0 10px; font-size: 14px; font-weight: 500; }
.confirm-box, .splits { background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.confirm-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted2); margin-bottom: 12px; font-weight: 600; }
.confirm-box select, .confirm-box input { width: 100%; padding: 11px; font-size: 16px; margin-bottom: 10px; }
.btn-confirm { width: 100%; padding: 13px; font-size: 16px; font-weight: 700; border: none;
  border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; }
.btn-confirm:hover { background: var(--primary-dark); }
/* iOS-style segmented control (track + sliding pill) */
.fmt-seg { display: inline-flex; gap: 2px; padding: 3px; margin: 2px 2px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; }
.fmt-seg-opt { padding: 7px 18px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-radius: 999px; text-decoration: none; }
.fmt-seg-opt:hover { text-decoration: none; color: var(--text); }
.fmt-seg-opt.on { background: var(--primary); color: #fff; }
.fmt-seg-opt.on:hover { color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 6px; }
.type-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.type-chip:hover { border-color: var(--primary); }
.type-chip.sel { border-color: var(--primary); background: var(--primary-tint);
  color: var(--primary-dark); font-weight: 600; }
.inline-form { display: inline; margin: 0; }
.equip-src { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: none;
  letter-spacing: 0; float: right; }
.prof-row { margin: 0 0 4px; }
.locker-row { display: flex; align-items: center; justify-content: space-between;
  padding: 7px 2px; border-bottom: 1px solid var(--border2); font-size: 14px; }
.locker-x { border: none; background: none; color: var(--muted2); font-size: 14px; cursor: pointer; }
.locker-x:hover { color: var(--red); }
.locker-add { display: flex; gap: 8px; margin: 8px 0 6px; }
.locker-add input { flex: 1; }
.promo-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.promo { display: flex; align-items: center; gap: 8px; background: var(--primary-tint);
  border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 10px; margin: 0; }
.promo-text { flex: 1; font-size: 13px; color: var(--primary-dark); }
.promo-yes { border: none; background: var(--primary); color: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lap-line.timed { font-weight: 600; }
.lap-line .role-tag, .lap-pick .role-tag { color: var(--muted2); font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.lap-line.rollout, .lap-pick.rollout { opacity: .55; }
.lap-ico { display: inline-block; width: 16px; text-align: center; color: var(--muted2); }
.lap-line.timed .lap-ico, .lap-pick.timed .lap-ico { color: var(--primary); }
.lap-line.entry .lap-ico, .lap-pick.entry .lap-ico { color: var(--amber); }

/* Tappable start-lap picker rows */
.lap-form { margin: 0; }
.lap-pick { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--border2); padding: 9px 4px;
  font: inherit; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.lap-pick:hover { background: var(--surface2); }
.lap-pick .lap-name { flex: 1; }
.lap-pick.timed { font-weight: 600; }
.lap-pick.cur { background: var(--primary-tint); border-left: 3px solid var(--primary); }
.guess-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.guess-pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--primary-tint);
  border: 1px solid var(--border2); color: var(--primary-dark); }
.guess-pill b { color: var(--primary-dark); }

.splits .total { font-size: 40px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.05; }
.splits .total small { display: block; font-size: 13px; color: var(--muted); font-weight: 500;
  letter-spacing: 0; margin-top: 2px; }
.split-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 14px; }
.split-grid .q { background: var(--surface2); border: none; border-radius: var(--radius);
  padding: 10px 6px; text-align: center; }
.split-grid .q .l { font-size: 10px; color: var(--muted2); text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; }
.split-grid .q .v { font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 700; margin-top: 2px; }
.lap-line { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border2);
  font-variant-numeric: tabular-nums; }
/* Unlabeled effort: each lap shows its label/elapsed + a compact quarter grid. */
.lap-raw { padding-bottom: 6px; }
.lap-raw .lap-line { font-weight: 600; }
.lap-raw .split-grid { margin-top: 6px; gap: 6px; }
.lap-raw .split-grid .q { padding: 6px 4px; }
.lap-raw .split-grid .q .v { font-size: 14px; font-weight: 600; }
.xch { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--border2); }
.xch .who { font-weight: 600; }
.xch .kind { color: var(--muted); font-size: 12px; }
.xch .gap.ok { color: var(--green-text); font-weight: 600; }
.xch .gap.bad { color: var(--red); font-weight: 600; }

.trend-best { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  color: var(--green-text); font-variant-numeric: tabular-nums; }
.trend-best small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin: 10px 0 2px; }
.spark .bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; opacity: .85; }
.spark .bar.best { background: var(--green); opacity: 1; }
.pr-best { color: var(--green-text); font-weight: 600; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px;
  display: flex; background: var(--surface); border-top: 1px solid var(--border2);
  box-shadow: 0 -2px 14px rgba(16,32,43,.05); padding-bottom: env(safe-area-inset-bottom, 0); z-index: 30; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 12px; color: var(--muted2); font-size: 11px; font-weight: 600; }
.tabbar a:hover { text-decoration: none; color: var(--muted); }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--primary); }

/* Login / brand header */
header { background: var(--surface); border-bottom: 2px solid var(--primary); padding: 16px 24px; }
.error { background: var(--red-bg); color: var(--red); border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; }

/* Two-field declare form: type + distance */
.field-label { display:block; font-size:12px; color:var(--muted); margin:10px 0 4px; text-transform:uppercase; letter-spacing:.04em; }
.preset-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.preset-chip { background:var(--primary-tint); border:1px solid var(--border2); color:var(--primary-dark);
  border-radius:14px; padding:4px 10px; font-size:13px; cursor:pointer; }
.preset-chip:hover { background:var(--primary); color:#fff; }

/* Logged-in user block in the sidebar */
.sidebar-user { padding: 10px 12px; margin: 0 12px 10px; border: 1px solid var(--border); border-radius: 8px; }
.sidebar-user-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.sidebar-logout { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--red); text-decoration: none; }
.sidebar-logout:hover { text-decoration: underline; }

/* Analytics dashboard */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
           gap: 12px; margin: 12px 0 24px; }
.pr-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; background: var(--surface); }
.pr-type { font-weight: 600; margin-bottom: 8px; }
.pr-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.pr-row b { font-variant-numeric: tabular-nums; }

/* ===================== Polish pass (ui-ux-pro-max) ===================== */
/* Consistent, native-feeling interaction states across every tappable thing. */
.type-chip, .preset-chip, .ft-opt, .fmt-seg-opt, .promo-yes, .btn-confirm,
.lap-pick, .ecard, .btn, .locker-x, .tabbar a {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
              transform .12s ease, box-shadow .18s ease;
}
/* Press feedback — scale only (never shifts surrounding layout). */
.type-chip:active, .preset-chip:active, .ft-opt:active, .fmt-seg-opt:active,
.promo-yes:active, .btn-confirm:active, .ecard:active, .btn:active,
.lap-pick:active { transform: scale(.97); }

/* Comfortable touch targets (>=44px effective). */
.type-chip { min-height: 42px; padding: 9px 14px; display: inline-flex; align-items: center; }
.preset-chip { min-height: 36px; padding: 7px 13px; display: inline-flex; align-items: center; }
.ft-opt, .fmt-seg-opt { min-height: 38px; display: inline-flex; align-items: center; }
.chip-row { gap: 8px; }

/* Visible keyboard focus on every interactive element (was missing). */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, .ecard:focus-visible, .type-chip:focus-visible,
.lap-pick:focus-visible, .fmt-seg-opt:focus-visible, .ft-opt:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--primary-tint);
}

/* Tabular figures everywhere a number is shown, so columns never jitter. */
.big, .total, .total small, .split-grid .v, .lap-val, .lap-pick, .trend-best,
.q .v, .meta { font-variant-numeric: tabular-nums; }

/* Honor reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
