/* ==========================================================================
   Dance Time — visual system
   Clean off-white surface, cool ink, one brand accent (violet) and one warm
   signal (rose). All colors live in :root so the palette swaps in one place.
   ========================================================================== */

:root {
  --paper: #f7f6fb;
  --card: #ffffff;
  --ink: #1c1b22;
  --ink-soft: #57545f;
  --ink-faint: #6f6b78;
  --line: rgba(28, 27, 34, 0.10);
  --line-strong: rgba(28, 27, 34, 0.20);

  --violet: #6d3fc7;
  --violet-600: #582fa5;
  --violet-50: #f1ecfb;
  --rose: #c62a6e;
  --rose-ink: #99205a;
  --rose-50: #fbe6f0;

  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-feature-settings: "tnum" 1; line-height: 1.55; }

h1, h2, h3 { line-height: 1.1; }

.font-display { font-family: "Fraunces", Georgia, serif; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 60;
  background: var(--ink); color: #fff; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
/* Route changes and the skip link move focus to the page heading or <main> so
   screen readers announce the new page. They aren't controls, so no ring —
   iOS Safari otherwise draws one on every page switch. */
h1[tabindex="-1"]:focus, #main:focus { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  background: rgba(244, 241, 234, 0.85);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: "Fraunces", serif; font-weight: 600; font-size: 21px;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
.topnav { display: none; }
@media (min-width: 640px) { .topnav { display: flex; } }
.navlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--ink-soft); padding: 7px 12px;
  border-radius: 9px; transition: color 0.12s, background 0.12s; white-space: nowrap;
}
.navlink:hover { color: var(--ink); background: rgba(28, 26, 23, 0.05); }
.navlink[aria-current="page"] { color: var(--violet-600); background: var(--violet-50); }

/* Phone tab bar: the same four places as the header nav, under the thumb. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  background: rgba(247, 246, 251, 0.94); backdrop-filter: saturate(1.1) blur(8px);
  border-top: 1px solid var(--line);
}
.tablink {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  color: var(--ink-soft);
}
.tablink .navicon { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 999px; }
.tablink[aria-current="page"] { color: var(--violet-600); }
.tablink[aria-current="page"] .navicon { background: var(--violet-50); }
@media (min-width: 640px) { .tabbar { display: none; } }
@media (max-width: 639px) { body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* Pages that want the whole screen (the call sheet) widen the shell. */
body[data-wide] .shell { max-width: 80rem; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-hover { transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease; }
.card-hover:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 26px -18px rgba(28, 26, 23, 0.45);
}

.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; padding: 9px 15px; border-radius: 10px;
  border: 1px solid transparent; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-600); }
.btn-clay { background: var(--rose); color: #fff; }
.btn-clay:hover { background: var(--rose-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(28, 26, 23, 0.03); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- Inputs ---------- */
.field {
  width: 100%; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 11px 14px; color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); }
.field-lg { padding: 14px 16px 14px 44px; font-size: 18px; }
.field.pl-11 { padding-left: 44px; }

/* ---------- Chips (toggle filters / selected dancers) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--violet); color: #fff; border-color: var(--violet); }
.chip:disabled { opacity: 0.45; cursor: not-allowed; border-color: var(--line-strong); color: var(--ink-soft); }
.saved-view-name { width: 14rem; max-width: 100%; padding: 6px 12px; }
.chip-warning[aria-pressed="true"] {
  background: #fff4dd; color: #7a4a00; border-color: #d7a84f;
}

/* Follow and reminders: Follow plus a bell on the dancer page, a bell per
   dancer on Following, full settings on /me/reminders */
.follow-controls:empty, .me-confirm:empty { display: none; }
.follow-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.follow-note { margin-top: 6px; }
.bell-glyph { display: inline-flex; }
.bell-btn[aria-pressed="true"] { background: var(--violet-50); color: var(--violet-600); border-color: var(--violet); }
.bell-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-faint); cursor: pointer;
}
.bell-icon:hover { color: var(--violet-600); }
.bell-icon:disabled { opacity: 0.55; cursor: default; }
.bell-error { margin-top: 2px; }
.switch {
  position: relative; flex-shrink: 0; width: 52px; height: 44px; cursor: pointer;
  background: transparent; border: 0; padding: 0;
}
.switch::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 30px;
  border-radius: 999px; background: var(--line-strong); transition: background 0.15s;
}
.switch::after {
  content: ""; position: absolute; left: 3px; top: 10px; width: 24px; height: 24px;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(28, 27, 34, 0.3);
  transition: transform 0.15s;
}
.switch[aria-checked="true"]::before { background: var(--violet); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.switch:focus-visible { outline: none; }
.switch:focus-visible::before { box-shadow: 0 0 0 3px var(--violet-50), 0 0 0 5px var(--violet); }
.switch:disabled { opacity: 0.55; cursor: default; }
.reminders-panel, .settings-device { padding: 20px; }
.reminders-list-title {
  margin-top: 18px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft);
}
.reminders-list { margin-top: 6px; }
.reminders-list li {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hub-status {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px;
  background: var(--violet-50); border-radius: var(--radius); color: var(--ink); font-size: 15px;
}
.hub-status > span:first-child { color: var(--violet-600); flex-shrink: 0; }
.hub-status-chev { color: var(--violet-600); font-size: 20px; line-height: 1; }
.hub-status:hover { background: #e8e0f8; }
.reminders-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reminders-settings { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.reminders-select { width: auto; padding: 7px 12px; }
.reminders-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.reminders-check input { margin-top: 4px; accent-color: var(--violet); width: 16px; height: 16px; flex-shrink: 0; }
.reminders-steps { list-style: decimal; padding-left: 22px; margin-top: 10px; font-size: 14px; }
.reminders-steps li + li { margin-top: 4px; }
.reminders-install {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.reminders-status:empty { display: none; }
.reminders-status { margin-top: 10px; font-size: 13px; color: var(--violet-600); }

/* On deck */
.ondeck-next { padding: 22px; border-color: var(--violet); }
.ondeck-countdown { font-size: 44px; line-height: 1.05; margin: 6px 0 4px; color: var(--violet-600); }
.ondeck-calls { margin-top: 12px; }
.ondeck-call { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ondeck-call:last-child { border-bottom: 0; }
.ondeck-time { width: 76px; flex-shrink: 0; padding-top: 1px; white-space: nowrap; }
.ondeck .btn[aria-pressed="true"] { background: var(--violet); color: #fff; border-color: var(--violet); }

/* Offline / saved-data banner under the header */
.app-status {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 16px; font-size: 13px; color: #6d4300; background: #fff8e8;
  border-top: 1px solid #d7a84f;
}

/* "Updated 12 min ago · Refresh": the data's age, and a check on demand */
.freshness-action {
  color: var(--violet-600); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.freshness-action:hover { color: var(--violet); }
.freshness-inline::before { content: " · "; }

/* Add to Home Screen: the phone-only banner and the step-by-step guide */
#install-banner:empty { display: none; }
.install-banner {
  max-width: 64rem; margin: 16px auto 0; padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px;
  background: var(--violet-50); border: 1px solid var(--violet); border-radius: var(--radius);
}
#install-banner { padding: 0 16px; }
.install-banner-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; background: var(--card); color: var(--violet-600);
}
.install-banner-text { flex: 1 1 14rem; min-width: 0; }
.install-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.install-banner-close {
  min-height: 44px; padding: 0 10px; font-size: 14px; color: var(--ink-soft); text-decoration: underline;
}
.install-page { max-width: 42rem; }
.install-done {
  margin-top: 16px; padding: 10px 14px; border-radius: 10px;
  background: var(--violet-50); color: var(--violet-600); font-weight: 600;
}
.install-benefits { display: grid; gap: 10px; margin-top: 20px; }
.install-benefits li { display: flex; flex-direction: column; padding-left: 14px; border-left: 3px solid var(--violet); }
.install-seg > button { padding: 10px 16px; font-size: 15px; }
.install-body { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.install-quick { padding: 16px; border: 1px solid var(--violet); border-radius: var(--radius); background: var(--violet-50); }
.install-steps { counter-reset: install-step; display: flex; flex-direction: column; gap: 10px; }
.install-step {
  counter-increment: install-step; position: relative;
  padding: 14px 16px 14px 60px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.install-step::before {
  content: counter(install-step); position: absolute; left: 16px; top: 13px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--violet); color: #fff; font-weight: 700; font-size: 15px;
}
.install-step-title { font-size: 17px; line-height: 1.6; }
.install-step-detail { margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.install-key {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline;
  padding: 1px 8px; margin: 0 1px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--paper); color: var(--violet-600); font-weight: 600; white-space: nowrap;
}
.install-icon-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.install-appicon { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }

.notice-warning {
  border: 1px solid #d7a84f; border-radius: 10px; padding: 9px 12px;
  background: #fff8e8; color: #6d4300; font-size: 13px;
}

/* Loading spinner */
.spin {
  display: inline-block; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--violet);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Back link */
.backlink { color: var(--violet-600); font-size: 14px; }
.backlink:hover { text-decoration: underline; }

/* ---------- Tags ---------- */
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 6px; line-height: 1.7; white-space: nowrap;
}
.tag-neutral  { background: #ece9f2; color: #514d5a; }
.tag-ballroom { background: #e7ecf3; color: #33455f; }
.tag-smooth   { background: #e2efeb; color: #0f5a4a; }
.tag-latin    { background: #f6e7df; color: #8f4022; }
.tag-rhythm   { background: #f2e7ef; color: #743a5e; }
.tag-social   { background: #eae6f4; color: #4c3b74; }
.tag-contested { background: #f7e4c9; color: #8a5a12; }
.tag-bronze   { background: #e6d3bd; color: #6e4a24; }
.tag-silver   { background: #e3e5e8; color: #4a5560; }
.tag-gold     { background: #efe0b0; color: #6a561a; }
.tag-live     { background: var(--rose-50); color: var(--rose-ink); }
.tag-upcoming { background: #e7ecf3; color: #33455f; }
.tag-past     { background: #ece9f2; color: #514d5a; }
.tag-unknown  { background: #f1eee6; color: #615b4d; }
.tag-results  { background: #e4efe3; color: #2f5d33; }

/* Live pulse dot */
.livedot {
  display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: var(--rose); box-shadow: 0 0 0 0 rgba(198, 42, 110, 0.5);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 42, 110, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(198, 42, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 42, 110, 0); }
}

/* Mono time / number token */
.tt { font-family: "JetBrains Mono", monospace; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- Home doorways ---------- */
.doorway {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.doorway:hover { border-color: var(--violet); box-shadow: 0 8px 26px -18px rgba(28, 26, 23, 0.4); }
.doorway-icon {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; background: var(--violet-50); color: var(--violet-600);
}

/* ---------- Home: Me's page ---------- */
.hub-next { padding: 22px; border-color: var(--violet); }
.hub-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.hub-countdown { font-size: 44px; line-height: 1.05; color: var(--violet-600); }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.hub-actions { display: grid; gap: 10px; }
@media (min-width: 640px) { .hub-actions { grid-template-columns: repeat(3, 1fr); } }
.hub-action {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink);
}
.hub-action > span:first-child { color: var(--violet-600); padding-top: 1px; }
.hub-action:hover { border-color: var(--violet); }
.friends-next { margin-top: 6px; }
.friends-next li {
  display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.friends-next li:last-child { border-bottom: 0; }
.confirm-me { padding: 18px; border-color: var(--violet); }
.following-entry + .following-entry { padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Now: the floor schedule ---------- */
.floor-heats { overflow: hidden; }
.floor-heat { border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.floor-heat:last-child { border-bottom: 0; }
.floor-heat.is-now { background: var(--violet-50); border-left-color: var(--violet); }
.floor-heat.is-past { background: #faf9fc; color: var(--ink-soft); }
.floor-heat.is-mine:not(.is-now) { border-left-color: var(--rose); }
.floor-heat-summary {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px;
  padding: 10px 14px; cursor: pointer; list-style: none; align-items: start;
}
.floor-heat-summary::-webkit-details-marker { display: none; }
.floor-heat-time { padding-top: 2px; white-space: nowrap; font-size: 14px; }
/* One line while closed; the whole list once open. */
.floor-heat-events { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor-heat details[open] .floor-heat-events { white-space: normal; }
.floor-heat-couples { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 12px 96px; font-size: 14px; }
a.couple-bib:hover { border-color: var(--violet); color: var(--violet-600); }

/* ---------- Call sheet layout ---------- */
.sheet { display: flex; flex-direction: column; gap: 16px; }
.sheet-rail { display: contents; }
.sheet-title { order: 1; }
.sheet-live { order: 2; }
.sheet-live:not(:has(> :not([hidden]))) { display: none; }
.sheet-controls { order: 3; }
/* An empty region (no add box, no chips) takes no row. */
.sheet-controls > .foldable:not(:has(> :not([hidden]))) { display: none; }
.textlink { color: var(--violet-600); font-size: 14px; }
.textlink:hover { text-decoration: underline; }
.sheet-tools { order: 4; }
/* On a phone the two folded cards share a row; an opened one takes it whole. */
@media (max-width: 1023px) {
  .sheet-tools { flex-direction: row !important; flex-wrap: wrap; }
  .sheet-tools > * { flex: 1 1 150px; min-width: 0; }
  .sheet-tools > :has(> details[open]), .sheet-tools > details[open] { flex-basis: 100%; }
  .sheet-tools .filter-long { display: none; }
}
.sheet-order { order: 5; margin-top: 8px; }
.sheet-print { order: 6; }
.sheet-print:not(:has(.print-sheet)) { display: none; }
@media (min-width: 1024px) {
  .sheet {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 36px; row-gap: 16px; align-items: start;
  }
  .sheet-title, .sheet-controls, .sheet-order { grid-column: 1; }
  .sheet-rail {
    display: flex; flex-direction: column; gap: 16px;
    grid-column: 2; grid-row: 1 / span 3;
    position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto;
  }
  .sheet-order { margin-top: 0; }
  .sheet-rail .stat-band > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
}

/* "More" menu on the call sheet */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 35;
  width: 290px; max-width: calc(100vw - 32px); padding: 12px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 16px 40px -22px rgba(28, 26, 23, 0.5);
}
.menu-panel .btn, .menu-panel .print-option { width: 100%; justify-content: flex-start; }
@media (min-width: 640px) { .menu-panel { left: auto; right: 0; } }
/* On a phone the menu spans the title row, so it never runs off screen.
   (Not position: fixed — the page's entrance animation would trap it.) */
.sheet-title { position: relative; }
@media (max-width: 639px) {
  .sheet-title .menu { position: static; }
  .menu-panel { left: 0; right: 0; width: auto; max-width: none; }
}

/* ---------- Running order (call sheet) ---------- */
.rundown { border-top: 2px solid var(--ink); }
.callrow {
  display: grid; grid-template-columns: 82px 1fr; gap: 14px;
  padding: 12px 8px 12px 12px; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.callrow--you { border-left-color: var(--violet); background: linear-gradient(90deg, rgba(109, 63, 199, 0.06), transparent 55%); }
.calltime { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.callampm { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.08em; }
.meta-chip {
  display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 10.5px;
  padding: 1px 7px; border-radius: 5px; background: #edeaf3; color: var(--ink-soft);
}
.breakband {
  font-size: 11.5px; color: var(--ink-faint); padding: 5px 0 5px 96px;
  display: flex; align-items: center; gap: 8px;
}
.breakband::before { content: ""; flex: none; width: 22px; border-top: 1px dashed var(--line-strong); }
.breakband--pc { color: var(--violet-600); font-weight: 600; }
.breakband--pc::before { border-top-style: solid; border-color: var(--violet); }
.sessionbreak {
  font-size: 11.5px; color: var(--ink-faint); text-align: center;
  padding: 4px 8px; border-block: 1px dashed var(--line-strong);
}

.sessionhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* Live view: where the published schedule says the floor is right now. */
/* One row: what is on (or next) beside a details button and a compact
   Live / Scheduled switch; notes and details stack underneath. */
.livebar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "head info mode" "note note note" "detail detail detail";
  column-gap: 8px; align-items: center;
  padding: 6px 6px 6px 12px; background: var(--card);
  border: 1px solid var(--violet); border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px rgba(28, 26, 23, 0.45);
}
.livebar[hidden] { display: none; }
.livemode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.livebar .livebar-heading { grid-area: head; }
.livebar .livemode { grid-area: mode; }
.liveswitch {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 4px 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.liveswitch[aria-checked="true"] { color: var(--violet-600); }
.liveswitch-track {
  position: relative; flex: none; width: 30px; height: 18px; border-radius: 999px;
  background: var(--line-strong); transition: background 0.15s;
}
.liveswitch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(28, 26, 23, 0.3);
  transition: transform 0.15s;
}
.liveswitch[aria-checked="true"] .liveswitch-track { background: var(--violet); }
.liveswitch[aria-checked="true"] .liveswitch-track::after { transform: translateX(12px); }
/* A small circled "i"; on a phone the button itself still spans 44px. */
.livebar-info {
  grid-area: info; min-width: 30px; min-height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.livebar-info > span {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--violet-600);
  font: italic 700 15px/1 Georgia, serif;
}
.livebar-info:hover > span { border-color: var(--violet); }
.livebar-info[aria-expanded="true"] > span { background: var(--violet); border-color: var(--violet); color: #fff; }
.livebar-note {
  grid-area: note; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--ink-soft);
}
.livebar-note:not([hidden]) { display: flex; flex-wrap: wrap; column-gap: 10px; }
.livebar-note > div { white-space: nowrap; }
.livebar-note > div:first-child:not(:only-child) { font-weight: 600; color: var(--violet-600); }
.livebar-note[hidden], .livebar-detail[hidden] { display: none; }
/* Floats under the site header while now is off screen; fixed, so it never
   moves the page when it appears or goes away. */
.livepill {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 8px 16px; border-radius: 999px; background: var(--violet); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 22px -10px rgba(28, 26, 23, 0.55);
}
.livepill:hover { background: var(--violet-600); }
.livemode[hidden] { display: none; }
/* Fixed two-line heading: the text changes each minute and must never change
   the banner's height, which would shift the page below it. It wraps only
   between parts, so a time or countdown is never split or cut short. */
.livebar-heading {
  font-weight: 600; font-size: 15px; line-height: 1.3; min-height: 2.6em; align-content: center;
}
.livebar-part { white-space: nowrap; }
.livebar-sub { font-weight: 500; color: var(--ink-soft); }
.livebar-detail {
  grid-area: detail; margin-top: 6px; padding: 6px 6px 2px 0; border-top: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.45;
}
/* The now line overlays the row's top edge instead of taking space, so it
   can move every minute without shifting the page. */
.callrow--nowline { position: relative; box-shadow: inset 0 2px 0 var(--violet); }
.callrow--nowline::before {
  content: attr(data-now-label); position: absolute; left: 8px; top: -9px;
  padding: 0 6px; background: var(--paper); color: var(--violet-600);
  font-size: 11px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.callrow--past { background: #faf9fc; }
.callrow--past .calltime, .callrow--past .font-medium { color: var(--ink-soft); }
.callrow[aria-current="time"] { background: var(--violet-50); border-left-color: var(--violet); }

/* ---------- Couple numbers on the call sheet ---------- */
.couple-bib {
  display: inline-block; min-width: 2.6em; margin-right: 6px; padding: 0 5px;
  border: 1px solid var(--line-strong); border-radius: 5px; text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 18px; color: var(--ink); vertical-align: 1px;
}

.heat-floor-summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; }
.heat-floor-summary > .eyebrow { flex: none; }
/* One line: the other events are a hint; tapping lists them all. */
.heat-floor-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-floor-summary::after { flex: none; }
.heat-floor-summary::-webkit-details-marker { display: none; }
/* Empty alt text: <details> already announces expanded/collapsed. */
.heat-floor-summary::after { content: "  ▸ Show couples" / ""; color: var(--violet-600); font-weight: 600; white-space: nowrap; }
.heat-floor[open] > .heat-floor-summary::after { content: "  ▾ Hide couples" / ""; }
.heat-floor .couple-bib { font-size: 11px; line-height: 16px; }

/* ---------- Number lookup ---------- */
.number-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-width: 64px; height: 64px; padding: 0 12px; border-radius: 10px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.number-badge-sm { min-width: 60px; height: 36px; font-size: 17px; border-width: 1.5px; border-radius: 8px; }
a.number-badge:hover { border-color: var(--violet); color: var(--violet-600); }
.number-call {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px;
  border-left: 3px solid transparent; border-bottom: 1px solid var(--line);
}
.number-call:last-child { border-bottom: 0; }
.number-call.is-now { background: var(--violet-50); border-left-color: var(--violet); }
.number-call.is-past { color: var(--ink-soft); }

/* ---------- Marks matrix (results) ---------- */
.matrix { border-collapse: collapse; }
.matrix th, .matrix td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix th { font-size: 11px; font-weight: 600; color: var(--ink-faint); }
.matrix th.lead, .matrix td.lead { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; }
.matrix tr.you td.lead { background: var(--violet-50); }
.matrix td.mono { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.matrix tr.you { background: var(--violet-50); }
.matrix td.place { font-weight: 600; font-family: "JetBrains Mono", monospace; }
.recall { display: inline-block; width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); }
.recall.on { background: var(--violet); border-color: var(--violet); }
.matrix-scroll-hint {
  display: none; margin-bottom: 4px; color: var(--ink-faint); font-size: 12px;
}

/* Expandable result rows */
summary.result-summary { list-style: none; padding: 4px; margin: -4px; border-radius: 9px; }
summary.result-summary::-webkit-details-marker { display: none; }
summary.result-summary:hover { background: rgba(28, 26, 23, 0.03); }
.chev { transition: transform 0.15s ease; color: var(--ink-faint); }
details[open] .chev { transform: rotate(180deg); }
.see-marks { color: var(--violet-600); font-size: 13px; }
details[open] .see-marks { display: none; }

/* ---------- Discover field finder ---------- */
.fieldbar { flex: none; width: 46px; height: 6px; border-radius: 999px; background: #e9e6f0; overflow: hidden; }
.fieldbar > span { display: block; height: 100%; background: var(--violet); }

/* Full-width depth bar behind a group's headline metric */
.depthbar { position: relative; height: 8px; border-radius: 999px; background: #ece9f2; overflow: hidden; }
.depthbar > span { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 999px; background: var(--violet); }

/* Year sparkline (pooled entries per edition year) */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark > i { flex: 1 1 4px; min-width: 3px; border-radius: 1.5px 1.5px 0 0; background: var(--violet-50); }
.spark > i.on { background: var(--violet); }

/* Sort segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg > button { padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); border-right: 1px solid var(--line); }
.seg > button:last-child { border-right: 0; }
.seg > button[aria-pressed="true"] { background: var(--violet); color: #fff; }

/* Competition browsing controls wrap cleanly on narrow screens. */
.competition-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.competition-controls > button {
  padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--card); color: var(--ink-soft); font-size: 12.5px; font-weight: 600;
}
.competition-controls > button:hover { border-color: var(--ink); color: var(--ink); }
.competition-controls > button[aria-pressed="true"] {
  background: var(--violet); border-color: var(--violet); color: #fff;
}
.home-live-link { color: var(--rose-ink); }
.home-live-link:hover { text-decoration: underline; }

/* Per-dance drill-down table */
.dancetab { width: 100%; border-collapse: collapse; font-size: 13px; }
.dancetab td, .dancetab th { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.dancetab th { font-size: 11px; font-weight: 600; color: var(--ink-faint); }
.dancetab td:first-child, .dancetab th:first-child { text-align: left; }

/* ---------- Utility ---------- */
.divider { border-top: 1px solid var(--line); }
.reveal { animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .spin, .reveal, .livedot { animation: none !important; }
}

@media (max-width: 640px) {
  .skip-link, .wordmark, .navlink, #main a, #main button, #main summary,
  #main label:has(input[type="checkbox"]) {
    min-width: 44px; min-height: 44px;
  }
  .wordmark, #main a:not(.card):not(.doorway):not(.hub-action):not(.hub-status),
  #main label:has(input[type="checkbox"]) {
    display: inline-flex; align-items: center;
  }
  .navlink, .btn, #main summary, .backlink, .print-option {
    align-items: center; justify-content: center;
  }
  #main input[type="checkbox"] { min-width: 24px; min-height: 24px; }
  .eyebrow, .tag, .meta-chip, .breakband, .sessionbreak, .callampm,
  .text-xs, .text-\[10px\] { font-size: 12px !important; }
  .matrix th, .dancetab th { font-size: 12px !important; }
  .matrix-scroll-hint { display: block; }
  /* Names inside a sentence or list stay inline text, not tap tiles. */
  #main :is(p, .number-call, .friends-next li, .floor-heat-couples li) a:not(.btn) {
    display: inline; min-height: 0; min-width: 0;
  }
  .heat-floor-summary { justify-content: flex-start; min-height: 36px; }
  .heat-floor-summary::after { content: "▸" / ""; }
  .heat-floor[open] > .heat-floor-summary::after { content: "▾" / ""; }
  /* Denser running order: more calls per screen. */
  .callrow { grid-template-columns: 58px 1fr; gap: 10px; padding: 10px 6px 10px 8px; }
  .calltime { font-size: 16px; }
  .breakband { padding-left: 70px; }
  .hub-countdown { font-size: 40px; }
  .floor-heat-summary { grid-template-columns: 70px minmax(0, 1fr); gap: 6px; padding: 8px 10px; }
  .floor-heat-couples { padding-left: 14px; }
}

/* ==========================================================================
   Print — a purpose-built floor call sheet, not a screenshot of the screen.
   ========================================================================== */
@media screen { .print-sheet { display: none; } }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0; }
  .sheet { display: block; }
  #main { padding: 0; max-width: none; }
  .print-sheet { display: block; font-family: "Inter", sans-serif; }
  .ps-layout { width: 100%; border-collapse: collapse; }
  .ps-layout > tbody > tr > td, .ps-layout > tfoot > tr > td { padding: 0; }
  .ps-masthead { border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
  .ps-kicker { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
  .ps-title { font-family: "Fraunces", serif; font-size: 26px; font-weight: 600; line-height: 1.05; }
  .ps-meta { font-size: 12px; }
  .ps-dancers { font-size: 12px; margin-top: 4px; }
  .ps-scope { font-size: 11px; margin-top: 2px; font-style: italic; }
  .ps-count { font-size: 11px; margin-top: 2px; font-weight: 600; }
  .ps-day { font-weight: 600; font-size: 14px; margin: 14px 0 4px; border-bottom: 1px solid #000; }
  .ps-day.brk { break-before: page; }
  .ps-session {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 7px; font-size: 11px; break-after: avoid; page-break-after: avoid;
  }
  .ps-session span { color: #444; font-weight: 400; }
  .ps-session-break {
    margin-top: 7px; padding: 2px 6px; text-align: center; font-size: 10px;
    font-style: italic; color: #444; background: #eee;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ps-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
  .ps-table th:nth-child(1), .ps-table td:nth-child(1) { width: 9%; }
  .ps-table th:nth-child(2), .ps-table td:nth-child(2) { width: 6%; }
  .ps-table th:nth-child(3), .ps-table td:nth-child(3) { width: 41%; }
  .ps-table th:nth-child(4), .ps-table td:nth-child(4) { width: 8%; }
  .ps-table th:nth-child(5), .ps-table td:nth-child(5) { width: 36%; }
  .ps-table th { text-align: left; border-bottom: 1.5px solid #000; padding: 3px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
  .ps-table td { border-bottom: 1px solid #ccc; padding: 4px 6px; vertical-align: top; }
  .ps-table tr {
    break-inside: avoid; page-break-inside: avoid;
  }
  .ps-day, .ps-session, .ps-table thead {
    break-after: avoid; page-break-after: avoid;
  }
  .ps-time { font-family: "JetBrains Mono", monospace; font-weight: 700; white-space: nowrap; }
  /* Break / partner-change divider line between calls; keep it legible without print backgrounds. */
  .ps-note td {
    text-align: center; font-size: 10px; font-style: italic; color: #333;
    padding: 3px 6px; border-top: 1px solid #888; border-bottom: 1px solid #ccc;
    background: #fff;
  }
  /* Subtle shading to visually group a run of consecutive calls */
  .ps-shade td { background: #f1f1f1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-you { font-weight: 700; }
  .ps-partner { color: #333; }
  .ps-event { white-space: normal; }
  .ps-couple { white-space: nowrap; font-size: 11px; }
  /* The number badge takes width from a fixed column; let a long partner
     name wrap instead of running past the page margin. */
  .ps-partner { white-space: normal; }
  .ps-bib {
    display: inline-block; min-width: 2.4em; margin-right: 4px; padding: 0 3px;
    border: 1px solid #555; border-radius: 3px; text-align: center;
    font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; font-size: 10px;
  }
  .ps-contested { font-size: 10px; color: #7a4a00; font-weight: 600; }
  .ps-footer {
    display: block; padding-top: 6px; border-top: 1px solid #ccc;
    background: #fff; text-align: center; font-size: 10px; line-height: 1.25;
    color: #444; white-space: nowrap;
  }
  .ps-footer-site { color: inherit; font-weight: 600; text-decoration: none; }
}
