:root {
  --cream: #f5e8d1;
  --pearl: #fff8ed;
  --sand: #d8bb8c;
  --brass: #c9a24d;
  --bourbon: #8d5628;
  --rosewood: #7d2f20;
  --fig: #3b1714;
  --pine: #234730;
  --pine-soft: #4d7252;
  --forest: #234730;
  --rose: #a0273f;
  --rose-soft: #f6d7de;
  --champagne: #f8efe1;
  --ink: #1f1712;
  --muted: #6d5849;
  --card-shadow: 0 24px 70px rgba(45, 24, 11, 0.16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --guest-race-poster: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(160, 39, 63, 0.18), transparent 18%),
    radial-gradient(circle at 86% 12%, rgba(224, 160, 79, 0.24), transparent 20%),
    linear-gradient(
      180deg,
      #341712 0%,
      #6f2e20 11%,
      #9f2840 16%,
      #d4a54f 20%,
      #f7ead3 28%,
      #fff8ed 100%
    );
  color: var(--ink);
  font-family: Constantia, "Palatino Linotype", "Book Antiqua", serif;
}

body.locked {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 18rem;
  height: 18rem;
  border-radius: 44% 56% 72% 28% / 38% 33% 67% 62%;
  filter: blur(14px);
  z-index: -1;
}

body::before {
  top: 7rem;
  right: -4rem;
  background:
    radial-gradient(circle, rgba(141, 86, 40, 0.18), rgba(141, 86, 40, 0.02)),
    url("assets/bourbon-toast-scene.svg") center / cover no-repeat;
}

body::after {
  bottom: 5rem;
  left: -5rem;
  background:
    radial-gradient(circle, rgba(35, 71, 48, 0.2), rgba(35, 71, 48, 0.03)),
    url("assets/derby-race-scene.svg") center / cover no-repeat;
}

.guest-portal-body {
  background:
    linear-gradient(
      180deg,
      rgba(20, 10, 10, 0.9) 0%,
      rgba(44, 17, 16, 0.76) 9%,
      rgba(108, 30, 34, 0.52) 16%,
      rgba(201, 162, 77, 0.22) 24%,
      rgba(255, 248, 238, 0.92) 39%,
      rgba(255, 251, 244, 0.98) 100%
    ),
    radial-gradient(circle at 14% 10%, rgba(201, 162, 77, 0.26), transparent 22%),
    radial-gradient(circle at 86% 8%, rgba(160, 39, 63, 0.24), transparent 18%),
    radial-gradient(circle at 18% 78%, rgba(35, 71, 48, 0.16), transparent 20%),
    radial-gradient(circle at 82% 72%, rgba(141, 86, 40, 0.12), transparent 24%),
    var(--guest-race-poster) center top / cover no-repeat,
    linear-gradient(180deg, #260d0b 0%, #5c1f1a 14%, #8a2435 21%, #d2a44a 28%, #fff7ec 43%, #fffaf3 100%);
}

.guest-portal-body::before {
  top: 5.75rem;
  right: max(1.15rem, calc((100vw - 1280px) / 2 + 0.4rem));
  width: clamp(18rem, 34vw, 31rem);
  height: clamp(24rem, 42vw, 39rem);
  border-radius: 34px;
  filter: none;
  opacity: 0.88;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.12), rgba(255, 251, 245, 0.02)),
    linear-gradient(180deg, rgba(18, 8, 8, 0.04), rgba(18, 8, 8, 0.42)),
    var(--guest-race-poster) center top / cover no-repeat;
  border: 1px solid rgba(255, 251, 245, 0.34);
  box-shadow:
    0 30px 100px rgba(45, 24, 11, 0.26),
    inset 0 0 0 1px rgba(255, 251, 245, 0.18),
    inset 0 12px 34px rgba(255, 251, 245, 0.08);
}

.guest-portal-body::after {
  bottom: 3rem;
  left: -3rem;
  width: 24rem;
  height: 24rem;
  opacity: 0.64;
  background:
    radial-gradient(circle at 30% 32%, rgba(255, 227, 170, 0.38), transparent 18%),
    radial-gradient(circle at 58% 48%, rgba(160, 39, 63, 0.22), transparent 22%),
    url("assets/derby-race-scene.svg") center / cover no-repeat;
}

.gate-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 11, 8, 0.3);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.gate-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(24, 10, 10, 0.78), rgba(24, 10, 10, 0.42)),
    linear-gradient(140deg, rgba(160, 39, 63, 0.18), rgba(35, 71, 48, 0.1)),
    var(--guest-race-poster) center / cover no-repeat;
  opacity: 1;
}

.gate-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(212, 165, 79, 0.26), transparent 18%),
    radial-gradient(circle at 82% 16%, rgba(160, 39, 63, 0.24), transparent 18%),
    radial-gradient(circle at 50% 85%, rgba(35, 71, 48, 0.16), transparent 24%);
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(36rem, 100%);
  padding: 2.4rem 2.2rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(212, 165, 79, 0.2), transparent 24%),
    radial-gradient(circle at 18% 100%, rgba(160, 39, 63, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 236, 214, 0.95));
  border: 1px solid rgba(255, 251, 245, 0.42);
  border-radius: var(--radius-xl);
  box-shadow:
    0 32px 90px rgba(24, 10, 10, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.gate-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.45rem;
  background: linear-gradient(180deg, var(--rose), var(--brass), var(--pine));
}

.gate-card h2,
.brand-lockup h1,
.hero-copy h2,
.section-heading h3,
.schedule-card h4,
.faq-card h4,
.auth-form h4,
.horse-card h4 {
  margin: 0;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
}

.gate-copy,
.gate-helper,
.hero-text,
.section-copy,
.schedule-card p,
.faq-card p,
.mini-note,
.horse-odds,
label,
.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.house-rules-note {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.1);
  background: rgba(255, 251, 245, 0.78);
}

.house-rules-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.house-rules-note-compact {
  margin-top: 0.35rem;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
  transition: filter 240ms ease, transform 240ms ease;
}

.page-shell.is-locked {
  filter: blur(18px);
  pointer-events: none;
  user-select: none;
}

.topbar,
.hero-grid,
.schedule-section,
.clubhouse-section,
.betting-section,
.faq-section {
  margin-top: 1.25rem;
}

.hero-top-stack {
  margin-top: 1.25rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(255, 248, 237, 0.88), rgba(245, 232, 209, 0.72));
  border: 1px solid rgba(61, 23, 20, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 77, 0.18);
}

.hero-top-stack .topbar {
  margin-top: 0;
}

.betting-window-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
}

.betting-window-banner-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.betting-window-banner .betting-window-helper {
  color: var(--fig);
}

.brand-lockup,
.topbar-actions,
.topbar-userbox,
.recent-head,
.interest-row,
.exposure-row,
.horse-card-top,
.horse-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-lockup {
  justify-content: flex-start;
}

.topbar-actions {
  flex-wrap: wrap;
}

.portal-section-nav {
  justify-content: flex-end;
  gap: 0.55rem;
}

.portal-section-button {
  min-width: 0;
}

.topbar-userbox {
  justify-content: flex-start;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.82);
  border: 1px solid rgba(61, 23, 20, 0.08);
}

.topbar-userbox.avatar-hidden {
  padding-left: 0.6rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f0cf84, var(--bourbon));
  color: var(--fig);
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 2px solid rgba(255, 248, 237, 0.7);
  box-shadow: inset 0 0 0 2px rgba(61, 23, 20, 0.12);
}

.eyebrow,
.panel-label,
.stat-label,
.metric-label,
.horse-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
}

.user-avatar,
.session-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  color: var(--fig);
  font-size: 0.92rem;
  font-weight: 700;
}

.user-avatar {
  min-width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(35, 71, 48, 0.96), rgba(125, 47, 32, 0.92));
  color: var(--pearl);
  letter-spacing: 0.06em;
}

.session-pill {
  border-radius: 999px;
  padding-left: 0.3rem;
  padding-right: 0.7rem;
}

.topbar-link-button,
.auth-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 23, 20, 0.12);
  background: rgba(255, 248, 237, 0.84);
  color: var(--fig);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.topbar-link-button:hover,
.auth-switch:hover {
  transform: translateY(-2px);
}

.topbar-link-button.is-active {
  background: linear-gradient(135deg, var(--pine), var(--fig));
  color: var(--pearl);
  box-shadow: 0 14px 30px rgba(32, 20, 14, 0.16);
}

.topbar-danger-button {
  color: var(--rosewood);
  border-color: rgba(125, 47, 32, 0.18);
  background: rgba(255, 244, 240, 0.92);
}

.topbar-danger-button:hover {
  background: rgba(255, 238, 231, 0.98);
}

.auth-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-switch.is-active {
  background: linear-gradient(135deg, var(--pine), var(--fig));
  color: var(--pearl);
  box-shadow: 0 14px 30px rgba(32, 20, 14, 0.16);
}

.nav-cta,
.button,
.text-button {
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.nav-cta:hover,
.button:hover,
.text-button:hover {
  transform: translateY(-2px);
}

.nav-cta,
.button-primary {
  background: linear-gradient(135deg, var(--pine), var(--fig));
  color: var(--pearl);
  box-shadow: 0 14px 30px rgba(32, 20, 14, 0.25);
}

.button[data-button-state="pending"] {
  background: linear-gradient(135deg, #7b8f88, #5f746d);
  color: #f8f5ef;
  box-shadow: 0 12px 24px rgba(47, 62, 56, 0.18);
}

.button[data-button-state="success"] {
  background: linear-gradient(135deg, #5d8f64, #3f6f4b);
  color: #f7f4eb;
  box-shadow: 0 12px 24px rgba(54, 93, 63, 0.2);
}

.button[data-button-state="error"] {
  background: linear-gradient(135deg, #b16a57, #8f4c3b);
  color: #fff8f1;
  box-shadow: 0 12px 24px rgba(111, 53, 38, 0.2);
}

.button-secondary {
  color: var(--fig);
  background: rgba(255, 248, 237, 0.84);
  border: 1px solid rgba(61, 23, 20, 0.12);
}

.button-card-action {
  color: var(--pine);
  background: rgba(35, 71, 48, 0.08);
  border: 1px solid rgba(35, 71, 48, 0.14);
  box-shadow: 0 10px 18px rgba(35, 71, 48, 0.08);
}

.button-card-action:hover {
  background: rgba(35, 71, 48, 0.14);
  border-color: rgba(35, 71, 48, 0.22);
  box-shadow: 0 12px 22px rgba(35, 71, 48, 0.12);
}

.hero {
  position: relative;
  isolation: isolate;
  padding: 0.5rem 0 2.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 3.5rem;
  border-radius: 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 12% 12%, rgba(201, 162, 77, 0.2), transparent 20%),
    radial-gradient(circle at 84% 18%, rgba(160, 39, 63, 0.16), transparent 22%);
  box-shadow:
    0 26px 80px rgba(45, 24, 11, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  top: 3rem;
  right: 1.5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 248, 237, 0.44), rgba(255, 248, 237, 0));
  filter: blur(10px);
  opacity: 0.78;
  z-index: -1;
}

.betting-section,
.clubhouse-section,
.faq-section {
  scroll-margin-top: 14rem;
}

.hero-grid,
.clubhouse-layout {
  display: grid;
  gap: 1.4rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(18rem, 0.82fr);
  gap: 1.2rem;
  align-items: start;
}

.hero-copy,
.hero-panel,
.schedule-section,
.auth-card,
.faq-section {
  background: rgba(255, 248, 237, 0.82);
  border: 1px solid rgba(61, 23, 20, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

.guest-portal-body .topbar {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(248, 236, 214, 0.78)),
    radial-gradient(circle at 82% 18%, rgba(201, 162, 77, 0.16), transparent 22%);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow:
    0 20px 56px rgba(45, 24, 11, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 0 0 1px rgba(201, 162, 77, 0.12);
}

.guest-portal-body .brand-mark {
  background: radial-gradient(circle at 35% 30%, #f7d891, #b97a24);
  color: #271510;
  box-shadow:
    inset 0 0 0 2px rgba(61, 23, 20, 0.12),
    0 12px 24px rgba(45, 24, 11, 0.12);
}

.guest-portal-body .topbar-link-button {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(61, 23, 20, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.guest-portal-body .topbar-link-button.is-active {
  background: linear-gradient(135deg, #1f4733, #5f231a);
  box-shadow: 0 16px 34px rgba(32, 20, 14, 0.22);
}

.hero-copy {
  padding: 3.2rem;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.95), rgba(246, 233, 209, 0.92)),
    radial-gradient(circle at 88% 16%, rgba(201, 162, 77, 0.18), transparent 22%);
}

.guest-portal-body .hero-copy {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 241, 227, 0.95)),
    radial-gradient(circle at 92% 14%, rgba(201, 162, 77, 0.16), transparent 18%),
    radial-gradient(circle at 84% 82%, rgba(160, 39, 63, 0.08), transparent 22%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 28px 80px rgba(45, 24, 11, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.organizer-hero {
  padding: 0.15rem 0 0.35rem;
}

.organizer-shell-page .reveal,
.organizer-shell-page .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: none;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3.4rem;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, 0), rgba(255, 248, 237, 0.08)),
    repeating-linear-gradient(
      180deg,
      rgba(160, 39, 63, 0.16) 0 16px,
      rgba(255, 255, 255, 0.06) 16px 32px
    );
  opacity: 0.7;
  z-index: 0;
}

.guest-portal-body .hero-copy::before {
  inset: 1.15rem auto 1.15rem 1.15rem;
  width: 0.68rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brass), var(--rose), var(--pine));
  opacity: 0.96;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -2rem;
  width: 13rem;
  height: 13rem;
  background: radial-gradient(circle, rgba(224, 160, 79, 0.36), transparent 70%);
  z-index: 0;
}

.guest-portal-body .hero-copy::after {
  right: -1.2rem;
  bottom: -1.4rem;
  width: 14rem;
  height: 14rem;
  background:
    radial-gradient(circle, rgba(224, 160, 79, 0.28), transparent 56%),
    radial-gradient(circle at 38% 36%, rgba(160, 39, 63, 0.18), transparent 42%);
}

.hero-copy h2 {
  margin-top: 0.65rem;
  max-width: 13ch;
  font-size: clamp(2.2rem, 3.4vw, 3.4rem);
  line-height: 0.95;
  text-wrap: balance;
  color: var(--fig);
}

.hero-copy .hero-text {
  max-width: 40rem;
}

.hero-spotlight {
  display: grid;
  gap: 1rem;
}

.hero-poster-card,
.hero-vibe-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(61, 23, 20, 0.1);
  box-shadow: var(--card-shadow);
}

.hero-poster-card {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(25, 13, 10, 0.02), rgba(25, 13, 10, 0.68)),
    linear-gradient(135deg, rgba(255, 248, 237, 0.08), rgba(255, 248, 237, 0.02));
}

.guest-portal-body .hero-poster-card {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 28px 80px rgba(45, 24, 11, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero-poster-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(35, 71, 48, 0.12), rgba(35, 71, 48, 0)),
    linear-gradient(180deg, rgba(39, 21, 15, 0.02) 0%, rgba(39, 21, 15, 0.74) 100%);
  z-index: 1;
}

.hero-poster-image {
  display: block;
  width: 100%;
  min-height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.03);
}

.hero-poster-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem 1.25rem 1.35rem;
  color: var(--pearl);
}

.hero-poster-copy .eyebrow {
  color: rgba(255, 248, 237, 0.82);
}

.hero-poster-copy h3 {
  margin: 0;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.04;
}

.hero-vibe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.hero-vibe-card {
  display: grid;
  gap: 0.45rem;
  min-height: 8.75rem;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
}

.guest-portal-body .hero-vibe-card,
.guest-portal-body .buzz-tribute-card,
.guest-portal-body .home-guest-notes,
.guest-portal-body .hero-program-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 237, 217, 0.96));
  border-color: rgba(61, 23, 20, 0.08);
  box-shadow: 0 18px 42px rgba(45, 24, 11, 0.1);
}

.guest-portal-body .hero-vibe-card::before,
.guest-portal-body .hero-program-card::before {
  background: linear-gradient(90deg, var(--rose), var(--brass), var(--pine));
}

.guest-portal-body .betting-section,
.guest-portal-body .clubhouse-section,
.guest-portal-body .faq-section,
.guest-portal-body .auth-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 241, 227, 0.95)),
    radial-gradient(circle at 100% 0, rgba(201, 162, 77, 0.12), transparent 20%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 26px 68px rgba(45, 24, 11, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.guest-portal-body .betting-section::before,
.guest-portal-body .clubhouse-section::before,
.guest-portal-body .faq-section::before,
.guest-portal-body .auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--rose), var(--brass), var(--pine));
}

.guest-portal-body #betting-board > .section-heading,
.guest-portal-body .board-summary,
.guest-portal-body .betting-window-banner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 237, 217, 0.95));
  border-color: rgba(61, 23, 20, 0.08);
  box-shadow: 0 18px 42px rgba(45, 24, 11, 0.1);
}

.hero-vibe-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass), rgba(125, 47, 32, 0.82));
}

.hero-vibe-card strong {
  position: relative;
  z-index: 1;
  color: var(--fig);
  font-size: 1rem;
  line-height: 1.4;
}

.buzz-tribute-card {
  display: grid;
  grid-template-columns: minmax(13.5rem, 0.78fr) minmax(0, 1.22fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1.45rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.09);
  background: linear-gradient(135deg, rgba(255, 251, 245, 0.9), rgba(241, 224, 195, 0.94));
  box-shadow: 0 18px 40px rgba(45, 24, 11, 0.12);
}

.buzz-tribute-copy {
  display: grid;
  gap: 0.45rem;
}

.buzz-tribute-copy h3 {
  margin: 0;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.05;
  color: var(--fig);
}

.buzz-tribute-text {
  margin: 0;
  white-space: pre-line;
}

.buzz-portrait-card {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}

.buzz-portrait-frame {
  width: min(100%, 15.5rem);
  aspect-ratio: 4 / 5;
  padding: 0.4rem;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(201, 162, 77, 0.34), rgba(35, 71, 48, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 248, 237, 0.55);
}

.buzz-portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 14px 30px rgba(45, 24, 11, 0.16);
}

.buzz-portrait-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 248, 237, 0.92), rgba(216, 187, 140, 0.52)),
    linear-gradient(180deg, rgba(35, 71, 48, 0.18), rgba(125, 47, 32, 0.16));
  color: var(--fig);
}

.buzz-portrait-placeholder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.8);
  border: 1px solid rgba(61, 23, 20, 0.12);
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.buzz-photo-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-program {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.home-guest-notes {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(245, 232, 209, 0.74));
}

.hero-program-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.hero-program-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-program-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-program-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
  overflow: hidden;
}

.hero-program-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass), rgba(35, 71, 48, 0.78));
}

.hero-program-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(201, 162, 77, 0.24), rgba(141, 86, 40, 0.16));
  color: var(--fig);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.hero-program-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.hero-program-time {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
}

.hero-program-copy strong {
  color: var(--fig);
  font-size: 1rem;
  line-height: 1.22;
}

.hero-panel {
  padding: 2rem;
  display: grid;
  gap: 1rem;
  align-items: start;
  background: linear-gradient(180deg, rgba(39, 21, 15, 0.94), rgba(91, 52, 32, 0.92));
  color: var(--pearl);
}

.hero-panel .panel-label,
.hero-panel .stat-label {
  color: rgba(255, 248, 237, 0.72);
}

.hero-panel .stat-value {
  color: var(--pearl);
}

.hero-stats,
.dashboard-metrics,
.mini-metrics,
.horse-stats,
.faq-grid,
.schedule-grid,
.horse-board {
  display: grid;
  gap: 1rem;
}

.hero-stats {
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
}

.hero-scene-card,
.hero-accent-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid rgba(255, 248, 237, 0.12);
  background: rgba(255, 248, 237, 0.06);
}

.hero-scene-card img,
.hero-accent-card img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-scene-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(39, 21, 15, 0.02), rgba(39, 21, 15, 0.84));
}

.hero-scene-overlay strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  color: var(--pearl);
}

.hero-accent-card {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
}

.hero-accent-card img {
  height: 100%;
  object-fit: cover;
}

.hero-accent-card > div {
  padding: 1rem;
}

.accent-copy {
  margin: 0.35rem 0 0;
  color: rgba(255, 248, 237, 0.76);
  line-height: 1.5;
}

.hero-stats article,
.dashboard-metrics article,
.mini-metrics article,
.schedule-card,
.faq-card,
.horse-card,
.auth-form,
.dashboard-panel {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  position: relative;
  overflow: hidden;
}

.hero-stats article,
.dashboard-metrics article,
.mini-metrics article,
.schedule-card,
.faq-card,
.horse-card,
.auth-form,
.dashboard-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
}

.hero-stats article::before,
.dashboard-metrics article::before,
.mini-metrics article::before,
.schedule-card::before,
.faq-card::before,
.horse-card::before,
.auth-form::before,
.dashboard-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass), rgba(35, 71, 48, 0.78));
}

.stat-value,
.metric-number {
  display: block;
  margin: 0.4rem 0 0;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: 2rem;
  color: var(--fig);
}

.metric-number {
  font-size: 1.85rem;
}

.schedule-section,
.clubhouse-section,
.betting-section,
.faq-section {
  padding: 2rem;
}

.faq-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.schedule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.schedule-card {
  display: flex;
  gap: 1rem;
}

.schedule-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(201, 162, 77, 0.28), rgba(141, 86, 40, 0.18));
  color: var(--fig);
  font-weight: 700;
}

.schedule-time {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: var(--pine);
}

.clubhouse-layout {
  grid-template-columns: minmax(0, 760px);
  align-items: start;
}

.clubhouse-heading {
  margin-bottom: 1.2rem;
}

.auth-card {
  padding: 2rem;
  display: grid;
  gap: 1rem;
}

.account-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.account-session-pill {
  padding-inline: 1rem;
  background: rgba(35, 71, 48, 0.12);
  border: 1px solid rgba(35, 71, 48, 0.08);
}

.auth-helper {
  margin: 0.15rem 0 0;
}

#betting-board > .section-heading {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: rgba(255, 248, 237, 0.88);
  box-shadow: 0 18px 42px rgba(45, 24, 11, 0.1);
}

#betting-board > .section-heading .section-heading-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

#betting-board > .section-heading .section-heading-copy {
  display: grid;
  gap: 0.2rem;
}

#betting-board > .section-heading .section-copy {
  max-width: 44rem;
  color: var(--fig);
}

.section-heading-action {
  flex-shrink: 0;
  min-width: 9.5rem;
  padding: 0.72rem 1rem;
  white-space: nowrap;
}

body.is-reference-viewer-open {
  overflow: hidden;
}

.reference-viewer {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.reference-viewer-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(214, 169, 74, 0.18), transparent 36%),
    rgba(29, 18, 13, 0.68);
  backdrop-filter: blur(14px);
}

.reference-viewer-panel {
  position: relative;
  width: min(68rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 247, 235, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(246, 236, 219, 0.96));
  box-shadow: 0 32px 80px rgba(29, 18, 13, 0.3);
  overflow: hidden;
}

.reference-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.reference-viewer-title-block {
  display: grid;
  gap: 0.2rem;
}

.reference-viewer-title-block h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3.3vw, 2.5rem);
}

.reference-viewer-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.reference-viewer-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.reference-viewer-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(61, 23, 20, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  color: var(--fig);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.reference-viewer-nav:hover,
.reference-viewer-nav:focus-visible,
.reference-viewer-pill:hover,
.reference-viewer-pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(45, 24, 11, 0.12);
  border-color: rgba(61, 23, 20, 0.22);
}

.reference-viewer-figure {
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(61, 23, 20, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 244, 233, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.reference-viewer-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(60vh, 42rem);
  border-radius: 18px;
}

.reference-viewer-details {
  display: grid;
  gap: 0.45rem;
}

.reference-viewer-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
}

.reference-viewer-meta strong {
  font-size: 1.18rem;
}

.reference-viewer-odds {
  color: var(--forest);
  font-weight: 700;
}

.reference-viewer-helper,
.reference-viewer-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.reference-viewer-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-height: 11.5rem;
  padding-right: 0.15rem;
  overflow: auto;
}

.reference-viewer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(61, 23, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  color: var(--fig);
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.reference-viewer-pill.is-active {
  border-color: rgba(34, 69, 46, 0.22);
  background: linear-gradient(135deg, rgba(34, 69, 46, 0.94), rgba(70, 35, 28, 0.92));
  color: var(--pearl);
}

.auth-forms {
  display: grid;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-form-secondary {
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(244, 228, 198, 0.9));
}

.exposure-list {
  display: grid;
  gap: 0.75rem;
}

.dashboard-metrics-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-summary {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
  margin-bottom: 1.15rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.1);
  background: rgba(255, 248, 237, 0.84);
  box-shadow: var(--card-shadow);
}

.board-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.board-summary-copy {
  display: grid;
  gap: 0.25rem;
}

.board-summary-metrics article {
  padding: 0.9rem 1rem;
}

.board-summary-metrics .metric-number {
  margin-top: 0.25rem;
  font-size: 1.55rem;
}

.betting-window-status-card {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(135deg, rgba(35, 71, 48, 0.1), rgba(201, 162, 77, 0.18));
}

.betting-window-value {
  display: block;
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1;
  white-space: nowrap;
}

.betting-window-helper {
  margin: 0;
}

.snapshot-refresh-button {
  flex-shrink: 0;
  min-width: 5.5rem;
  padding: 0.72rem 0.95rem;
}

.organizer-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.organizer-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.organizer-action-status {
  margin-top: 0.9rem;
}

.organizer-summary-copy {
  display: grid;
  gap: 0.35rem;
}

.organizer-summary-title {
  margin: 0;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.02;
  color: var(--fig);
}

.organizer-summary-note {
  max-width: 50rem;
  color: var(--fig);
}

.organizer-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.1rem 0 1rem;
}

.organizer-section-panel {
  scroll-margin-top: 6.5rem;
}

.organizer-section-nav-bottom {
  margin: 1.3rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(61, 23, 20, 0.08);
}

.organizer-section-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: rgba(255, 248, 237, 0.78);
  color: var(--fig);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.organizer-section-button:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 71, 48, 0.24);
}

.organizer-section-button.is-active {
  background: linear-gradient(135deg, rgba(35, 71, 48, 0.96), rgba(125, 47, 32, 0.92));
  color: var(--pearl);
  border-color: rgba(35, 71, 48, 0.18);
}

.snapshot-updated {
  margin: 0;
  color: var(--pine-soft);
  font-size: 0.84rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fig);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(61, 23, 20, 0.14);
  background: rgba(255, 251, 245, 0.8);
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(201, 162, 77, 0.3);
  border-color: rgba(35, 71, 48, 0.45);
}

.is-invalid-field {
  border-color: rgba(125, 47, 32, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(125, 47, 32, 0.12);
  background: rgba(255, 245, 241, 0.98) !important;
}

.horse-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.horse-card {
  display: grid;
  gap: 0;
  padding: 0.18rem;
  overflow: visible;
}

.horse-card.is-expanded {
  z-index: 30;
}

.horse-card-shell {
  display: grid;
  grid-template-columns: minmax(7.15rem, 7.7rem) minmax(0, 1fr);
  gap: 0.38rem;
  align-items: stretch;
  min-height: 10.55rem;
  padding: 0.28rem;
  border-radius: 20px;
  border: 1px solid rgba(61, 23, 20, 0.08);
  background:
    radial-gradient(circle at top right, rgba(214, 169, 74, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 239, 225, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 26px rgba(45, 24, 11, 0.07);
}

.horse-card-silk-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.06rem 0.14rem 0.06rem 0.02rem;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
}

.horse-card-silk-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.28rem;
  background: linear-gradient(90deg, var(--brass), var(--rose), var(--pine));
}

.horse-card-info-panel {
  display: grid;
  align-content: start;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.2rem 0.3rem 0.2rem 0.06rem;
  border-radius: 16px;
  background: transparent;
  color: var(--fig);
}

.horse-card-info-head {
  min-width: 0;
}

.horse-silk-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: min(100%, 6.2rem);
  height: 8.8rem;
  margin-top: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(61, 23, 20, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(249, 241, 229, 0.94));
  box-shadow: 0 8px 18px rgba(45, 24, 11, 0.08);
}

.horse-silk-badge::after {
  display: none;
}

.horse-silk-badge.has-image {
  padding: 0.22rem 0.16rem 0.18rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(247, 237, 223, 0.96));
}

.horse-silk-badge.has-reference-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 237, 223, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(212, 165, 79, 0.12), transparent 36%);
}

.horse-silk-badge.has-reference-card::before {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(61, 23, 20, 0.04);
}

.horse-silk-badge.has-reference-card img {
  position: relative;
  z-index: 1;
}

.horse-silk-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center 82%;
  transform: scale(1.3);
  transform-origin: center;
}

.horse-silk-badge.has-silk-image .horse-silk-image {
  object-fit: contain;
  object-position: center;
  transform: none;
}

.horse-silk-badge.has-reference-card .horse-silk-image {
  object-fit: contain;
  object-position: center top;
  transform: none;
}

.horse-silk-fallback {
  position: relative;
  z-index: 1;
  color: var(--pearl);
  font-family: Consolas, "Aptos Mono", "SFMono-Regular", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.horse-name-wrap {
  position: relative;
  display: grid;
  gap: 0.16rem;
  z-index: 3;
  min-width: 0;
}

.horse-name-wrap.is-open {
  z-index: 60;
}

.horse-name-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.horse-name-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.horse-name-title {
  display: inline-block;
  color: var(--fig);
  font-size: clamp(1.08rem, 1.3vw, 1.42rem);
  line-height: 0.92;
  text-wrap: balance;
}

.horse-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(35, 71, 48, 0.16);
  border-radius: 999px;
  background: rgba(35, 71, 48, 0.08);
  color: var(--pine);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  position: relative;
  z-index: 6;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.horse-info-trigger:hover {
  background: rgba(35, 71, 48, 0.14);
}

.horse-info-trigger:focus-visible {
  outline: 2px solid rgba(35, 71, 48, 0.34);
  outline-offset: 3px;
}

.horse-odds-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  justify-content: center;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(35, 71, 48, 0.14);
  background: rgba(35, 71, 48, 0.08);
  color: var(--pine);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.horse-bio-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 0.5rem);
  z-index: 4;
  width: min(20rem, calc(100vw - 3rem));
  max-width: calc(100vw - 3rem);
  padding: 0.8rem 0.9rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(61, 23, 20, 0.12);
  background:
    radial-gradient(circle at top right, rgba(212, 165, 79, 0.12), transparent 28%),
    linear-gradient(180deg, rgb(255, 252, 248), rgb(246, 235, 216));
  box-shadow:
    0 18px 34px rgba(45, 24, 11, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.horse-bio-popover[hidden] {
  display: none;
}

.horse-name-wrap.is-open .horse-bio-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.horse-bio-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.horse-bio-spacer {
  display: block;
  width: 1.8rem;
  height: 1.8rem;
}

.horse-bio-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 1px solid rgba(61, 23, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--fig);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.horse-bio-close:hover {
  background: rgba(255, 248, 237, 0.98);
}

.horse-bio-close:focus-visible {
  outline: 2px solid rgba(35, 71, 48, 0.35);
  outline-offset: 2px;
}

.horse-bio-label {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--fig);
}

.horse-bio-popover p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.horse-reference-card {
  margin: 0.65rem 0 0.8rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(61, 23, 20, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 20px rgba(45, 24, 11, 0.1);
}

.horse-reference-image {
  display: block;
  width: 100%;
  height: auto;
}

.horse-bio-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.horse-bio-copy-muted {
  color: rgba(75, 58, 43, 0.72);
}

.horse-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  background: rgba(35, 71, 48, 0.12);
  color: var(--pine);
  font-weight: 700;
  font-size: 0.85rem;
}

.horse-odds {
  margin: 0.35rem 0 0;
}

.horse-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.22rem;
}

.horse-stats-hero {
  gap: 0.22rem;
}

.horse-stat {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 2.5rem;
  padding: 0.24rem 0.2rem;
  border-radius: 10px;
  background: rgba(255, 251, 245, 0.88);
  border: 1px solid rgba(61, 23, 20, 0.08);
  text-align: center;
  gap: 0.12rem;
}

.horse-stat-hero {
  background: rgba(255, 252, 248, 0.96);
  border: 1px solid rgba(61, 23, 20, 0.08);
}

.horse-stat span {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}

.horse-stat-hero span {
  color: var(--muted);
}

.horse-stat strong {
  color: var(--fig);
  font-size: 0.88rem;
  font-family: Consolas, "Aptos Mono", "SFMono-Regular", "Courier New", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: 0.01em;
}

.horse-stat-hero strong {
  color: var(--fig);
  font-size: 0.92rem;
}

.bet-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.26rem;
  align-items: center;
}

.bet-form-hero {
  margin-top: 0.48rem;
}

.bet-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.32rem;
  min-height: 2.18rem;
  padding: 0 0.32rem 0 0.46rem;
  border-radius: 11px;
  border: 1px solid rgba(35, 71, 48, 0.14);
  background: rgba(35, 71, 48, 0.08);
  touch-action: manipulation;
}

.bet-input-label {
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.bet-input-control {
  display: grid;
  grid-template-columns: minmax(2.45rem, 1fr) auto;
  align-items: center;
  gap: 0.26rem;
  min-width: 0;
}

.horse-card-info-panel .bet-input-row {
  border-color: rgba(35, 71, 48, 0.14);
  background: rgba(35, 71, 48, 0.08);
}

.bet-input-row:focus-within {
  border-color: rgba(35, 71, 48, 0.24);
  background: rgba(35, 71, 48, 0.12);
}

.bet-input-row input {
  width: 100%;
  min-width: 2.1rem;
  padding: 0.28rem 0.04rem;
  border: none;
  background: transparent;
  border-radius: 0;
  color: var(--fig);
  text-align: right;
  font-weight: 700;
  font-size: 0.96rem;
  font-family: Consolas, "Aptos Mono", "SFMono-Regular", "Courier New", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: 0.01em;
  appearance: textfield;
  -moz-appearance: textfield;
}

.bet-input-row input:focus {
  outline: none;
}

.bet-input-row input::-webkit-outer-spin-button,
.bet-input-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-stepper {
  display: grid;
  gap: 0.1rem;
  flex: 0 0 auto;
  justify-items: center;
}

.bet-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.24rem;
  height: 0.92rem;
  padding: 0;
  border: 1px solid rgba(61, 23, 20, 0.12);
  border-radius: 6px;
  background: rgba(248, 242, 232, 0.96);
  color: var(--pine);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bet-step-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 250, 243, 1);
  border-color: rgba(35, 71, 48, 0.22);
}

.bet-step-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.button-compact {
  min-width: 4.15rem;
  min-height: 2.18rem;
  padding: 0.44rem 0.74rem;
  box-shadow: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.button-compact-icon {
  min-width: 3.5rem;
  padding: 0;
  gap: 0;
  border-radius: 999px;
}

.button-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1;
}

.button-icon-svg svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button:disabled,
.topbar-link-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button:disabled:hover,
.topbar-link-button:disabled:hover {
  transform: none;
}

.organizer-editor-card,
.organizer-breakdown-card {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.1);
  background: rgba(255, 248, 237, 0.84);
  box-shadow: var(--card-shadow);
}

#organizer-breakdown-section > .section-heading {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: rgba(255, 248, 237, 0.88);
  box-shadow: 0 18px 42px rgba(45, 24, 11, 0.1);
}

#organizer-breakdown-section > .section-heading .section-copy {
  color: var(--fig);
}

.organizer-editor-head,
.organizer-breakdown-head,
.organizer-backer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.organizer-editor-head {
  margin-bottom: 1rem;
}

.organizer-editor-card h4,
.organizer-breakdown-card h4 {
  margin: 0;
}

.organizer-horse-list,
.organizer-user-list,
.organizer-breakdown-grid,
.organizer-backer-list {
  display: grid;
  gap: 0.9rem;
}

.organizer-horse-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.organizer-inline-copy {
  margin: 0.35rem 0 0;
}

.organizer-event-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.organizer-tribute-note-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.organizer-tribute-note-field textarea {
  min-height: 7rem;
}

.organizer-betting-quick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.85rem;
  margin-top: 0.95rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(245, 232, 209, 0.92));
}

.organizer-betting-duration-field {
  width: min(18rem, 100%);
}

.organizer-betting-duration-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.organizer-betting-duration-box {
  display: grid;
  gap: 0.35rem;
}

.organizer-betting-duration-box input {
  min-width: 0;
}

.organizer-betting-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-start;
  gap: 0.7rem;
}

.organizer-betting-status-card {
  display: grid;
  gap: 0.4rem;
  flex: 1 1 18rem;
  min-width: min(100%, 18rem);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(135deg, rgba(35, 71, 48, 0.08), rgba(201, 162, 77, 0.16));
}

.organizer-betting-status-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.organizer-betting-status-value {
  display: block;
  margin-top: 0.2rem;
  font-family: "Baskerville Old Face", Garamond, Georgia, serif;
  font-size: 1.3rem;
  color: var(--fig);
}

.organizer-betting-status-helper {
  margin: 0;
}

.organizer-program-head {
  margin-top: 1rem;
}

.organizer-program-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.organizer-program-card {
  position: relative;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
  overflow: hidden;
}

.organizer-program-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass), rgba(35, 71, 48, 0.78));
}

.organizer-program-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.organizer-program-fields {
  display: grid;
  gap: 0.8rem;
}

.organizer-program-details textarea {
  min-height: 6rem;
}

.organizer-bettor-head {
  align-items: end;
}

.organizer-bettor-picker {
  width: min(20rem, 100%);
}

.organizer-bettor-picker select {
  margin-top: 0.45rem;
}

.organizer-bettor-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.organizer-snapshot-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
}

.organizer-snapshot-card {
  gap: 0.7rem;
}

.organizer-horse-row {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
}

.organizer-horse-row.is-hidden-horse {
  border-color: rgba(89, 112, 123, 0.32);
  background:
    linear-gradient(180deg, rgba(244, 248, 250, 0.98), rgba(223, 232, 237, 0.96)),
    linear-gradient(90deg, rgba(89, 112, 123, 0.12), transparent 28%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.organizer-horse-row.is-hidden-horse .horse-label {
  color: #435560;
}

.organizer-horse-row.is-hidden-horse .organizer-hide-button {
  color: #425e70;
}

.organizer-horse-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.organizer-horse-row-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.organizer-horse-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.organizer-horse-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.42fr);
  gap: 0.85rem;
  margin-bottom: 0.8rem;
}

.organizer-order-button {
  min-width: 5.6rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.organizer-hide-button {
  color: var(--pine);
}

.organizer-hidden-horse-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.organizer-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 23, 20, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 232, 209, 0.92));
}

.organizer-user-copy {
  min-width: 0;
}

.organizer-user-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.organizer-username {
  color: var(--pine);
  font-weight: 700;
}

.organizer-user-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.organizer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(35, 71, 48, 0.12);
  color: var(--pine);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.organizer-badge-muted {
  background: rgba(224, 160, 79, 0.18);
  color: var(--fig);
}

.organizer-user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.organizer-user-protected {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.organizer-breakdown-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.organizer-breakdown-total {
  flex-shrink: 0;
  min-width: 6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(35, 71, 48, 0.12);
  color: var(--pine);
  font-weight: 700;
  text-align: center;
}

.organizer-breakdown-metrics {
  display: grid;
  gap: 0.42rem;
  justify-items: stretch;
  flex-shrink: 0;
}

.organizer-backer-list {
  margin-top: 1rem;
}

.organizer-backer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 251, 245, 0.82);
  border: 1px solid rgba(61, 23, 20, 0.08);
}

.organizer-backer-copy,
.organizer-backer-bet-column,
.organizer-backer-payout {
  display: grid;
  gap: 0.12rem;
}

.organizer-backer-name {
  color: var(--fig);
  font-weight: 700;
}

.organizer-backer-bet-column span,
.organizer-backer-payout span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.organizer-backer-bet-column,
.organizer-backer-payout {
  justify-items: end;
  text-align: right;
  flex-shrink: 0;
}

.organizer-backer-bet-column strong,
.organizer-backer-payout strong {
  color: var(--fig);
  font-size: 0.98rem;
  font-family: Consolas, "Aptos Mono", "SFMono-Regular", "Courier New", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
}

.text-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--rosewood);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.status-message {
  min-height: 1.5rem;
  margin: 0;
  color: var(--muted);
}

.organizer-integrity-banner {
  display: block;
  min-height: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(61, 23, 20, 0.1);
  background: rgba(255, 248, 237, 0.88);
}

.status-message:empty {
  display: none;
}

.status-message[data-state="success"] {
  color: var(--pine);
}

.status-message[data-state="error"] {
  color: var(--rosewood);
}

.organizer-integrity-banner[data-state="success"] {
  border-color: rgba(35, 71, 48, 0.18);
  background: rgba(226, 241, 227, 0.95);
}

.organizer-integrity-banner[data-state="error"] {
  border-color: rgba(125, 47, 32, 0.18);
  background: rgba(249, 231, 225, 0.96);
}

.is-hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 600ms ease, transform 600ms ease;
}

@media (max-width: 1100px) {
  .horse-board,
  .organizer-snapshot-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .clubhouse-layout,
  .faq-grid,
  .organizer-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .hero-vibe-grid {
    grid-template-columns: 1fr;
  }

  .organizer-event-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .organizer-program-list {
    grid-template-columns: 1fr;
  }

  .horse-board,
  .organizer-snapshot-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .buzz-tribute-card {
    grid-template-columns: 1fr;
  }

  .guest-portal-body::before {
    top: 6.5rem;
    width: 15.5rem;
    height: 22rem;
    right: -2.75rem;
    opacity: 0.38;
  }

  .guest-portal-body::after {
    width: 18rem;
    height: 18rem;
    left: -4rem;
    bottom: 2rem;
    opacity: 0.42;
  }

  .hero::before {
    inset: 0 0 2.75rem;
    border-radius: 34px;
  }
}

@media (max-width: 820px) {
  .organizer-horse-list,
  .horse-board,
  .organizer-snapshot-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    padding: 2.35rem 2rem 2rem;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
  }

  .topbar,
  .betting-window-banner,
  .organizer-section-nav,
  .auth-switcher,
  .hero-program-head,
  .bet-form,
  .hero-accent-card,
  .hero-stats,
  .board-summary-head,
  .organizer-summary-actions,
  .organizer-section-actions,
  .organizer-user-row,
  .organizer-user-actions,
  .organizer-bettor-head,
  .organizer-event-settings-grid,
  .organizer-betting-quick-bar,
  .organizer-betting-quick-actions,
  .organizer-program-list,
  .organizer-horse-fields,
  .schedule-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .organizer-horse-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #betting-board > .section-heading .section-heading-head {
    flex-direction: column;
    align-items: stretch;
  }

  .horse-board {
    grid-template-columns: 1fr;
  }

  .section-heading-action {
    width: 100%;
    justify-content: center;
  }

  .topbar,
  .hero-copy,
  .hero-panel,
  .schedule-section,
  .clubhouse-section,
  .auth-card,
  .betting-section,
  .faq-section {
    padding: 1.4rem;
  }

  .topbar {
    border-radius: 28px;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .brand-lockup {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    gap: 0.55rem;
  }

  .topbar .nav-cta,
  .topbar .topbar-link-button {
    white-space: nowrap;
    width: 100%;
    justify-content: center;
  }

  .organizer-section-button {
    width: 100%;
  }

  .hero-copy h2 {
    max-width: none;
    font-size: 2.2rem;
    line-height: 0.98;
  }

  .horse-card {
    padding: 0.54rem;
  }

  .horse-card-shell {
    grid-template-columns: minmax(7.45rem, 8.15rem) minmax(0, 1fr);
    gap: 0.68rem;
    min-height: 12.9rem;
  }

  .horse-card-silk-panel {
    min-height: auto;
    padding: 0.34rem 0.28rem 0.28rem 0.08rem;
  }

  .horse-silk-badge {
    width: min(100%, 7.3rem);
    height: 10.9rem;
  }

  .horse-card-info-panel {
    gap: 0.58rem;
    padding: 0.34rem 0.34rem 0.34rem 0;
  }

  .horse-name-heading {
    gap: 0.55rem;
  }

  .horse-name-title {
    font-size: clamp(1.44rem, 5.9vw, 1.78rem);
    line-height: 0.98;
  }

  .horse-info-trigger {
    display: none;
  }

  .horse-bio-popover {
    position: fixed;
    left: 0.4rem;
    right: 0.4rem;
    top: 0.55rem;
    bottom: 0.4rem;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: auto;
    border-radius: 22px;
    padding: 1.02rem 1.02rem 1.08rem;
    transform: translateY(16px);
    z-index: 50;
  }

  .horse-name-wrap.is-open .horse-bio-popover {
    transform: translateY(0);
  }

  .horse-reference-card {
    margin: 0.42rem 0 0.82rem;
    border-radius: 16px;
  }

  .horse-bio-label {
    font-size: 1.05rem;
  }

  .horse-bio-copy,
  .horse-bio-copy-muted {
    font-size: 1rem;
    line-height: 1.55;
  }

  .bet-form-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.84rem;
    align-items: center;
  }

  .bet-input-row {
    min-height: 3.56rem;
    padding: 0 0.72rem 0 0.86rem;
  }

  .bet-input-label {
    font-size: 1.06rem;
  }

  .bet-input-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .bet-input-row input {
    min-width: 2.95rem;
    padding: 0.5rem 0.12rem;
    font-size: 1.28rem;
  }

  .bet-stepper {
    display: none;
  }

  .bet-step-button {
    width: 1.82rem;
    height: 1.28rem;
    font-size: 0.86rem;
    border-radius: 8px;
  }

  .horse-stat {
    min-height: 3.14rem;
    padding: 0.38rem 0.26rem;
  }

  .horse-stat span {
    font-size: 0.6rem;
  }

  .horse-stat strong,
  .horse-stat-hero strong {
    font-size: 1.08rem;
  }

  .button-compact {
    min-width: 5.4rem;
    min-height: 3.56rem;
    padding: 0.7rem 1.04rem;
  }

  .button-compact-icon {
    min-width: 4.2rem;
    padding: 0;
  }

  .reference-viewer-panel {
    width: min(100vw - 0.8rem, 100%);
    max-height: calc(100vh - 0.8rem);
    gap: 0.8rem;
    padding: 0.95rem;
  }

  .reference-viewer-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "figure figure"
      "prev next";
    align-items: stretch;
    gap: 0.62rem;
  }

  .reference-viewer-nav {
    min-height: 3.2rem;
    min-width: 4.6rem;
    padding: 0.78rem 0.86rem;
    font-size: 0.96rem;
  }

  .reference-viewer-figure {
    grid-area: figure;
    padding: 0.55rem;
    border-radius: 18px;
  }

  .reference-viewer-image {
    max-height: min(66vh, 42rem);
  }

  .reference-viewer-nav[data-reference-nav="prev"] {
    grid-area: prev;
    justify-self: stretch;
  }

  .reference-viewer-nav[data-reference-nav="next"] {
    grid-area: next;
    justify-self: stretch;
  }

  .reference-viewer-picker {
    display: none;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 0.7rem, 100%);
  }

  .topbar-actions {
    gap: 0.45rem;
    grid-template-columns: 1fr;
  }

  .guest-portal-body::before {
    width: 11rem;
    height: 15rem;
    right: -2rem;
    opacity: 0.22;
  }

  .guest-portal-body::after {
    width: 14rem;
    height: 14rem;
    left: -4rem;
    bottom: 1.2rem;
    opacity: 0.28;
  }

  .hero::before {
    inset: 0 0 2.2rem;
    border-radius: 28px;
  }

  .hero-poster-copy h3 {
    font-size: 1.4rem;
  }

  .topbar .nav-cta,
  .topbar .topbar-link-button {
    padding: 0.72rem 0.92rem;
    font-size: 0.94rem;
  }

  .topbar,
  .hero-copy,
  .hero-panel,
  .schedule-section,
  .clubhouse-section,
  .auth-card,
  .betting-section,
  .faq-section {
    padding: 1.1rem;
  }

  .hero-program-list,
  .organizer-betting-duration-inputs,
  .organizer-horse-list,
  .horse-board,
  .organizer-snapshot-board,
  .dashboard-metrics-wide,
  .organizer-betting-status-metrics,
  .organizer-bettor-metrics,
  .board-summary-metrics {
    grid-template-columns: 1fr;
  }

  .horse-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .horse-card-top {
    gap: 0.45rem;
  }

  .horse-card-info-panel {
    gap: 0.5rem;
    padding: 0.3rem 0.24rem 0.3rem 0;
  }

  .horse-stat {
    min-height: 3.32rem;
    padding: 0.42rem 0.28rem;
  }

  .horse-stat span {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .horse-stat strong,
  .horse-stat-hero strong {
    font-size: 1.06rem;
  }

  .bet-form-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.76rem;
  }

  .bet-input-row {
    min-height: 3.42rem;
    padding: 0 0.66rem 0 0.8rem;
  }

  .bet-input-label {
    font-size: 1.02rem;
  }

  .bet-input-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .bet-input-row input {
    min-width: 2.75rem;
    padding: 0.48rem 0.1rem;
    font-size: 1.22rem;
  }

  .bet-stepper {
    display: none;
  }

  .button-compact {
    min-width: 5.2rem;
    min-height: 3.42rem;
    padding: 0.7rem 0.92rem;
  }

  .button-compact-icon {
    min-width: 3.95rem;
    padding: 0;
  }

  .horse-bio-popover {
    left: 0.22rem;
    right: 0.22rem;
    top: 0.28rem;
    bottom: 0.22rem;
    max-height: none;
    padding: 0.96rem 0.9rem 1.02rem;
  }

  .horse-card-shell {
    grid-template-columns: minmax(7.1rem, 7.45rem) minmax(0, 1fr);
    gap: 0.62rem;
    min-height: 12.3rem;
  }

  .horse-card-silk-panel {
    padding: 0.28rem 0.24rem 0.22rem 0.06rem;
  }

  .horse-silk-badge {
    width: min(100%, 6.55rem);
    height: 10rem;
  }

  .horse-name-title {
    font-size: 1.4rem;
    line-height: 1;
  }

  .horse-info-trigger {
    display: none;
  }

  .horse-bio-label {
    font-size: 1.08rem;
  }

  .horse-bio-copy,
  .horse-bio-copy-muted {
    font-size: 1rem;
    line-height: 1.58;
  }

  .horse-reference-card {
    margin: 0.38rem 0 0.78rem;
    border-radius: 15px;
  }

  .reference-viewer-panel {
    width: calc(100vw - 0.4rem);
    max-height: calc(100vh - 0.4rem);
    gap: 0.72rem;
    padding: 0.82rem;
    border-radius: 22px;
  }

  .reference-viewer-header {
    gap: 0.72rem;
  }

  .reference-viewer-title-block h3 {
    font-size: clamp(1.42rem, 7vw, 1.8rem);
  }

  .reference-viewer-count,
  .reference-viewer-helper,
  .reference-viewer-empty {
    font-size: 0.96rem;
  }

  .reference-viewer-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "figure figure"
      "prev next";
    align-items: stretch;
    gap: 0.5rem;
  }

  .reference-viewer-nav {
    min-width: 4.2rem;
    min-height: 3.05rem;
    padding: 0.74rem 0.68rem;
    font-size: 0.92rem;
  }

  .reference-viewer-figure {
    grid-area: figure;
    padding: 0.42rem;
    border-radius: 16px;
  }

  .reference-viewer-image {
    max-height: min(72vh, 40rem);
  }

  .reference-viewer-nav[data-reference-nav="prev"] {
    grid-area: prev;
    justify-self: stretch;
  }

  .reference-viewer-nav[data-reference-nav="next"] {
    grid-area: next;
    justify-self: stretch;
  }

  .reference-viewer-picker {
    display: none;
  }
}
