/* Show App styles. One hand-written stylesheet, no build step.
   Tokens first, then base elements, then components (header, buttons,
   filters, tabs, cards, tables, chips, forms). Dark mode swaps the tokens. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --fg: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-fg: #ffffff;
  --accent-soft: #eef2ff;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --ring: 0 0 0 3px rgba(67, 56, 202, 0.25);
  --radius: 10px;
  /* Older names still used in page-specific styles. */
  --card: var(--surface);
  --chip: var(--surface-2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #1c2536;
    --fg: #e5e7eb;
    --muted: #94a3b8;
    --line: #263145;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-fg: #0b1120;
    --accent-soft: #1e1b4b;
    --ok: #34d399;
    --ok-soft: #062e24;
    --warn: #fbbf24;
    --warn-soft: #3a2a09;
    --danger: #f87171;
    --danger-soft: #3b1010;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ring: 0 0 0 3px rgba(129, 140, 248, 0.35);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; margin: 8px 0 6px; }
/* Section page titles (SHOWS, ROSTER, REPERTOIRE…): caps, in the logo's purple.
   Record names (a show, song, person) keep the plain h1. */
.page-title { text-transform: uppercase; color: var(--accent); letter-spacing: 0.04em; }
/* A title with actions pushed to the right edge on the same line. */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 16px; font-weight: 650; margin: 24px 0 10px; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
p.hint { color: var(--muted); margin: 4px 0 16px; max-width: 80ch; }
.muted { color: var(--muted); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 16px; }
form.inline { display: inline; }
details > summary { cursor: pointer; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
details[open] > summary.btn { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); margin-bottom: 8px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ── Header ───────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-right: 8px; color: var(--fg); text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg); font-size: 13px; font-weight: 800;
}
header nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
header nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none;
  font-weight: 550; white-space: nowrap;
}
header nav a:hover { background: var(--surface-2); color: var(--fg); }
header nav a.on { background: var(--accent-soft); color: var(--accent); }
header nav a .count {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: 12px; text-align: center;
}
header .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status.busy::before { background: var(--warn); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.3; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 550; font-size: 14px; line-height: 1.2;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
button:hover, .btn:hover { background: var(--surface-2); color: var(--fg); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary, .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.primary:hover, .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn-ghost, button.link { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover, button.link:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.btn-sm, button.link { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
/* A remove "×" inside a chip stays tiny. */
.chip button.link { padding: 0 2px 0 4px; font-size: 13px; line-height: 1; border-radius: 4px; }
.back { margin: 0 0 4px; }

/* ── Pill filters and tabs ────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 14px; }
.filters > a, .filters > .pill {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); text-decoration: none; font-size: 13px; font-weight: 550;
}
.filters > a:hover { background: var(--surface-2); }
.filters > a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filters .spacer { flex: 1; }

.rtabs { display: inline-flex; gap: 2px; padding: 3px; margin: 6px 0 14px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.rtabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; }
.rtabs a:hover { color: var(--fg); }
.rtabs a.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px;
}
.card > h2:first-child { margin-top: 0; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸'; color: var(--muted); margin-right: 8px; display: inline-block; transition: transform 0.15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
/* A summary that reads differently while open ("✎ Edit" / "Done"). */
details > summary .when-open, details[open] > summary .when-closed { display: none; }
details[open] > summary .when-open { display: inline; }

/* ── Tables ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child > td { border-bottom: none; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
tbody tr:hover > td, table > tr:hover > td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.card table { box-shadow: none; }
td a:not(.btn):not(.chip) { text-decoration: none; font-weight: 550; }
td a:not(.btn):not(.chip):hover { text-decoration: underline; }

/* ── Chips ────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; margin: 1px 3px 1px 0;
  border-radius: 999px; background: var(--surface-2); color: var(--fg); font-size: 12.5px; font-weight: 500;
  line-height: 1.5; white-space: nowrap;
}
a.chip { text-decoration: none; }
a.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); font-weight: 650; }
.chip.admin { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--surface-2); color: var(--muted); }
/* A show's band code (MS, TOTT), styled like the selected menu pill. */
.chip.band { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); font-weight: 700; letter-spacing: .03em; vertical-align: 2px; margin-right: 6px; }
.chip.theme { background: color-mix(in srgb, #a855f7 14%, transparent); color: #9333ea; font-weight: 600; }

/* ── Messages ─────────────────────────────────────────────────────────── */
.flash { padding: 10px 14px; border-radius: 8px; margin: 8px 0 16px; background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }

/* ── Forms ────────────────────────────────────────────────────────────── */
input[type=text], input[type=search], input[type=password], input[type=tel], input[type=email], input[type=date], select, textarea {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { width: 100%; min-height: 70px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
label input[type=text], label input[type=tel], label input[type=date], label select { width: 100%; margin-top: 3px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; }

@media (max-width: 640px) {
  main { padding: 14px 12px 40px; }
  h1 { font-size: 21px; }
  header { padding: 8px 12px; }
  header .right { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* Small disclosure inside a row ("booking a section?") */
details.inline-details { display: inline-block; margin-left: 6px; font-size: 12px; }
details.inline-details > summary { cursor: pointer; list-style: none; display: inline; }
details.inline-details > summary::-webkit-details-marker { display: none; }
details.inline-details[open] > summary { margin-right: 6px; }
details.inline-details[open] { display: inline-flex; align-items: center; gap: 6px; }

/* NEW pill on lineups: people with fewer than 4 past shows */
.chip.new { background: #fde68a; color: #92400e; font-weight: 700; font-size: 10.5px; letter-spacing: .04em; padding: 1px 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.new { background: #78350f; color: #fde68a; } }

/* Personnel status selects on show lineups */
select.pst { padding: 1px 4px; font-size: 12px; border-radius: 999px; width: auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
select.pst-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
select.pst-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
select.pst-info { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
select.pst-bad { background: color-mix(in srgb, #dc2626 12%, transparent); color: #dc2626; border-color: transparent; font-weight: 600; text-decoration: line-through; }
select.pst-lock { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); font-weight: 700; }

/* Urgent shows (open chairs, no one on it, double-booked within 30 days): Shows list banner and rows. */
.urgent-banner { display: block; background: #fdecea; color: #7a1410; border: 2px solid #d93025; border-radius: 10px; padding: 8px 14px; margin: 4px 0 10px; }
.urgent-banner:not(details) { display: flex; gap: 10px; align-items: flex-start; }
.urgent-banner > summary { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; list-style: none; }
.urgent-banner > summary::-webkit-details-marker { display: none; }
.urgent-banner > summary > span:last-child { flex: 1; min-width: 0; }
.urgent-banner .ub-sign { font-size: 24px; line-height: 1.1; }
.urgent-banner .ub-line { display: block; font-size: 14px; margin-top: 2px; }
.urgent-banner > summary::after { content: '▸'; font-size: 18px; line-height: 1; opacity: .8; }
.urgent-banner[open] > summary::after { content: '▾'; }
.urgent-banner b { font-size: 15px; }
.urgent-banner .ub-line b { font-size: 14px; }
.urgent-banner ul { margin: 8px 0 0 34px; padding-left: 18px; }
.urgent-banner li { margin: 2px 0; }
.urgent-banner a { color: inherit; font-weight: 650; }
.urgent-banner .ub-days { opacity: .8; }
.urgent-banner.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.urgent-banner.info { background: var(--accent-soft); color: var(--fg); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-width: 1px; }
.urgent-banner.info .ub-sign { color: var(--accent); }
/* Notices stay one slim line until opened (Blake, 2026-11-12): the rest of the summary trails off with "…". */
.urgent-banner { padding: 6px 12px; margin: 0 0 6px; }
.urgent-banner .ub-sign { font-size: 17px; line-height: 1.3; width: 22px; text-align: center; flex: none; }
.urgent-banner > summary, .urgent-banner:not(details) { align-items: center; }
.urgent-banner b, .urgent-banner .ub-line b { font-size: 14px; }
.urgent-banner:not([open]) > summary > span:last-child, .urgent-banner.slim .ub-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urgent-banner:not([open]) .ub-line { display: inline; margin-left: 4px; font-size: 13.5px; opacity: .85; }
.urgent-banner.slim .ub-text { flex: 1; min-width: 0; }
.urgent-banner.slim > a { white-space: nowrap; font-size: 14px; }
.urgent-banner ul { margin: 6px 0 0 32px; font-size: 14px; }
.urgent-banner + :not(.urgent-banner) { margin-top: 10px; }
tr.srow.urgent > td { background: #fdecea; }
tr.srow.urgent > td:first-child { box-shadow: inset 5px 0 0 #d93025; }
/* An open inquiry on the Shows list: not a show yet. */
tr.srow.inq > td { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--accent-soft) 8px 9px); }
tr.srow.inq > td:first-child { box-shadow: inset 3px 0 0 var(--muted); }
/* Inquiries that look like one event, bracketed together under a heading row. */
tr.inq-same-head > td { background: var(--accent-soft); font-size: 13px; padding: 6px 12px; border-bottom: none; box-shadow: inset 4px 0 0 var(--accent); }
tr.inq-same > td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
tr.inq-same > td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.urgent-sign { display: inline-block; font-size: 26px; line-height: 1; color: #d93025; vertical-align: middle; margin-right: 2px; }
/* Roster → Permissions grid: one tick per cell, each its own little form. */
#perms th.perm { text-align: center; font-size: 12px; line-height: 1.2; max-width: 90px; white-space: normal; }
#perms td.perm { text-align: center; width: 1%; }
#perms td.perm form { margin: 0; }
#perms td.perm input { width: 18px; height: 18px; cursor: pointer; }
#perms td.perm input:disabled { cursor: default; }
/* ✉ New mail on a show (Client mail only): before the title on the Shows list, the show page and Mail. */
.mail-new { display: inline-block; font-size: 1.15em; line-height: 1; color: var(--accent); text-decoration: none; vertical-align: -1px; }
.mail-new:hover { text-decoration: none; opacity: .8; }
.mail-banner { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 4px 0 14px; }
.mail-banner .mb-sign { font-size: 34px; line-height: 1; color: var(--accent); }
.mail-banner b { font-size: 17px; }
.mail-banner ul { margin: 6px 0 0; padding-left: 18px; }
.mail-banner li { margin: 2px 0; }
.mail-banner a { font-weight: 650; }
.mail-banner .mb-meta { font-size: 13px; opacity: .8; }
.mail-banner .mb-meta a { font-weight: 400; }
@media (prefers-color-scheme: dark) {
  .urgent-banner { background: #3a1513; color: #ffb4ab; border-color: #e5534b; }
  tr.srow.urgent > td { background: #33181a; }
  .urgent-sign { color: #ff6b61; }
}

/* ── Analysis charts (Outlook → Analysis) ─────────────────────────────── */
/* Each show type keeps one colour everywhere; "not categorized" is grey. */
.an { --t-wedding: #2a78d6; --t-corporate: #eb6834; --t-gala: #1baf7a; --t-festival: #eda100; --t-private: #e87ba4; --t-club: #008300; --t-promo: #6250d6; --t-none: #94a3b8; }
@media (prefers-color-scheme: dark) {
  .an { --t-wedding: #3987e5; --t-corporate: #d95926; --t-gala: #199e70; --t-festival: #c98500; --t-private: #d55181; --t-club: #008300; --t-promo: #9085e9; --t-none: #64748b; }
}
.an-wedding { background: var(--t-wedding); } .an-corporate { background: var(--t-corporate); } .an-gala { background: var(--t-gala); }
.an-festival { background: var(--t-festival); } .an-private { background: var(--t-private); } .an-club { background: var(--t-club); } .an-promo { background: var(--t-promo); } .an-none { background: var(--t-none); }
.an .card h2 { font-size: 16px; margin: 0 0 12px; }
.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.an-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.an-label { color: var(--muted); font-size: 13px; }
.an-hero { font-size: 48px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; }
.an-num { font-size: 28px; font-weight: 650; line-height: 1.5; }
.an-num small { font-size: 15px; font-weight: 500; color: var(--muted); }
.an-sub, .an-note { color: var(--muted); font-size: 13px; }
.an-note { margin: 10px 0 0; }
.an-meter { height: 6px; border-radius: 3px; background: var(--surface-2); margin: 2px 0 6px; overflow: hidden; }
.an-meter i { display: block; height: 100%; background: var(--accent); }
.an-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.an-bars { display: grid; gap: 10px; }
.an-row { display: grid; grid-template-columns: 124px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.an-name { color: var(--fg); text-decoration: none; white-space: nowrap; }
.an-track { display: flex; align-items: center; gap: 8px; padding-right: 150px; position: relative; }
.an-bar { display: block; height: 16px; min-width: 2px; border-radius: 0 4px 4px 0; flex: none; }
.an-val { white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: -150px; }
.an-val small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.an-segs { display: flex; gap: 2px; height: 20px; flex: none; }
.an-segs i { min-width: 2px; }
.an-segs i:last-child { border-radius: 0 4px 4px 0; }
.an-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.an-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.an-months { position: relative; }
.an-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.an-grid span { position: absolute; left: 0; bottom: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-cols { position: absolute; left: 48px; right: 0; top: 0; bottom: 0; display: flex; }
.an-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.an-stack { display: flex; flex-direction: column; gap: 2px; width: 24px; max-width: 70%; }
.an-stack i { display: block; }
.an-stack i:first-child { border-radius: 4px 4px 0 0; }
.an-cap { font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-x { height: 24px; line-height: 24px; font-size: 12px; color: var(--muted); }
.an-table td:not(:first-child), .an-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.an-table tr.an-total td { font-weight: 650; border-top: 2px solid var(--line); }
.an-table td.an-thin { color: var(--warn); font-weight: 650; }
details.card .an-table td:not(:first-child), details.card .an-table th:not(:first-child) { text-align: left; }
/* Booking pace: next year's and this year's lines stand out; finished years are grey. */
.an { --p-next: #2a78d6; --p-this: #eb6834; --p-past: #a8b3c4; }
@media (prefers-color-scheme: dark) { .an { --p-next: #3987e5; --p-this: #d95926; --p-past: #55617a; } }
.an-next { background: var(--p-next); } .an-this { background: var(--p-this); } .an-past { background: var(--p-past); } .an-accent { background: var(--accent); }
.an-tiles.an-flat .an-tile { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.an-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.an-lines { position: relative; }
.an-plot { position: absolute; left: 40px; right: 78px; top: 0; }
.an-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.an-plot polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.an-l-past { stroke: var(--p-past); stroke-width: 1.5; } .an-l-this { stroke: var(--p-this); stroke-width: 2.5; } .an-l-next { stroke: var(--p-next); stroke-width: 2.5; }
.an-split { position: absolute; left: 50%; top: 0; bottom: -40px; border-left: 1px solid var(--line); }
.an-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; margin: 0 0 -5px -5px; box-shadow: 0 0 0 2px var(--surface); }
.an-end { position: absolute; margin: 0 0 -8px 8px; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-end-now { color: var(--fg); font-weight: 650; }
.an-strip { position: absolute; top: 0; bottom: 0; width: 4.1667%; }
.an-strip:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); }
.an-months-x, .an-spans { position: absolute; left: 40px; right: 78px; font-size: 12px; color: var(--muted); }
.an-months-x { bottom: 22px; height: 18px; } .an-months-x span { position: absolute; padding-left: 4px; }
.an-spans { bottom: 0; display: grid; grid-template-columns: 1fr 1fr; } .an-spans span { padding-left: 4px; font-weight: 550; }
.an-lead polyline.an-l-bold { stroke-width: 2.5; }
.an-lead .an-l-past { stroke: var(--muted); }
.an-lead ~ * .an-past, .an-legend .an-key.an-past { background: var(--p-past); }
.an-year { position: absolute; bottom: -24px; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.an-table td:not(:first-child) { white-space: nowrap; }
.an-table td small { color: var(--muted); margin-left: 6px; }
.an-table td.an-now { font-weight: 700; color: var(--accent); }
.an-tip { white-space: pre-line; }
.an-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12px; padding: 5px 9px; border-radius: 6px; max-width: 340px; }

/* Busy dates (Outlook): a calendar shaded by the chance of a date reaching X shows. One hue, light to strong. */
.an { --heat: #2a78d6; }
@media (prefers-color-scheme: dark) { .an { --heat: #3987e5; } }
.bd-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bd-month { margin: 0; padding: 12px 14px; }
.bd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bd-w { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.bd-day { position: relative; display: block; height: 46px; border-radius: 6px; background: var(--surface-2); color: var(--fg); text-decoration: none; }
.bd-day:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.bd-d { position: absolute; left: 5px; top: 3px; font-size: 11px; color: var(--muted); }
.bd-p { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bd-n { position: absolute; right: 3px; top: 3px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 8px; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 650; text-align: center; color: var(--fg); }
.bd-day.bd-there, .bd-key.bd-there { background: var(--heat); color: #fff; }
.bd-day.bd-there .bd-d { color: #fff; opacity: .85; }
.bd-day.bd-past { opacity: .45; }
.bd-day.bd-hot .bd-d { color: var(--fg); }
.bd-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--line); }
.an-legend .bd-n { position: static; display: inline-block; margin-right: 5px; }
.bd-meter { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.bd-meter i { display: block; height: 100%; background: var(--heat); }
.bd-list td.muted { white-space: normal; font-size: 12px; }
.bd-booked { background: var(--heat); } .bd-more { background: color-mix(in srgb, var(--heat) 35%, var(--surface)); }
.bd-mstack { position: relative; }
.bd-last { position: absolute; left: -7px; right: -7px; height: 0; border-top: 2px solid var(--fg); opacity: .55; }
.bd-lastkey { display: inline-block; width: 16px; border-top: 2px solid var(--fg); opacity: .55; margin-right: 6px; vertical-align: middle; }
.an-x small { font-size: 10px; }
.bd-month h2 { display: flex; align-items: baseline; gap: 8px; }
.bd-sum { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }

/* Public shows: the listing editor and its preview. */
.pub-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .pub-grid { grid-template-columns: 1fr; } }
.pub-grid label { display: block; margin-bottom: 10px; font-weight: 550; font-size: 14px; }
.pub-grid label input, .pub-grid label textarea, .pub-grid label select { display: block; width: 100%; margin-top: 3px; box-sizing: border-box; font-weight: normal; }
.pub-prev { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.pub-img { width: 120px; min-height: 80px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 12px; }
.pub-img img { width: 100%; display: block; }
.pub-t { font-size: 18px; font-weight: 700; } .pub-sub { font-size: 14px; font-style: italic; } .pub-band { color: var(--accent); font-weight: 600; font-size: 14px; }
.pub-when { margin-top: 6px; font-weight: 600; } .pub-venue { margin-top: 4px; } .pub-addr, .pub-age { color: var(--muted); font-size: 13px; }
.pub-time { margin-top: 4px; font-size: 14px; } .pub-blurb { margin-top: 6px; font-size: 14px; } .pub-link { margin-top: 6px; color: var(--accent); font-size: 14px; }
a.pubpill { text-decoration: none; cursor: pointer; } a.pubpill:hover { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Background saves (public/app.js): toasts, and a busy cursor while a save is on its way. */
.ms-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.ms-toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); font-size: 14px; transition: opacity .35s, transform .35s; }
.ms-toast.bad { background: var(--danger); color: #fff; }
.ms-toast.out { opacity: 0; transform: translateY(6px); }
html.ms-saving, html.ms-saving * { cursor: progress !important; }

/* ── Help (/admin/help) ───────────────────────────────────────────────── */
/* A guide that follows the nav: a contents rail on the left, a band per section, a sheet per page. Buttons named in the
   text are drawn small (.b), who-can-use-it as purple chips (.perm), what runs by itself as "Automatic". */
header .right .btn.on { background: var(--accent-soft); color: var(--accent); }
.help { --help-blue: #1d5fbf; --help-blue-soft: #e1edff; }
@media (prefers-color-scheme: dark) { .help { --help-blue: #7cb0ff; --help-blue-soft: #132a4f; } }
.help-mast { display: grid; gap: 4px; margin-bottom: 8px; }
.help-lede { font-size: 17px; max-width: 70ch; margin: 4px 0; }
.help-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.help-strip a { text-decoration: none; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13.5px; font-weight: 600; }
.help-strip a:hover { border-color: var(--accent); color: var(--accent); }
.help-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.help-search label { font-weight: 650; margin: 0; }
.help-search input { flex: 1 1 260px; min-width: 0; font-size: 15px; padding: 9px 12px; }
.help-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.help-toc { position: sticky; top: 72px; font-size: 13.5px; max-height: calc(100vh - 90px); overflow-y: auto; }
.help-toc h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 4px; }
.help-toc h4:first-child { margin-top: 0; }
.help-toc a { display: block; color: var(--fg); text-decoration: none; padding: 2px 0 2px 10px; border-left: 2px solid var(--line); }
.help-toc a:hover { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 900px) { .help-grid { grid-template-columns: minmax(0, 1fr); } .help-toc { display: none; } }
.help .band { margin-bottom: 48px; scroll-margin-top: 70px; }
.help .band-head { display: grid; gap: 6px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--fg); }
.help .eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.help .band-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; margin: 0; }
.help .band-head p { margin: 0; max-width: 72ch; color: var(--muted); }
.help .tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.help .tabs span { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 7px 7px 0 0; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; }
.help .sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; scroll-margin-top: 70px; }
.help .sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.help .sheet h3 { font-size: 19px; font-weight: 700; margin: 0; }
.help .sheet .who { margin-left: auto; }
.help .sheet > p { margin: 0 0 10px; max-width: 75ch; }
.help .sheet h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.help .sheet ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.help .sheet li { max-width: 80ch; }
.help .path { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; text-decoration: none; white-space: nowrap; }
a.path:hover { color: var(--accent); }
.help .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.help .cols > div { min-width: 0; }
.help .note { margin: 12px 0 0; padding: 9px 13px; border-radius: 8px; background: var(--surface-2); max-width: 80ch; }
.help .note b { color: var(--accent); }
.help .b { display: inline-block; font-size: .86em; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 6px; padding: 0 6px; line-height: 1.55; white-space: nowrap; }
.help .chip.perm { background: var(--accent); color: var(--accent-fg); font-weight: 650; }
.help .chip.danger { background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.help .chip.blue { background: var(--help-blue-soft); color: var(--help-blue); }
.help .auto { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); margin-right: 4px; }
.help .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.help .fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; align-content: start; }
.help .fact strong { font-size: 24px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.help .fact span { font-size: 13.5px; color: var(--muted); }
.help .flow { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: 10px; }
.help .flow .col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; font-size: 14px; }
.help .flow .col.app { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.help .flow .lbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
.help .flow .arrow { display: grid; place-items: center; font-size: 20px; color: var(--muted); }
@media (max-width: 720px) { .help .flow { grid-template-columns: minmax(0, 1fr); } .help .flow .arrow { transform: rotate(90deg); } }
.help .you { width: 1%; text-align: center; }
.help .later { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.help .later > div { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.help .later h4 { font-size: 15px; margin: 0 0 6px; }
.help .later ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 2px; }
.help .hidden-by-search { display: none !important; }
.help mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Beta warning at the top of every page (until the app is live) */
.beta {
  background: var(--warn-soft); color: var(--warn); border-bottom: 2px solid var(--warn);
  padding: 10px 16px; text-align: center; font-size: 15px; line-height: 1.4;
}
.beta b { font-weight: 750; }

/* Guided tours (public/app.js): the card, and the cut-out that dims the page around what it points at */
.ms-tour-spot { position: fixed; z-index: 900; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); outline: 2px solid var(--accent); transition: all .2s ease; }
.ms-tour { position: fixed; z-index: 901; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); transition: top .2s ease, left .2s ease; }
.ms-tour.mid { box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55), 0 12px 32px rgba(0, 0, 0, .25); }
.ms-tour h3 { margin: 2px 0 6px; font-size: 17px; }
.ms-tour p { margin: 0 0 12px; line-height: 1.45; font-size: 15px; }
.ms-tour-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.ms-tour-bar span { display: block; height: 100%; background: var(--accent); }
.ms-tour-btns { display: flex; gap: 8px; align-items: center; }
@media (prefers-reduced-motion: reduce) { .ms-tour, .ms-tour-spot { transition: none; } }

/* A page opened over the current one (public/app.js: data-modal), e.g. offering a chair. */
.ms-modal { border: none; border-radius: var(--radius); padding: 0; width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--card); color: var(--fg); box-shadow: var(--shadow), 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.ms-modal::backdrop { background: rgba(0,0,0,.45); }
.ms-modal-body { padding: 20px 24px 24px; overflow: auto; max-height: calc(100vh - 48px); }
.ms-modal-body > h1:first-child, .ms-modal-body > :first-child h1 { margin-top: 0; padding-right: 36px; }
.ms-modal-body .card { box-shadow: none; border: 1px solid var(--line); }
.ms-modal-x { position: absolute; top: 10px; right: 10px; z-index: 1; border: none; background: var(--surface-2); color: var(--muted);
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer; }
.ms-modal-x:hover { color: var(--fg); }
@media (max-width: 600px) { .ms-modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; } .ms-modal-body { max-height: 100vh; padding: 16px; } }

/* ── Phones (≤ 640px) ─────────────────────────────────────────────────────
   public/app.js marks wide list tables .stack (cards, cells labelled from the column headings) and boxes in wide
   number grids. The header stops sticking and fits on two short rows; tabs scroll sideways instead of wrapping. */
@media (max-width: 640px) {
  .beta { padding: 5px 12px; font-size: 12.5px; }
  header { position: static; gap: 6px 10px; padding: 8px 12px; }
  header .brand { order: 1; margin-right: 0; }
  header .brand .brand-name { display: none; }
  header .right { order: 2; margin-left: auto; width: auto; gap: 4px; flex-wrap: nowrap; }
  header nav { order: 3; flex: 1 1 100%; margin: 0 -12px; padding: 0 12px; }
  header nav a { padding: 6px 10px; }
  header .status:not(.busy) { font-size: 0; gap: 0; }
  .hide-sm { display: none !important; }
  .rtabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .rtabs::-webkit-scrollbar, header nav::-webkit-scrollbar { display: none; }
  .rtabs a { white-space: nowrap; padding: 6px 11px; }
  .chip { white-space: normal; max-width: 100%; }
  .card { padding: 12px 14px; }
  p.hint { font-size: 14px; }
  .findbar input[type=search] { flex: 1 1 140px; }
  /* Fixed minimum widths (often inline) would push past the screen edge; never wider than the space there is. */
  main input:not([type=checkbox]):not([type=radio]), main select, main textarea { min-width: 0 !important; max-width: 100%; }
  main img, main video, main iframe, main pre { max-width: 100%; }
  main pre { overflow-x: auto; }
  /* Outlook on phones (Blake, 2026-11-12): fewer columns and labels so nothing collides. Tables say what to drop:
     .sm-first-N keeps the first N columns, .sm-hide-N drops column N; .sm-off drops a detail (an amount, a note). */
  .sm-off { display: none !important; }
  .sm-first-3 tr > :nth-child(n+4), .sm-first-4 tr > :nth-child(n+5) { display: none; }
  .sm-hide-2 tr > :nth-child(2) { display: none; }
  .sm-hide-3 tr > :nth-child(3) { display: none; }
  .sm-hide-4 tr > :nth-child(4) { display: none; }
  .sm-hide-5 tr > :nth-child(5) { display: none; }
  .sm-hide-6 tr > :nth-child(6) { display: none; }
  .sm-hide-7 tr > :nth-child(7) { display: none; }
  .sm-hide-8 tr > :nth-child(8) { display: none; }
  .sm-hide-9 tr > :nth-child(9) { display: none; }
  .an-table th { font-size: 10.5px; letter-spacing: .03em; }
  .an-table th, .an-table td { padding: 8px 8px; }
  .an-table td small { white-space: nowrap; }
  .an-table.paths td:first-child { overflow-wrap: anywhere; }
  .an-year .yr-c { font-size: 0; }
  .an-year .yr-c::before { content: '’'; font-size: 12px; }
  .an-cap { font-size: 9.5px; letter-spacing: -.02em; }
  .an-x { font-size: 10.5px; }
  .an-x small { display: none; }
  .an-lines, .an-months { margin-top: 18px; }
  .an-row { grid-template-columns: 96px 1fr; }
  /* Booking pace chart: fewer month labels, and the two year captions on one line each. */
  .an-months-x span:nth-child(even) { display: none; }
  .an-spans span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }

  table.stack { display: block; }
  table.stack > thead, table.stack tr.stack-head { display: none !important; }
  table.stack > tbody { display: block; }
  table.stack tr:not([hidden]) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
  table.stack tr:has(> td[data-lead]) { position: relative; padding-left: 38px; }
  table.stack > tbody:last-child > tr:last-child { border-bottom: none; }
  table.stack td, table.stack th { display: block; border: 0; padding: 0; flex: 0 1 auto; min-width: 0; max-width: 100%; text-align: left; }
  table.stack td:empty, table.stack td[data-blank] { display: none; }
  table.stack td[data-title] { flex-basis: 100%; }
  table.stack td[data-lead] { position: absolute; left: 4px; top: 7px; width: 30px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none !important; box-shadow: none !important; }
  table.stack td[data-label]::before { content: attr(data-label); margin-right: 5px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  table.stack tr[data-band] { padding: 0; }
  table.stack tr[data-band] > td, table.stack tr[data-band] > th { flex-basis: 100%; padding: 5px 12px; }
  table.stack tr.srow.urgent { background: #fdecea; box-shadow: inset 5px 0 0 #d93025; }
  table.stack tr.srow.urgent > td { background: none; }
  table.stack tr.srow.urgent > td:first-child { box-shadow: none; }
}
@media (max-width: 640px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.stack tr.srow.urgent { background: #33181a; } }
@media (min-width: 641px) { .hide-wide { display: none; } }
