/* Offline Workouts. Gym-floor palette: chalk, rubber, and bumper-plate colours used only for meaning. */
@font-face {
  font-family: "Archivo";
  src: url(fonts/archivo-var.woff2) format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
:root {
  --chalk: #F2F4F0; --paper: #FFFFFF; --rubber: #1B201D; --rubber-2: #2A302C;
  --ink-2: #4E5751; --line: #D3D9D1; --line-2: #E5E9E3;
  --red: #CF2F37; --blue: #2353C2; --yellow: #F3C11A; --green: #1C7D4C;
  --focus: #2353C2;
  --r-s: 8px; --r-m: 14px; --r-l: 24px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gut: 16px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--chalk); color: var(--rubber); font: 400 16px/1.5 var(--font); font-stretch: 100%; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 22px; height: 22px; flex: none; fill: none; }
.num { font-variant-numeric: tabular-nums; }
.display { font-stretch: 68%; font-weight: 820; line-height: .92; letter-spacing: -.005em; }
.muted { color: var(--ink-2); }
.error { color: var(--red); font-weight: 600; padding: 24px 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--rubber); color: var(--chalk); padding: 10px 14px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { top: 8px; }
@media (min-width: 720px) { :root { --gut: 32px; } }

/* ---------- plates (difficulty, badges, week goal) ---------- */
[data-plate] { --pc: var(--line); --plate-ring: #fff; }
[data-plate="red"] { --pc: var(--red); }
[data-plate="blue"] { --pc: var(--blue); }
[data-plate="yellow"] { --pc: var(--yellow); --plate-ring: var(--rubber); }
[data-plate="green"] { --pc: var(--green); }
[data-plate="white"] { --pc: #fff; --plate-ring: var(--rubber); }
.diff { display: inline-flex; align-items: center; gap: 5px; }
.diff .ico { width: 16px; height: 16px; color: var(--pc); filter: drop-shadow(0 0 .5px rgba(27, 32, 29, .6)); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 2px solid transparent; border-radius: 12px; font-weight: 700; font-size: 17px; text-decoration: none; background: none; }
.btn.primary { background: var(--yellow); color: var(--rubber); }
.btn.primary:hover { background: #FFD233; }
.btn.dark { background: var(--rubber); color: var(--chalk); }
.btn.line { border-color: currentColor; }
.btn .ico { width: 20px; height: 20px; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; padding: 0; }
.iconbtn:hover { background: rgba(27, 32, 29, .08); }
.linkish { background: none; border: 0; padding: 10px 4px; min-height: 44px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header + nav ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(242, 244, 240, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 8px var(--gut); display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-stretch: 72%; font-size: 24px; text-decoration: none; letter-spacing: .005em; min-height: 44px; }
.brand .ico { width: 26px; height: 26px; color: var(--rubber); --plate-ring: var(--chalk); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.nav a:hover { color: var(--rubber); background: rgba(27, 32, 29, .06); }
.nav a[aria-current="page"] { color: var(--rubber); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.nav .ico { width: 20px; height: 20px; }
.streak { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  background: var(--rubber); color: var(--chalk); text-decoration: none; font-weight: 800; font-stretch: 75%; font-size: 20px; }
.streak .ico { color: var(--yellow); }
.streak.cold .ico { color: #8C958F; }
@media (max-width: 719px) {
  .top { backdrop-filter: none; background: var(--chalk); } /* backdrop-filter would trap the fixed tab bar inside the header */
  .nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line);
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; justify-content: center; min-height: 56px; font-size: 13px; padding: 0; }
  .nav a[aria-current="page"] { box-shadow: none; background: none; color: var(--rubber); }
  .nav a[aria-current="page"] .ico { color: var(--rubber); background: var(--yellow); border-radius: 999px; width: 48px; padding: 1px 12px; }
  body.has-tabs { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
}

/* ---------- page shell ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px var(--gut) 48px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.h2 { font-size: 30px; font-stretch: 72%; font-weight: 800; line-height: 1; }
.h2 small { font-size: 18px; font-weight: 600; color: var(--ink-2); font-stretch: 85%; margin-left: 8px; }
.img { width: 100%; height: auto; object-fit: cover; background: var(--line-2); }
.img.ph { display: grid; place-items: center; color: var(--line); aspect-ratio: 5/4; }
.img.ph .ico { width: 40%; height: 40%; }

/* ---------- home: today ---------- */
.today { display: grid; gap: 16px; }
@media (min-width: 960px) { .today { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: stretch; } }
.hero { background: var(--rubber); color: var(--chalk); border-radius: var(--r-l); overflow: hidden; display: grid; }
@media (min-width: 600px) { .hero { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
.hero .img { aspect-ratio: 16/10; height: 100%; }
@media (min-width: 600px) { .hero { min-height: 440px; } .hero .img { aspect-ratio: auto; position: absolute; inset: 0; } .hero .imgcell { position: relative; } }
.hero-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 960px) { .hero-body { padding: 32px; } }
.hero .prog { color: #B9C2BC; font-weight: 600; text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; align-self: flex-start; margin: -10px 0 -10px; }
.hero .prog:hover { color: var(--chalk); text-decoration: underline; }
.hero h1 { font-size: clamp(64px, 11vw, 112px); }
.hero h1 span { display: block; font-size: .3em; font-stretch: 85%; font-weight: 650; line-height: 1.15; margin-top: 8px; letter-spacing: 0; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #D5DBD6; }
.hero .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hero .meta .ico { width: 18px; height: 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 4px; }
.hero .linkish { color: var(--chalk); }
.hero .done-note { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 18px; }
.hero .done-note .ico { background: var(--green); color: #fff; border-radius: 50%; padding: 4px; width: 30px; height: 30px; }

/* segmented program bar: one cell per day */
.segs { display: flex; gap: 2px; height: 10px; }
.segs i { flex: 1; border-radius: 2px; background: rgba(27, 32, 29, .12); }
.segs i.done { background: var(--rubber); }
.segs i.cur { background: var(--yellow); }
.hero .segs i { background: rgba(255, 255, 255, .16); }
.hero .segs i.done { background: var(--chalk); }
.hero .segs i.cur { background: var(--yellow); }

.side { display: grid; gap: 16px; align-content: start; }
.panel { background: var(--paper); border-radius: var(--r-m); padding: 20px; box-shadow: inset 0 0 0 1px var(--line-2); }
.panel h2 { font-size: 22px; font-stretch: 78%; font-weight: 750; line-height: 1.1; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.week div { display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.week b { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.week .on b { background: var(--rubber); border-color: var(--rubber); color: var(--yellow); }
.week .on b .ico { width: 60%; height: 60%; }
.week .is-today b { border-color: var(--rubber); border-style: dashed; }
.week .is-today { color: var(--rubber); }
.goalline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.goalline b { font-size: 34px; font-stretch: 70%; font-weight: 820; line-height: 1; }
.streakline { display: flex; align-items: center; gap: 14px; }
.streakline .big { font-size: 56px; font-stretch: 66%; font-weight: 850; line-height: .9; }
.streakline .ico { width: 34px; height: 34px; color: var(--red); }

.programs { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 10px; border-radius: var(--r-m);
  text-decoration: none; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); min-height: 64px; }
.prow:hover { box-shadow: inset 0 0 0 2px var(--rubber); }
.prow .img { grid-row: span 2; width: 64px; height: 64px; border-radius: var(--r-s); aspect-ratio: 1; }
.prow .t { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.prow .t span { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
@media (min-width: 720px) and (max-width: 959px) { .side { grid-template-columns: 1fr 1fr; } .side > .programs-wrap { grid-column: 1 / -1; } }

/* ---------- library ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search input { width: 100%; min-height: 48px; padding: 0 14px 0 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); font-size: 17px; }
.search input:focus-visible { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(35, 83, 194, .25); }
.filter-toggle { position: relative; }
.filter-toggle .count { background: var(--yellow); color: var(--rubber); border-radius: 999px; font-size: 13px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 14px; align-items: flex-end; }
.filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.filters legend, .filters label.lab { font-size: 14px; font-weight: 650; color: var(--ink-2); padding: 0; margin-bottom: 6px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; white-space: nowrap; }
.chip input:checked + span { background: var(--rubber); color: var(--chalk); box-shadow: none; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip .ico { width: 18px; height: 18px; }
.chip input:checked + span .star-ico { fill: var(--yellow); color: var(--yellow); }
select.sel { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); padding: 0 36px 0 14px; font-weight: 600;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--rubber) 50%), linear-gradient(135deg, var(--rubber) 50%, transparent 50%);
  background-position: right 18px top 50%, right 13px top 50%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }
.filters .clear { align-self: center; }
@media (max-width: 899px) {
  .filters:not(.open) { display: none; }
  .filters { background: var(--paper); border-radius: var(--r-m); padding: 16px; box-shadow: inset 0 0 0 1px var(--line-2); }
  .filters .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .filters fieldset, .filters .field { width: 100%; }
}
@media (min-width: 900px) { .filter-toggle { display: none !important; } }

.cards { display: grid; gap: 24px 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 20px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px 20px; } }
.card { position: relative; min-width: 0; }
.card > a { display: grid; gap: 10px; text-decoration: none; }
.card .img { aspect-ratio: 5/4; border-radius: var(--r-m); }
.card .t { font-weight: 700; font-stretch: 88%; font-size: 17px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card > a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.card .m { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; color: var(--ink-2); margin-top: -4px; }
.card .m > span { display: inline-flex; align-items: center; gap: 5px; }
.card .m .ico { width: 16px; height: 16px; }
.card .done-mark { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; background: var(--green); color: #fff; border-radius: 999px;
  padding: 3px 10px 3px 6px; font-size: 13px; font-weight: 700; }
.card .done-mark .ico { width: 16px; height: 16px; }
.fav { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: none; padding: 0; }
.fav::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(27, 32, 29, .25); }
.fav .ico { position: relative; width: 20px; height: 20px; color: var(--rubber); }
.fav[aria-pressed="true"] .ico { fill: var(--yellow); color: #7A5D00; }
.empty { padding: 40px 0; display: grid; gap: 12px; justify-items: start; }
.empty p { font-size: 18px; }

/* ---------- collection ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 650; text-decoration: none; color: var(--ink-2); margin-left: -6px; }
.back:hover { color: var(--rubber); }
.chead { display: grid; gap: 24px; margin-top: 8px; }
@media (min-width: 900px) { .chead { grid-template-columns: minmax(0, 1fr) 420px; align-items: end; } }
.chead h1 { font-size: clamp(56px, 10vw, 120px); }
.chead .sub { font-size: 19px; margin-top: 12px; color: var(--ink-2); }
.chead .sub b { color: var(--rubber); }
.chead .actions { margin-top: 20px; display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; }
.map { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.map a, .map span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-weight: 750; font-stretch: 75%; font-size: 17px; text-decoration: none;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); min-height: 40px; }
.map .done { background: var(--rubber); color: var(--chalk); box-shadow: none; }
.map .cur { background: var(--yellow); box-shadow: none; }
.map .na { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line-2) 5px 7px); color: var(--ink-2); }
.map a:hover { box-shadow: inset 0 0 0 2.5px var(--rubber); }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.maplegend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; box-shadow: inset 0 0 0 1.5px var(--line); }
.maplegend .k-done { background: var(--rubber); box-shadow: none; } .maplegend .k-cur { background: var(--yellow); box-shadow: none; }
.weekh { font-size: 22px; font-stretch: 78%; font-weight: 750; margin: 36px 0 10px; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day { position: relative; display: grid; grid-template-columns: 52px 88px minmax(0, 1fr) 44px; gap: 14px; align-items: center; background: var(--paper);
  border-radius: var(--r-m); padding: 8px 8px 8px 4px; box-shadow: inset 0 0 0 1px var(--line-2); scroll-margin-top: 90px; }
.day > a { display: contents; text-decoration: none; }
.day > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.day > a:focus-visible { outline: none; }
.day:has(> a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.day:has(> a:hover) { box-shadow: inset 0 0 0 2px var(--rubber); }
.day .fav { position: relative; right: auto; top: auto; z-index: 1; }
.day .fav::before { box-shadow: none; background: none; }
.day .n { font-size: 34px; font-stretch: 66%; font-weight: 820; text-align: center; line-height: 1; }
.day .img { width: 88px; aspect-ratio: 5/4; border-radius: 10px; }
.day .t { font-weight: 700; line-height: 1.25; }
.day .m { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.day .m > span { display: inline-flex; align-items: center; gap: 5px; }
.day .m .ico { width: 16px; height: 16px; }
.day.done .n { color: var(--green); }
.day .tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--rubber); }
.day .tag .ico { width: 16px; height: 16px; color: var(--green); }
.day.cur { box-shadow: inset 0 0 0 3px var(--yellow); background: #FFFBEA; }
.day.cur .tag { background: var(--yellow); border-radius: 999px; padding: 0 10px; }
.day.na { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.day.na .img { opacity: .45; filter: grayscale(1); }
@media (max-width: 480px) { .day { grid-template-columns: 40px 72px minmax(0, 1fr) 44px; gap: 10px; } .day .img { width: 72px; } .day .n { font-size: 28px; } }

/* ---------- stats ---------- */
.shead { display: grid; gap: 16px; margin-top: 8px; }
@media (min-width: 900px) { .shead { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.bigstreak { background: var(--rubber); color: var(--chalk); border-radius: var(--r-l); padding: 28px; display: grid; gap: 8px; align-content: space-between; min-height: 220px; }
.bigstreak .row { display: flex; align-items: flex-end; gap: 16px; }
.bigstreak .n { font-size: clamp(110px, 18vw, 180px); font-stretch: 64%; font-weight: 860; line-height: .8; }
.bigstreak .ico { width: 56px; height: 56px; color: var(--yellow); margin-bottom: 6px; }
.bigstreak .l { font-size: 24px; font-stretch: 80%; font-weight: 700; }
.bigstreak p { color: #B9C2BC; }
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-2); border-radius: var(--r-m); overflow: hidden; margin: 0; box-shadow: 0 0 0 1px var(--line-2); }
.figs div { background: var(--paper); padding: 18px 20px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; }
.figs dt { color: var(--ink-2); font-weight: 600; }
.figs dd { margin: 0; font-size: 44px; font-stretch: 68%; font-weight: 820; line-height: 1; }
.goalbox { display: grid; gap: 20px; }
@media (min-width: 720px) { .goalbox { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.plates { display: flex; flex-wrap: wrap; gap: 8px; }
.plates .ico { width: 52px; height: 52px; color: var(--line); --plate-ring: var(--paper); }
.plates .ico.on { color: var(--rubber); --plate-ring: var(--yellow); }
.plates .ico.extra { color: var(--green); }
.stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--chalk); border-radius: 999px; padding: 4px; }
.stepper .iconbtn { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.stepper output { min-width: 80px; text-align: center; font-weight: 700; }
.stepper output b { font-size: 26px; font-stretch: 70%; font-weight: 820; display: block; line-height: 1; }
.cal-wrap { overflow-x: auto; padding-bottom: 6px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: 18px repeat(7, var(--cs)); grid-auto-columns: var(--cs); gap: 4px; --cs: 15px; width: max-content; }
@media (min-width: 720px) { .cal { --cs: 22px; } }
@media (min-width: 1100px) { .cal { --cs: 34px; gap: 5px; } }
.cal .mo { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.cal .d { border-radius: 4px; background: var(--line-2); }
.cal .d.c1 { background: #7C9486; } .cal .d.c2 { background: #4E6457; } .cal .d.c3 { background: var(--rubber); }
.cal .d.today { box-shadow: 0 0 0 2px var(--yellow); }
.cal .d.pad { background: none; }
.cal-key { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.cal-key i { width: 13px; height: 13px; border-radius: 3px; background: var(--line-2); display: inline-block; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 20px 12px; list-style: none; margin: 0; padding: 0; }
.badge { display: grid; justify-items: center; gap: 8px; text-align: center; font-weight: 650; font-size: 15px; line-height: 1.2; }
.badge .disc { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--pc); color: #fff; font-stretch: 66%; font-weight: 850; font-size: 30px; box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12), inset 0 0 0 16px rgba(255, 255, 255, .1); }
.badge[data-plate="yellow"] .disc, .badge[data-plate="white"] .disc { color: var(--rubber); }
.badge[data-plate="white"] .disc { box-shadow: inset 0 0 0 2px var(--line), inset 0 0 0 16px var(--chalk); }
.badge.locked .disc { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); }
.badge.locked { color: var(--ink-2); font-weight: 500; }
.badge small { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.hist { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line-2); }
.hist li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line-2); align-items: baseline; }
.hist li:first-child { border-top: 0; }
.hist time { color: var(--ink-2); font-size: 15px; }
.hist a { font-weight: 700; text-decoration: none; }
.hist a:hover { text-decoration: underline; }
.hist .r { color: var(--ink-2); font-size: 15px; text-align: right; white-space: nowrap; }
.hist .stopped { color: var(--red); font-weight: 600; }
@media (max-width: 560px) { .hist li { grid-template-columns: minmax(0, 1fr) auto; } .hist time { grid-column: 1 / -1; font-size: 14px; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 10px; justify-items: end; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--rubber); color: var(--chalk); border-radius: 12px; padding: 14px 18px; font-weight: 650;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: rise .25s ease-out; font-size: 17px; }
.toast .ico { color: var(--yellow); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gut); }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 28px; }
.login .brand { font-size: 44px; gap: 12px; }
.login .brand .ico { width: 44px; height: 44px; }
.login form { display: grid; gap: 14px; }
.login label { font-weight: 650; }
.login input { min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); padding: 0 16px; font-size: 18px; width: 100%; }
.login input:focus-visible { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(35, 83, 194, .25); }
.login input[aria-invalid="true"] { border-color: var(--red); }
.login .msg { display: flex; gap: 8px; align-items: center; color: var(--red); font-weight: 650; }
.login .btn { width: 100%; min-height: 52px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.hero :focus-visible, .bigstreak :focus-visible, .streak:focus-visible { outline-color: var(--yellow); }

/* ---------- TV mode (html.tv, see app.js): a TV browser is about 960x540 CSS px and has no pointer ---------- */
html.tv { scroll-behavior: auto; }
html.tv:has(.has-tabs) { scroll-padding: 76px 0 96px; }
/* Three bands (dark, yellow, dark) so the ring shows on chalk, on dark panels and around yellow buttons alike. */
html.tv :focus, html.tv .chip input:focus + span, html.tv .day:has(> a:focus) {
  outline: 2px solid var(--rubber) !important; outline-offset: 7px !important; box-shadow: 0 0 0 3px var(--rubber), 0 0 0 7px var(--yellow) !important; }
html.tv .day > a:focus, html.tv .chip input:focus { outline: none !important; box-shadow: none !important; }
html.tv .top { backdrop-filter: none; background: var(--chalk); } /* blur is slow on TV chips */
html.tv .skip, html.tv #fs, html.tv .keys { display: none; }
html.tv .wrap { padding-top: 14px; }
/* Today's workout and its Start button fit the first screen. */
html.tv .hero { min-height: 0 !important; height: calc(100vh - 100px); }
html.tv .hero-body { padding: 20px 28px; gap: 8px; justify-content: center; }
html.tv .hero h1 { font-size: 84px; }
