/* ================================================================
   Cursor × Thrad · London 2026
   Dark theme — Thrad-adjacent: lifted zinc surfaces, disciplined orange
   ---------------------------------------------------------------- */

:root {
  /* Surfaces — lifted zinc (Thrad.ai-style: brighter panels, crisp ink) */
  --bg: #0e0e12;
  --bg-subtle: #18181d;
  --bg-tint: #1a1a20;
  --panel: #202026;
  --panel-hover: #28282f;
  --text: #f6f6f8;
  --text-strong: #ffffff;
  --text-secondary: #b9b9c4;
  --muted: #8b8b99;
  --faint: #5e5e6a;
  --border: #34343c;
  --border-subtle: #22222a;

  /* Brand — warm orange ramp (primary CTA + Thrad-adjacent glow) */
  --primary-50: #1c1008;
  --primary-100: #27160d;
  --primary-200: #3d2317;
  --primary-300: #fdba74;
  --primary-400: #fb923c;
  --primary-500: #f97316;
  --primary-600: #ea580c;
  --primary-700: #fb923c;
  --primary-800: #ea580c;
  --primary-900: #c2410c;

  /* Semantic accents */
  --accent: var(--primary-500);
  --accent-deep: var(--primary-900);
  --accent-glow: rgba(249, 115, 22, 0.16);
  --accent-subtle: rgba(249, 115, 22, 0.1);
  --accent-ring: rgba(249, 115, 22, 0.42);

  /* Social preview strip — same orange as primary CTAs */
  --post-accent: var(--primary-500);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 36px;

  --danger: #f87171;
  --danger-subtle: rgba(127, 29, 29, 0.3);
  --danger-ring: rgba(220, 38, 38, 0.5);
  --warn: #fbbf24;
  --warn-subtle: rgba(120, 53, 15, 0.3);
  --warn-ring: rgba(217, 119, 6, 0.5);
  --ok: #34d399;
  --ok-subtle: rgba(20, 83, 45, 0.3);
  --ok-ring: rgba(5, 150, 105, 0.5);

  /* Typography — thrad.ai uses Inter Tight + Fragment Mono (Framer inline CSS) */
  --font-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --font-heading: var(--font-sans);
  --font-script: var(--font-sans);
  --font-serif: var(--font-sans);
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Shadows — pure black with higher alpha for dark surfaces */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5),
    0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -16px rgba(0, 0, 0, 0.6),
    0 8px 16px -8px rgba(0, 0, 0, 0.4);

  /* Sticky site header (~60–88px): lifts hash / in-page scroll targets clear of the bar */
  --site-sticky-header-gutter: clamp(60px, 2.75rem + 2vw, 88px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

/* Desktop: header stays sticky — pad scrollport so #anchors aren’t hidden under it */
@media (min-width: 761px) {
  html {
    scroll-padding-top: var(--site-sticky-header-gutter);
  }
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soft backdrop — flat zinc with one quiet radial wash for depth (no grid) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    1100px 520px at 88% -8%,
    rgba(249, 115, 22, 0.06),
    transparent 60%
  );
  pointer-events: none;
}

/* ---------------- Header ---------------- */
header {
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  position: sticky;
  top: 0;
  /* Above context cards / video compositor layers; below modals (400+) and drawers (500+). */
  z-index: 300;
  isolation: isolate;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-50), var(--panel));
  border: 1px solid var(--primary-200);
  color: var(--primary-700);
  box-shadow: var(--shadow-xs), 0 0 18px var(--accent-glow);
}
/* Header video mark: no chrome — poster reads as the logo until hover/click plays clip */
.brand-mark.brand-mark--video {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: none;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  cursor: pointer;
}
.brand-mark.brand-mark--video:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 3px;
  border-radius: 6px;
}
/* Static cube fallback (poster / img) — warm accent glow */
.brand-mark > img {
  display: block;
  max-height: 100%;
  width: auto;
  filter: drop-shadow(0 0 4px rgba(251, 146, 60, 0.45)) brightness(1.06)
    saturate(1.15);
}

.brand-cursor-video-tint {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  line-height: 0;
}
.brand-cursor-video {
  display: block;
  height: 36px;
  /* Intrinsic sizing / decode can lag behind layout; reserve box from known asset dims (498×544). */
  aspect-ratio: 498 / 544;
  width: auto;
  max-width: min(112px, 32vw);
  object-fit: contain;
  opacity: 1;
  filter: sepia(0.18) saturate(1.2) hue-rotate(-6deg) brightness(0.98);
}
.brand-mark.brand-mark--video.brand-mark--footer .brand-cursor-video-tint {
  height: 14px;
}
.brand-mark.brand-mark--video.brand-mark--footer .brand-cursor-video {
  height: 14px;
  max-width: 48px;
}
.video-smooth {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.brand-subtitle {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  row-gap: 2px;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-location {
  font: inherit;
  color: inherit;
  letter-spacing: 0.06em;
  text-transform: inherit;
}

.brand-subtitle-sep {
  display: inline-block;
  padding: 0 0.32em;
  font: inherit;
  font-weight: 500;
  color: inherit;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  transform: translateY(-0.03em);
  user-select: none;
}

.brand-halkin {
  display: inline-flex;
  align-items: baseline;
  line-height: inherit;
  text-decoration: none;
  border-radius: 6px;
  outline-offset: 2px;
  transition: opacity 0.15s ease;
  font: inherit;
  color: inherit;
  letter-spacing: 0.06em;
  text-transform: inherit;
}
.brand-halkin:any-link {
  color: inherit;
}
.brand-halkin:hover {
  opacity: 0.85;
}
.brand-halkin:focus-visible {
  outline: 2px solid var(--primary-500);
}
.brand-halkin-inner {
  display: inline-flex;
  align-items: baseline;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
  gap: 0;
}
.brand-halkin-place,
.brand-halkin-when {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.brand-halkin-svg {
  display: block;
  height: 13px;
  width: auto;
  max-width: min(78px, 32vw);
}
.brand-halkin-rule {
  fill: var(--muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stats-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.stat-pill span {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-strong);
}

.stat-pill.flagged span {
  color: var(--danger);
}
.stat-pill.clean span {
  color: var(--ok);
}
.stat-pill.loc .loc-value {
  color: var(--primary-800);
}

.stat-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}

.meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ---------------- Context (above tracks) ---------------- */
.context {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-6) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

/* Inside .tracks: horizontal padding comes from the section — don’t double-inset. */
.context.context--in-tracks {
  padding-left: 0;
  padding-right: 0;
}

.context-inner {
  max-width: 720px;
}

.context .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.context-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 0 0 16px;
}

.context-lead {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.context-lead--tight {
  margin-top: 16px;
}

.context-lead strong {
  color: var(--text-strong);
  font-weight: 600;
}

.context-inline-link {
  color: var(--primary-600);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary-600) 45%, transparent);
  text-underline-offset: 2px;
}

.context-inline-link:hover {
  color: var(--primary-500);
}

.context.context--in-tracks .context-inner {
  max-width: 1240px;
}

/* Wider than default 720px so “Why this moment” copy isn’t a narrow column on large viewports. */
.context.context--in-tracks .context-title,
.context.context--in-tracks .context-lead {
  max-width: min(64rem, 100%);
}

.context-strip-wrap {
  margin: 28px -12px 0;
  padding: 0 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-gutter: stable;
}

.context-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 14px;
  width: max-content;
  min-height: 0;
  padding: 4px 12px 14px;
}

/* Thrad-aligned post preview tiles — bright panel, single accent rail */
.context-post-card {
  --context-post-accent: var(--post-accent);
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  width: min(292px, 82vw);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-top: 2px solid var(--context-post-accent);
  background: color-mix(in srgb, var(--panel) 92%, var(--context-post-accent) 5%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    var(--shadow-xs);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.context-post-card:hover,
.context-post-card:focus-visible {
  border-color: color-mix(in srgb, var(--context-post-accent) 35%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--context-post-accent) 22%, transparent),
    0 12px 32px color-mix(in srgb, #000 45%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.context-post-card:focus-visible {
  box-shadow:
    0 0 0 2px var(--accent-ring),
    0 12px 32px color-mix(in srgb, #000 40%, transparent);
}

.context-post-card__media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 132px;
  overflow: hidden;
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  background: color-mix(in srgb, var(--border) 35%, var(--panel));
}

.context-post-card__media:has(.context-post-card__media-video) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.context-post-card__media:has(.context-post-card__media-video) > * {
  grid-area: 1 / 1;
}

.context-post-card__media img.context-post-card__media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 0;
}

.context-post-card__media video.context-post-card__media-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #0a0a0f;
  position: relative;
  z-index: 1;
}

.context-post-card__media:has(img.context-post-card__media-img) .context-post-card__media-fallback {
  display: none;
}

.context-post-card__media:has(video.context-post-card__media-video) .context-post-card__media-fallback {
  display: none;
}

.context-post-card__media-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  box-sizing: border-box;
  text-align: center;
  background:
    radial-gradient(
      ellipse 125% 85% at 12% 18%,
      color-mix(in srgb, var(--context-post-accent) 55%, transparent),
      transparent 58%
    ),
    radial-gradient(
      ellipse 100% 80% at 92% 88%,
      color-mix(in srgb, var(--primary-300) 26%, transparent),
      transparent 52%
    ),
    linear-gradient(
      158deg,
      color-mix(in srgb, #0b0b12 90%, var(--context-post-accent)),
      color-mix(in srgb, #07070e 95%, var(--context-post-accent))
    );
}

.context-post-card__media-fallback-handle {
  max-width: 100%;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  color: color-mix(in srgb, #fff 72%, var(--context-post-accent));
}

.context-post-card__media-fallback-glyph {
  flex: 0 0 auto;
  opacity: 0.78;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.context-post-card__media--playable .context-post-card__play-badge {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.context-post-card__media--playable .context-post-card__play-icon {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}


.context-post-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: var(--space-4) var(--space-4) 0;
}

.context-post-card__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    color-mix(in srgb, #fff 35%, var(--context-post-accent)),
    var(--context-post-accent)
  );
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--context-post-accent) 45%, #000);
}

.context-post-card__handle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--context-post-accent) 82%, #fff);
}

.context-post-card__title {
  margin: 0 0 8px;
  padding: 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.context-post-card__body {
  margin: 0 0 var(--space-3);
  padding: 0 var(--space-4);
  flex: 1 1 auto;
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.context-post-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: auto;
  padding: 10px var(--space-4) var(--space-3);
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, var(--context-post-accent) 12%);
}

.context-post-card__footer-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-secondary) 88%, var(--context-post-accent) 12%);
}

.context-post-card__cta {
  font-size: 0.72rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--primary-300) 70%, #e2e8f0);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--context-post-accent) 50%, transparent);
  text-underline-offset: 2px;
}

.context-post-card__cta:hover,
.context-post-card__cta:focus-visible {
  color: #fff;
  text-decoration-color: var(--context-post-accent);
  outline: none;
}

@media (max-width: 520px) {
  .context-strip-wrap {
    margin-left: -8px;
    margin-right: -8px;
  }

  .context-strip {
    gap: 10px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .context-post-card {
    width: min(280px, 88vw);
  }

  .context-post-card__top {
    padding: 12px 14px 0;
  }

  .context-post-card__title {
    font-size: 0.98rem;
    padding-left: 14px;
    padding-right: 14px;
  }

  .context-post-card__body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .context-post-card__footer {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 10px;
  }
}

/* Context lightbox (above .modal in z-index) */
.context-lightbox {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(4vw, 20px);
  box-sizing: border-box;
}

.context-lightbox[hidden] {
  display: none !important;
}

.context-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #030712 82%, transparent);
  cursor: default;
}

.context-lightbox__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  max-width: min(96vw, 1000px);
  width: 100%;
  max-height: min(90vh, 900px);
  pointer-events: none;
  /* Keeps side nav from painting above the media column if layouts overlap. */
  isolation: isolate;
}

.context-lightbox__shell > * {
  pointer-events: auto;
}

.context-lightbox__nav {
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 95%, #000);
  color: var(--text-strong);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
  align-self: center;
}

.context-lightbox__nav:hover,
.context-lightbox__nav:focus-visible {
  background: var(--panel);
  border-color: var(--primary-500);
  outline: none;
}

.context-lightbox__nav-icon {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 300;
  margin-top: -2px;
}

.context-lightbox__column {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: min(88vh, 900px);
}

.context-lightbox__imgrow {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, #000);
}

.context-lightbox__media-slot {
  pointer-events: auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(46vh, 480px);
  background: #07070e;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
}

.context-lightbox__media-slot > .context-lightbox__video,
.context-lightbox__media-slot > .context-lightbox__still,
.context-lightbox__media-slot > .context-lightbox__embed {
  grid-area: 1 / 1;
}

.context-lightbox__media-slot[hidden] {
  display: none !important;
}

.context-lightbox__video {
  pointer-events: auto;
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(46vh, 480px);
  object-fit: cover;
  object-position: center;
  background: #000;
}

.context-lightbox__video[hidden] {
  display: none !important;
}

.context-lightbox__still {
  pointer-events: auto;
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(46vh, 480px);
  object-fit: contain;
  object-position: center;
  background: #000;
}

.context-lightbox__still[hidden] {
  display: none !important;
}

.context-lightbox__embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(46vh, 480px);
  border: 0;
  background: #07070e;
}

.context-lightbox__embed[hidden] {
  display: none !important;
}

.context-lightbox-preview-card {
  --context-post-accent: var(--post-accent);
  margin: 0;
  padding: 22px 22px 18px;
  background: color-mix(in srgb, var(--panel) 94%, var(--context-post-accent) 4%);
}

.context-lightbox-preview-card__accent {
  height: 2px;
  margin: -22px -22px 18px;
  background: var(--context-post-accent);
  border-radius: 0;
}

.context-lightbox-preview-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.context-lightbox-preview-card__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    color-mix(in srgb, #fff 38%, var(--context-post-accent)),
    var(--context-post-accent)
  );
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--context-post-accent) 48%, #000);
}

.context-lightbox-preview-card__handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--context-post-accent) 88%, #fff);
  letter-spacing: 0.02em;
}

.context-lightbox-preview-card__title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--text-strong);
}

.context-lightbox-preview-card__lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.context-lightbox-preview-card__footer-cap {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, var(--context-post-accent) 14%);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-secondary) 82%, var(--context-post-accent) 18%);
}

.context-lightbox__links {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px 10px;
  padding: 10px 10px 8px 12px;
  max-width: 85%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, #0a0a0a 80%, transparent) 28%,
    color-mix(in srgb, #0a0a0a 90%, transparent) 100%
  );
  border-bottom-left-radius: 10px;
}

.context-lightbox__link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e5e7eb;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary-600) 25%, #111);
  border: 1px solid color-mix(in srgb, var(--primary-500) 40%, #333);
  pointer-events: auto;
}

.context-lightbox__link:hover,
.context-lightbox__link:focus-visible {
  color: #fff;
  border-color: var(--primary-500);
  outline: none;
}

.context-lightbox__link--secondary {
  background: color-mix(in srgb, var(--panel) 90%, #000);
  font-weight: 500;
  border-color: var(--border);
}

.context-lightbox__link[hidden] {
  display: none !important;
}

.context-lightbox__desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 100%;
  padding: 0 4px;
}

@media (max-width: 600px) {
  .context-lightbox__nav {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .context-lightbox__shell {
    flex-wrap: nowrap;
  }
  .context-lightbox__links {
    max-width: 100%;
  }
}

/* ---------------- Tracks hero ---------------- */
.tracks {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-6) var(--space-5);
}

/* Two columns: copy (min 0 for overflow) + QR column sized so QR can match URL line width */
.tracks-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(480px, 40vw));
  align-items: center;
  column-gap: clamp(var(--space-5), 4vw, var(--space-7));
  margin-bottom: var(--space-6);
}

.tracks-header {
  margin-bottom: 0;
  min-width: 0;
}

.site-qr-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: clamp(4px, 0.8vw, 8px);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  width: 100%;
  max-width: min(480px, 100%);
  justify-self: end;
}

.site-qr-link {
  display: block;
  width: 100%;
  line-height: 0;
  border-radius: var(--r-md);
  transition: opacity 0.15s ease;
}

.site-qr-link:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 4px;
}

.site-qr-link:hover {
  opacity: 0.92;
}

.site-qr-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border-radius: var(--r-sm);
}

.site-qr-url {
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  color: var(--muted);
  word-break: break-all;
  width: 100%;
  max-width: none;
  line-height: 1.35;
}

.tracks-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.tracks-title-accent {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary-400);
  display: inline;
  font-size: inherit;
  letter-spacing: -0.025em;
}

.tracks-infra-kicker {
  margin-top: 16px;
  max-width: min(40rem, 100%);
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.9vw, 1.05rem);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--text) 88%, var(--primary-400) 12%);
}

.tracks-sub {
  margin-top: 12px;
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

/* Judge bonus bucket — below main track cards */
.subtracks {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.subtracks-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.subtracks-intro {
  margin: -4px 0 14px;
  max-width: 42rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.subtracks-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* Icon + title in one row: denser, reads like a tile not a poster */
.subtrack-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  margin: 0;
  min-height: 0;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 4%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, transform 0.2s ease;
}

.subtrack-card:hover {
  border-color: color-mix(in srgb, var(--border) 60%, var(--text-secondary));
  background: var(--panel-hover);
}

/* Marks sit in a fixed column; title flexes and wraps */
.subtrack-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

/* Briefcase + Corgi: same row, hairline only between */
.subtrack-logo-wrap--dual {
  max-width: 104px;
  gap: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subtrack-img {
  display: block;
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

.subtrack-img--cursor {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
}

/* Bonus-track logo chip — uniform neutral panel for any partner mark.
   Chip lives on the wrapper so favicons / marks stay readable on one surface. */
.subtrack-logo-wrap:has(.partner-logo--overmind),
.subtrack-logo-wrap:has(.partner-logo--tavily),
.subtrack-logo-wrap:has(.partner-logo--alpic),
.subtrack-logo-wrap:has(.subtrack-img--cursor) {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Alpic asset is full-bleed dark tile — fill chip, no inset padding */
.subtrack-logo-wrap:has(.partner-logo--alpic) {
  padding: 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}

.partner-logo--overmind,
.partner-logo--tavily,
.partner-logo--alpic {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Cookielaw “dark” glyph: draw as a light mark on the neutral chip */
.partner-logo--tavily {
  filter: invert(1) brightness(1.1);
}

/* Non-square PNG + flex: height:auto was ~26px; stretch to 40×40 chip */
.partner-logo--alpic {
  flex: 1 1 100%;
  align-self: stretch;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
}

.subtrack-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 5%, transparent) inset;
}

/* Specter mark — square logo */
.subtrack-logo-wrap:has(.subtrack-img--specter) {
  max-width: 40px;
  margin-inline: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  line-height: 0;
  flex-shrink: 0;
}

.subtrack-img--specter {
  display: block;
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--r-sm);
}

/* Black blossom mark — invert for dark UI */
.subtrack-img--openai {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  filter: invert(1);
  opacity: 0.95;
}

.subtrack-img--briefcase {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}

/* Tall SVG — fix height, let width follow aspect (no squish; asset uses meet) */
.subtrack-img--corgi {
  width: auto;
  height: 32px;
  max-height: 32px;
  max-width: 44px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid color-mix(in srgb, var(--border) 90%, var(--faint));
}

.subtrack-title {
  font-family: var(--font-display);
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-strong);
  flex: 1;
  min-width: 0;
  text-align: left;
  max-width: none;
}

/* Stacked main row + promo sub-card (Cursor, Specter) */
.subtrack-card--with-sub {
  flex-direction: column;
  align-items: stretch;
  align-content: flex-start;
  gap: 10px;
}

.subtrack-card-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.subtrack-sub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  overflow: visible;
  position: relative;
  z-index: 0;
}

/* Tooltip card must stack above sibling bonus tiles (later columns paint on top). */
.subtracks-grid > li.subtrack-card--popover-host.subtrack-card--with-sub {
  position: relative;
  z-index: 50;
}
.subtrack-card:has(.subtrack-info-wrap:hover),
.subtrack-card:has(.subtrack-info-wrap:focus-within),
.subtrack-card:has(.subtrack-info-wrap.subtrack-sdk-open) {
  position: relative;
  z-index: 50;
}

.subtrack-sub-lead {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.subtrack-sub-lead .subtrack-access-link {
  color: color-mix(in srgb, var(--accent) 88%, #fff);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.subtrack-sub-lead .subtrack-access-link:hover {
  color: var(--text-strong);
}

.subtrack-sub-lead--sdk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.subtrack-sub-lead-text {
  flex: 1 1 12ch;
  min-width: 0;
}

.subtrack-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.subtrack-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent));
  background: color-mix(in srgb, var(--panel) 70%, #0f172a);
  color: color-mix(in srgb, var(--accent) 85%, #fff);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.subtrack-info-btn:hover,
.subtrack-info-btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--text-strong);
  transform: scale(1.06);
}

.subtrack-sdk-popover {
  display: none;
  position: fixed;
  z-index: 10000;
  width: min(292px, calc(100vw - 28px));
  max-height: min(72vh, 440px);
  overflow-y: auto;
  padding: 0;
  margin: 0;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--border) 75%, #0f172a);
  background: color-mix(in srgb, #0b1120 94%, var(--panel));
  box-shadow: 0 14px 42px color-mix(in srgb, #000 48%, transparent),
    0 0 0 1px color-mix(in srgb, #fff 5%, transparent) inset;
  -webkit-overflow-scrolling: touch;
}

.subtrack-info-wrap:hover .subtrack-sdk-popover,
.subtrack-info-wrap:focus-within .subtrack-sdk-popover,
.subtrack-info-wrap.subtrack-sdk-open .subtrack-sdk-popover,
.subtrack-sdk-popover.subtrack-sdk-popover--open {
  display: block;
}

.subtrack-sdk-popover__inner {
  padding: 12px 14px 14px;
}

.subtrack-sdk-popover__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.25;
}

.subtrack-sdk-popover__subtitle {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--accent) 88%, #fff);
  letter-spacing: 0.02em;
}

.subtrack-sdk-popover__section-title {
  margin: 10px 0 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-strong);
}

.subtrack-sdk-popover__p {
  margin: 0 0 8px;
  font-size: 0.65rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 450;
}

.subtrack-sdk-popover__p:last-child {
  margin-bottom: 0;
}

.subtrack-sub-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}

a.subtrack-sub-cta {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.subtrack-sub-ctas .subtrack-sub-cta {
  flex: 1 1 calc(50% - 4px);
  min-width: min(100%, 7.5rem);
  width: auto;
}

.track-card {
  position: relative;
  background: color-mix(in srgb, var(--panel) 96%, #fff 2%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--space-6) var(--space-6) var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease,
    border-color 0.18s ease;
  text-align: left;
  width: 100%;
  color: inherit;
}

.track-card:hover {
  border-color: color-mix(in srgb, var(--border) 60%, var(--text-secondary));
  background: color-mix(in srgb, var(--panel) 85%, var(--panel-hover));
}

.track-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.track-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.track-card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  color: var(--primary-800);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
}

.track-card-badge.badge-accent {
  color: var(--primary-300);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--primary-400) 35%, var(--border));
  font-weight: 600;
}

.track-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  margin-bottom: 10px;
}

.track-card-desc {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.track-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  list-style: none;
}

.track-card-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 5px;
}

/* ---------------- Main layout ---------------- */
main {
  position: relative;
  z-index: 0;
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-6) var(--space-7);
}

.panel.full-width {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h2::before {
  content: "";
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--primary-500), var(--primary-800));
  border-radius: 3px;
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-md);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filters label:hover {
  border-color: var(--primary-300);
  color: var(--text-strong);
  background: var(--primary-50);
}

.filters input[type="checkbox"] {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--faint);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--panel);
}

.filters input[type="checkbox"]:checked {
  background: var(--primary-700);
  border-color: var(--primary-700);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8.5 7 12 13 4.5'/%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
}

.sorter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.sorter select {
  background: transparent;
  color: var(--text-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
}

.sorter select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------------- Table ---------------- */
.table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 180px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* Tooltip on headers */
th[data-tooltip] {
  cursor: help;
  position: relative;
}

th[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--text-strong);
  border-radius: var(--r-md);
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

th[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Column widths */
.th-repo {
  width: 22%;
  min-width: 220px;
}
.th-track {
  width: 11%;
  min-width: 120px;
}
.th-partners {
  width: 11%;
  min-width: 120px;
  max-width: 160px;
}
.th-status {
  width: 8%;
  min-width: 100px;
  text-align: center;
}
.th-judge {
  width: 8%;
  text-align: center;
}
.th-num {
  width: 7%;
  text-align: right;
}
.th-flag {
  width: 5%;
  text-align: center;
}
.th-verdict {
  width: 5%;
  text-align: center;
}
.th-ai {
  width: 20%;
  min-width: 200px;
}

.summary-tech-cell {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-secondary);
  max-width: 180px;
}
.summary-tech-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.summary-tech-muted {
  color: var(--muted);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text);
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--primary-50);
}

tbody tr.selected {
  background: var(--primary-50);
  box-shadow: inset 3px 0 0 var(--primary-700);
}

/* Repo cell */
.repo-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.repo-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.92rem;
  letter-spacing: -0.005em;
}

.repo-url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.repo-meta {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.repo-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  margin-left: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--panel);
}

.repo-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.repo-link {
  color: var(--primary-700);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  border-bottom: 1px solid var(--primary-100);
  transition: border-color 0.15s;
}

.repo-link:hover {
  border-color: var(--primary-700);
}

/* Numeric cells */
.num-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.82rem;
  text-align: right;
  display: block;
  color: var(--text);
}

.num-cell.loc-add {
  color: var(--ok);
}
.num-cell.loc-del {
  color: var(--danger);
}

.judge-cell {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
}

.judge-chip {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-md);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-800);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
}

.judge-chip.no-data {
  color: var(--muted);
  background: transparent;
  border: none;
  font-weight: 400;
  font-size: 0.9rem;
}

.judge-score-group {
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
}

.judge-score-val {
  font-weight: 600;
}

.judge-score-denom {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.judge-meta-count {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.judge-meta-count::before {
  content: "·";
  margin-right: 5px;
  color: var(--border-strong, var(--muted));
}

.track-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.track-chip {
  background: var(--primary-50);
  color: var(--primary-800);
  border-color: var(--primary-100);
}

.track-chip--empty {
  background: transparent;
  color: var(--faint);
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
}

.status-chip {
  min-width: 82px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.status-chip--analyzed {
  background: var(--ok-subtle);
  color: var(--ok);
  border-color: var(--ok-ring);
}

.status-chip--pending {
  background: var(--warn-subtle);
  color: var(--warn);
  border-color: var(--warn-ring);
}

/* Flag chips — neutral for "no flag", danger only when actually flagged */
.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

/* "ok" = no flag raised — neutral, not green */
.flag.ok {
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

/* "danger" = flag raised — warm red */
.flag.danger {
  color: var(--danger);
  background: var(--danger-subtle);
  border: 1px solid var(--danger-ring);
}

/* Verdict icon in table */
.verdict-cell {
  text-align: center;
}

.verdict-icon {
  font-size: 1.05rem;
  cursor: help;
  filter: grayscale(0.15);
  transition: transform 0.15s ease;
}

.verdict-icon:hover {
  transform: scale(1.2);
}
.verdict-icon.authentic {
  filter: none;
}
.verdict-icon.suspicious {
  filter: none;
}
.verdict-icon.pending {
  opacity: 0.5;
}
.verdict-icon.neutral {
  opacity: 0.7;
}

/* AI Summary cell */
.ai-preview {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-preview.no-data {
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 0.9rem;
}

/* ---------------- Drawer ---------------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer-overlay.visible {
  opacity: 1;
}
.drawer-overlay.hidden {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 600px;
  max-width: 92vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 501;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.drawer.visible {
  transform: translateX(0);
}
.drawer.hidden {
  display: none;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 2px 10px;
  line-height: 1;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}

.close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-strong);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* AI Section */
.ai-section {
  margin-bottom: 26px;
}

.ai-section h3,
.judge-section h3,
.commits-section h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.ai-output {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.ai-output .verdict {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.82rem;
}

.ai-output .verdict.authentic {
  background: var(--ok-subtle);
  color: var(--ok);
  border: 1px solid var(--ok-ring);
}

.ai-output .verdict.suspicious {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid var(--danger-ring);
}

.judge-section {
  margin-bottom: 20px;
}

.judge-output {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.submission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.submission-item {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.submission-item--block {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.submission-label {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.submission-value {
  color: var(--text-strong);
  font-size: 0.88rem;
  word-break: break-word;
}

.judge-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.judge-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-strong);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.judge-score-pill.highlight {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-800);
}
.judge-score-avg-label {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
}

.judge-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.judge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.judge-row {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.judge-thought {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.55;
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

.metric-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px;
}

.metric-card h4 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-card pre {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 130px;
  overflow: auto;
}

/* Commits section */
.commits-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.commit-count {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 400;
}

.commits-table-wrapper {
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
}

#commits-table {
  font-size: 0.77rem;
}
#commits-table th {
  padding: 9px 11px;
  font-size: 0.6rem;
}
#commits-table td {
  padding: 9px 11px;
}
#commits-table .flag {
  font-size: 0.55rem;
  padding: 2px 5px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.55;
}
.empty-state-hint {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.empty-state-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* Scrollbars — light, briefcase-style */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 65%, var(--border));
  border: 2px solid var(--bg-subtle);
  border-radius: 8px;
  transition: background 0.15s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
::-webkit-scrollbar-corner {
  background: var(--bg-subtle);
}
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 70%, var(--border))
    var(--bg-subtle);
}

/* Focus ring — brand orange, slight offset for dense UIs */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
  border-radius: var(--r-sm);
}

.btn:focus-visible {
  border-radius: var(--r-md);
}

.btn-small:focus-visible {
  border-radius: var(--r-sm);
}

/* ---------------- Skip link + shared utilities ---------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 8px 14px;
  background: var(--primary-800);
  color: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  z-index: 999;
}
.skip-link:focus {
  left: 16px;
}
.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;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary-600);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--primary-400) 35%, transparent);
}
.btn-primary:hover {
  background: var(--primary-500);
}

/* Submit project: loading = disabled + cursor only (no animated border/glow) */
.btn-submit-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11.5rem;
}
.btn-submit-project.is-loading {
  cursor: wait;
  opacity: 0.88;
}
.btn-submit-project.is-loading .btn-submit-label {
  letter-spacing: 0.02em;
}
.btn-ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--border) 50%, var(--text-secondary));
  background: var(--panel-hover);
  color: var(--text-strong);
}
.btn-small {
  height: 30px;
  padding: 0 14px;
  font-size: 0.78rem;
  border-radius: var(--r-pill);
}
.btn-chip {
  height: 30px;
  padding: 0 12px;
  font-size: 0.75rem;
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-chip:hover {
  color: var(--primary-800);
  border-color: var(--primary-200);
}

/* ---------------- Nav ---------------- */
.site-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(12px, 1.2vw, 18px);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.site-nav a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-nav a:hover {
  color: var(--primary-300);
  background: var(--primary-50);
}

/* ---------------- Tracks enhancements ---------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.accent-script {
  font-family: var(--font-script);
  font-weight: 600;
  color: var(--primary-700);
  display: inline-block;
  transform: rotate(-2deg);
}

.tracks-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 6vw, 36px);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.tstat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tstat-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.015em;
}
.tstat-lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 15em;
  line-height: 1.35;
  text-wrap: balance;
}

.track-card-examples {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.track-card-examples li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}
.track-card-examples li::before {
  content: "→";
  color: var(--primary-600);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}

/* ---------------- Section shared ---------------- */
.section-header {
  max-width: 720px;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.section-sub {
  margin-top: 10px;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 580px;
}

/* ---------------- Rubric ---------------- */
.rubric-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 28px 16px;
}
.rubric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
}
.rubric-core,
.rubric-bonus {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 24px 24px 16px;
  box-shadow: var(--shadow-sm);
}
.rubric-core-head,
.rubric-bonus-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.rubric-core-label,
.rubric-bonus-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.rubric-core-total,
.rubric-bonus-total {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary-800);
  letter-spacing: -0.01em;
}
.rubric-criteria {
  list-style: none;
  counter-reset: r;
}
.rubric-criteria li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-subtle);
  counter-increment: r;
}
.rubric-criteria li:last-child {
  border-bottom: none;
}
.rubric-criteria li::before {
  content: "0" counter(r);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.rubric-criterion-body .rubric-criterion-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-strong);
  font-size: 1rem;
  display: block;
  margin-bottom: 2px;
}
.rubric-criterion-body .rubric-criterion-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.rubric-criterion-pts {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  border: 1px solid var(--primary-100);
  white-space: nowrap;
}
.rubric-bonus-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}
.side-quests {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-quests li {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.side-quests .sq-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.side-quests .sq-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.88rem;
  margin-bottom: 2px;
}
.side-quests .sq-blurb {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.side-quests .sq-pts {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  border: 1px solid var(--primary-100);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------------- Prizes ---------------- */
.prizes-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-6) var(--space-4);
}
.prizes-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.prize-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.prize-card:hover {
  border-color: var(--primary-200);
  background: var(--panel-hover);
}
.prize-card--featured {
  grid-column: span 2;
}
.prize-card--slim {
  grid-column: span 3;
}
.prize-card--first {
  border-color: var(--primary-200);
  background: linear-gradient(165deg, var(--primary-50), var(--panel) 65%);
}
.prize-card--first .prize-card-head {
  background: linear-gradient(
      90deg,
      var(--primary-600),
      var(--primary-500) 45%,
      var(--primary-400)
    )
    top / 100% 3px no-repeat,
    var(--bg-subtle);
}
.prize-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 13px;
  margin: 0;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  border-bottom: 1px solid var(--border-subtle);
}
.prize-card--featured .prize-card-head {
  padding: 20px 24px 14px;
}
.prize-rank {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.prize-card--featured .prize-rank {
  color: var(--primary-400);
}
.prize-card--first .prize-rank {
  color: var(--primary-500);
}
.prize-card--first .prize-rank-ord {
  color: color-mix(in srgb, var(--primary-400) 72%, var(--muted));
  opacity: 1;
}
.prize-card:not(.prize-card--first) .prize-rank-ord {
  color: inherit;
  opacity: 0.72;
}
.prize-rank-num {
  font-size: 2.6rem;
}
.prize-card--slim .prize-rank-num {
  font-size: 2rem;
}
.prize-rank-ord {
  margin-left: 0.06em;
  font-size: 0.94em;
  font-weight: 600;
  line-height: 1;
  text-transform: lowercase;
}
.prize-place {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  line-height: 1;
  translate: 0 0.08em;
}
.prize-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  padding: 16px 22px 21px;
}
.prize-card--featured .prize-perks {
  padding: 20px 24px 22px;
}
.prize-card--slim .prize-perks {
  padding-bottom: 20px;
}
.prize-perks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.58;
}
.prize-perks li::before {
  content: "→";
  flex-shrink: 0;
  margin-top: 0.38em;
  line-height: 1;
  color: var(--primary-500);
  font-weight: 600;
}
.prize-perks li strong {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 880px) {
  .prizes-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .prize-card--featured,
  .prize-card--slim {
    grid-column: span 1;
  }
}

/* ---------------- Judges ---------------- */
.judges-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-6) var(--space-4);
}
.judge-grid {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

@media (min-width: 768px) {
  .judge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .judge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

.judge-card {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border: none;
  border-radius: var(--r-pill);
  align-items: center;
  min-height: 0;
  width: 100%;
  height: auto;
  align-self: center;
  transition: background-color 0.18s ease;
  color: inherit;
  text-decoration: none;
  position: relative;
  box-shadow: none;
}

/* LinkedIn pill column: fixed track so trailing pills share one x-alignment (2- vs 3-line bodies). */
.judge-card.judge-card--link,
.judge-dual-col.judge-card--link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 3.25rem;
  align-items: center;
}
.judge-card.judge-card--link {
  gap: var(--space-3);
}
.judge-dual-col.judge-card--link {
  gap: var(--space-3);
}
.judge-grid > li {
  display: flex;
  align-items: center;
  justify-content: stretch;
  min-width: 0;
}
.judge-card:hover {
  background: color-mix(in srgb, var(--panel) 78%, var(--panel-hover));
}
.judge-card--link:hover {
  transform: none;
}
.judge-card--link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.judge-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.judge-linkedin {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  opacity: 0;
  transition: opacity 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  justify-self: end;
}
.judge-card--link:hover .judge-linkedin,
.judge-card--link:focus-visible .judge-linkedin {
  opacity: 1;
}
.judge-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  object-fit: cover;
  background-color: var(--primary-100);
}
.judge-avatar--img {
  border: none;
}
.judge-avatar:has(> img) {
  overflow: hidden;
  padding: 0;
}
.judge-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
img.judge-avatar {
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  padding: 0;
}
.judge-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.94rem;
  display: block;
  line-height: 1.2;
  letter-spacing: -0.005em;
  min-width: 0;
  overflow-wrap: break-word;
}
.judge-role {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 3px;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: break-word;
}
.judge-focus {
  font-family: var(--font-script);
  font-size: 0.95rem;
  color: var(--primary-700);
  display: block;
  margin-top: 3px;
}

.judge-card--dual {
  flex-direction: row;
  align-items: center;
  gap: 0;
  min-height: 0;
  padding: 8px 12px;
}
.judge-dual-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 0 2px 2px;
  border-bottom: 1px solid var(--border-subtle);
}
.judge-dual-shared__org {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-700);
}
.judge-dual-shared__title {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.judge-dual-cols {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
  width: 100%;
}
.judge-dual-divider {
  width: 1px;
  align-self: stretch;
  min-height: 36px;
  margin: 0 6px;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--border-subtle) 18%,
    var(--border-subtle) 82%,
    transparent 100%
  );
}
.judge-card--dual .judge-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.92rem;
}
.judge-dual-col {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-pill);
  padding: 0 2px;
  margin: 0;
}
.judge-dual-col:not(:last-child) {
  border: none;
  padding-right: 4px;
  margin-right: 0;
  padding-bottom: 0;
}
.judge-dual-col .judge-body {
  flex: 1;
  min-width: 0;
}
.judge-dual-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
  line-height: 1.3;
}
.judge-dual-col.judge-card--link:hover .judge-linkedin,
.judge-dual-col.judge-card--link:focus-visible .judge-linkedin {
  opacity: 1;
}
.judge-dual-col.judge-card--link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-ring);
  border-radius: var(--r-pill);
}
@media (max-width: 640px) {
  .judge-card--dual {
    padding: 8px 12px;
  }
  .judge-dual-cols {
    flex-direction: column;
    align-items: stretch;
  }
  .judge-dual-divider {
    width: auto;
    height: 1px;
    align-self: auto;
    min-height: 0;
    margin: 4px 0;
    background: linear-gradient(
      90deg,
      transparent 0%,
      var(--border-subtle) 18%,
      var(--border-subtle) 82%,
      transparent 100%
    );
  }
  .judge-dual-col:not(:last-child) {
    padding-right: 2px;
    padding-bottom: 0;
  }
}

/* ---------------- Panel header refinements ---------------- */
.panel-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.panel-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------------- Drawer extra header actions ---------------- */
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- Modals ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 52%, rgb(0 0 0));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modal-fade 0.15s ease-out;
}
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-card.judge-card,
.modal-card.manager-card {
  width: min(760px, 100%);
}
.modal-card.manager-card {
  /* Organizer cockpit: wide work surface so the submissions table breathes. */
  width: min(1280px, calc(100vw - 32px));
  max-width: min(1280px, calc(100vw - 32px));
}
.manager-submissions-host--full {
  /* Submissions tab body — fill the modal width, no padding around the panel */
  width: 100%;
}
.manager-submissions-host--full .manager-submissions-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.modal-foot--manager {
  justify-content: flex-end;
}
/* Cursor-style live dot for leaderboards header */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-500) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-500) 32%, transparent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-700);
  vertical-align: middle;
}
.live-indicator__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-500, #ff8a3d);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-500) 60%, transparent);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-500) 55%, transparent);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary-500) 0%, transparent);
    opacity: 0.7;
  }
}
.live-indicator[aria-busy="true"] .live-indicator__dot {
  background: var(--primary-700);
}
/* Fork detection chip (NEW / FORK / UNKNOWN) */
.repo-flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.repo-flag-chip--new {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}
.repo-flag-chip--fork {
  color: #fbbf24;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.45);
}
.repo-flag-chip--unknown {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-subtle);
}
.repo-flag-chip--loading {
  color: var(--muted);
  background: transparent;
  border-color: var(--border-subtle);
  opacity: 0.7;
}
/* Admin row actions inside the submissions table */
.row-actions {
  display: inline-flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.row-actions .row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.row-actions .row-action:hover {
  color: var(--text-strong);
  background: var(--panel);
  border-color: var(--border);
}
.row-actions .row-action--danger:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.row-actions .row-action--flagged {
  color: #fbbf24;
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.1);
}
/* Filter checkbox group: forks variant gets a faint amber tint when active */
.manager-submissions-panel .filters .filter-fork:has(input:checked) {
  color: #fbbf24;
}
.manager-submissions-panel .filters {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
/* ============================================================
   Judge workbench (cursor.com-inspired: minimal zinc, single
   disciplined orange accent, mono labels, generous whitespace)
   ============================================================ */
#judge-modal {
  padding: 16px;
}
.judge-workbench {
  position: relative;
  z-index: 1;
  --judge-rail-width: clamp(320px, 30vw, 380px);
  --judge-rail-chrome-line: color-mix(
    in srgb,
    var(--border-subtle) 88%,
    var(--text-strong) 12%
  );
  --judge-rail-tab-indicator: color-mix(
    in srgb,
    var(--text-strong) 58%,
    transparent
  );
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--judge-rail-width);
  gap: 16px;
  width: 100%;
  max-width: min(1280px, 100vw - 32px);
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  min-height: 0;
}
.judge-workbench__primary,
.judge-workbench__rail {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Stage split: demo full-width in primary ---------- */
.judge-stage-split {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}

/* Shared refresh spin keyframe (used by reels refresh button below) */
@keyframes judge-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}
.judge-stage-split__media {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  align-items: stretch;
  height: 100%;
}

/* ---------- Demo reel (portrait embed) ---------- */
.judge-demo-card,
#judge-demo-card {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  border-bottom: none;
  min-height: 0;
  height: 100%;
  /* Reels-style: stop the browser from hijacking the vertical gesture so
     pointerup deltas can drive prev/next. The iframe is a separate document
     and keeps its own touch handling. */
  touch-action: none;
  width: 100%;
  max-width: 100%;
}
.judge-demo-card.is-empty .judge-demo-stage iframe,
.judge-demo-card.is-empty .judge-demo-stage video {
  /* Iframe is hidden in empty state, but keep the rule scoped so reels
     overlay controls (counter, nav, refresh) remain at full opacity. */
  opacity: 0.45;
}
.judge-demo-stage,
#judge-demo-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  max-height: none;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  box-shadow: none;
}
.judge-demo-stage iframe,
.judge-demo-stage video.judge-demo-video {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #000;
  position: relative;
  z-index: 2;
}
.judge-demo-stage video.judge-demo-video {
  object-fit: cover;
  object-position: center;
}
.judge-demo-stage iframe[hidden],
.judge-demo-stage video.judge-demo-video[hidden] {
  display: none !important;
}
.judge-demo-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.judge-demo-fallback__msg {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.judge-demo-fallback__hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============================================================
   Reels-style overlay on the demo stage
   ------------------------------------------------------------
   Layout: counter (top-left), nav column (left middle),
   caption (bottom gradient). Overlay layer is pass-through
   except on its interactive children.
   ============================================================ */
.judge-reels-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.judge-reels-counter {
  position: absolute;
  top: 12px;
  left: 12px;
  pointer-events: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.judge-reels-counter.is-flash {
  animation: judge-reels-counter-flash 320ms ease-out;
}
@keyframes judge-reels-counter-flash {
  from {
    opacity: 0.25;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.judge-reels-nav {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.judge-reels-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    opacity 0.15s ease;
}
.judge-reels-btn > span {
  display: inline-block;
  line-height: 1;
}
.judge-reels-btn:hover {
  background: rgba(0, 0, 0, 0.62);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.judge-reels-btn:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent-ring);
}
.judge-reels-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.judge-reels-btn--refresh {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
  margin-top: 4px;
  opacity: 0.78;
}
.judge-reels-btn--refresh:hover {
  opacity: 1;
}
.judge-reels-btn--refresh.is-loading > span {
  animation: judge-refresh-spin 0.8s linear infinite;
  display: inline-block;
}

.judge-reels-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 38px 18px 14px 54px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  transition: opacity 0.18s ease;
}
.judge-reels-caption.is-hidden {
  opacity: 0;
}
.judge-reels-chips {
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 18px;
}
.judge-reels-chips:empty {
  display: none;
}
.judge-stage-chip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.judge-stage-chip--track {
  color: rgba(255, 255, 255, 0.9);
}
.judge-stage-chip--status-current {
  color: var(--primary-300);
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.36);
}
.judge-stage-chip--status-scored {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}
.judge-reels-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.judge-reels-meta {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}
.judge-demo-card:hover .judge-reels-caption {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}
.judge-workbench__rail:focus-within ~ * .judge-reels-caption,
.judge-workbench__rail:focus-within .judge-reels-caption {
  /* no-op fallback in case of structure changes */
}

/* When the demo card has no entries selected, give the empty fallback
   center stage and pull the nav controls slightly out of the way. */
.judge-demo-card.is-empty .judge-reels-caption {
  opacity: 0;
}
.judge-demo-card.is-empty .judge-reels-nav {
  opacity: 0.78;
}

@media (max-width: 920px) {
  .judge-reels-nav {
    left: 6px;
    gap: 6px;
  }
  .judge-reels-btn {
    width: 34px;
    height: 34px;
  }
  .judge-reels-btn--refresh {
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .judge-reels-counter.is-flash,
  .judge-reels-btn--refresh.is-loading > span,
  .judge-reels-caption {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Rail tabs (Submission | Score) ---------- */
.judge-rail-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  margin: 0 0 10px;
  padding: 0;
  border-bottom: 1px solid var(--judge-rail-chrome-line, var(--border-subtle));
}
.judge-rail-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 7px 10px 8px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--muted) 92%, var(--text-secondary));
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.judge-rail-tab:hover {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-subtle) 55%, transparent);
}
.judge-rail-tab.is-active {
  color: var(--text-strong);
  font-weight: 500;
  border-bottom-color: var(
    --judge-rail-tab-indicator,
    color-mix(in srgb, var(--text-strong) 58%, transparent)
  );
}
.judge-rail-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
  border-radius: var(--r-sm);
}
.judge-rail-panels {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.judge-rail-panel {
  flex: 1 1 0;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.judge-rail-panel.is-active {
  display: flex;
}
.judge-rail-panel[hidden] {
  display: none !important;
}
#judge-rail-panel-score .judge-rail-pin {
  flex: 0 0 auto;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  background: transparent;
}
.judge-rail-scroll--score {
  flex: 1 1 0;
  min-height: 0;
}

/* ---------- Stage tabs ---------- */
.judge-stage-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 22px 0;
  border-bottom: 1px solid var(--border-subtle);
  flex: 0 0 auto;
}
.judge-stage-tabs--rail {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0 0 8px;
  margin: 0;
  border-bottom: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.judge-stage-tabs--rail .judge-stage-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 6px 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.judge-stage-tabs--rail .judge-stage-tab:hover {
  background: var(--bg-subtle);
  color: var(--text-strong);
  border-color: var(--border-subtle);
}
.judge-stage-tabs--rail .judge-stage-tab.is-active {
  background: color-mix(in srgb, var(--primary-500) 12%, var(--bg-subtle));
  color: var(--text-strong);
  font-weight: 600;
  border-color: color-mix(in srgb, var(--primary-500) 28%, var(--border-subtle));
  box-shadow: none;
}
.judge-stage-tabs--rail .judge-stage-tab.is-active::after {
  display: none;
}
.judge-stage-tab {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 10px 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.judge-stage-tab:hover {
  color: var(--text-strong);
}
.judge-stage-tab.is-active {
  color: var(--text-strong);
}
.judge-stage-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--primary-500);
  border-radius: 2px 2px 0 0;
}
.judge-stage-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
  border-radius: var(--r-sm);
}

/* ---------- Stage body / panes ---------- */
.judge-stage-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 8px 4px;
  display: flex;
  flex-direction: column;
}
.judge-stage-body.judge-stage-body--rail {
  flex: 1 1 auto;
  min-height: 120px;
  min-width: 0;
  max-height: none;
  margin: 0;
  padding: 10px 8px 10px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-subtle) 48%, var(--panel));
  border-radius: var(--r-md);
  overflow-y: visible;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.judge-stage-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.judge-stage-pane.is-active {
  display: flex;
}
.judge-stage-pane[hidden] {
  display: none;
}
/* ---------- Overview pane ---------- */
.judge-overview-block .submission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.judge-overview-block .submission-item {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
}
.judge-overview-extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.judge-overview-extra {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.judge-overview-extra p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.judge-overview-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.judge-overview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ---------- Code signal pane ---------- */
.judge-code-signal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.judge-code-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.judge-code-stat {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.judge-code-stat span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.judge-code-stat strong {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.judge-code-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.judge-code-group--empty {
  opacity: 0.85;
}
.judge-code-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.judge-code-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: help;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.judge-code-chip:hover {
  border-color: var(--border);
  background: var(--panel-hover);
  color: var(--text-strong);
}
.judge-code-chip em {
  font-style: normal;
  font-size: 0.6rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.judge-code-chip--tech {
  color: var(--text-strong);
}
.judge-code-chip--flag {
  text-transform: none;
  font-family: var(--font-sans);
  font-size: 0.72rem;
}
.judge-code-chip--warn {
  color: var(--warn);
  border-color: var(--warn-subtle);
  background: var(--warn-subtle);
}
.judge-code-chip--info {
  color: var(--text-secondary);
}
.judge-code-empty {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}
.judge-code-group--empty .judge-rail-mini-label {
  margin-bottom: 2px;
}
.judge-code-group--empty .judge-code-empty {
  font-size: 0.72rem;
}
.judge-code-commits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.judge-code-commits li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
.judge-code-commits code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(249, 115, 22, 0.08);
}
.judge-code-commit-when {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
  white-space: nowrap;
}
.judge-code-raw {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  padding: 8px 10px;
}
.judge-code-raw__summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  list-style-position: inside;
}
.judge-code-raw[open] .judge-code-raw__summary {
  margin-bottom: 8px;
}
.judge-code-raw__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

/* ---------- AI summary pane ---------- */
.judge-side-block {
  min-width: 0;
}
.judge-side-block--ai {
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  word-wrap: break-word;
  color: var(--text);
}

.judge-ai-empty {
  margin: 0;
}

.judge-ai-empty-lead {
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-strong);
}

.judge-ai-empty-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.judge-ai-empty-hint + .judge-ai-empty-hint {
  margin-top: 8px;
}

.judge-ai-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-strong);
}

.judge-inline-code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
}

.judge-side-section-h {
  margin: 14px 0 6px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-mono);
}
.judge-side-section-h:first-child {
  margin-top: 0;
}
.judge-side-repo-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 5px 9px;
  margin: 0 0 8px;
  display: inline-block;
  letter-spacing: 0.02em;
}
.judge-side-metric-pre {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.45;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 220px;
  color: var(--text-secondary);
}
.judge-side-commits-wrap {
  overflow-x: auto;
  max-height: 280px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.judge-side-commits th,
.judge-side-commits td {
  font-size: 0.7rem;
}

/* ---------- Judge rail: narrow sidebar (vertical-first, minimal H-scroll) ---------- */
.judge-workbench__rail .judge-overview-block .submission-grid {
  grid-template-columns: minmax(0, 1fr);
}
.judge-workbench__rail .judge-code-stats {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.judge-workbench__rail .judge-code-raw {
  padding: 6px 8px;
}
.judge-workbench__rail .judge-code-raw__grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.judge-workbench__rail .judge-code-raw__grid .judge-side-metric-pre {
  max-height: 160px;
}
.judge-workbench__rail .judge-rubric-line {
  flex-wrap: wrap;
  row-gap: 4px;
  align-items: flex-start;
}
.judge-workbench__rail .judge-rubric-line strong {
  word-break: break-word;
}
.judge-workbench__rail .judge-rubric-summary {
  flex-wrap: wrap;
  row-gap: 6px;
}
.judge-workbench__rail .judge-rubric-summary__hint {
  white-space: normal;
}
.judge-workbench__rail .judge-side-repo-pill {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.judge-workbench__rail .judge-side-commits-wrap {
  overflow-x: clip;
  max-width: 100%;
}
.judge-workbench__rail .judge-side-commits {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.judge-workbench__rail .judge-side-commits th,
.judge-workbench__rail .judge-side-commits td {
  padding: 4px 5px;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.judge-workbench__rail .judge-side-commits th:nth-child(6),
.judge-workbench__rail .judge-side-commits td:nth-child(6),
.judge-workbench__rail .judge-side-commits th:nth-child(7),
.judge-workbench__rail .judge-side-commits td:nth-child(7),
.judge-workbench__rail .judge-side-commits th:nth-child(8),
.judge-workbench__rail .judge-side-commits td:nth-child(8) {
  display: none;
}
.judge-workbench__rail .judge-side-commits td:nth-child(2) {
  white-space: normal !important;
}
.judge-workbench__rail .judge-side-commits td:nth-child(9) {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-width: none !important;
}
.judge-workbench__rail .judge-side-commits .num-cell {
  font-variant-numeric: tabular-nums;
}
.judge-workbench__rail .judge-rail-score-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.judge-workbench__rail .judge-save-btn {
  align-self: stretch;
  width: 100%;
  min-width: 0;
}
.judge-workbench__rail #judge-score-input {
  width: 100%;
  box-sizing: border-box;
}

/* ---------- Rail (right column) ---------- */
.judge-workbench__rail {
  position: relative;
  padding: 12px 14px 14px;
  gap: 0;
  overflow-x: clip;
  overflow-y: hidden;
  min-width: 0;
}

.judge-rail-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
  overscroll-behavior: contain;
}
.judge-rail-pin {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--border-subtle);
  background: var(--panel);
}

/* Judge rail: vertical-first layout — stage scrolls, score pin always reachable */
.judge-workbench__rail .judge-rail-head {
  flex-shrink: 0;
  margin: -12px -14px 0;
  padding: 12px 16px;
  min-height: 0;
  border-bottom: 1px solid var(--judge-rail-chrome-line, var(--border-subtle));
  background: transparent;
}
.judge-workbench__rail .judge-rail-identity {
  flex: 0 0 auto;
  gap: 0;
  padding: 9px 0 10px;
  max-height: none;
  border-bottom: 1px solid var(--judge-rail-chrome-line, var(--border-subtle));
}
.judge-workbench__rail .judge-rail-identity--compact .judge-rail-identity__row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  max-height: none;
  flex-wrap: nowrap;
}
.judge-workbench__rail .judge-rail-identity__name {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text-strong);
}
.judge-workbench__rail .judge-rail-identity__chip {
  flex: 0 0 auto;
  width: auto;
  max-width: 46%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-subtle) 82%, transparent);
  font-size: 0.625rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.judge-workbench__rail .judge-rail-tabs {
  margin: 0 0 10px;
  padding-top: 2px;
}
.judge-workbench__rail .judge-rail-mini-label {
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}
.judge-workbench__rail .judge-stage-pane {
  gap: 10px;
}
.judge-workbench__rail .judge-side-section-h {
  margin: 10px 0 5px;
  color: color-mix(in srgb, var(--muted) 45%, var(--text-secondary));
}
.judge-workbench__rail .judge-stage-body--rail .empty-state {
  justify-content: center;
  align-items: center;
  padding: clamp(18px, 4vh, 32px) 14px;
  max-width: 19rem;
  margin: 0 auto;
  min-height: min(200px, 32vh);
}
.judge-workbench__rail .judge-stage-body--rail .empty-state-icon {
  font-size: 1.45rem;
  margin-bottom: 8px;
  opacity: 0.65;
}
.judge-workbench__rail
  .judge-stage-body--rail
  .empty-state
  > div:not(.empty-state-icon):not(.empty-state-hint) {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}
.judge-workbench__rail .judge-stage-body--rail .empty-state-hint {
  margin-top: 6px;
  font-size: 0.68rem;
  line-height: 1.45;
  max-width: 17rem;
  color: var(--muted);
}
.judge-workbench__rail .judge-mine-toggle-wrap {
  flex-shrink: 0;
}
.judge-rail-pin .judge-rail-form,
.judge-rail-pin .judge-rail-queue {
  flex-shrink: 0;
}
.judge-workbench__rail .judge-rail-form {
  gap: 6px;
}
.judge-workbench__rail .judge-rail-notes textarea {
  min-height: 64px;
}

.judge-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 32px;
}
.judge-rail-head__label {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  padding-right: 8px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  line-height: 32px;
  white-space: nowrap;
}
.judge-rail-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}
.judge-workbench.is-eagle-open .judge-rail-head {
  visibility: hidden;
  pointer-events: none;
}
.judge-eagle-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 11px;
  width: auto;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 88%, transparent);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.judge-eagle-open-btn__icon {
  display: block;
  flex-shrink: 0;
  opacity: 1;
}
.judge-eagle-open-btn__label {
  white-space: nowrap;
}
.judge-eagle-open-btn:hover,
.judge-eagle-open-btn:focus-visible {
  outline: none;
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--border-subtle) 55%, var(--border));
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text-strong) 6%, transparent);
}
.judge-eagle-open-btn[aria-expanded="true"],
.judge-eagle-open-btn.is-active {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--border-subtle) 35%, var(--text-strong) 18%);
  background: color-mix(in srgb, var(--bg-subtle) 55%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-strong) 8%, transparent);
}
.judge-rail-resize {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  margin-left: -7px;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--border-subtle) 55%, transparent);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.judge-rail-resize::before,
.judge-rail-resize::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 1px;
  height: 22px;
  margin-top: -11px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--text-secondary) 45%, var(--border-subtle));
  opacity: 0.55;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    height 0.15s ease,
    margin-top 0.15s ease;
}
.judge-rail-resize::before {
  left: calc(50% - 2px);
}
.judge-rail-resize::after {
  left: calc(50% + 2px);
}
.judge-rail-resize:hover,
.judge-rail-resize:focus-visible {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}
.judge-rail-resize:hover::before,
.judge-rail-resize:hover::after,
.judge-rail-resize:focus-visible::before,
.judge-rail-resize:focus-visible::after,
.judge-workbench__rail.is-resizing .judge-rail-resize::before,
.judge-workbench__rail.is-resizing .judge-rail-resize::after {
  opacity: 1;
  height: 32px;
  margin-top: -16px;
  background: color-mix(in srgb, var(--accent) 80%, var(--border-subtle));
}
.judge-rail-resize:active,
.judge-workbench__rail.is-resizing .judge-rail-resize {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}
.judge-rail-resize:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: -2px;
}
.judge-workbench.is-rail-resizing,
.judge-workbench.is-rail-resizing * {
  cursor: col-resize !important;
  user-select: none;
}
body.is-judge-rail-resizing {
  cursor: col-resize !important;
}
.judge-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.judge-overview-meta__chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.judge-overview-meta__chip--track {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.judge-overview-meta__chip a {
  color: inherit;
  text-decoration: none;
}
.judge-overview-meta__chip a:hover {
  text-decoration: underline;
}
.judge-rail-score-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}
.judge-rubric-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.judge-rubric-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent));
  background: color-mix(in srgb, var(--panel) 70%, #0f172a);
  color: color-mix(in srgb, var(--accent) 85%, #fff);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.judge-rubric-info-btn:hover,
.judge-rubric-info-btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--text-strong);
  transform: scale(1.06);
}
.judge-rubric-popover {
  width: min(300px, calc(100vw - 28px));
  max-height: min(72vh, 440px);
}
.judge-rubric-popover .judge-rubric-reminder {
  margin-top: 4px;
}
.judge-rubric-popover .judge-rubric-line {
  font-size: 0.74rem;
  line-height: 1.35;
}
.judge-rubric-popover .judge-rubric-line span {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.judge-score-scale-hint {
  display: block;
  min-height: 1.1em;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}
.judge-score-scale-hint:not(:empty) {
  color: color-mix(in srgb, var(--accent) 75%, var(--text-secondary));
}
.judge-coop-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12000;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--panel) 92%, #000);
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  pointer-events: none;
  animation: judge-coop-toast-in 0.22s ease-out;
}
.judge-coop-toast strong {
  color: var(--accent);
  font-weight: 600;
}
@keyframes judge-coop-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.judge-eagle {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 10px;
  background: var(--panel);
  border-radius: var(--r-2xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  min-height: 0;
}
.judge-eagle.hidden {
  display: none !important;
}
.judge-eagle__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 32px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
}
.judge-eagle__head-text {
  min-width: 0;
  flex: 1 1 auto;
}
.judge-eagle__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  line-height: 1.2;
}
.judge-eagle__hint {
  margin: 2px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  flex-shrink: 0;
}
.judge-eagle__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
}
.judge-eagle__table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}
.judge-eagle__table th,
.judge-eagle__table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.judge-eagle__table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0;
}
.judge-eagle__sort-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 100%;
  padding: 6px 10px;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.judge-eagle__sort-btn:hover,
.judge-eagle__sort-btn:focus-visible {
  color: var(--text-strong);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  outline: none;
}
.judge-eagle__table th.is-sorted .judge-eagle__sort-btn {
  color: var(--accent);
}
.judge-eagle__sort {
  display: inline-block;
  width: 0.75em;
  opacity: 0.35;
  font-size: 0.9em;
}
.judge-eagle__sort.is-active {
  opacity: 1;
  color: var(--accent);
}
.judge-eagle__table thead .judge-eagle__project .judge-eagle__sort-btn {
  justify-content: flex-start;
}
.judge-eagle__table .judge-eagle__project {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-strong);
  padding: 0;
}
.judge-eagle__project-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 6px 8px;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.judge-eagle__project-btn:hover,
.judge-eagle__project-btn:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}
.judge-eagle__table thead .judge-eagle__project {
  z-index: 3;
  background: var(--panel);
}
.judge-eagle__table tr.is-current .judge-eagle__project {
  box-shadow: inset 3px 0 0 var(--accent);
}
.judge-eagle__table tr.is-current td {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.judge-eagle__cell--empty {
  color: var(--faint);
}
.judge-eagle__cell--score {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-strong);
}
.judge-eagle__table th.judge-eagle__avg,
.judge-eagle__table td.judge-eagle__cell--avg {
  border-left: 2px solid var(--border-subtle);
}
.judge-eagle__table th.judge-eagle__avg {
  color: var(--muted);
}
.judge-eagle__cell--avg.judge-eagle__cell--score {
  font-weight: 700;
}
.judge-eagle__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.judge-eagle__updated {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}
.judge-rail-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.judge-rail-head .judge-rail-close.close-btn {
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
}
.judge-rail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.judge-rail-close:hover,
.judge-rail-close:focus-visible {
  outline: none;
  color: var(--text-strong);
  background: var(--bg-subtle);
  border-color: transparent;
}
.judge-rail-mini-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.judge-rail-identity {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
.judge-rail-identity--compact {
  max-height: none;
  padding: 8px 0 10px;
}
.judge-rail-identity__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
  min-height: 24px;
}
.judge-rail-identity__name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-strong);
  letter-spacing: -0.015em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.judge-rail-identity__chip {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-subtle) 82%, transparent);
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.2;
}
.judge-rail-identity__chip:empty {
  display: none;
}

/* Rubric — collapsed by default, monochrome until expanded */
.judge-rubric-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  padding: 8px 10px;
}
.judge-rubric-card--side {
  margin: 0;
}
.judge-rubric-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style-position: inside;
}
.judge-rubric-summary > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.judge-rubric-summary__hint {
  color: var(--faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
}
.judge-rubric-card[open] .judge-rubric-summary {
  margin-bottom: 8px;
  color: var(--text-strong);
}
.judge-rubric-total {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.72rem;
  margin-bottom: 6px;
}
.judge-rubric-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.judge-rubric-list--bonus {
  border-top: 1px dashed var(--border-subtle);
  margin-top: 6px;
  padding-top: 6px;
}
.judge-rubric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.judge-rubric-line strong {
  color: var(--text-strong);
  font-family: var(--font-mono);
}

/* Form / score */
.judge-rail-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.judge-rail-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.judge-rail-score-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#judge-score-input {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.01em;
  height: 44px;
  padding: 0 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-strong);
}
#judge-score-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.judge-save-btn {
  align-self: end;
  height: 44px;
  min-width: 88px;
  padding: 0 18px;
  border-radius: var(--r-md);
  box-shadow: none;
  font-weight: 600;
  font-size: 0.88rem;
}
.judge-save-btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}
.judge-save-status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  min-height: 14px;
}
.judge-save-status.is-saving {
  color: var(--text-secondary);
}
.judge-save-status.is-saved {
  color: var(--ok);
}
.judge-save-status.is-error {
  color: var(--danger);
}
.judge-rail-notes {
  gap: 4px;
}
.judge-rail-notes textarea {
  min-height: 72px;
  background: var(--bg);
  border-color: var(--border-subtle);
  font-size: 0.86rem;
  line-height: 1.45;
}

.judge-mine-toggle-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 6px 8px;
  background: transparent;
}
.judge-mine-toggle-wrap[hidden] {
  display: none;
}
.judge-mine-toggle-summary {
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}
.judge-mine-toggle-summary:hover {
  color: var(--text-strong);
}
.judge-mine-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.judge-mine-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary-500);
  cursor: pointer;
}

/* Queue (always visible — inner list scrolls) */
.judge-rail-queue {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.judge-rail-queue__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.judge-rail-queue__count {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.3;
  text-align: right;
  white-space: normal;
}
.judge-rail-queue__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  padding: 4px;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.judge-rail-queue__list:empty::after {
  content: "Queue is empty.";
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  padding: 8px;
}
.judge-rail-queue__row {
  display: grid;
  grid-template-columns: 22px 12px minmax(0, 1fr);
  align-items: start;
  gap: 6px 8px;
  padding: 8px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  transition: background 0.12s ease, color 0.12s ease,
    transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.judge-rail-queue__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.judge-rail-queue__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.judge-rail-queue__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  min-width: 0;
}
.judge-queue-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  line-height: 1.2;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--panel) 88%, var(--bg-subtle));
  color: var(--muted);
  white-space: nowrap;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.judge-queue-chip.is-scored {
  color: var(--ok);
  border-color: var(--ok-subtle);
  background: var(--ok-subtle);
}
.judge-queue-chip.is-mine {
  color: var(--primary-500);
  border-color: color-mix(in srgb, var(--primary-500) 45%, var(--border-subtle));
  background: var(--accent-subtle);
}
.judge-queue-chip.is-pending {
  color: var(--muted);
  border-color: var(--border-subtle);
  background: transparent;
}
.judge-queue-chip.is-extra {
  font-style: italic;
  max-width: 6.5rem;
}
.judge-queue-chip--more {
  cursor: pointer;
  color: var(--text-secondary);
  border-style: dashed;
  font-variant-numeric: tabular-nums;
  padding-inline: 5px;
}
.judge-queue-chip--more:hover {
  color: var(--text-strong);
  border-color: var(--text-secondary);
  background: var(--panel-hover);
}
.judge-queue-judges-popover {
  display: none;
  position: fixed;
  z-index: 12050;
  width: min(16.5rem, calc(100vw - 24px));
  max-height: min(16rem, calc(100vh - 24px));
  overflow: hidden;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 10px 32px color-mix(in srgb, #000 42%, transparent),
    0 0 0 1px color-mix(in srgb, #fff 4%, transparent) inset;
  pointer-events: none;
}
.judge-queue-judges-popover[hidden] {
  display: none !important;
}
.judge-queue-judges-popover.is-open {
  display: flex;
  pointer-events: auto;
}
.judge-queue-judges-popover__title {
  margin: 0;
  padding: 8px 10px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.judge-queue-judges-popover__list {
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.judge-queue-judges-popover__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 7px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
}
.judge-queue-judges-popover__item.is-pending {
  color: var(--muted);
}
.judge-queue-judges-popover__item.is-scored {
  color: var(--ok);
}
.judge-queue-judges-popover__item.is-mine {
  color: var(--primary-500);
}
.judge-queue-judges-popover__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.judge-queue-judges-popover__score {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.judge-rail-queue__row:hover {
  background: var(--panel-hover);
  color: var(--text-strong);
}
.judge-rail-queue__row.is-active {
  background: var(--panel);
  color: var(--text-strong);
  box-shadow: inset 2px 0 0 var(--primary-500);
}
.judge-rail-queue__idx {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.judge-rail-queue__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--faint);
  margin-top: 5px;
}
.judge-rail-queue__row.is-scored .judge-rail-queue__dot {
  background: var(--ok);
  border-color: var(--ok);
}
.judge-rail-queue__row.is-active .judge-rail-queue__dot {
  background: var(--primary-500);
  border-color: var(--primary-500);
}
.judge-rail-queue__name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  word-break: break-word;
  font-weight: 500;
  line-height: 1.3;
}
.judge-rail-queue__score {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
  text-align: right;
}
.judge-rail-queue__row.is-scored .judge-rail-queue__score {
  color: var(--text-strong);
}
.judge-rail-queue__row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}

.judge-running-total-hidden,
.judge-submission-summary--compact,
.judge-submission-toolbar[aria-hidden="true"],
.judge-quick-recap[hidden] {
  display: none !important;
}
.judge-submission-select--hidden {
  display: none !important;
}

@media (max-width: 920px) {
  #judge-modal {
    padding: 8px;
  }
  .judge-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    max-height: calc(100vh - 16px);
    --judge-rail-width: 100%;
  }
  .judge-workbench__rail {
    max-height: 55vh;
    overflow-y: hidden;
    overflow-x: clip;
  }
  .judge-rail-resize {
    display: none;
  }
  .judge-rail-scroll,
  .judge-rail-scroll--score {
    max-height: min(28vh, 240px);
  }
  .judge-stage-split {
    padding: 0;
  }
  .judge-stage-body.judge-stage-body--rail {
    margin-left: 0;
    margin-right: 0;
    padding-left: 8px;
    padding-right: 8px;
    min-height: 120px;
  }
}
.manager-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
}
.manager-tab {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 8px 14px;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.manager-tab:hover {
  color: var(--text-strong);
  background: var(--bg-subtle);
}
.manager-tab[aria-selected="true"] {
  color: var(--primary-800);
  background: var(--primary-50);
  border-color: var(--primary-200);
}
.manager-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.manager-tab-panel {
  padding-top: 8px;
}
.manager-section--first {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.manager-dash-divider {
  border: none;
  border-top: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  margin: 18px 0 14px;
  width: 100%;
}
.manager-organizer-below {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 2px;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  margin-top: 4px;
}
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-foot {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.form-help {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 340px;
}
.form-help code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}
.form-help--specter {
  margin: 10px 0 0;
  max-width: none;
}
.score-group .form-help--judge-bonus {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}
.form-help--specter a {
  color: color-mix(in srgb, var(--accent) 88%, #fff);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-help--specter a:hover {
  color: var(--text-strong);
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-strong);
}
.field-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.field-label em {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}
.field input,
.field textarea,
.field select {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-strong);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  gap: 14px;
}
.form-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.track-picker {
  display: flex;
  gap: 8px;
}
.track-pick {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--panel);
  cursor: pointer;
  transition: all 0.15s;
}
.track-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.track-pick:hover {
  border-color: var(--primary-300);
  color: var(--primary-800);
  background: var(--primary-50);
}
.track-pick:has(input:checked) {
  border-color: var(--primary-700);
  background: var(--primary-50);
  color: var(--primary-800);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Technologies-used picker (multi-select checkbox chips) */
.tech-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-picker-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 4px 2px;
}
.tech-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--panel);
  cursor: pointer;
  transition: all 0.15s;
}
.tech-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tech-pick:hover {
  border-color: var(--primary-300);
  color: var(--primary-800);
  background: var(--primary-50);
}
.tech-pick:has(input:checked) {
  border-color: var(--primary-700);
  background: var(--primary-50);
  color: var(--primary-800);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.tech-pick:focus-within {
  outline: 2px solid var(--primary-700);
  outline-offset: 2px;
}

/* Team roster — chip list + add-member drawer (Cursor design-mode inspector vibe) */
.team-roster {
  gap: 8px;
}
.team-roster__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.team-roster__chips:empty {
  display: none;
}
.team-roster__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--panel);
  font-size: 0.84rem;
  color: var(--text-strong);
  max-width: 100%;
}
.team-roster__chip-name {
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14ch;
}
.team-roster__chip-email {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18ch;
}
.team-roster__chip-sep {
  color: var(--border);
}
.team-roster__chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}
.team-roster__chip-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.team-roster__chip-btn:hover {
  background: var(--panel-hover);
  color: var(--text-strong);
}
.team-roster__chip-btn--remove:hover {
  color: var(--danger);
}
.team-roster__empty {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}
.team-roster__chips:not(:empty) + .team-roster__empty {
  display: none;
}
.team-roster__add-wrap {
  position: relative;
}
.team-roster__add {
  align-self: flex-start;
}
.team-roster__drawer {
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 12px;
  display: grid;
  gap: 10px;
  animation: team-roster-slide 0.14s ease-out;
}
@keyframes team-roster-slide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.team-roster__drawer[hidden] {
  display: none;
}
.team-roster__drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
@media (max-width: 540px) {
  .team-roster__drawer-grid {
    grid-template-columns: 1fr;
  }
}
.field--inline {
  gap: 4px;
  font-size: 0.82rem;
}
.field--inline .field-label {
  font-size: 0.65rem;
}
.field--inline input {
  padding: 7px 10px;
  font-size: 0.86rem;
}
.team-roster__drawer-error {
  margin: 0;
  min-height: 1em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--danger);
}
.team-roster__drawer-error:empty {
  display: none;
}
.team-roster__drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Judge overview — structured team block */
.judge-team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.judge-team-member {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-strong);
}
.judge-team-member__name {
  font-weight: 600;
}
.judge-team-member__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}
.judge-team-member__link:hover {
  color: var(--text-strong);
  border-bottom-color: var(--primary-500);
}
.judge-team-member__email {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* Scoring inputs */
.score-group {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px 10px;
  background: var(--bg-subtle);
}
.score-group legend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 8px;
}
.score-group-cap {
  color: var(--primary-700);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.score-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.score-row {
  display: grid;
  grid-template-columns: 1fr 110px 50px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-subtle);
}
.score-row:last-child {
  border-bottom: none;
}
.score-row-name {
  font-size: 0.9rem;
  color: var(--text-strong);
  font-weight: 500;
  line-height: 1.3;
}
.score-row-name small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}
.score-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary-700);
}
.score-row-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-800);
  text-align: right;
  font-size: 0.86rem;
}

.score-running {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.score-running-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.score-running-num {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-800);
  margin-left: 4px;
}

/* Manager panel */
.manager-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
/* Slim KPI grid: 4 large tiles for organizer cockpit (admin focus only). */
.manager-stats--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
@media (max-width: 720px) {
  .manager-stats--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.manager-stats--compact .manager-stat {
  padding: 12px 14px 11px;
  min-width: 0;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}
.manager-stats--compact .manager-stat-num {
  font-size: 1.65rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.1;
}
.manager-stats--compact .manager-stat-lbl {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  line-height: 1.25;
  margin-top: 4px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.manager-stat--accent .manager-stat-num {
  color: var(--primary-700);
}
.manager-stat--danger .manager-stat-num {
  color: var(--danger);
}
.manager-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.manager-stat-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.manager-stat-lbl {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
#panel-mgr-submissions {
  padding-top: 2px;
}
#panel-mgr-submissions .manager-submissions-panel .panel-header {
  padding: 10px 14px;
  flex-wrap: wrap;
  row-gap: 6px;
}
#panel-mgr-submissions .manager-submissions-panel .panel-header h2 {
  font-size: 0.95rem;
}
#panel-mgr-submissions .manager-submissions-panel .panel-header .panel-sub {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.9;
}
#panel-mgr-submissions .manager-submissions-panel .filters label {
  padding: 4px 8px;
  font-size: 0.72rem;
}
#panel-mgr-submissions .manager-submissions-panel .sorter {
  font-size: 0.75rem;
}
#panel-mgr-submissions .manager-section--first h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
#panel-mgr-submissions .manager-section--first .manager-hint {
  font-size: 0.78rem;
  margin-bottom: 8px;
  line-height: 1.4;
}
.manager-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 4px;
}
.manager-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.manager-section h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-700);
  font-weight: 600;
  margin-bottom: 8px;
}
.manager-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}
.leaderboards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.leaderboard ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: lb;
}
.leaderboard li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--panel);
  counter-increment: lb;
  font-size: 0.85rem;
}
.leaderboard li::before {
  content: counter(lb);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
}
.leaderboard li .lb-name {
  color: var(--text-strong);
  font-weight: 500;
}
.leaderboard li .lb-name--link {
  color: var(--primary-700);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
.leaderboard li .lb-name--link:hover {
  color: var(--primary-800);
  border-bottom-color: color-mix(in srgb, var(--primary-700) 40%, transparent);
}
.leaderboard li .lb-score {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-700);
}
.flagged-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
[data-manager-dashboard] .flagged-list {
  max-height: 220px;
  padding: 2px 2px 4px 0;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--border) 70%, transparent) transparent;
}
[data-manager-dashboard] .flagged-list li {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.flagged-list li {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.flagged-list li .flagged-name {
  color: var(--text-strong);
  font-weight: 500;
}
.flagged-list li .flagged-tags {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--danger);
  letter-spacing: 0.05em;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-strong);
}
.footer-halkin {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}
.footer-halkin:hover {
  color: var(--primary-400);
  text-decoration: underline;
}
.footer-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}
.footer-right a {
  color: var(--primary-700);
  text-decoration: none;
  font-weight: 600;
}
.footer-right a:hover {
  text-decoration: underline;
}
.footer-right code {
  font-family: var(--font-mono);
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .site-nav {
    gap: 10px;
  }
  .site-nav a {
    padding: 5px 7px;
    font-size: 0.78rem;
  }
  .rubric-grid {
    grid-template-columns: 1fr;
  }
  .leaderboards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .context {
    padding: 32px 20px 4px;
  }
  .context.context--in-tracks {
    padding-left: 0;
    padding-right: 0;
  }
  .tracks {
    padding: 40px 20px 16px;
  }
  .tracks-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .subtracks-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .stats-inline {
    gap: 4px;
  }
  .stats-inline .stat-pill {
    font-size: 0.68rem;
    padding: 4px 8px;
  }
  .brand-subtitle {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
  }
  .tracks-title-accent {
    display: inline;
    margin-left: 0;
    font-size: inherit;
  }
}

@media (max-width: 520px) {
  .tracks-hero-row {
    grid-template-columns: 1fr;
    row-gap: 24px;
    justify-items: center;
    text-align: center;
  }

  .tracks-header {
    max-width: 100%;
  }

  .tracks-infra-kicker,
  .tracks-sub {
    margin-inline: auto;
  }

  .site-qr-card {
    justify-self: center;
    width: 100%;
    max-width: min(480px, 100%);
  }
}

@media (max-width: 760px) {
  header {
    /* Not sticky on small screens; relative (not static) so z-index still applies. */
    position: relative;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 4px;
    column-gap: 8px;
    max-width: min(100%, 520px);
  }
  .site-nav a {
    padding: 4px 6px;
    font-size: 0.74rem;
  }
  .header-right {
    gap: 6px;
    flex-wrap: wrap;
  }
  .manager-btn {
    display: none;
  }
  .tracks-stats {
    gap: 20px;
    flex-wrap: wrap;
  }
  .form-row.two {
    grid-template-columns: 1fr;
  }
  .rubric-section,
  .prizes-section,
  .judges-section {
    padding: 32px 18px 8px;
  }
  .stats-inline {
    display: none;
  }
  .meta {
    display: none;
  }
  .th-ai {
    display: none;
  }
  td:nth-child(13) {
    display: none;
  }
  .drawer {
    width: 100%;
    max-width: none;
  }
  .submission-grid {
    grid-template-columns: 1fr;
  }
  main {
    padding: 8px 18px 32px;
  }
  .tracks {
    padding: 28px 18px 8px;
  }
  .tracks-title {
    font-size: 1.9rem;
  }
  .subtracks-grid {
    grid-template-columns: 1fr;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-right {
    text-align: left;
  }
  .score-row {
    grid-template-columns: 1fr 70px 40px;
  }
}

/* ---------------- Judge submission inline summary ---------------- */
.field--block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.judge-form-row-top {
  align-items: flex-start;
}
.judge-submission-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-subtle, var(--primary-50));
  border: 1px solid var(--border, var(--primary-100));
  border-radius: var(--r-lg, var(--r-xl));
}
.judge-submission-toolbar:empty {
  display: none;
  padding: 0;
  border: none;
}
.judge-submission-select {
  width: 100%;
  min-width: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.judge-toolbar-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}
.judge-toolbar-empty {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
.judge-submission-summary {
  display: none;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-xl);
  padding: 12px 14px;
  margin: 4px 0 2px;
}
.judge-submission-summary--compact,
.judge-submission-summary--compact.is-visible {
  display: none;
}
.judge-submission-summary.is-visible {
  display: block;
}
.judge-sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.judge-sub-project {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.judge-sub-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.judge-sub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
  font-size: 0.82rem;
}
.judge-sub-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.judge-sub-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  row-gap: 8px;
  font-size: 0.78rem;
}
.judge-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border, var(--primary-100));
  background: var(--panel);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
}
.judge-sub-pill-team {
  text-transform: none;
  font-family: var(--font-sans, inherit);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.judge-sub-pill-track {
  text-transform: none;
  font-family: var(--font-sans, inherit);
  font-size: 0.76rem;
}
.judge-sub-pill-you.is-on {
  color: var(--primary-800);
  border-color: var(--primary-200);
  background: rgba(249, 115, 22, 0.08);
}
.judge-sub-pill-others.is-on {
  color: var(--text-strong);
}
.judge-sub-pill-muted {
  opacity: 0.85;
  font-weight: 500;
}
.judge-sub-links-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.judge-sub-links-inline .judge-sub-dot {
  opacity: 0.45;
  user-select: none;
}
.judge-sub-link-compact {
  font-size: 0.78rem;
  font-weight: 600;
}
.judge-sub-muted {
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------------- Password / auth gate ---------------- */
.modal-card.password-card {
  width: min(420px, 100%);
}

/* ---------------- Toasts (Cursor-inspired: zinc panel, orange accent) ---------------- */
#toast-stack {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 28px));
}
.toast {
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: toast-enter 0.38s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}
@keyframes toast-enter {
  0% {
    opacity: 0;
    transform: translateY(12px) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}
.toast.toast--exit {
  animation: toast-exit 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}
.toast--default {
  background: var(--panel);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.toast--success {
  position: relative;
  border-radius: var(--r-lg);
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}
.toast--success .toast-surface {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 16px 16px;
  border-radius: inherit;
}
.toast--success .toast-check {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  box-shadow: none;
}
.toast--success .toast-check-mark {
  display: block;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 600;
  color: var(--primary-500);
  animation: toast-check-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}
@keyframes toast-check-pop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.toast--success .toast-text {
  min-width: 0;
  text-align: left;
}
.toast--success .toast-title {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text-strong);
  line-height: 1.3;
  margin-bottom: 4px;
  animation: toast-line-reveal 0.4s cubic-bezier(0.2, 0.85, 0.25, 1) 0.04s both;
}
.toast--success .toast-detail {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  animation: toast-line-reveal 0.4s cubic-bezier(0.2, 0.85, 0.25, 1) 0.08s both;
}
.toast--success .toast-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.45;
  animation: toast-line-reveal 0.38s cubic-bezier(0.2, 0.85, 0.25, 1) 0.12s both;
}
@keyframes toast-line-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------- Confetti overlay ---------------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.confetti-layer--active {
  opacity: 1;
}
.confetti-layer--fade {
  opacity: 0;
  transition: opacity 0.65s ease-out;
}
.confetti-piece {
  position: absolute;
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
  animation: confetti-burst 2.75s cubic-bezier(0.18, 0.82, 0.22, 1) forwards;
}
@keyframes confetti-burst {
  0% {
    transform: translate(0, 8px) rotate(0deg) scale(0.35);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.07), calc(var(--dy) * 0.07)) rotate(12deg)
      scale(1.08);
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.75);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
  .toast.toast--exit {
    animation: none;
    opacity: 0;
  }
  .toast--success .toast-check-mark,
  .toast--success .toast-title,
  .toast--success .toast-detail,
  .toast--success .toast-meta {
    animation: none;
  }
  .confetti-piece {
    animation-duration: 0.01ms !important;
  }
}
