/* DJFC on Pico CSS (pico.min.css, loaded first): Pico styles the plain
   HTML; this file themes it in the logo's colours (sunshine yellow on
   near-black) and adds the site's own pieces. */
:root {
  --yellow: #fef14c;
  --yellow-hover: #f3e43a;
  --ink: #262626;

  --bg: #fffdf0;
  --surface: #ffffff;
  --text: var(--ink);
  --muted: #6b6b6b;
  --border: #e6e2c8;
  --danger: #b42318;
  --ok: #1a7f37;
  --focus: #2563eb;
  --radius: 12px;
  --gap: 1rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181818;
    --surface: #222222;
    --text: #f2f2f2;
    --muted: #a3a3a3;
    --border: #3a3a3a;
    --danger: #ff7b72;
    --ok: #56d364;
    --focus: #79a8ff;
  }
}

/* Pico's theme, from the colours above. :root:root outranks Pico's own
   light/dark and per-breakpoint settings. */
:root:root {
  --pico-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pico-font-size: 100%;
  --pico-line-height: 1.5;
  --pico-background-color: var(--bg);
  --pico-color: var(--text);
  --pico-muted-color: var(--muted);
  --pico-muted-border-color: var(--border);
  --pico-border-radius: 8px;
  --pico-spacing: 1rem;
  --pico-form-element-spacing-vertical: 0.55rem;
  --pico-form-element-spacing-horizontal: 0.75rem;
  --pico-form-element-background-color: var(--surface);
  --pico-form-element-border-color: var(--border);
  --pico-form-element-focus-color: var(--focus);
  --pico-card-background-color: var(--surface);
  --pico-card-border-color: var(--border);
  --pico-card-sectioning-background-color: var(--surface);
  --pico-table-border-color: var(--border);
  --pico-primary: var(--text);
  --pico-primary-hover: var(--text);
  --pico-primary-underline: color-mix(in srgb, var(--text) 40%, transparent);
  --pico-primary-hover-underline: var(--text);
  --pico-primary-focus: color-mix(in srgb, var(--focus) 35%, transparent);
  --pico-primary-background: var(--yellow);
  --pico-primary-hover-background: var(--yellow-hover);
  --pico-primary-border: var(--ink);
  --pico-primary-hover-border: var(--ink);
  --pico-primary-inverse: var(--ink);
  --pico-secondary: var(--muted);
  --pico-secondary-background: transparent;
  --pico-secondary-border: var(--border);
  --pico-secondary-hover-background: color-mix(in srgb, var(--text) 6%, transparent);
  --pico-secondary-hover-border: var(--muted);
  --pico-secondary-inverse: var(--text);
  --pico-del-color: var(--danger);
  --pico-ins-color: var(--ok);
  --pico-typography-spacing-vertical: 0.75rem;
}

h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Layout */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.5rem 1rem;
  background: var(--yellow);
  color: var(--ink);
}
.site-header :is(a, button.link, span) { --pico-color: var(--ink); color: var(--ink); }
.site-header .logo img { display: block; height: 44px; width: auto; }

/* Moving between pages fades the content and leaves the header in place,
   where browsers support it. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: center; flex: 1; }
.site-header nav a { text-decoration: none; font-weight: 600; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-header .who { margin-left: auto; display: flex; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
.site-header .who form { margin: 0; }
/* On phones the nav gets its own row under the logo, scrolling sideways if
   it has to rather than stacking. */
/* The menu: on a wide screen its two parts sit in the header's own row. */
.site-menu { display: contents; }
.menu-toggle { display: none; }

/* On a phone, with JavaScript, the menu folds behind a hamburger button. */
@media (max-width: 640px) {
  .site-header { padding: 0.4rem 0.75rem; }
  .site-header .logo img { height: 36px; }
  .site-menu { display: flex; flex-direction: column; flex-basis: 100%; gap: 0.25rem; }
  .site-header nav { flex-direction: column; align-items: stretch; gap: 0; flex: none; }
  .site-header nav a { padding: 0.7rem 0.25rem; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
  .site-header .who { margin: 0; padding: 0.7rem 0.25rem 0.4rem; justify-content: space-between;
    border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); font-size: 1rem; }
  .js .menu-toggle {
    display: inline-grid; place-items: center; margin: 0 0 0 auto; padding: 0.3rem 0.45rem; width: auto;
    --pico-background-color: transparent; --pico-color: var(--ink); --pico-border-color: var(--ink); --pico-box-shadow: none;
    border-radius: 8px;
  }
  .js .site-menu { display: none; }
  .js .site-menu.open { display: flex; }
  .menu-toggle .cross, .menu-toggle[aria-expanded="true"] .bars { display: none; }
  .menu-toggle[aria-expanded="true"] .cross { display: block; }
}

body > main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
body > main.narrow { max-width: 440px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: var(--gap);
}
.card > :last-child, .callout > :last-child { margin-bottom: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Forms: Pico styles the fields; these lay them out. */
form.stack { display: grid; gap: 0.25rem; }
.grid-form {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-items: end;
}
.grid-form .wide { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 0.9rem; }
label > :is(input, select, textarea) { font-weight: 400; margin-top: 0.3rem; }
label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
label.check input { margin: 0; }
.grid-form label.check { margin-bottom: var(--pico-spacing); }

/* Pico spreads navs across the width and stretches submit buttons. */
nav { justify-content: flex-start; }
nav ul, nav li { padding: 0; margin: 0; }
button[type="submit"] { width: auto; }
[type="checkbox"]:not([role="switch"]) { border-radius: 4px; }
[type="checkbox"]:checked { --pico-background-color: var(--ink); --pico-border-color: var(--ink); }
@media (prefers-color-scheme: dark) {
  [type="checkbox"]:checked { --pico-background-color: var(--yellow); --pico-border-color: var(--yellow); }
}
/* Fold-outs inside tables (score breakdowns) don't need Pico's arrow. */
td details summary::after { display: none; }
form button, form [type="submit"] { margin-bottom: 0; }

button.link {
  --pico-background-color: transparent;
  --pico-border-color: transparent;
  --pico-color: inherit;
  --pico-box-shadow: none;
  padding: 0; margin: 0; width: auto;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
button.danger { --pico-background-color: transparent; --pico-color: var(--danger); --pico-border-color: var(--danger); }

.error { color: var(--danger); font-weight: 600; margin: 0; }
.success { color: var(--ok); font-weight: 600; margin: 0; }

.callout {
  border-left: 4px solid var(--yellow);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--gap);
}
.callout code, .copyable {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

/* Tables: scroll sideways on small screens instead of squashing. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--gap); }
.table-wrap table { margin-bottom: 0; }
table { font-variant-numeric: tabular-nums; }
th, td { padding: 0.55rem 0.6rem; vertical-align: top; background: transparent; }
thead th { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; }
tr.me td { background: color-mix(in srgb, var(--yellow) 30%, transparent); }

.points { font-weight: 800; font-size: 1.1rem; }
.breakdown { font-size: 0.8rem; color: var(--muted); }

.htmx-indicator { opacity: 0; transition: opacity 150ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Log page */
.summary { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.summary .totals { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.summary .big { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.lives { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; align-items: center; }
.life { font-size: 1.4rem; line-height: 1; color: #d92d20; }
/* A life: a heart with a little x to lose it, or a beer (tap to undo). */
.life-btn {
  position: relative; display: inline-block; margin: 0; padding: 0; width: auto; border: 0; background: none;
  --pico-box-shadow: none; cursor: pointer; line-height: 1;
}
span.life-btn { cursor: default; }
.life-btn .x {
  position: absolute; top: -0.3rem; right: -0.45rem; display: grid; place-items: center;
  width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); font: 700 0.55rem/1 var(--pico-font-family);
}
button.life-btn:hover .x, button.life-btn:focus-visible .x { background: var(--text); color: var(--surface); }
button.life-btn:hover .life { transform: scale(1.1); }
.preview { margin: 0 0 var(--gap); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
details summary { cursor: pointer; }

/* Leaderboard */
.season-picker { max-width: 200px; margin-bottom: 1rem; }
.leaderboard th a { text-decoration: none; color: inherit; }
.leaderboard th[aria-sort="descending"] a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.leaderboard td a { text-decoration: none; font-weight: 600; }
.leaderboard td a:hover { text-decoration: underline; }
.leaderboard-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: end; margin-bottom: 1rem; }
.leaderboard-controls .season-picker, .leaderboard-controls .tabs { margin: 0; }
.leaderboard-controls :is(label, select) { margin-bottom: 0; }

/* Tabs (leaderboards, admin sections, scoring) */
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0 0 1rem; }
.tabs a {
  padding: 0.35rem 0.9rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.tabs a:hover { border-color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--yellow); color: var(--ink); border-color: var(--ink); }

/* Checklists (admin tags, participants) */
.checklist { list-style: none; padding: 0; margin: 0; columns: 16rem; }
.checklist li { break-inside: avoid; padding: 0.15rem 0; list-style: none; }

/* Charts. Colours are the validated reference palette's slots 1 and 2
   (blue for the emphasised series, orange for the second), with grey context
   lines; checked against the card surface in both modes. */
:root {
  --chart-surface: var(--surface);
  --chart-focus: #2a78d6;
  --chart-best: #eb6834;
  --chart-other: #c9c7bd;
  --chart-hover: #0b0b0b;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-tick: #6b6a66;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chart-focus: #3987e5;
    --chart-best: #d95926;
    --chart-other: #4d4c48;
    --chart-hover: #ffffff;
    --chart-grid: #2c2c2a;
    --chart-axis: #4a4a47;
    --chart-tick: #a3a29c;
  }
}

figure.chart { margin: 0 0 var(--gap); }
.chart-title { margin: 0 0 0.25rem; }
figure.chart figcaption p { margin: 0 0 0.75rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; padding: 0; margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 0.4rem; }
.key, .tip-key { display: inline-block; width: 16px; height: 0; border-top: 2px solid; border-radius: 1px; }
.key-focus { border-color: var(--chart-focus); }
.key-best { border-color: var(--chart-best); }
.key-other { border-color: var(--chart-other); }
.key-hover { border-color: var(--chart-hover); }

.chart-plot { position: relative; width: 100%; min-height: 260px; touch-action: pan-y; }
.chart-plot:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.chart-svg { display: block; overflow: visible; }
.chart-grid line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid line.axis { stroke: var(--chart-axis); }
.chart-svg .tick { fill: var(--chart-tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line-other { stroke: var(--chart-other); stroke-width: 1.25; }
.chart-svg .line-best { stroke: var(--chart-best); stroke-width: 2; }
.chart-svg .line-focus { stroke: var(--chart-focus); stroke-width: 2; }
.chart-svg .line-hover { stroke: var(--chart-hover); stroke-width: 2; }
.chart-svg .end { stroke: var(--chart-surface); stroke-width: 2; }
.chart-svg .end-focus { fill: var(--chart-focus); }
.chart-svg .end-best { fill: var(--chart-best); }
.chart-svg .end-other { fill: var(--chart-tick); }
.chart-svg .end-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-svg .end-label-inside { paint-order: stroke; stroke: var(--chart-surface); stroke-width: 4px; stroke-linejoin: round; }
.chart-svg .leader { stroke: var(--chart-tick); stroke-width: 1; }
.chart-svg .crosshair { stroke: var(--chart-axis); stroke-width: 1; pointer-events: none; }

.chart-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 9rem; max-width: 16rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.4rem 0.6rem; box-shadow: 0 4px 16px rgb(0 0 0 / 0.12); font-size: 0.8rem;
}
.tip-head { color: var(--muted); margin-bottom: 0.2rem; }
.tip-row { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.tip-row strong { font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
.tip-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.chart-table { margin-top: 0.5rem; font-size: 0.9rem; }
.chart-table summary { color: var(--muted); }
.scoring-toggle { align-items: center; margin-bottom: 0.5rem; }
.scoring-toggle .muted { margin-right: 0.25rem; }

/* Comparison colours: the reference palette's eight categorical slots, in
   their validated order (light and dark steps). Light-mode aqua, yellow and
   magenta sit below 3:1 on white, so every series also has an end label,
   a key beside its name, and the table view. */
:root {
  --slot-1: #2a78d6; --slot-2: #eb6834; --slot-3: #1baf7a; --slot-4: #eda100;
  --slot-5: #e87ba4; --slot-6: #008300; --slot-7: #4a3aa7; --slot-8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root {
    --slot-1: #3987e5; --slot-2: #d95926; --slot-3: #199e70; --slot-4: #c98500;
    --slot-5: #d55181; --slot-6: #008300; --slot-7: #9085e9; --slot-8: #e66767;
  }
}
.key-slot-1 { border-color: var(--slot-1); } .key-slot-2 { border-color: var(--slot-2); }
.key-slot-3 { border-color: var(--slot-3); } .key-slot-4 { border-color: var(--slot-4); }
.key-slot-5 { border-color: var(--slot-5); } .key-slot-6 { border-color: var(--slot-6); }
.key-slot-7 { border-color: var(--slot-7); } .key-slot-8 { border-color: var(--slot-8); }
.chart-svg [class*="line-slot-"] { stroke-width: 2; }
.chart-svg .line-slot-1 { stroke: var(--slot-1); } .chart-svg .line-slot-2 { stroke: var(--slot-2); }
.chart-svg .line-slot-3 { stroke: var(--slot-3); } .chart-svg .line-slot-4 { stroke: var(--slot-4); }
.chart-svg .line-slot-5 { stroke: var(--slot-5); } .chart-svg .line-slot-6 { stroke: var(--slot-6); }
.chart-svg .line-slot-7 { stroke: var(--slot-7); } .chart-svg .line-slot-8 { stroke: var(--slot-8); }
.chart-svg .end-slot-1 { fill: var(--slot-1); } .chart-svg .end-slot-2 { fill: var(--slot-2); }
.chart-svg .end-slot-3 { fill: var(--slot-3); } .chart-svg .end-slot-4 { fill: var(--slot-4); }
.chart-svg .end-slot-5 { fill: var(--slot-5); } .chart-svg .end-slot-6 { fill: var(--slot-6); }
.chart-svg .end-slot-7 { fill: var(--slot-7); } .chart-svg .end-slot-8 { fill: var(--slot-8); }

.chart-builder { margin-bottom: 0.5rem; }
.chart-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 0.75rem; }
.chart-chips li {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.4rem 0.2rem 0.6rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; background: var(--bg);
}
.chart-chips a { text-decoration: none; font-weight: 600; }
.chip-remove { font-size: 1.1rem; line-height: 1; padding: 0 0.3rem; text-decoration: none; }
.chart-add { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: end; }
.chart-add label { min-width: 10rem; }
.chart-add p { flex-basis: 100%; margin: 0; }
.chart-empty { padding: 4rem 0; text-align: center; }
.chart-picker { border: 0; padding: 0; margin: 1rem 0 0; }
.chart-picker legend { font-weight: 700; margin-bottom: 0.5rem; }
.chart-picker ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.chart-picker li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.chart-picker .muted { display: block; }
.pick-key { display: inline-block; width: 16px; flex: none; }
.pick-rank { color: var(--muted); min-width: 1.5rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Strava */
.view-on-strava { color: #fc5200; font-weight: 700; font-size: 0.85rem; }
.strava-item header { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; margin-bottom: 0.75rem; }
.strava-item header .view-on-strava { margin-left: auto; }
.strava-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
/* Pico gives some buttons a bottom margin; none here, or they sit unlevel. */
.strava-actions :is(button, a) { margin: 0; }
.strava-disconnect { margin-top: 2rem; }
ul.consent { padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.powered { margin-top: 2rem; text-align: right; }

/* Admin */
.badge {
  display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.5rem; border-radius: 999px;
  background: var(--yellow); color: var(--ink); font-size: 0.75rem; font-weight: 700; vertical-align: middle;
}
.section-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin: 1.75rem 0 0.75rem; }
.section-head h2 { margin: 0; }
.section-head .filter { max-width: 16rem; margin: 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: 0.75rem; }
textarea.copyable { resize: vertical; margin: 0.5rem 0; }
.status { text-transform: capitalize; }
.status-live { color: var(--ok); font-weight: 700; }
.strava-id summary { cursor: pointer; white-space: nowrap; }
.strava-id summary::after { display: none; }
.strava-id form { display: flex; gap: 0.35rem; margin-top: 0.35rem; min-width: 14rem; }
.strava-id button { padding: 0.35rem 0.75rem; }
/* Strava's brand orange, per their guidelines for the connect button. */
button.strava, .strava-connect {
  --pico-background-color: #fc5200; --pico-border-color: #fc5200; --pico-color: #fff;
  --pico-primary-hover-background: #e34a00;
}
[hidden] { display: none !important; }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin: 0.5rem 0 1rem; }
.inline-form label { flex: 1 1 16rem; max-width: 22rem; }
.inline-form :is(input, select, button) { margin: 0; }
.rule-type { padding: 0.75rem 1rem; }
.rule-type summary { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.rule-type summary::after { margin-left: auto; }
.rule-type { margin-bottom: 0.5rem; }
.rule-type[open] summary { margin-bottom: 0.75rem; }
.rule-type .table-wrap { margin-top: 0.75rem; }
.rules-table input:not([type="checkbox"]) { min-width: 4.5rem; }
.rules-table td:first-child { width: 45%; }
.rules-table td:first-child input { min-width: 12rem; }
.rules-table td:last-child { width: 1%; text-align: center; }
.rules-editor fieldset { border: 1px solid var(--border); padding: 1rem 1.25rem 0; }
.rules-editor legend { font-weight: 700; padding: 0 0.25rem; }
.rules-table td { padding: 0.3rem 0.4rem; vertical-align: middle; }
.rules-table input { margin: 0; }
.rules-save { position: sticky; bottom: 0; background: var(--bg); padding: 0.75rem 0; border-top: 1px solid var(--border); }

/* Info icons: an "i" whose explanation (data-tip) is shown by tips.js in a
   tooltip kept on screen, on hover, focus or tap. */
.info {
  display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; margin-left: 0.3rem;
  border: 1px solid currentColor; border-radius: 50%; vertical-align: 0.05em;
  font: italic 700 0.7rem/1 Georgia, serif; color: var(--muted); cursor: help;
}
.info:hover, .info:focus-visible { color: var(--text); }
#tip {
  position: fixed; z-index: 100; max-width: min(20rem, calc(100vw - 1rem)); padding: 0.5rem 0.65rem;
  border-radius: 8px; background: var(--ink); color: #fff; font: 400 0.8rem/1.4 var(--pico-font-family);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.25); pointer-events: none;
}
@media (prefers-color-scheme: dark) { #tip { background: #f2f2f2; color: #181818; } }

/* The login page is just the Strava button, full width of its narrow column. */
main.narrow button.strava { width: 100%; margin-top: 1.5rem; }

/* Add a login: one row on a wide screen (who, username, Strava, then the
   admin box and button), wrapping to a column on a phone. */
.add-login { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: flex-end; }
.add-login > label { flex: 1 1 11rem; margin: 0; }
.add-login > label.grow { flex-grow: 1.5; }
.add-login :is(input, select) { margin-bottom: 0; }
.add-login-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; flex: 0 0 auto; }
.add-login-actions label.check { margin: 0; }
.add-login-actions button { margin: 0; }
@media (max-width: 640px) {
  .add-login > label, .add-login-actions { flex-basis: 100%; }
  .add-login-actions { justify-content: space-between; }
}

/* Anything absolutely positioned inside a scrolling table stays inside it,
   instead of widening the whole page. */
.table-wrap { position: relative; }

/* The activity table: cells line up in the middle of the row, and the points
   fold-out doesn't add Pico's bottom margin. */
table.activities :is(td, th) { vertical-align: middle; }
table.activities details { margin: 0; }
table.activities summary { margin: 0; list-style: none; }
table.activities summary::-webkit-details-marker { display: none; }
table.activities button.link { line-height: 1.4; }

/* Log page buttons: Strava and manual side by side, equal width. */
.log-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: var(--gap); }
.log-actions > * { margin: 0; flex: 1 1 0; min-width: 11rem; text-align: center; }

/* A page title with an action beside it. */
.page-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin: 0.5rem 0 1rem; }
.page-head h1 { margin: 0; }
.page-head [role="button"] { margin: 0; }

/* Test runs. */
.badge-test { background: #e0e7ff; color: #312e81; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.danger-zone form { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }

/* Strava activities that are fetched but not yet in the log. */
.badge-pending { background: #fde68a; color: #78350f; }
.pending-callout { border-left-color: #f59e0b; }
