/* mitcenter dashboard. Each centre's colours and fonts arrive as CSS variables in the
   page itself, so nothing here names a centre. Series colours stay on the validated
   data-viz palette and never take a brand colour.

   The look is a working report, not a stack of cards: content sits directly on the page, the
   same left edge from logo to footer, sections divided by rules, and boxes only where something
   really is a separate object. Don't reintroduce pills, rounded cards or coloured card edges. */
@font-face { font-family: "Inter"; src: url("/assets/inter-1f021a24.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/assets/open-sans-7177765c.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("/assets/roboto-slab-5e4ce567.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/assets/montserrat-9fa5e944.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/barlow-400-47c07709.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/barlow-600-81a96cd2.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/barlow-700-d0f827ec.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f7f7f5; --surface: #ffffff; --ink: #242424; --ink-2: #55554f; --muted: #6f6f68;
  --grid: #e9e6dc; --baseline: #cfccc0; --ring: rgba(36, 36, 36, 0.10);
  --accent: #2a78d6; --accent-ink: #1d5ea8; --on-accent: #ffffff;
  --up: #006300; --down: #d03b3b;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --div-neg: #e34948;
  --ok: #0ca30c; --ok-ink: #006300; --warn: #fab219; --warn-ink: #7a5200; --bad: #d03b3b; --bad-ink: #a92f2f;
  --tint-ok: color-mix(in srgb, var(--ok) 13%, var(--surface));
  --tint-warn: color-mix(in srgb, var(--warn) 24%, var(--surface));
  --tint-bad: color-mix(in srgb, var(--bad) 20%, var(--surface));
  --track: color-mix(in srgb, var(--ink) 3.5%, var(--surface));
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --head-transform: none; --head-weight: 600; --logo-height: 1.6rem;
  --gutter: clamp(1rem, 3.4vw, 3rem);
  --r: 2px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* masthead: logo, then tabs that sit on the rule */
.masthead { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; padding: 0 var(--gutter); background: var(--masthead-bg, var(--surface)); border-bottom: 1px solid var(--baseline); }
.masthead-left { display: flex; align-items: stretch; gap: clamp(1.25rem, 3vw, 2.75rem); min-width: 0; }
.brand { color: var(--ink); display: inline-flex; align-items: center; flex: none; padding: 0.6rem 0; }
.brand-logo { height: var(--logo-height); width: auto; display: block; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.masthead-nav { display: flex; gap: 0.15rem; }
.masthead-nav a { display: flex; align-items: center; color: var(--masthead-ink, var(--ink-2)); text-decoration: none; font-size: 0.875rem; font-weight: 500; padding: 0 0.7rem; margin-bottom: -1px; border-bottom: 3px solid transparent; white-space: nowrap; }
.masthead-nav a:hover { color: var(--masthead-ink, var(--ink)); border-bottom-color: var(--baseline); }
.masthead-nav a.active { color: var(--masthead-ink, var(--ink)); font-weight: 650; border-bottom-color: var(--accent); }
.masthead-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.masthead-meta { display: flex; align-items: center; flex: none; }
.masthead-sub { color: var(--masthead-ink, var(--muted)); font-size: 0.8rem; white-space: nowrap; }

/* always on screen: what's fictional */
.demo-banner { position: sticky; top: var(--masthead-h, 0); z-index: 19; background: var(--ink); color: var(--surface); padding: 0.32rem var(--gutter); font-size: 0.8rem; font-weight: 500; line-height: 1.4; }
.banner-short { display: none; }
.demo-footer { color: var(--muted); font-size: 0.78rem; margin: 0 var(--gutter); padding: 0.9rem 0 2.5rem; border-top: 1px solid var(--grid); }

main { padding: 0 var(--gutter) 2.5rem; max-width: 1640px; }

section + section { margin-top: 3rem; }
.section-head { font-family: var(--font-display); font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: var(--head-weight); letter-spacing: -0.012em; line-height: 1.15; text-transform: var(--head-transform); text-wrap: balance; padding-top: 0.7rem; margin-bottom: 1rem; border-top: 2px solid var(--ink); }
section:first-child .section-head { border-top: 0; padding-top: 1.5rem; }
.section-head.sub { font-size: 1.1rem; }
.lead-note { color: var(--ink-2); max-width: 70ch; margin: -0.4rem 0 1.2rem; }

/* key figures: one strip, divided by hairlines. The first can lead. */
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); row-gap: 1.1rem; overflow: hidden; margin-bottom: 1.8rem; }
.tile { position: relative; min-width: 0; padding: 0 1rem 0 1.1rem; margin-left: -1px; border-left: 1px solid var(--grid); }
.tile-row > .tile:first-child { padding-left: 0; border-left: 0; margin-left: 0; }
.tile-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); line-height: 1.25; text-align: left; }
button.tile-label { background: none; border: 0; cursor: help; position: relative; text-decoration: underline dotted var(--baseline); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button.tile-label:hover, button.tile-label:focus-visible { color: var(--ink); text-decoration-color: var(--ink); outline: none; }
button.panel-help { display: inline; font: inherit; color: inherit; padding: 0; }
button.tile-label::after { content: ""; position: absolute; inset: -0.5rem; } /* a bigger target for fingers */
.tile-value { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.15; margin-top: 0.3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value small { font-size: 0.6em; font-weight: 500; letter-spacing: 0; }
.tile-value .sep { color: var(--baseline); font-weight: 400; margin: 0 0.12em; }
.lead-first > .tile:first-child .tile-value { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1; margin-top: 0.2rem; }
@media (min-width: 1100px) {
  #kpi-tiles { grid-template-columns: auto auto repeat(5, minmax(0, 1fr)); }
  #kpi-tiles > .tile:nth-child(-n+2) { padding-right: 1.6rem; }
  #kpi-tiles > .tile:nth-child(-n+2) .tile-value { font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1; margin-top: 0.2rem; }
  #kpi-tiles > .tile:nth-child(n+3) .tile-value { font-size: 1.3rem; margin-top: 0.4rem; }
}
.tile-delta { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.delta-up { color: var(--up); font-weight: 600; }
.delta-down { color: var(--down); font-weight: 600; }
.delta-flat { color: var(--ink-2); font-weight: 600; }
.tile-source { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.tile-source::before { content: ""; width: 0.45rem; height: 0.45rem; background: currentColor; flex: none; }
.tile > .tile-source { margin-top: 0.3rem; }
.tile-source-real { color: var(--ok-ink); }
.tl-bar { display: flex; gap: 2px; height: 6px; margin-top: 0.45rem; max-width: 11rem; }
.tl-bar span { min-width: 2px; }
.tl-bar .ok { background: var(--ok); } .tl-bar .warn { background: var(--warn); } .tl-bar .bad { background: var(--bad); }
.tl-ok { color: var(--ok-ink); } .tl-warn { color: var(--warn-ink); } .tl-bad { color: var(--bad-ink); }

/* charts sit on the page. Two across by default, four when they are small multiples. */
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem clamp(1.5rem, 3vw, 3rem); }
.panel-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .panel-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel { min-width: 0; }
.panel-wide { grid-column: 1 / -1; }
.panel-title { font-weight: 650; font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.45rem; }
.panel-note { display: block; color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 0.3rem 1rem; margin: 0 0 0.4rem; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--ink-2); }
.legend-swatch { width: 0.65rem; height: 0.65rem; flex: none; }

.tooltip { position: fixed; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 0.78rem; line-height: 1.45; padding: 0.45rem 0.65rem; border-radius: var(--r); opacity: 0; transition: opacity 80ms; z-index: 30; max-width: 300px; }
.tooltip.visible { opacity: 1; }
.tooltip .tt-title { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .tooltip { transition: none; } }

/* tables */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.matrix th, .matrix td { padding: 0.42rem 0.7rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--grid); }
.matrix thead th { font-weight: 600; font-size: 0.78rem; line-height: 1.25; color: var(--ink-2); vertical-align: bottom; border-bottom: 1px solid var(--ink); }
.matrix th:first-child { padding-left: 0; }
.matrix tbody th, .matrix thead th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); font-weight: 500; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: none; }
.matrix .row-group th { padding-top: 1.1rem; color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--baseline); }
.matrix .row-group td { border-bottom: 1px solid var(--baseline); }
.matrix td.current { color: var(--muted); font-style: italic; }
.matrix-legend { color: var(--ink-2); font-size: 0.8rem; max-width: 90ch; margin: 0.6rem 0; }
section > .matrix-legend:first-of-type:not(:last-child) { margin-top: -0.3rem; }
.scroll-hint { color: var(--muted); font-size: 0.76rem; margin: 0 0 0.3rem; }

/* ugeplan: a timetable. Days across, parts of the day down, one line per class. */
.sched-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin-bottom: 0.9rem; }
.sched-head .section-head { margin-bottom: 0; }
.cal-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; margin-bottom: 1.4rem; }
.cal-meta:not(:has(> :not([hidden]))) { display: none; }
.picker-field { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.8rem; color: var(--muted); }

.weeks-picker { display: inline-flex; flex-wrap: wrap; padding: 0 1px 1px 0; }
.weeks-picker[hidden], .picker-field[hidden] { display: none; }
.weeks-btn { border: 1px solid var(--baseline); margin: 0 -1px -1px 0; background: var(--surface); font-size: 0.8rem; font-weight: 500; color: var(--ink-2); padding: 0.28rem 0.7rem; cursor: pointer; }
.weeks-btn:hover { color: var(--ink); background: var(--track); }
.weeks-btn.active { position: relative; background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.weeks-btn:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: 1px; }

.weeks-picker.plain { padding: 0; gap: 0.1rem 1rem; }
.plain .weeks-btn { border: 0; margin: 0; background: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.plain .weeks-btn:hover { background: none; border-bottom-color: var(--baseline); }
.plain .weeks-btn.active { background: none; color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }

.sched-key { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 1.5rem; margin-bottom: 0.7rem; }
.week-sub { color: var(--ink-2); font-size: 0.85rem; }
.badge-legend { display: flex; align-items: center; gap: 0.3rem 0.9rem; flex-wrap: wrap; }
.badge-legend:empty { display: none; }
.badge-legend .legend-swatch { outline: 1px solid var(--ring); outline-offset: -1px; width: 1.1rem; }
.legend-note { color: var(--muted); font-size: 0.78rem; }
.schedule-note { color: var(--ink-2); font-size: 0.85rem; max-width: 90ch; margin-bottom: 0.7rem; }
.schedule-note[hidden], .campaign-note[hidden], .chart-note[hidden] { display: none; }
.campaign-note { color: var(--ink-2); font-size: 0.88rem; margin: -0.8rem 0 1.6rem; }
.chart-note { color: var(--muted); font-size: 0.78rem; margin: 0.2rem 0 0.4rem; }

.cal { display: grid; grid-template-columns: 5.2rem repeat(7, minmax(9.75rem, 1fr)); min-width: 73.45rem; }
.cal-head-wrap { position: sticky; top: calc(var(--masthead-h, 0px) + var(--banner-h, 0px)); z-index: 15; overflow: hidden; background: var(--surface); border-bottom: 2px solid var(--ink); }
.cal-wrap { overflow-x: auto; border-bottom: 1px solid var(--baseline); }
.cal-corner { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.cal-dayhead { font-family: var(--font-display); font-size: 0.92rem; font-weight: 650; padding: 0.4rem 0.4rem 0.35rem calc(0.4rem + 3px); }

.cal-band { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 0.45rem 0.5rem 0.6rem 0; font-size: 0.8rem; font-weight: 650; line-height: 1.2; border-top: 1px solid var(--baseline); }
.cal-band small { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); margin-top: 0.1rem; }
.cal-band:first-child { border-top: 0; }
.cal-day { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0.3rem 0 0.6rem; border-left: 1px solid var(--grid); border-top: 1px solid var(--baseline); }
.cal-day.first-band { border-top: 0; }

/* One class: the whole row takes its status, so the worst classes are the loudest, and a thin bar
   along the bottom shows how full it is. Number, colour and length say the same thing, so it
   still reads without colour. */
.cal-card, .slot-row { --tint: var(--track); --solid: transparent; --fill: 0%; display: grid; grid-template-columns: 3.05em minmax(0, 1fr) auto; column-gap: 0.1rem; align-items: baseline; padding: 0.24rem 0.4rem 0.36rem; font-size: 0.8rem; line-height: 1.22; background-color: var(--tint); background-image: linear-gradient(to right, var(--solid) var(--fill), transparent var(--fill)); background-size: 100% 3px; background-position: left bottom; background-repeat: no-repeat; }
.cal-card { margin-left: 2px; cursor: default; }
.cal-card:hover { outline: 1px solid var(--ink); outline-offset: -1px; }
.card-time { color: var(--ink-2); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.card-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.card-pct { grid-column: 3; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: 0.3rem; }
.card-line { grid-column: 2 / -1; color: var(--ink-2); font-size: 0.9em; min-width: 0; overflow-wrap: anywhere; }
.card-loc { color: var(--ink-2); }
.card-line.tight { font-size: 0.8em; }
.status-ok { --tint: var(--tint-ok); --solid: var(--ok); } .status-ok .card-pct { color: var(--ok-ink); }
.status-warn { --tint: var(--tint-warn); --solid: var(--warn); } .status-warn .card-pct { color: var(--warn-ink); }
.status-bad { --tint: var(--tint-bad); --solid: var(--bad); } .status-bad .card-pct { background: var(--bad); color: #fff; padding: 0 0.28rem; border-radius: var(--r); }
.status-none .card-pct { color: var(--muted); font-weight: 500; font-size: 0.9em; }
/* Program: names, as the centre publishes them, and no colour of any kind. */
.cal-card.status-program { --st: var(--muted); background: none; border-bottom: 1px solid var(--grid); padding-bottom: 0.32rem; }
.cal-card.status-program .card-loc { color: var(--muted); }
/* Narrow columns: a long word gets its own line, so it doesn't break mid-word. */
@media (min-width: 761px) and (max-width: 1439px) {
  .cal-card.long-name .card-name { grid-column: 1 / -1; grid-row: 2; }
  .cal-card.long-name .card-pct { grid-row: 1; }
  .cal-card.long-name .card-line { grid-column: 1 / -1; }
}

.list-grid { margin-top: 2.25rem; }
.slot-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.slot-row { grid-template-columns: 6.6em minmax(0, 1fr) auto; font-size: 0.85rem; padding: 0.34rem 0.5rem; }
.slot-room { color: var(--ink-2); font-weight: 400; }

.day-picker { display: none; }

/* membership distribution */
.dist { display: grid; gap: 0.4rem; padding-bottom: 0.4rem; }
.dist-row { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.8rem; }
.dist-name { font-weight: 600; line-height: 1.2; }
.dist-name small { display: block; color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.dist-track { display: flex; gap: 2px; min-width: 0; }
.dist-bar { display: block; height: 12px; min-width: 2px; }
.dist-bar:last-child { border-radius: 0 3px 3px 0; }
.dist-value { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dist-flat { color: var(--muted); }
.dist-key { display: inline-block; width: 7px; height: 7px; margin: 0 0.2rem 0 0.25rem; }

/* PT follow-up */
.pt-fiction { color: var(--muted); font-size: 0.82rem; margin: -0.9rem 0 1.3rem; }
.pt-sub { color: var(--muted); font-size: 0.85rem; margin: -0.3rem 0 0.7rem; max-width: 70ch; }
.pt-foot { margin: 0.8rem 0 0; font-size: 0.8rem; }
.pt-meta { margin: 0 0 1.3rem; }
.pt-meta:empty { display: none; }
.pt-block { font-size: 0.98rem; font-weight: 650; margin: 2rem 0 0.5rem; }
@media (min-width: 761px) {
  .pt-table th:nth-child(1) { width: 23%; }
  .pt-table th:nth-child(2) { width: 25%; }
  #udloeb-matrix { table-layout: fixed; }
  #udloeb-matrix th:first-child { width: 22%; }
}
.pt-table td.pt-left, .pt-table th.pt-left { text-align: left; }
.pt-table td { vertical-align: baseline; }
.pt-table td.pt-card { white-space: normal; }
.pt-table th.pt-sortable { cursor: pointer; user-select: none; }
.pt-table th.pt-sortable:hover, .pt-table th.pt-sorted { color: var(--ink); }
.pt-table th.pt-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pt-member { color: inherit; text-decoration: none; }
.pt-member:hover, .pt-member:focus-visible { text-decoration: underline; }
.pt-no { color: var(--muted); font-size: 0.85em; margin-left: 0.5em; font-weight: 400; }
.pt-of { color: var(--muted); font-size: 0.85em; }
.pt-empty { color: var(--muted); }
.pt-expiring { color: var(--ink-2); white-space: nowrap; }
.pt-flag { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; line-height: 1.3; padding: 0 0.3rem; border-radius: var(--r); background: var(--tint-warn); color: var(--warn-ink); }
.pt-table tbody td:first-child { font-weight: 600; position: sticky; left: 0; background: var(--surface); padding-left: 0; }
.pt-table thead th:first-child { text-align: left; }

/* members: the status counts are the filter, then one plain register */
.mem-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--baseline); margin-bottom: 0.7rem; }
.mem-filter-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left; background: none; border: 0; border-left: 1px solid var(--grid); border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 0.15rem 1rem 0.6rem 1.1rem; cursor: pointer; color: var(--ink-2); }
.mem-filter-btn:first-child { border-left: 0; padding-left: 0; }
.mem-filter-btn:hover { border-bottom-color: var(--baseline); }
.mem-filter-btn.active { color: var(--ink); border-bottom-color: var(--ink); } /* not the brand colour: on some brands it's the red of a status */
.mem-filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mem-filter-label { display: inline-flex; align-items: flex-start; gap: 0.45rem; font-size: 0.8rem; font-weight: 500; }
.mem-filter-btn.active .mem-filter-label { font-weight: 650; }
.mem-filter-n { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.mem-tools { margin: 1.4rem 0 0.8rem; align-items: flex-end; }
.mem-tools-left { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; }
.mem-search { font: inherit; font-size: 0.85rem; color: var(--ink); background: var(--surface); border: 0; border-bottom: 1px solid var(--baseline); border-radius: 0; padding: 0.3rem 0; width: min(18rem, 100%); }
.mem-search:focus { outline: none; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }
.mem-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; }
.mem-filter-label .mem-dot { margin-top: 0.32em; }
.mem-dot-ok { background: var(--ok); } .mem-dot-warn { background: var(--warn); } .mem-dot-bad { background: var(--bad); }
.mem-table td.mem-left, .mem-table th.mem-left, .mem-visits .mem-left { text-align: left; }
.mem-table td { vertical-align: middle; }
.mem-table tbody tr { cursor: pointer; }
.mem-table tbody tr:hover td { background: var(--track); }
.mem-table th.pt-sortable { cursor: pointer; user-select: none; }
.mem-table th.pt-sortable:hover, .mem-table th.pt-sorted { color: var(--ink); }
.mem-table th.pt-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mem-table thead th:first-child { padding-left: 1.05rem; }
.mem-who { font-weight: 600; }
.mem-who .mem-dot { margin-right: 0.45rem; vertical-align: 0.05em; }
.mem-who a { color: var(--ink); text-decoration: none; }
.mem-who a:hover, .mem-who a:focus-visible { text-decoration: underline; }
.mem-new { font-size: 0.72rem; font-weight: 650; color: var(--ink); margin-left: 0.25rem; }
.mem-weeks-col { width: 1%; }
.mem-spark { display: block; margin-left: auto; }
.mem-spark .sp-on { fill: var(--ink); } .mem-spark .sp-now { fill: var(--baseline); } .mem-spark .sp-off { fill: var(--grid); }
.mem-more { display: flex; align-items: baseline; gap: 1rem; margin-top: 0.8rem; color: var(--muted); font-size: 0.8rem; }
.mem-more-btn { background: none; border: 1px solid var(--baseline); padding: 0.35rem 0.9rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.mem-more-btn:hover { border-color: var(--ink); }

/* one member */
.mem-back { display: inline-block; margin-top: 1.2rem; color: var(--ink-2); font-size: 0.85rem; text-decoration: none; }
.mem-back:hover { color: var(--ink); text-decoration: underline; }
.mem-profile .mem-name { padding-top: 0.5rem; }
.mem-no { color: var(--muted); font-weight: 400; font-size: 0.6em; letter-spacing: 0; margin-left: 0.35rem; }
.mem-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.4rem; font-size: 0.95rem; color: var(--ink-2); margin: -0.4rem 0 1.5rem; max-width: 80ch; }
.mem-status .mem-dot { align-self: center; margin-right: 0.1rem; }
.mem-status strong { color: var(--ink); }
.mem-facts { grid-template-columns: repeat(auto-fill, minmax(10rem, 15rem)); }
.mem-facts .tile-value { font-size: clamp(1.05rem, 1.5vw, 1.3rem); white-space: normal; }
.mem-habit { color: var(--ink-2); font-size: 0.9rem; margin: -0.3rem 0 0.8rem; }
.mem-card { color: var(--ink-2); font-size: 0.9rem; line-height: 1.6; margin: -0.4rem 0 0.8rem; }
.mem-visits { width: auto; min-width: min(100%, 520px); }

/* training calendar: weeks across, weekdays down, one square a day (the same form as the PT customer page) */
.hm { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 0.4rem; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.8rem; color: var(--ink-2); }
.hm-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hm-swatch { width: 13px; height: 13px; flex: none; }
.hm-year[hidden] { display: none; }
.hm-year-head { font-size: 0.85rem; margin-bottom: 0.25rem; }
.hm-year-head span { color: var(--muted); margin-left: 0.4rem; }
.hm-scroll { overflow-x: auto; }
.hm-svg { display: block; width: 100%; max-width: 980px; min-width: 760px; height: auto; }
.hm-label { font-size: 10px; fill: var(--muted); }
.hm-hit { fill: transparent; }
.hm-none { fill: var(--grid); }
.hm-pt { fill: var(--s1); }
.hm-other { fill: var(--s2); }
.hm-other-fill { fill: var(--s2); pointer-events: none; }
.hm-day:hover .hm-cell { stroke: var(--ink); stroke-width: 1.2; }
.hm-active { cursor: pointer; }
.hm-day:focus { outline: none; }
.hm-day:focus-visible .hm-cell { stroke: var(--ink); stroke-width: 1.5; }
.hm-key { display: inline-block; width: 0.8rem; height: 2px; margin-right: 0.4rem; vertical-align: middle; }
.hm-key-pt { background: var(--s1); }
.hm-key-other { background: var(--s2); }
.matrix thead th small { font-size: 0.92em; font-weight: 400; color: var(--muted); }
.nav-short { display: none; }
.mem-visits td:first-child { padding-left: 0; }

/* centre comparison */
.centre-swatch { display: inline-block; margin-right: 0.45rem; vertical-align: -1px; }
.row-total th, .row-total td { font-weight: 700; border-top: 1px solid var(--ink); }
.matrix tbody .row-total th { font-weight: 700; }
.matrix thead .tile-source { display: flex; justify-content: flex-end; margin-top: 0.15rem; }

@media (max-width: 760px) {
  .banner-full { display: none; }
  .banner-short { display: inline; }
  .demo-banner { font-size: 0.78rem; }

  /* logo and date on one line, tabs under them, and it all scrolls away so the banner has the top */
  .masthead { position: static; flex-wrap: wrap; row-gap: 0; }
  .masthead-left { display: contents; }
  .brand { order: 1; padding: 0.55rem 0 0.35rem; }
  .brand-logo { height: min(var(--logo-height), 2rem); }
  .masthead-meta { order: 2; }
  .masthead-sub { font-size: 0.72rem; }
  .masthead-nav { order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 calc(var(--gutter) - 0.6rem); overflow-x: auto; gap: 0; width: calc(100% + var(--gutter) * 2); }
  .masthead-nav a { padding: 0.5rem 0.6rem 0.45rem; }

  section + section { margin-top: 2.25rem; }
  /* the timetable comes first on a phone, with its figures after it */
  #schedule { display: flex; flex-direction: column; }
  #schedule > #kpi-tiles { order: 1; margin: 1.6rem 0 0; }
  #schedule > #traffic-panels { order: 2; }
  .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 0 0.6rem 0 0.8rem; }
  .tile-row > .tile:nth-child(odd) { padding-left: 0; border-left: 0; margin-left: 0; }
  .lead-first > .tile:first-child { grid-column: 1 / -1; }
  .lead-first > .tile:nth-child(even) { padding-left: 0; border-left: 0; margin-left: 0; }
  .lead-first > .tile:nth-child(odd):not(:first-child) { padding: 0 0.6rem 0 0.8rem; margin-left: -1px; border-left: 1px solid var(--grid); }
  .lead-first > .tile:last-child:nth-child(even) { grid-column: 1 / -1; }

  .cal-meta { align-items: flex-start; flex-direction: column; }
  .weeks-btn { padding: 0.45rem 0.7rem; }
  .plain .weeks-btn { padding: 0.4rem 0; }
  .sched-key { margin-bottom: 0.5rem; }

  /* one day at a time: seven columns can't be read on a phone */
  .day-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 0.25rem; border-bottom: 2px solid var(--ink); }
  .day-btn { min-height: 2.75rem; border: 0; background: none; font-size: 0.85rem; font-weight: 500; color: var(--ink-2); cursor: pointer; margin-bottom: -2px; border-bottom: 3px solid transparent; }
  .day-btn.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
  .day-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .cal-head-wrap { display: none; }
  .cal { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .cal-wrap { overflow: visible; border-bottom: 0; }
  .cal-day:not(.is-selected) { display: none; }
  .cal-day { border: 0; padding: 0 0 0.35rem; }
  .cal-band { position: static; display: flex; align-items: baseline; gap: 0.5rem; padding: 0.7rem 0 0.3rem; border-top: 0; }
  .cal-band small { margin: 0; }
  .cal-card { margin-left: 0; font-size: 0.92rem; padding: 0.42rem 0.5rem; grid-template-columns: 3.1em minmax(0, 1fr) auto; }
  .cal-empty { color: var(--muted); padding: 1rem 0; }

  .slot-row { grid-template-columns: 5.6em minmax(0, 1fr) auto; }
  .panel-grid, .panel-grid.four { grid-template-columns: minmax(0, 1fr); }
  .list-grid { margin-top: 1.8rem; }

  .pt-table th, .pt-table td { padding-left: 0.45rem; padding-right: 0.45rem; }
  .pt-table thead th { white-space: normal; line-height: 1.2; }
  .pt-no { display: block; margin-left: 0; }
  .pt-table tbody td:first-child { white-space: normal; }

  .mem-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.4rem; }
  .mem-filter-btn:nth-child(odd) { border-left: 0; padding-left: 0; }
  .nav-full { display: none; } .nav-short { display: inline; }
  .mem-tools { align-items: stretch; }
  .mem-tools-left { flex-direction: column; gap: 0.2rem; width: 100%; min-width: 0; }
  /* filters are one row each that swipes, so no option sits alone on a line */
  .mem-tools .weeks-picker.plain { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .mem-search { width: 100%; }
  .mem-table th, .mem-table td { padding-left: 0.4rem; padding-right: 0.4rem; }
  .mem-table .pt-no { display: block; margin-left: 1.05rem; }
  .mem-table td.mem-who { white-space: normal; padding-left: 1.05rem; text-indent: -1.05rem; }
  .mem-table td.mem-who .pt-no { text-indent: 0; margin-left: 0; }
  .mem-status { font-size: 0.9rem; }
}
