/* Design tokens. Light is the default; dark follows the OS. There is no theme
   toggle — one user, one machine, and the OS already knows. */
:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --panel-2: #f1efea;
  --ink: #1b1a17;
  --ink-2: #55534d;
  --ink-3: #8b8880;
  --line: #e2ded5;
  --line-2: #cdc8bc;

  --blaze: #b8501c;
  --ok: #4c7a22;
  --warn: #9a7311;
  --bad: #a81e32;

  --s-run: #c2571c;
  --s-trail: #6f8c24;
  --s-ski: #2b7595;
  --s-hike: #8a6e3e;
  --s-bike: #6257a0;
  --s-strength: #9a8558;
  --s-other: #8b8880;

  --k-key: #b8501c;
  --k-quality: #6257a0;
  --k-long: #2b7595;
  --k-easy: #6f8c24;
  --k-rest: #a5a29a;
  --k-race: #a81e32;
  --k-test: #9a7311;
  --k-strength: #8a6e3e;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 18, 14, 0.06), 0 4px 14px rgba(20, 18, 14, 0.04);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --panel: #1e1d1a;
    --panel-2: #262421;
    --ink: #f0eee9;
    --ink-2: #b6b2a9;
    --ink-3: #837f77;
    --line: #302e2a;
    --line-2: #423f39;

    --blaze: #e2793c;
    --ok: #8fb54a;
    --warn: #d3a52f;
    --bad: #e05365;

    --s-run: #e2793c;
    --s-trail: #9dbe4b;
    --s-ski: #52a8cc;
    --s-hike: #c09a5f;
    --s-bike: #9188d8;
    --s-strength: #c4ac74;
    --s-other: #8f8b83;

    --k-key: #e2793c;
    --k-quality: #9188d8;
    --k-long: #52a8cc;
    --k-easy: #9dbe4b;
    --k-rest: #6e6a63;
    --k-race: #e05365;
    --k-test: #d3a52f;
    --k-strength: #c09a5f;

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

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-3); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.74rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- structure */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 52px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand span { font-weight: 400; font-size: 0.78rem; color: var(--ink-3); }
nav.tabs { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
nav.tabs a {
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 0.88rem;
}
nav.tabs a:hover { background: var(--panel-2); text-decoration: none; }
nav.tabs a.on { background: var(--ink); color: var(--bg); }

main { max-width: 1180px; margin: 0 auto; padding: 22px 18px 80px; }

.flash {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  padding: 9px 13px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.88rem;
}

/* Page sections. The eyebrow heading sits OUTSIDE the cards, which is what
   gives the reworked pages their rhythm: groups are labelled by quiet uppercase
   text and separated by space, instead of every card shouting at equal volume. */
.sec { margin: 30px 0 0; }
.sec-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.sec-hd h2 {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}

/* Today's session on the dashboard: the one thing the page is for, so it is
   allowed to be bigger than everything else. */
.hero-sess .t { font-size: 1.12rem; }
.hero-sess .kind { width: 10px; height: 10px; margin-top: 8px; }

/* align-items: start, or a short card stretches to match a tall neighbour and
   leaves a slab of empty panel underneath it. */
.flash.open-local { border-left-color: var(--warn); font-size: 0.82rem; }
/* On a phone the full explanation is eight lines of banner on every page; the
   headline carries the message and the detail lives on the desktop and in the
   settings page. */
@media (max-width: 760px) {
  .open-local-more { display: none; }
}

.grid { display: grid; gap: 16px; align-items: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

@media (max-width: 900px) {
  .g2, .g3, .g-2-1 { grid-template-columns: minmax(0, 1fr); }
  /* Four stats stay 2x2 rather than becoming a column of four: they are the
     summary, and a summary you have to scroll is not one. */
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .grid { gap: 12px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card > h2, .card > h3 { display: flex; align-items: baseline; gap: 8px; }
.card-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card-hd h2, .card-hd h3 { margin: 0; }

/* ------------------------------------------------------------------ numbers */

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stat .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.stat .sub { font-size: 0.78rem; color: var(--ink-2); }
.stat.wide .v { font-size: 2.1rem; }

.delta { font-family: var(--mono); font-size: 0.78rem; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--ink-3); }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.pill.ok { border-color: var(--ok); color: var(--ok); }
.pill.bad { border-color: var(--bad); color: var(--bad); }
.pill.warn { border-color: var(--warn); color: var(--warn); }

/* ------------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
.tbl-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ sessions */

.kind {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.k-key { background: var(--k-key); }
.k-quality { background: var(--k-quality); }
.k-long { background: var(--k-long); }
.k-easy { background: var(--k-easy); }
.k-rest { background: var(--k-rest); }
.k-race { background: var(--k-race); }
.k-test { background: var(--k-test); }
.k-strength { background: var(--k-strength); }

.sess {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.sess:last-child { border-bottom: 0; }
.sess .kind { margin-top: 6px; }
.sess .body { min-width: 0; flex: 1; }
.sess .t { font-weight: 550; }
.sess.done .t { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.sess .meta { font-size: 0.78rem; color: var(--ink-3); font-family: var(--mono); }

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-family: var(--mono);
}
.badge.done { background: var(--ok); color: var(--panel); }
.badge.partial { background: var(--warn); color: var(--panel); }
.badge.skipped { background: var(--k-rest); color: var(--panel); }
.badge.moved { background: var(--line-2); color: var(--ink); }
/* A weekend recommendation. Outlined rather than filled, because the whole
   point is that it is not a prescription. */
.badge.flex { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); }
.cal .chip.flex .kind, .cal-list .chip.flex .kind { opacity: 0.55; }
.cal .chip.flex span, .cal-list .chip.flex span { font-style: italic; }

/* ----------------------------------------------------------------- calendar */

.cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cal th { padding: 4px 6px; }
.cal td {
  border: 1px solid var(--line);
  border-width: 0 1px 1px 0;
  padding: 5px 6px;
  height: 96px;
  vertical-align: top;
  background: var(--panel);
}
.cal tr td:first-child { border-left-width: 1px; }
.cal tr:first-child td { border-top-width: 1px; }
.cal td.out { background: var(--bg); }
.cal td.out .dom { color: var(--ink-3); }
.cal td.now { box-shadow: inset 0 0 0 2px var(--blaze); }
.cal .dom { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); }
.cal .chip {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 0.72rem;
  line-height: 1.25;
  margin-top: 3px;
  color: var(--ink);
}
.cal .chip .kind { width: 6px; height: 6px; }
.cal .chip.act { color: var(--ink-2); font-family: var(--mono); font-size: 0.68rem; }
.cal .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .mile {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--k-race);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cal td a { color: inherit; }
.cal td a:hover { text-decoration: none; }
.cal .dom a { display: inline-block; }

/* Drag to move. `cursor: grab` is the only affordance a drag has, so it matters
   more than it looks; the drop highlight is what tells you the target accepted. */
.cal .chip.drag { cursor: grab; border-radius: 3px; }
.cal .chip.drag:hover { background: var(--panel-2); }
.cal .chip.drag.dragging { opacity: 0.35; cursor: grabbing; }
.cal td.dragover { background: color-mix(in srgb, var(--blaze) 14%, var(--panel)); }
.cal td.dragover .dom { color: var(--blaze); }

/* The agenda's per-session move form: touch devices get no drag events. */
.move-inline { border: 0; padding: 0 0 0 14px; margin: 0; }
.move-inline > summary { font-size: 0.7rem; color: var(--ink-3); font-weight: 400; }
.move-inline[open] > summary { margin-bottom: 4px; }
.cal .wtot {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-3);
  padding-top: 4px;
  white-space: nowrap;
}

/* -------------------------------------------------------------------- forms */

form.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 3px; }
input, select, textarea, button {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 6px 9px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blaze); outline-offset: -1px; }
textarea { width: 100%; min-height: 66px; resize: vertical; font-family: inherit; }
input[type="number"], input[type="date"] { font-family: var(--mono); }
button {
  cursor: pointer;
  font-weight: 550;
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
button:hover { opacity: 0.88; }
button.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.field { margin-bottom: 10px; }
.field.grow { flex: 1; min-width: 140px; }
/* Width classes rather than inline styles, so the mobile rules below can
   actually reach them — and so the input matches the field instead of
   overflowing a 96 px box at its default 20-character size. */
.field.f-xs { width: 84px; }
.field.f-sm { width: 112px; }
.field.f-xs input, .field.f-sm input, .field.f-xs select, .field.f-sm select { width: 100%; }

/* ------------------------------------------------------------------- charts */

/* Explicit width/height attributes are set on every <svg> in charts.js, and
   this must not undo them: `height: auto` on an SVG whose intrinsic ratio has
   been stripped resolves to zero, which is how a chart silently becomes a
   1-pixel strip. Width scales, height stays as drawn. */
svg.chart { display: block; width: 100%; max-width: 100%; height: auto; }
/* app.js draws each chart at its container's measured width, so nothing here
   needs a min-width forcing a scrollbar. The wrapper stays because a chart that
   is somehow wider than its box should scroll rather than push the page sideways
   — the body must never scroll horizontally. */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-err {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--bad);
  padding: 10px 0;
}
/* ---------------------------------------------------------------------- map */

/* Map beside profile. A CLASS, not an inline grid-template-columns: an inline
   style is unreachable from the media query below, and at 360 px a stuck
   `420px 1fr` gave the second column zero width — which rendered the elevation
   profile into a 0-pixel-wide box and pushed the page 26 px sideways. */
.map-split {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .map-split { grid-template-columns: minmax(0, 1fr); }
}

/* Tiles are absolutely positioned in percentages of the grid, and the SVG track
   shares the grid's coordinate system through its viewBox — so the whole map is
   one scalable unit and needs no JavaScript to lay out or to resize. */
.map {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.map img {
  position: absolute;
  display: block;
  border: 0;
  /* Monochrome and pale, so the map is a background and the track is the subject.
     grayscale first, then sepia to pull the grey towards the app's warm off-white,
     then brightness/contrast to push it back until it reads as paper rather than
     as a photograph. The order matters: sepia() on a colour image tints the
     original hues, so the grayscale has to come first. */
  filter: grayscale(1) sepia(0.28) saturate(0.55) brightness(1.16) contrast(0.78);
}
@media (prefers-color-scheme: dark) {
  /* Not the same filter dimmed: a pale map in a dark card glares. Darken it
     instead and let the track carry the contrast. */
  .map img {
    filter: grayscale(1) sepia(0.22) saturate(0.5) brightness(0.52) contrast(0.9);
  }
}
:root[data-theme="light"] .map img {
  filter: grayscale(1) sepia(0.28) saturate(0.55) brightness(1.16) contrast(0.78);
}
:root[data-theme="dark"] .map img {
  filter: grayscale(1) sepia(0.22) saturate(0.5) brightness(0.52) contrast(0.9);
}
.map .map-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* With a neutral basemap the track can take the app's own colours instead of
   hard-coded ones that had to survive arbitrary map imagery. */
.map .track-halo { stroke: var(--panel); stroke-opacity: 0.85; }
.map .track-line { stroke: var(--blaze); }
.map .track-start { fill: var(--ok); stroke: var(--panel); }
.map .track-end { fill: none; stroke: var(--blaze); }

.map .map-attr {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  font-size: 9px;
  line-height: 1.4;
  padding: 1px 4px;
  /* Fixed colours, not theme tokens: this sits on map imagery, which does not
     follow the OS theme. Attribution is a licence condition — do not remove it. */
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--ink-2);
  border-top-left-radius: 4px;
}

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.74rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }

/* --------------------------------------------------------------- predictions */

table.pred td.now { font-weight: 650; color: var(--ink); }
table.pred td { font-size: 0.95rem; }
table.pred thead th:first-child { width: 1%; }

/* ------------------------------------------------------------------ signals */

.sig { display: flex; flex-direction: column; gap: 3px; }
.sig .lab { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.sig .v { font-family: var(--mono); font-size: 1.45rem; font-weight: 600; }
.sig .goal { font-size: 0.74rem; color: var(--ink-3); }

.bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blaze); }
.bar.ok > i { background: var(--ok); }

/* -------------------------------------------------------------------- login */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login {
  width: 100%;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.login h1 { font-size: 1.2rem; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 12px; }
.login .err { color: var(--bad); font-size: 0.84rem; margin-top: 10px; }

/* ------------------------------------------------------------------ details */

details { border-top: 1px solid var(--line); padding: 8px 0; }
details > summary { cursor: pointer; font-size: 0.88rem; font-weight: 550; }
details[open] > summary { margin-bottom: 8px; }

/* minmax(0, ...) on both tracks, or a long unbreakable value — a filesystem path
   in a monospace dd — makes the grid wider than its container and the whole page
   scrolls sideways on a phone. `anywhere` then lets that path wrap mid-token. */
.kv {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 3px 14px;
  font-size: 0.85rem;
}
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-family: var(--mono); min-width: 0; overflow-wrap: anywhere; }

.block-row { display: flex; gap: 10px; align-items: baseline; }
.block-tag {
  font-family: var(--mono);
  font-weight: 700;
  width: 1.5em;
  flex: 0 0 auto;
  color: var(--ink-3);
}
.block-row.current .block-tag { color: var(--blaze); }
.block-row.past { opacity: 0.62; }

/* ------------------------------------------------------------------- mobile
   One user, one phone, and the phone is where a session actually gets logged —
   standing in a car park after a climb. So the phone layout is not a courtesy:
   the day page and the calendar have to work with one thumb.

   Two elements genuinely cannot survive being narrowed and are swapped instead
   of squeezed: the month grid becomes an agenda list (.cal-list), and the wide
   tables drop their least useful columns (.opt). Everything else just reflows. */

/* Columns dropped in two tiers as the screen narrows, rather than letting the
   table compress until numbers wrap and headings clip. `.opt` goes on a tablet,
   `.opt2` on a phone — what survives to 390 px is date, name, time, km and
   vertical, which is the list you actually scan. */
@media (max-width: 760px) {
  .opt { display: none; }
}
@media (max-width: 560px) {
  .opt2 { display: none; }
}

/* Wide/narrow pairs: two renderings of the same rows, exactly one in the flow. */
.narrow-only { display: none; }
@media (max-width: 560px) {
  .wide-only { display: none; }
  .narrow-only { display: block; }
}

/* The month grid and the agenda list are mutually exclusive: exactly one of the
   two is in the flow at any width. */
.cal-list { display: none; }

@media (max-width: 760px) {
  main { padding: 14px 12px 60px; }
  .top-in { padding: 0 12px; gap: 10px; }
  .card { padding: 13px 13px; border-radius: 9px; }

  /* One row of tabs, tightened so all six fit a 360 px screen, with horizontal
     scroll as the fallback rather than a second row eating 40 px of every
     screen. The scrollbar is hidden; the clipped tab is the affordance. */
  nav.tabs {
    margin-left: 0;
    width: 100%;
    order: 3;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { padding: 9px 8px; font-size: 0.86rem; flex: 0 0 auto; }
  .brand span { display: none; }

  .cal-grid { display: none; }
  .cal-list { display: block; }

  .stat .v { font-size: 1.4rem; }
  .stat.wide .v { font-size: 1.7rem; }
  .sig .v { font-size: 1.25rem; }
  h1 { font-size: 1.28rem; }

  /* Full-width fields: side-by-side text inputs at 360 px are a mis-tap waiting
     to happen. The narrow numeric ones stay inline, three to a row, because they
     are labelled and short. */
  .field { width: 100%; }
  .field input, .field select, .field textarea { width: 100%; }
  .field.f-xs, .field.f-sm { width: calc(33.333% - 7px); }
  form.inline { gap: 10px; }
  input, select, textarea, button { padding: 9px 10px; font-size: 16px; }
  /* 16 px is not a style choice: iOS Safari zooms the viewport on focus for
     anything smaller, and the zoom does not come back. */
  button { min-height: 42px; }

  th, td { padding: 8px 6px; }
}

/* The agenda list itself — a day per row, planned and recorded together. */
.cal-day {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.cal-day:last-child { border-bottom: 0; }
.cal-day.now { background: color-mix(in srgb, var(--blaze) 8%, transparent); }
.cal-day.empty { opacity: 0.5; }
.cal-day .when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  line-height: 1.3;
}
/* Weekday and block letter on one line, the date under it — three lines of a
   two-word label is a lot of vertical space to spend 35 times a month. */
.cal-day .when .dow { display: block; }
.cal-day .when b { font-size: 1.05rem; color: var(--ink); }
.cal-day a { color: inherit; }
.cal-week-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.cal-week-hd .mono { text-transform: none; letter-spacing: 0; }
/* In the grid a chip must stay on one line or the cell grows; in the list there
   is a whole row available, so let the title wrap and be readable. */
.cal-list .chip span { white-space: normal; overflow: visible; }
.cal-list .chip { align-items: flex-start; }
.cal-list .chip .kind { margin-top: 4px; }
