/* Layout: sticky top bar with two tabs; a date rail beside each day's events; a side drawer for
   one event. Radius rule: containers 12px, buttons and fields 8px, chips and badges fully round.
   Colour comes from the banner photo: its sky blue for structure (links, times, tier B, focus)
   and its complement, the roofs' terracotta orange, only for what must not be missed (tier A,
   primary actions), on navy ink. Green means open, amber warns, red fails. The page is light
   whatever the OS says; dark is only what the top-bar toggle sets (data-theme="dark"). */
/* Fonts are served from this site, not Google Fonts (ADR 0004): variable files, latin and
   latin-ext only; other scripts fall back to the system font. vendor/README.md lists them. */
@font-face {
  font-family: "Geist";
  font-weight: 400 700;
  font-display: swap;
  src: url("vendor/fonts/geist-v5-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-weight: 400 700;
  font-display: swap;
  src: url("vendor/fonts/geist-v5-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 400 500;
  font-display: swap;
  src: url("vendor/fonts/geist-mono-v6-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 400 500;
  font-display: swap;
  src: url("vendor/fonts/geist-mono-v6-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 500 700;
  font-display: swap;
  src: url("vendor/fonts/space-grotesk-v22-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 500 700;
  font-display: swap;
  src: url("vendor/fonts/space-grotesk-v22-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f4f7fc;
  --wash: linear-gradient(140deg, #e3eefc 0%, #f6f9fd 48%, #fdf1e6 100%);
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --fg: #14264f;
  --muted: #566179;
  --line: #dde4ef;
  --accent: #1d5fbf;
  --accent-soft: #e2ecfa;
  --warm: #b5400c;
  --warm-soft: #fdeadd;
  --on-accent: #ffffff;
  --ok: #0b7a5e;
  --ok-soft: #dff4ec;
  --warn: #8a5a00;
  --warn-soft: #fff1c6;
  --bad: #b4232f;
  --bad-soft: #fce7e9;
  --hot: linear-gradient(110deg, #b33a12, #c84b0e);
  --hot-text: var(--hot);
  --brand-text: linear-gradient(100deg, #1d5fbf, #c84b0e);
  --neutral-soft: rgb(20 38 79 / 0.07);
  --strip: linear-gradient(90deg, #1d5fbf, #4a98e6 35%, #f6a23c 65%, #d9541e);
  --drawer-wash: linear-gradient(135deg, #e3eefc, #f6f9fd 55%, #fdf1e6);
  --card-shadow: 0 1px 2px rgb(20 38 79 / 0.05), 0 8px 24px rgb(29 95 191 / 0.06);
  --glow: 0 4px 14px rgb(200 75 14 / 0.3);
  --shadow: 0 12px 40px rgb(20 38 79 / 0.2);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 8px;
  --radius-card: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1830;
  --wash: radial-gradient(60% 50% at 8% 12%, rgb(29 95 191 / 0.3), transparent 70%),
          radial-gradient(45% 40% at 95% 6%, rgb(74 152 230 / 0.16), transparent 70%),
          radial-gradient(55% 50% at 88% 100%, rgb(217 84 30 / 0.16), transparent 70%);
  --surface: #14223f;
  --surface-2: #1c2c4f;
  --fg: #e8eef9;
  --muted: #9fb0cc;
  --line: #263a60;
  --accent: #7db3ff;
  --accent-soft: #1b335c;
  --warm: #ffa66b;
  --warm-soft: #3d2a26;
  --on-accent: #ffffff;
  --ok: #5fd9b0;
  --ok-soft: #123a38;
  --warn: #ffd36b;
  --warn-soft: #3a3322;
  --bad: #ff8f9a;
  --bad-soft: #40222f;
  --hot-text: linear-gradient(110deg, #ffb27a, #ff8a4c);
  --brand-text: linear-gradient(100deg, #7db3ff, #ffa66b);
  --neutral-soft: rgb(232 238 249 / 0.08);
  --drawer-wash: linear-gradient(135deg, rgb(29 95 191 / 0.28), rgb(20 34 63 / 0) 55%, rgb(217 84 30 / 0.14));
  --card-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  --glow: 0 4px 16px rgb(217 84 30 / 0.35);
  --shadow: 0 12px 40px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--sans);
}
/* A fixed layer, not background-attachment: fixed, which mobile Safari ignores. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--wash);
  pointer-events: none;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--strip) top / 100% 3px no-repeat, color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 16px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.brand b {
  font-weight: inherit;
  background: var(--brand-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand span { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs a {
  display: flex;
  align-items: center;
  padding-inline: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-selected="true"] { color: var(--fg); }
.tabs a[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 12px -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--hot);
}
.run {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
}
.run-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.run[data-state="ok"] .run-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.run[data-state="failed"] .run-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.btn.theme { gap: 6px; padding-inline: 10px 12px; background: var(--neutral-soft); border-color: transparent; }
.btn.theme:hover { background: var(--accent-soft); border-color: transparent; }
.btn.theme svg { width: 18px; height: 18px; color: var(--accent); }
.theme .sun, .theme .to-light, [data-theme="dark"] .theme .moon, [data-theme="dark"] .theme .to-dark { display: none; }
[data-theme="dark"] .theme .sun { display: block; }
[data-theme="dark"] .theme .to-light { display: inline; }
.btn.account { gap: 8px; max-width: 220px; }
.btn.account:has(.avatar) { padding-left: 5px; }
.account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hot);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* Banner: a photo of the city under a navy scrim, closed by the palette strip. */
.hero {
  position: relative;
  isolation: isolate;
  height: clamp(240px, 32vw, 440px);
  overflow: hidden;
  background: #14264f;
  color: #fff;
}
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--strip) bottom / 100% 4px no-repeat,
    linear-gradient(90deg, rgb(13 27 58 / 0.84), rgb(13 27 58 / 0.48) 40%, rgb(13 27 58 / 0) 72%),
    linear-gradient(0deg, rgb(13 27 58 / 0.5), transparent 50%);
}
.hero-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 14px rgb(0 0 0 / 0.3);
}
.hero-sub { margin: 0; font-size: 1.02rem; color: rgb(255 255 255 / 0.92); max-width: 52ch; }
.hero-sub b { font-weight: 600; color: #fff; }
.hero-credit {
  position: absolute;
  right: 12px;
  bottom: 10px;
  margin: 0;
  font-size: 0.7rem;
  color: rgb(255 255 255 / 0.8);
}
.hero-credit a { color: inherit; }

/* Page and toolbar */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 20px 64px;
}
.banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.field { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}
.field.grow { flex: 1 1 220px; }
input[type="search"], select {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  height: 38px;
  width: 100%;
  max-width: 100%;
}
select { width: auto; min-width: 160px; }
input[type="search"]:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle, .btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.toggle:hover, .btn:hover { border-color: var(--muted); }
.toggle:active, .btn:active { transform: translateY(1px); }
.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.toggle[data-tier="A"][aria-pressed="true"] { background: var(--warm-soft); border-color: var(--warm); }
.toggle[data-tier="C"][aria-pressed="true"] { background: var(--surface-2); border-color: var(--muted); }
.toggle .n { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.btn.primary { background: var(--hot); border-color: transparent; color: var(--on-accent); font-weight: 600; box-shadow: var(--glow); }
.btn.primary:hover { border-color: transparent; filter: brightness(1.06) saturate(1.1); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.count { color: var(--muted); font-size: 0.85rem; margin: 14px 0 6px; }

/* Chips and tier badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--muted);
  white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.tier-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--neutral-soft);
  color: var(--muted);
  flex: none;
}
.tier-badge.A { background: var(--hot); color: var(--on-accent); box-shadow: var(--glow); }
.tier-badge.B { background: var(--accent-soft); color: var(--accent); }
.tier-badge.none { background: transparent; border: 1px dashed var(--line); }

/* Timeline */
.timeline { display: grid; gap: 28px; }
.month h2 {
  font-size: 1.15rem;
  margin: 0 0 8px;
  position: sticky;
  top: var(--bar-h, 61px);
  z-index: 5;
  font-family: var(--display);
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding-block: 8px;
}
.month h2::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--hot);
}
.days, .orgs {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.day {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.day:first-child { border-top: 0; }
.day-rail {
  padding: 12px 0 12px 14px;
  display: grid;
  align-content: start;
  gap: 0;
  font-variant-numeric: tabular-nums;
}
.day-rail .dow { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.day-rail .dom { font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.day.today { background: linear-gradient(90deg, var(--accent-soft), transparent 220px); }
.day.today .day-rail .dom {
  background: var(--hot-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.day.today .day-rail .dom::after { content: "Today"; display: block; font-size: 0.72rem; font-weight: 600; margin-top: 2px; }
.day-events { list-style: none; margin: 0; padding: 4px 0; min-width: 0; }
.event {
  width: 100%;
  display: grid;
  grid-template-columns: 76px 26px minmax(0, 1fr) auto 48px;
  gap: 4px 12px;
  align-items: start;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 14px 9px 0;
  cursor: pointer;
}
.event:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.event .time {
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event.dropped .time { color: var(--muted); background: var(--neutral-soft); }
.event .main { display: grid; gap: 2px; min-width: 0; }
.event .title { font-weight: 600; overflow-wrap: anywhere; }
.event.tier-C .title, .event.dropped .title { font-weight: 500; color: var(--muted); }
.event .meta { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.event .tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* The event's own cover image; without one, a palette tile with the organiser's initial. */
.cover {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--hot);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
  box-shadow: inset 0 0 0 1px rgb(20 38 79 / 0.08);
  align-self: center;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.cover.t1 { background: linear-gradient(135deg, #1d5fbf, #4a98e6); }
.cover.t2 { background: linear-gradient(135deg, #14264f, #1d5fbf); }
.cover.t3 { background: linear-gradient(135deg, #d9541e, #f6a23c); }
.cover.t4 { background: linear-gradient(135deg, #2f6fd0, #14264f 120%); }
.event.tier-C .cover, .event.dropped .cover { filter: saturate(0.3); opacity: 0.7; }
.drawer-cover {
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  background: var(--surface-2);
}
/* No overflow: hidden on the figure: in the scrolling grid it would let the row shrink to 0. */
.drawer-cover img { display: block; max-width: 100%; max-height: 300px; border-radius: var(--radius-card); }
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.skeleton { display: grid; gap: 10px; }
.skeleton div {
  height: 52px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Organisations */
.org { border-top: 1px solid var(--line); }
.org:first-child { border-top: 0; }
.org > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 20px;
  padding: 14px 16px;
  align-items: center;
}
.org > summary::-webkit-details-marker { display: none; }
.org > summary:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.org[open] > summary { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.org-name { display: grid; gap: 2px; min-width: 0; }
.org-name strong { overflow-wrap: anywhere; }
.org-name .domain { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.org-tags, .org-counts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tier-count { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 0.85rem; }
.org-health { flex-basis: 100%; font-size: 0.85rem; color: var(--muted); }
.tier-count.zero { opacity: 0.4; }
.org-body { padding: 4px 16px 18px; display: grid; gap: 16px; }
.org-body h3 { font-size: 0.85rem; margin: 0 0 6px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { text-align: left; padding: 7px 10px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr + tr td { border-top: 1px solid var(--line); }
td.url { font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; min-width: 220px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.org-events { list-style: none; margin: 0; padding: 0; }
.org-events .event { grid-template-columns: 120px 26px minmax(0, 1fr) auto 48px; padding-left: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Adding an organisation */
.add-org { margin-left: auto; }
.login-options { display: grid; gap: 8px; }
.login-options .btn { justify-content: center; min-height: 44px; }
.intakes { margin-top: 16px; display: grid; gap: 8px; }
.intakes h2 { font-size: 0.85rem; color: var(--muted); margin: 0; }
.intake-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 10px 14px;
  cursor: pointer;
}
.intake-row:hover { border-color: var(--accent); }
.intake-row .main { display: grid; gap: 2px; min-width: 0; }
.intake-row .title { font-weight: 600; overflow-wrap: anywhere; }
.intake-row .meta { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.form { display: grid; gap: 14px; }
.form .field > span { font-size: 0.85rem; }
.form .hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
input[type="url"], input[type="text"] {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  min-height: 38px;
  width: 100%;
}
input[type="url"]:focus, input[type="text"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--bad); font-size: 0.88rem; margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 0;
  color: var(--muted);
}
.steps .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--mono);
}
.steps li.done { color: var(--fg); }
.steps li.done .mark { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.steps li.active { color: var(--fg); font-weight: 600; }
.steps li.active .mark { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.steps li.stopped .mark { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.steps li.failed .mark { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.85rem; }
.log li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; overflow-wrap: anywhere; }
.log time { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; padding-top: 1px; }
.log .ok { color: var(--ok); }
.log .warn { color: var(--warn); }
.log .error { color: var(--bad); }
.profile-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px 14px; display: grid; gap: 8px; }
.profile-card .chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgb(13 24 48 / 0.45); z-index: 20; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px 20px 14px;
  background: var(--drawer-wash);
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.35; overflow-wrap: anywhere; }
.drawer-head .tier-badge { margin-top: 3px; }
.drawer-head .tier-badge[hidden] + h2 { grid-column: 1 / span 2; }
.drawer-head > .btn { grid-column: 3; }
.drawer-body { overflow-y: auto; padding: 16px 20px 32px; display: grid; gap: 22px; align-content: start; }
.drawer-body section { display: grid; gap: 8px; }
.drawer-body h3 { margin: 0; font-size: 0.85rem; color: var(--muted); }
dl.facts { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 14px; }
dl.facts dt { color: var(--muted); font-size: 0.88rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.note { font-size: 0.85rem; color: var(--muted); margin: 0; }
.note.warn { color: var(--warn); }
.reasons { margin: 0; padding-left: 18px; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sources li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.sources a { font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; min-width: 0; }
.description { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.lede { margin: 0; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 0.88rem; }

/* Footer, and the Impressum and privacy pages */
.foot {
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.85rem;
  color: var(--muted);
}
.foot a { color: inherit; }
.foot a:hover { color: var(--fg); }
.foot a[aria-current="page"] { color: var(--fg); text-decoration: none; }
.bar .back { margin-left: auto; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.bar .back:hover { color: var(--fg); }
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  line-height: 1.6;
}
.legal h1 { margin: 0; font-family: var(--display); font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; }
.legal .gloss { margin: 4px 0 20px; color: var(--muted); }
.legal h2 { margin: 32px 0 8px; font-family: var(--display); font-size: 1.25rem; line-height: 1.3; }
.legal h3 { margin: 20px 0 6px; font-size: 1rem; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 4px; }
.legal address { font-style: normal; margin: 0 0 10px; }
.legal code { font-family: var(--mono); font-size: 0.85em; overflow-wrap: anywhere; }
.legal .updated { margin-top: 32px; font-size: 0.85rem; color: var(--muted); }
.legal .table-wrap { overflow-x: auto; margin: 0 0 10px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.legal td:first-child { min-width: 150px; }

@media (max-width: 720px) {
  .bar-inner { gap: 12px; flex-wrap: wrap; padding-block: 8px 0; }
  #theme-toggle { order: 1; margin-left: auto; }
  #account-button { order: 1; }
  .btn.account:has(.avatar) { padding-right: 5px; }
  .btn.account:has(.avatar) .account-name { display: none; }
  .run { order: 2; width: 100%; margin-top: -8px; }
  .tabs { order: 3; width: 100%; }
  .day { grid-template-columns: 52px minmax(0, 1fr); }
  .day-rail { padding-left: 10px; }
  .event { grid-template-columns: 26px minmax(0, 1fr) 44px; padding-right: 10px; }
  .event .time { grid-column: 2; grid-row: 1; }
  .event .tier-badge { grid-column: 1; grid-row: 1 / span 2; }
  .event .main { grid-column: 2; }
  .event .tags { grid-column: 2; justify-content: flex-start; }
  .event .cover { grid-column: 3; grid-row: 1 / span 3; align-self: start; width: 44px; height: 44px; }
  .org > summary { grid-template-columns: minmax(0, 1fr); }
  .org-events .event { grid-template-columns: 26px minmax(0, 1fr) 44px; }
  .hero-inner { padding-bottom: 34px; }
  .hero-sub { font-size: 0.95rem; }
  .hero-credit { right: 10px; bottom: 9px; }
  select { min-width: 0; width: 100%; }
  .toolbar .field { flex: 1 1 100%; }
  .toggle { white-space: normal; text-align: left; }
  .add-org { margin-left: 0; width: 100%; justify-content: center; }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dd { margin-bottom: 6px; }
  .bar .back { display: none; }
  .legal { padding: 22px 18px 24px; }
  .legal h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
