/* =====================================================================
   Swingelo — app-shell layout.
   Component visuals live in components.css (generated from ds/ — the single
   source). This file holds only the app shell: header, footer, hero, page
   layout, table/list shells, profile scaffolding, and the responsive rules.
   Load order in index.html: themes.css → components.css → style.css.
   ===================================================================== */

/* Role accents — used ONLY on role chips/labels for dual-role profiles. Never
   on the division ramp (division color stays load-bearing for level). */
:root {
  --role-leader: #5fb0d4;
  --role-follower: #e08fb6;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection {
  background: rgba(255, 106, 61, 0.3);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #2c241b;
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
button {
  font-family: inherit;
  color: inherit;
}
a {
  color: inherit;
}

.bg-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--veil);
  z-index: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4.5vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 24px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.brand-chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  color: var(--bg);
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.search {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 420px;
}
#search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-card);
  border: 1px solid rgba(246, 239, 228, 0.1);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  /* 16px (not 14px) so iOS Safari does NOT auto-zoom the page on focus — the
     zoom triggers for any input below 16px. Keep >=16px; do not lock the
     viewport with maximum-scale/user-scalable (that kills pinch-zoom a11y). */
  font-size: 16px;
  outline: none;
}
#search-input:focus {
  border-color: rgba(255, 106, 61, 0.6);
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  z-index: 50;
}
.search-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

.nav-spacer {
  flex: 1;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-link.active {
  color: var(--ink);
}
.nav-edge {
  color: var(--accent-2);
}
.nav-sep {
  font-size: 13px;
  color: #5b5347;
}

/* ---- layout ---- */
.content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.5vw, 28px) 90px;
}
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4.5vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
}
.footer-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.footer-link:hover {
  text-decoration: underline;
}
.footer-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #5b5347;
  letter-spacing: 0.02em;
}

/* ---- hero ---- */
.hero {
  padding: clamp(28px, 6vw, 46px) 0 clamp(20px, 4vw, 30px);
}
.hero-copy {
  max-width: 640px;
  animation: fadeUp 0.5s ease both;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* stat-tiles grid (tiles themselves are components) */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

/* ---- section bar ---- */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.015em;
  margin: 0;
}
.section-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 5px 0 0;
}

/* ---- panel scaffolding (card itself is a component) ---- */
.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.panel-head-copy {
  max-width: 560px;
}
.panel-note-sm {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 8px 0 0;
}
.empty-note {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---- spotlight layout containers ---- */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.rise-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.rise-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.rise-note {
  font-size: 12.5px;
  color: var(--muted);
}
.rise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

/* ---- leaderboard shell (rows are components) ---- */
.list-card,
.lb-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.lb-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  cursor: default;
}
.lb-more-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.lb-more-count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.lb-more-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--bg-card);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.lb-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* ---- profile scaffolding ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin: 26px 0 22px;
}
.back-link:hover {
  color: var(--ink);
}
.p-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.p-header-main {
  flex: 1;
  min-width: 240px;
}
.p-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.p-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: -0.02em;
  margin: 0;
}
.p-level-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.p-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.synced {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--up);
}
.synced-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
}
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.p-grid-hero {
  margin-top: 24px;
}

/* ---- dual-role: compact role chips (header selector) ----
   One pill per competing role, to the right of the name; the active pill fills
   with the role accent (applied inline per role). Doubles as the [Follower |
   Leader] selector — matches the prototype (Swingelo Redesign.dc.html). */
.p-role-chips {
  flex: none;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  border: 1px solid;
  border-radius: 11px;
  /* 11px vertical padding clears the 44px touch-target minimum (the chips are
     the only role selector on mobile, where they stack). */
  padding: 11px 14px;
  text-align: left;
  transition:
    filter 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.role-pill[aria-pressed="false"]:hover {
  filter: brightness(1.12);
}
.role-pill-abbr {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  width: 32px;
}
.role-pill-pts {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  min-width: 22px;
  text-align: right;
}
.role-pill-level {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.rslt-role-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
}
.both-roles-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 12px;
}
.card-muted {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.muted-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink-2);
}
.stats-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.stats-row {
  display: flex;
  gap: 18px 22px;
  flex-wrap: wrap;
}
.stat-mini-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
}
.stat-mini-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.stats-summary {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ---- results & achievements ---- */
.results-block {
  margin-top: 16px;
}
.rslt-eyebrow {
  margin-bottom: 10px;
}
.rslt-headline {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.rslt-hl-chip {
  width: 78px;
  height: 78px;
  flex: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  border: 2px solid var(--border-2);
}
.rslt-hl-main {
  flex: 1;
  min-width: 200px;
}
.rslt-hl-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.rslt-hl-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 5px;
}
.rslt-hl-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.rslt-hl-tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.rslt-list-card {
  margin-top: 14px;
}
.rslt-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rslt-list-note {
  font-size: 12px;
  color: var(--muted);
}
.rslt-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rslt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
}
.rslt-marker {
  width: 90px;
  flex: none;
  display: flex;
  align-items: center;
}
.rslt-chip {
  min-width: 44px;
  padding: 5px 9px;
  text-align: center;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  border: 1.5px solid transparent;
}
.rslt-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.rslt-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rslt-event {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rslt-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.rslt-date {
  font-size: 12.5px;
  color: var(--muted-2);
}
.rslt-pts {
  width: 88px;
  flex: none;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}
.rslt-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.rslt-foot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  flex: none;
}
/* Folded same-event prelim round, shown under a final when callbacks are expanded. */
.rslt-prelim-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #6b6256;
  margin-top: 1px;
}
/* Callback noise reduction (ADDENDUM 3): the expander + de-emphasized standalone
   callbacks that never led to a final. */
.rslt-cb-toggle {
  margin-top: 10px;
  width: 100%;
  padding: 11px;
  border-radius: 11px;
  cursor: pointer;
  background: rgba(246, 239, 228, 0.03);
  border: 1px dashed var(--border-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.rslt-cb-toggle:hover {
  background: rgba(246, 239, 228, 0.06);
  color: var(--ink-2);
}
.rslt-quiet-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 9px;
}
.rslt-quiet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(246, 239, 228, 0.02);
  opacity: 0.82;
}
.rslt-quiet-row .rslt-event {
  font-size: 13.5px;
  -webkit-line-clamp: 1;
}
@media (max-width: 720px) {
  .rslt-date {
    display: none;
  }
  .rslt-marker {
    width: auto;
  }
  .rslt-pts {
    width: auto;
  }
}

/* ---- where you'll final next ---- */
.wyf-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.wyf-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(70, 199, 192, 0.14);
}
.wyf-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 11px;
  /* 7px vertical padding lands the box at 44px — the touch-target minimum. */
  padding: 7px 13px;
  margin-top: 14px;
}
.wyf-search:focus-within {
  border-color: rgba(255, 106, 61, 0.6);
}
.wyf-search-icon {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted-2);
}
.wyf-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  /* >=16px so iOS Safari does NOT auto-zoom on focus (see #search-input). */
  font-size: 16px;
  padding: 4px 0;
}
.wyf-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 18px 0 11px;
}
.wyf-kicker + .be-list {
  margin-top: 0;
}
.wyf-empty {
  padding: 14px 2px 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- points breakdown ---- */
.pb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.pb-head-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pb-list {
  display: flex;
  flex-direction: column;
}
.pb-row {
  display: grid;
  grid-template-columns: 78px 1fr 130px 56px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.pb-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 5px 0;
  border-radius: 7px;
}
.pb-event {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pb-event-name {
  font-weight: 600;
  font-size: 14.5px;
}
.pb-event-loc {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.pb-date {
  color: var(--muted);
  font-size: 12.5px;
}
.pb-pts {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.pb-more {
  padding: 12px 0 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pb-total {
  border-bottom: none;
  padding-top: 14px;
}
.pb-total-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
}
.pb-total-val {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

/* ---- funnel note + judges grouping (rows are components) ---- */
.card-note {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.jgroup-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 18px 0 9px;
}
.jgroup-label.good {
  color: var(--up);
}
.jgroup-label.bad {
  color: var(--down);
}
.jgroup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.be-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}
.moves {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
}

/* =====================================================================
   Responsive — phones are the priority consumer
   ===================================================================== */
@media (max-width: 680px) {
  .nav-spacer,
  #nav-rankings,
  .nav-sep {
    display: none;
  }
  .stat-tiles {
    grid-template-columns: 1fr 1fr;
  }
  .stat-value {
    font-size: 26px;
  }

  /* leaderboard collapses to Rank / Dancer / Score */
  .lb-row {
    grid-template-columns: 38px 1fr 88px;
  }
  .lb-trend,
  .lb-finals,
  .lb-cb {
    display: none;
  }

  /* points breakdown drops the date column */
  .pb-row {
    grid-template-columns: 58px 1fr 44px;
  }
  .pb-date {
    display: none;
  }

  .panel,
  .card {
    padding: 18px;
  }
  .lb-row,
  .lb-head {
    padding: 12px 16px;
  }
  .points-big {
    font-size: 48px;
  }

  /* Focusing the search lets the input fill the full header width so the
     results dropdown reads in a wider, shorter column. Brand + nav collapse
     to zero width while the field is focused, then return on blur.
     IMPORTANT: collapse via width/opacity, NOT display:none. Removing nodes
     from the render tree while an input gains focus makes iOS Safari drop the
     input's focus (soft keyboard dismisses, so typing/autocomplete + Enter all
     break). Keeping brand/nav rendered but zero-width avoids that. */
  .search {
    transition: max-width 0.18s ease;
  }
  .brand,
  .site-nav {
    min-width: 0;
    overflow: hidden;
    transition:
      max-width 0.18s ease,
      opacity 0.15s ease;
  }
  /* Collapse while the field is focused OR while the results dropdown is open
     (.search-open, toggled in app.js). The latter matters on tap: selecting a
     result blurs the input, and if the collapse keyed only on :focus-within the
     header would reflow and slide the absolutely-positioned dropdown out from
     under the finger before the click lands — so the tap dismissed the results
     instead of opening the profile. Keeping it collapsed holds the dropdown
     still through the tap. */
  .site-header-inner:focus-within,
  .site-header-inner.search-open {
    gap: 0;
  }
  .site-header-inner:focus-within .brand,
  .site-header-inner:focus-within .site-nav,
  .site-header-inner.search-open .brand,
  .site-header-inner.search-open .site-nav {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
  }
  .search:focus-within,
  .site-header-inner.search-open .search {
    max-width: 100%;
  }
}

/* =====================================================================
   Results-card header: title + "Per-judge marks" link on the left, the
   result date span over the note on the right.
   ===================================================================== */
.rslt-head-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.rslt-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.rslt-span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.rslt-marks-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
}
.rslt-marks-link:hover {
  color: var(--ink);
}
.rslt-marks-caret {
  font-size: 14px;
  line-height: 1;
}

/* =====================================================================
   Judge marks view (#/d/<name>/marks): per-event, per-round, per-judge
   calls. Mark colors: called = green (--up), alternate = teal (--accent-2),
   not called = muted + struck through.
   ===================================================================== */
.marks-view {
  max-width: 560px;
}
.marks-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}
.marks-header-main {
  min-width: 0;
}
.marks-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.marks-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.marks-legend-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.marks-legend {
  font-size: 10.5px;
  white-space: nowrap;
}
.mk-called {
  color: var(--up);
}
.mk-alt {
  color: var(--accent-2);
}
.mk-not {
  color: var(--muted-2);
  text-decoration: line-through;
}
.marks-events {
  display: flex;
  flex-direction: column;
}
.marks-event {
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.marks-event-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.marks-event-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  /* Wrap long titles instead of truncating them (they clipped mid-word on
     narrow viewports where the name shared a row with the date badge). */
  overflow-wrap: anywhere;
}
.marks-event-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
}
.marks-round {
  margin-top: 11px;
}
.marks-round-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.marks-round-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
/* The division + role a round belongs to ("· Advanced Leader"), shown inline
   after the round name in normal case so same-event rounds are distinguishable. */
.marks-round-div {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.marks-round-cb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.marks-round-place {
  font-size: 11.5px;
  color: var(--muted-2);
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marks-judges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  line-height: 1.4;
}
.mk {
  font-size: 13px;
}
.mk-altnum {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-2);
}
.marks-foot {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
}
