/* SigmaWagering - premium dark / gold theme */
:root {
  --bg: #060608;
  --bg-elevated: #0e0e12;
  --bg-card: #121218;
  --gold: #c5a059;
  --gold-dim: #8a7340;
  --gold-glow: rgba(197, 160, 89, 0.35);
  --gold-star: #f59e0b;
  --empty-star: #4b5563;
  --text: #e8e6e3;
  --text-muted: #9a9690;
  --border: rgba(197, 160, 89, 0.22);
  --danger: #c44;
  --mylife-navy: #1a2744;
  --mylife-red: #c9232c;
  --mylife-green: #0d7a5c;
  --header-bg: rgba(6, 6, 8, 0.92);
  --grid-line: rgba(197, 160, 89, 0.03);
  --panel-soft-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  --panel-soft-solid: rgba(255, 255, 255, 0.04);
  --panel-soft-border: rgba(255, 255, 255, 0.07);
  --panel-soft-highlight: rgba(255, 255, 255, 0.03);
  --panel-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
  --chip-soft-bg: rgba(255, 255, 255, 0.04);
  --chip-soft-border: rgba(197, 160, 89, 0.14);
  --gold-chip-bg: rgba(197, 160, 89, 0.08);
  --gold-chip-border: rgba(197, 160, 89, 0.2);
  --tier-qualified-border: rgba(16, 185, 129, 0.42);
  --tier-qualified-bg: rgba(16, 185, 129, 0.1);
  --tier-qualified-rail: rgba(16, 185, 129, 0.88);
  --tier-qualified-chip-bg: rgba(16, 185, 129, 0.14);
  --tier-qualified-chip-border: rgba(16, 185, 129, 0.26);
  --tier-qualified-chip-text: #a7f3d0;
  --tier-qualified-name: #ecfdf5;
  --tier-qualified-number-bg: rgba(16, 185, 129, 0.3);
  --tier-qualified-shadow: rgba(16, 185, 129, 0.14);
  --tier-strong-border: rgba(245, 158, 11, 0.46);
  --tier-strong-bg: rgba(245, 158, 11, 0.12);
  --tier-strong-rail: rgba(245, 158, 11, 0.94);
  --tier-strong-chip-bg: rgba(245, 158, 11, 0.18);
  --tier-strong-chip-border: rgba(245, 158, 11, 0.3);
  --tier-strong-chip-text: #fde68a;
  --tier-strong-name: #fff7ed;
  --tier-strong-number-bg: rgba(245, 158, 11, 0.34);
  --tier-strong-shadow: rgba(245, 158, 11, 0.18);
  --tier-elite-border: rgba(251, 191, 36, 0.6);
  --tier-elite-bg: rgba(251, 191, 36, 0.14);
  --tier-elite-rail: rgba(251, 191, 36, 1);
  --tier-elite-chip-bg: linear-gradient(180deg, rgba(251, 191, 36, 0.34), rgba(197, 160, 89, 0.2));
  --tier-elite-chip-border: rgba(251, 191, 36, 0.34);
  --tier-elite-chip-text: #fff7d6;
  --tier-elite-name: #fff3bf;
  --tier-elite-number-bg: rgba(251, 191, 36, 0.44);
  --tier-elite-shadow: rgba(251, 191, 36, 0.2);
  --bar-track: rgba(255, 255, 255, 0.06);
  --surface-contrast: rgba(255, 255, 255, 0.08);
  --surface-2: #1a1a1e;
  --surface-3: #2a2a2e;
  --modal-scrim: rgba(0, 0, 0, 0.72);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --error: #f87171;
  --error-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --focus-ring: 0 0 0 3px rgba(197, 160, 89, 0.24);
  --hero-shell-bg:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(18, 18, 24, 0.98), rgba(10, 10, 13, 0.94));
  --hero-shell-sheen: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 32%, rgba(255, 255, 255, 0.03));
  --font-display: "Cormorant Garamond", "Songti TC", "PMingLiU", Georgia, serif;
  --font-body: "Manrope", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --sidebar-width: min(320px, 22vw);
}

/* Mobile-first adjustments: denser layout, stacked tables, and modal ordering */
@media (max-width: 680px) {
  /* Allow more compact card columns on narrow screens to reduce vertical scroll */
  .card-grid,
  .answer-grid,
  .home-hero__shell,
  .technical-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
  }

  .card {
    padding: 0.9rem;
    border-radius: 10px;
  }

  .hero {
    padding: 1.6rem 0 1rem;
  }

  .page-with-rail {
    padding: 1rem 0 2rem;
    gap: 1rem;
  }

  /* Modal: make the profile panel stack and show hero first on small screens */
  .quant-horse-modal__dialog {
    width: min(720px, 96vw);
    margin: 0.8rem auto;
  }
  .quant-horse-modal__content {
    padding: 0.6rem;
  }
  .quant-horse-modal__tabpanel[data-modal-panel="profile"] {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .quant-horse-modal__hero-head {
    order: -1;
  }
  .quant-horse-modal__chips {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  /* Compact top-four summary in horse modal hero to reduce mobile scroll */
  .quant-horse-modal__topfour {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.55rem;
  }
  .quant-horse-modal__topfour-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    background: var(--chip-soft-bg);
    border: 1px solid var(--chip-soft-border);
    min-width: 120px;
    flex: 1 1 120px;
  }
  .quant-horse-modal__topfour-number {
    font-weight: 700;
    color: var(--gold-dim);
    width: 30px;
    text-align: center;
  }
  .quant-horse-modal__topfour-name { flex: 1; font-size: 0.95rem; }
  .quant-horse-modal__topfour-prob { color: var(--text-muted); font-size: 0.9rem; margin-left: 0.25rem; }

  /* Tables: collapse to stacked rows for small screens to avoid horizontal scrolling */
  .data-table thead {
    display: none;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td,
  .data-table th {
    display: block;
    width: 100%;
  }
  .data-table tr {
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
  }
  .data-table td,
  .data-table th {
    padding: 0.25rem 0;
    border: none;
  }

  /* Make wide modal tables wrap into 2 columns for readability */
  .quant-horse-modal__group .quant-horse-modal__table thead,
  .quant-horse-modal__group .quant-horse-modal__table tbody {
    display: block;
  }
  .quant-horse-modal__group .quant-horse-modal__table thead tr,
  .quant-horse-modal__group .quant-horse-modal__table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Safety: horizontal scroll wrapper for any remaining wide tables (touch friendly) */
  .odds-table-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .odds-table-wrapper::after{
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(0,0,0,0.06));
    display: block;
  }
  /* Prevent scroll chaining and enable intuitive horizontal panning inside the wrapper */
  .odds-table-wrapper {
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }
  .odds-table-wrapper table { min-width: 100%; border-collapse: collapse; }
  .odds-table-wrapper table thead th { position: sticky; top: 0; z-index: 4; background: var(--bg-card); }
  .odds-table-wrapper table th:first-child,
  .odds-table-wrapper table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-card);
    box-shadow: 2px 0 6px rgba(0,0,0,0.12);
  }
}

@media (max-width: 420px) {
  html {
    font-size: 15px;
  }
  .brand-logo {
    max-height: 44px;
  }
  .nav-main a {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
  }
  .container {
    width: 96vw;
  }
  .card {
    padding: 0.7rem;
  }
  .quant-horse-modal__dialog {
    margin: 0.5rem;
    width: 96vw;
  }
  .quant-horse-modal__content {
    padding: 0.5rem;
  }
  .quant-horse-modal__hero-head {
    padding: 0;
  }
  .quant-horse-modal__group .quant-horse-modal__table tbody tr {
    grid-template-columns: 1fr;
  }
  .quant-horse-modal__raw-fields .data-table tbody tr {
    grid-template-columns: 1fr;
  }
  .data-table tr {
    padding: 0.6rem 0;
  }
}

/* SigmaQuant mobile CTA styling and tighter mobile modal/card spacing */
.sigma-quant-cta {
  display: inline-block;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(197,160,89,0.95), rgba(255,215,0,0.96));
  color: #121212;
  font-weight: 700;
  text-decoration: none;
}
.sigma-quant-cta:hover { box-shadow: 0 6px 18px rgba(197,160,89,0.18); }
.mobile-only { display: none; }

@media (max-width: 680px) {
  .mobile-only { display: block !important; }
  /* sticky CTA at bottom for quick access */
  .sigma-quant-cta--sticky { display: block; position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 12000; }

  /* Further compress modal/card spacing for aggressive mobile density */
  .section { padding: 1rem 0; }
  .card { padding: 0.7rem; border-radius: 10px; }
  .home-pillars article { padding: 0.65rem; }

  .quant-horse-modal__content { padding: 0.5rem; }
  .quant-horse-modal__section { padding: 0.45rem 0; gap: 0.45rem; }
  .quant-horse-modal__insight-card,
  .quant-horse-modal__history-card,
  .quant-horse-modal__technical-grid article { padding: 0.5rem; border-radius: 10px; }
  .quant-horse-modal__chips { gap: 0.35rem; }
  .quant-horse-modal__chip strong { font-size: 1rem; }
  .quant-horse-modal__hero-head .quant-horse-modal__eyebrow { font-size: 0.78rem; }
  .quant-horse-modal__insight-meta { font-size: 0.78rem; }
  .quant-horse-modal__section-note { display: none; }
  .quant-horse-modal__group .quant-horse-modal__table tbody tr { grid-template-columns: 1fr; }
}

html[data-theme="light"] {
  --bg: #f7f1e8;
  --bg-elevated: #fffaf3;
  --bg-card: #fffdf8;
  --gold: #9b6f1f;
  --gold-dim: #7e5b22;
  --gold-glow: rgba(155, 111, 31, 0.16);
  --gold-star: #d18a10;
  --empty-star: #d3c0a2;
  --text: #231a17;
  --text-muted: #6d6258;
  --border: rgba(155, 111, 31, 0.18);
  --header-bg: rgba(255, 250, 243, 0.92);
  --grid-line: rgba(155, 111, 31, 0.045);
  --panel-soft-bg: linear-gradient(180deg, rgba(35, 26, 23, 0.03), rgba(35, 26, 23, 0.015));
  --panel-soft-solid: rgba(35, 26, 23, 0.035);
  --panel-soft-border: rgba(35, 26, 23, 0.09);
  --panel-soft-highlight: rgba(255, 255, 255, 0.85);
  --panel-shadow: 0 14px 26px rgba(87, 60, 24, 0.08);
  --chip-soft-bg: rgba(35, 26, 23, 0.035);
  --chip-soft-border: rgba(155, 111, 31, 0.16);
  --gold-chip-bg: rgba(155, 111, 31, 0.08);
  --gold-chip-border: rgba(155, 111, 31, 0.18);
  --tier-qualified-border: rgba(15, 118, 110, 0.6);
  --tier-qualified-bg: rgba(15, 118, 110, 0.13);
  --tier-qualified-rail: rgba(15, 118, 110, 0.96);
  --tier-qualified-chip-bg: linear-gradient(180deg, #ecfdf5, #d1fae5);
  --tier-qualified-chip-border: rgba(15, 118, 110, 0.4);
  --tier-qualified-chip-text: #115e59;
  --tier-qualified-name: #0f172a;
  --tier-qualified-number-bg: rgba(15, 118, 110, 0.24);
  --tier-qualified-shadow: rgba(15, 118, 110, 0.18);
  --tier-strong-border: rgba(180, 83, 9, 0.68);
  --tier-strong-bg: rgba(180, 83, 9, 0.16);
  --tier-strong-rail: rgba(180, 83, 9, 0.98);
  --tier-strong-chip-bg: linear-gradient(180deg, #fff7ed, #fed7aa);
  --tier-strong-chip-border: rgba(180, 83, 9, 0.46);
  --tier-strong-chip-text: #9a3412;
  --tier-strong-name: #2d1607;
  --tier-strong-number-bg: rgba(180, 83, 9, 0.28);
  --tier-strong-shadow: rgba(180, 83, 9, 0.22);
  --tier-elite-border: rgba(217, 119, 6, 0.78);
  --tier-elite-bg: rgba(217, 119, 6, 0.2);
  --tier-elite-rail: rgba(217, 119, 6, 1);
  --tier-elite-chip-bg: linear-gradient(180deg, #fef3c7, #fcd34d);
  --tier-elite-chip-border: rgba(217, 119, 6, 0.54);
  --tier-elite-chip-text: #78350f;
  --tier-elite-name: #3b2207;
  --tier-elite-number-bg: rgba(217, 119, 6, 0.32);
  --tier-elite-shadow: rgba(217, 119, 6, 0.26);
  --bar-track: rgba(35, 26, 23, 0.08);
  --surface-contrast: rgba(35, 26, 23, 0.07);
  --surface-2: #ede5d3;
  --surface-3: #e0d7c3;
  --modal-scrim: rgba(50, 36, 17, 0.22);
  --success-soft: rgba(22, 163, 74, 0.12);
  --error-soft: rgba(220, 38, 38, 0.12);
  --info-soft: rgba(37, 99, 235, 0.12);
  --focus-ring: 0 0 0 3px rgba(155, 111, 31, 0.18);
  --hero-shell-bg:
    radial-gradient(circle at top right, rgba(155, 111, 31, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(255, 251, 244, 0.98), rgba(246, 236, 221, 0.96));
  --hero-shell-sheen: linear-gradient(90deg, rgba(255, 255, 255, 0.62), transparent 38%, rgba(155, 111, 31, 0.03));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--gold-glow), transparent),
    linear-gradient(180deg, transparent 0%, var(--bg) 320px),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 80px,
      var(--grid-line) 80px,
      var(--grid-line) 81px
    );
  pointer-events: none;
  z-index: -1;
}

input,
select,
button,
textarea {
  font: inherit;
}

a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-main a:focus-visible,
.lang-switch button:focus-visible,
.theme-toggle:focus-visible,
.home-support-link:focus-visible,
.plan-card__btn:focus-visible {
  outline: 2px solid var(--sw-gold-400, var(--gold));
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border: 2px solid var(--sw-gold-400, var(--gold));
  border-radius: 0.5rem;
  background: var(--sw-elevated, var(--surface));
  color: var(--sw-text-primary, var(--text));
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.sw-seo-only-heading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.brand-cluster .brand {
  gap: 0;
}

.brand-logo {
  height: auto;
  width: min(44px, 10vw);
  max-width: min(44px, 10vw);
  border-radius: 8px;
  display: block;
}

.brand-logo--ball {
  width: min(44px, 10vw);
  max-width: min(44px, 10vw);
  background: #0a0a0a;
}

.brand-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  margin-left: 0.15rem;
}

.brand-text strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-text span {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase;
}

.nav-main {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-main a {
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}

.nav-products {
  position: relative;
}

.nav-products::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 0.55rem;
}

.nav-products__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.nav-products__caret {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-products__menu {
  position: absolute;
  top: calc(100% + 0.12rem);
  left: 0;
  min-width: 12rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.nav-products__menu a {
  display: block;
  width: 100%;
}

.nav-products__menu-item.is-disabled {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--text-muted);
  opacity: 0.55;
  cursor: not-allowed;
  user-select: none;
}

.nav-main a,
.nav-main button,
.nav-products__toggle {
  white-space: nowrap;
}
.nav-main a:hover,
.nav-main a.is-active,
.nav-products:hover .nav-products__toggle,
.nav-products:focus-within .nav-products__toggle,
.nav-products.is-active .nav-products__toggle {
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold);
  text-decoration: none;
}

.nav-products:hover .nav-products__menu,
.nav-products:focus-within .nav-products__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

html[data-theme="light"] .nav-products__menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding-inline: 0.72rem;
}

.theme-toggle__icon {
  font-size: 0.9rem;
  color: var(--gold);
}

.theme-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.18), rgba(197, 160, 89, 0.06));
  border-color: rgba(197, 160, 89, 0.32);
  color: var(--gold);
}

.lang-switch button {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  min-height: 36px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}
.lang-switch button.is-on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(197, 160, 89, 0.1);
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.25), rgba(197, 160, 89, 0.08));
  color: var(--gold);
  font-weight: 600;
  font-size: 0.88rem;
}
.btn:hover {
  box-shadow: 0 0 20px var(--gold-glow);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(197, 160, 89, 0.08);
  color: rgba(197, 160, 89, 0.5);
  border-color: rgba(197, 160, 89, 0.3);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.is-loading {
  opacity: 0.78;
  cursor: wait;
}

/* Layout: main + sidebar */
.page-with-rail {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  width: min(1280px, 94vw);
  margin: 0 auto;
  padding: 2rem 0 4rem;
  align-items: start;
}

/* Keep inner sections inside the main rail column, not under the sidebar. */
.page-with-rail .container {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 960px) {
  .page-with-rail {
    grid-template-columns: 1fr;
  }
  :root {
    --sidebar-width: 100%;
  }
}

main.main-column {
  min-width: 0;
}

.rail {
  position: sticky;
  top: 5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 0.88rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  z-index: 1;
}
.rail h3 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--gold);
}
.rail article {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.rail article:last-child {
  border: none;
  margin: 0;
  padding: 0;
}
.rail .tag {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
  margin-bottom: 0.35rem;
}
.rail article h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 0.2rem 0 0.45rem;
}
.rail article p {
  font-size: 0.97rem;
  line-height: 1.7;
}

.home-pillars {
  display: grid;
  gap: 0.95rem;
}
.home-pillar {
  background: var(--panel-soft-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  transform: scale(0.965);
  opacity: 0.55;
  filter: saturate(0.75);
  transition: transform 260ms ease, opacity 260ms ease, filter 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}
.home-pillar h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}
.home-pillar p {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.78;
}
.home-pillar.is-active {
  transform: scale(1.01);
  opacity: 1;
  filter: saturate(1);
  border-color: rgba(197, 160, 89, 0.36);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(197, 160, 89, 0.14) inset;
}
html[data-theme="light"] .home-pillar {
  box-shadow: 0 8px 18px rgba(87, 60, 24, 0.06);
}
html[data-theme="light"] .home-pillar.is-active {
  box-shadow: 0 14px 28px rgba(87, 60, 24, 0.12), 0 0 0 1px rgba(155, 111, 31, 0.2) inset;
}

/* Hero */
.hero {
  padding: 3rem 0 2rem;
}
.hero-brand-row {
  margin-bottom: 1.25rem;
}
.hero-logo {
  max-width: min(320px, 88vw);
  height: auto;
  max-height: clamp(72px, 16vw, 120px);
  display: block;
  filter: drop-shadow(0 8px 28px var(--gold-glow));
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.hero-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}
.trilang-block {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.trilang-block .lang-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
}

.section {
  padding: 2.5rem 0;
}
.section h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--gold);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.answer-intro {
  color: var(--text-muted);
  margin: 0.4rem 0 1rem;
}

.answer-grid {
  margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

html[data-lang="en"] .lang-panel.lang-en.answer-grid,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.answer-grid,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.answer-grid {
  display: grid;
}

html[data-lang="en"] .lang-panel.lang-en.faq-list,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.faq-list,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.faq-list {
  display: grid;
}

.answer-card h3,
.faq-item h2,
.faq-item h3 {
  margin: 0 0 0.6rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.3;
}

.answer-card p,
.faq-item p {
  margin: 0;
  color: var(--text-muted);
}

.faq-list {
  display: grid;
  gap: 0.9rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover:not(.card--locked) {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.card--locked {
  position: relative;
  filter: blur(2px);
  opacity: 0.65;
  pointer-events: auto;
}
.card--locked .coming-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 8, 0.65);
  border-radius: 12px;
  filter: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold);
}

/* Homepage */
.page-with-rail--home {
  grid-template-columns: minmax(0, 1fr);
  gap: 1.6rem;
}

.page-with-rail--home .section {
  padding-block: 2rem;
}

.home-hero--balanced {
  padding: 2.2rem 0 1.1rem;
}

.home-hero__shell {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.4rem);
  padding: clamp(1.35rem, 2.7vw, 2rem);
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    var(--hero-shell-bg);
  box-shadow: var(--panel-shadow);
}

.home-hero__shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-shell-sheen);
  pointer-events: none;
}

.home-hero__shell::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  pointer-events: none;
}

.home-hero__copy,
.home-hero__support-card {
  position: relative;
  z-index: 1;
}

.home-hero__copy {
  display: grid;
  align-content: start;
  gap: 1.1rem;
  justify-items: center;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.home-hero__intro {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
}

.home-kicker,
.home-panel__eyebrow,
.home-product-card__eyebrow {
  margin: 0;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
}

.home-hero--balanced .hero-logo {
  max-width: min(340px, 72vw);
}

.home-hero--balanced h1 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 4.5vw, 3.95rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
}

.home-hero--balanced .hero-lead {
  max-width: 64ch;
  margin: 0;
  font-size: clamp(0.98rem, 1.22vw, 1.08rem);
  line-height: 1.72;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.45rem;
  justify-content: center;
  align-items: center;
}

.home-hero__btn {
  min-width: 220px;
  min-height: 54px;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  border-radius: 16px;
  padding-inline: 1.35rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.home-hero__btn--primary {
  min-width: 240px;
  border-color: rgba(197, 160, 89, 0.5);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.62), rgba(197, 160, 89, 0.24));
  color: var(--text);
  box-shadow: 0 18px 34px var(--gold-glow);
}

html[data-theme="light"] .home-hero__btn--primary {
  border-color: rgba(155, 111, 31, 0.34);
  background: linear-gradient(180deg, rgba(155, 111, 31, 0.3), rgba(155, 111, 31, 0.12));
  color: var(--text);
}

.home-hero__btn--secondary {
  border-color: var(--gold-chip-border);
  background: rgba(255, 255, 255, 0.02);
}

.home-hero__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px var(--gold-glow);
}

.home-hero__btn--secondary:hover {
  transform: translateY(-1px);
}

.home-spotlight-section {
  scroll-margin-top: 110px;
}

.home-section-header--spotlight {
  max-width: 60rem;
}

.home-hero__support-card {
  width: 100%;
  margin: 0;
  display: grid;
  gap: 1.1rem;
  padding: 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(197, 160, 89, 0.18);
  background:
    radial-gradient(circle at top left, rgba(197, 160, 89, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    var(--bg-card);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 16px 34px rgba(0, 0, 0, 0.1);
}

.home-hero__support-head {
  display: grid;
  gap: 0.65rem;
  justify-items: start;
  text-align: left;
  padding: 0.1rem 0 0.85rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.1);
}

.home-credibility {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.home-credibility--band {
  gap: 0.45rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  justify-content: flex-start;
}

.home-credibility__item,
.home-product-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--gold-chip-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    var(--gold-chip-bg);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  box-shadow: none;
}

.home-credibility__item::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), rgba(197, 160, 89, 0.55));
  box-shadow: none;
}

.home-hero__support-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.2;
  color: var(--gold);
}

.home-panel__body {
  margin: 0;
  color: var(--text-muted);
  max-width: 62ch;
  line-height: 1.56;
  font-size: 0.88rem;
}

.home-hero__support-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.home-support-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.home-support-point {
  min-height: 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.12);
  background: rgba(255, 255, 255, 0.022);
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.home-support-point:hover {
  transform: translateY(-2px);
  border-color: rgba(197, 160, 89, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.home-support-point__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 40px;
  min-height: 28px;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.11);
  border: 1px solid rgba(197, 160, 89, 0.16);
  color: var(--gold-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.home-support-point span:last-child {
  color: var(--text);
  line-height: 1.55;
}

.home-hero__support-actions {
  display: grid;
  gap: 0.7rem;
  justify-items: stretch;
  min-width: 220px;
}

.home-support-btn {
  min-height: 48px;
  justify-content: center;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.home-support-btn:hover {
  transform: translateY(-1px);
}

.home-support-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  color: var(--text);
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.home-support-link:hover {
  background: rgba(197, 160, 89, 0.08);
  border-color: rgba(197, 160, 89, 0.28);
  color: var(--gold);
  text-decoration: none;
}

.home-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.42rem;
}

.home-feature-list li {
  position: relative;
  padding-left: 0.88rem;
  color: var(--text-muted);
  line-height: 1.42;
  font-size: 0.84rem;
}

.home-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: none;
}

.home-section-header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.home-section-header h2,
.home-section-header h3 {
  margin: 0;
}

.home-section-header h2 {
  font-size: clamp(1.55rem, 2.15vw, 2.15rem);
  color: var(--gold);
}

.home-trust-card,
.home-insight-card,
.home-proof-card,
.home-plan-card {
  border-radius: 14px;
}

.home-trust-card {
  padding: 1.1rem 1.05rem;
  border: 1px solid rgba(197, 160, 89, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    var(--bg-card);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.home-trust-card h3,
.home-insight-card h3,
.home-proof-card h3,
.home-product-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  line-height: 1.18;
}

.home-trust-card h3,
.home-insight-card h3,
.home-proof-card h3 {
  font-size: 1.14rem;
  color: var(--gold);
}

.home-trust-card p,
.home-insight-card p,
.home-proof-card p,
.home-product-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.home-insights {
  position: relative;
}

.home-insight-grid {
  margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

html[data-lang="en"] .lang-panel.lang-en.home-insight-grid,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.home-insight-grid,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.home-insight-grid {
  display: grid;
}

.home-insight-card {
  min-height: 100%;
  padding: 1.05rem;
  border: 1px solid rgba(197, 160, 89, 0.12);
  background:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    var(--bg-card);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.home-insight-card .tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 0.7rem;
  padding: 0.18rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: rgba(197, 160, 89, 0.1);
  color: var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-pillars--refined {
  gap: 0.9rem;
}

.home-pillars--refined .home-pillar {
  position: relative;
  padding: 1.15rem 1.15rem 1.1rem;
  transform: translateY(14px);
  opacity: 0;
  filter: none;
  border-color: rgba(197, 160, 89, 0.12);
}

.home-pillar__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  margin-bottom: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.16);
  color: var(--gold-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.reveal-up {
  transition: opacity 360ms ease, transform 360ms ease;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-proof {
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    var(--bg-card);
}

.home-proof__grid--soft {
  margin-top: 1rem;
}

.home-proof-card {
  padding: 1.1rem;
  border: 1px solid rgba(197, 160, 89, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.home-proof-card--accent {
  border-color: rgba(197, 160, 89, 0.22);
  background:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.03);
}

.home-products-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(220px, 1fr));
}

.home-product-card {
  min-height: 100%;
}

.home-product-card--primary {
  display: grid;
  gap: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  background:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--bg-card);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.home-product-card--primary:hover {
  text-decoration: none;
}

.home-product-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.home-product-card__arrow {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
}

.home-product-card--primary h3 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  color: var(--text);
}

.home-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

.home-plan-grid--soft {
  gap: 1rem;
}

.home-plan-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border-color: rgba(197, 160, 89, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.home-plan-card .btn {
  margin-top: 0.7rem;
  width: 100%;
  min-height: 44px;
}

html[data-lang="en"] .lang-panel.lang-en.home-plan-grid,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.home-plan-grid,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.home-plan-grid {
  display: grid;
}

@media (max-width: 1160px) {
  .home-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-product-card--primary {
    grid-column: 1 / -1;
  }

  .home-hero__support-body {
    grid-template-columns: 1fr;
  }

  .home-hero__support-actions {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .home-hero--balanced h1 {
    max-width: none;
  }

  .home-support-points {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-with-rail--home {
    gap: 1.2rem;
  }

  .home-hero--balanced {
    padding-top: 1.3rem;
  }

  .home-hero__shell,
  .home-proof {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .home-credibility--band {
    gap: 0.65rem;
  }

  .home-credibility__item,
  .home-product-tags span,
  .hero-actions .btn {
    width: 100%;
  }

  .home-credibility {
    justify-content: center;
  }

  .home-hero__copy {
    justify-items: stretch;
  }

  .home-hero__btn {
    justify-content: center;
    text-align: center;
  }

  .home-credibility__item {
    justify-content: center;
    text-align: center;
  }

  .home-hero__support-card {
    padding: 0.9rem;
  }

  .home-hero__support-actions {
    grid-template-columns: 1fr;
  }

  .home-products-grid,
  .home-proof__grid {
    grid-template-columns: 1fr;
  }

  .home-product-card__top {
    flex-direction: column;
    gap: 0.3rem;
  }

  .plan-card--stack {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .plan-card__price-block,
  .plan-card__action {
    justify-items: start;
    justify-content: start;
  }

  .plan-card__btn {
    width: 100%;
  }
}

/* Plans */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.plans-page {
  padding: 2.35rem 0 4.5rem;
}

.plans-page__intro {
  display: grid;
  gap: 0.6rem;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.plans-page__intro h1 {
  margin: 0;
  max-width: none;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1.18;
  text-wrap: wrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.plans-page__intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.72;
}

.plans-page__note {
  margin-top: 1.4rem;
  text-align: center;
}

.plans-page__guide {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  max-width: 980px;
  margin: 1rem auto 0;
}

.plans-page__guide-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.014)),
    rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.3;
}

.plans-page__guide-pill strong {
  color: var(--text);
  margin-right: 0.3rem;
}

.plan-grid--stack {
  margin-top: 1.5rem;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  align-items: stretch;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--bg-elevated);
}
.plan-card--stack {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
  align-items: start;
  width: 100%;
  min-height: 100%;
  padding: 1.25rem;
  border-radius: 24px;
  border: 1px solid rgba(217, 217, 217, 0.08);
  background:
    radial-gradient(circle at top center, rgba(197, 160, 89, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--bg-elevated);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  opacity: 0;
  filter: blur(5px);
  transform: translateY(34px) scale(0.985);
  transition:
    opacity 720ms cubic-bezier(0.2, 0.9, 0.18, 1),
    transform 720ms cubic-bezier(0.2, 0.9, 0.18, 1),
    filter 720ms cubic-bezier(0.2, 0.9, 0.18, 1),
    border-color 260ms ease,
    box-shadow 260ms ease,
    background-position 320ms ease;
  transition-delay: calc(var(--plan-delay, 0) * 120ms);
}

.plan-card--stack.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.plan-card--featured {
  border-color: rgba(197, 160, 89, 0.32);
  background:
    radial-gradient(circle at top center, rgba(197, 160, 89, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
    var(--bg-elevated);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(197, 160, 89, 0.08) inset;
  animation: featuredPulse 2.8s ease-in-out infinite;
}

.plan-card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 15%, rgba(255, 255, 255, 0.12) 40%, transparent 65%);
  transform: translateX(-120%);
  opacity: 0.6;
  pointer-events: none;
  animation: planShimmer 4.2s ease-in-out infinite;
}

.plan-card__head {
  display: grid;
  gap: 0.65rem;
  width: 100%;
}

.plan-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.plan-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.02;
}

.plan-card__identity {
  min-width: 0;
  display: grid;
  gap: 0.45rem;
}

.plan-card__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: fit-content;
  margin-bottom: 0;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--gold-chip-border);
  background: var(--gold-chip-bg);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plan-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.16rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.92), rgba(197, 160, 89, 0.62));
  color: #101214;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 10px 24px rgba(197, 160, 89, 0.22);
}

.plan-card__desc {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.62;
  font-size: 0.95rem;
}

.plan-card__summary {
  display: grid;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(217, 217, 217, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.02);
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.plan-card__price-block {
  display: grid;
  gap: 0.25rem;
  align-items: flex-start;
  width: 100%;
}
.plan-price {
  font-size: clamp(2rem, 3vw, 2.65rem);
  color: var(--text);
  margin: 0;
  line-height: 1;
  transition: letter-spacing 260ms ease, transform 260ms ease, text-shadow 260ms ease;
}

.plan-card__period {
  margin: 0;
  font-size: 0.95rem;
}

.plan-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 0;
  text-decoration: none;
  text-align: center;
  border-radius: 16px;
  font-size: 0.98rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.plan-card__feature-shell {
  width: 100%;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(217, 217, 217, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.015);
}

.plan-card__feature-title {
  margin: 0 0 0.85rem;
  color: var(--gold-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.plan-card__features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
  width: 100%;
  align-content: start;
}

.plan-card__feature {
  position: relative;
  min-height: 100%;
  padding-left: 1.4rem;
  color: var(--text);
  line-height: 1.58;
  opacity: 0.58;
  transform: translateY(12px);
  transition: opacity 360ms ease, transform 360ms ease;
}

.plan-card__feature::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), rgba(197, 160, 89, 0.5));
  box-shadow: 0 0 14px rgba(197, 160, 89, 0.18);
}

.plan-card--featured .plan-card__btn {
  border-color: rgba(197, 160, 89, 0.52);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.86), rgba(197, 160, 89, 0.48));
  color: #111315;
  box-shadow: 0 16px 28px rgba(197, 160, 89, 0.18);
}

.plan-card--featured .plan-card__summary,
.plan-card--featured .plan-card__feature-shell {
  border-color: rgba(197, 160, 89, 0.14);
}

.plan-card--stack.is-visible .plan-card__feature {
  opacity: 1;
  transform: translateY(0);
}

.plan-card--stack.is-visible .plan-card__feature:nth-child(1) {
  transition-delay: calc(var(--plan-delay, 0) * 120ms + 140ms);
}

.plan-card--stack.is-visible .plan-card__feature:nth-child(2) {
  transition-delay: calc(var(--plan-delay, 0) * 120ms + 220ms);
}

.plan-card--stack.is-visible .plan-card__feature:nth-child(3) {
  transition-delay: calc(var(--plan-delay, 0) * 120ms + 300ms);
}

@media (hover: hover) and (pointer: fine) {
  .plan-card--stack:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 160, 89, 0.22);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(197, 160, 89, 0.06) inset;
  }

  .plan-card--stack:hover .plan-card__summary {
    transform: translateY(-1px);
    border-color: rgba(197, 160, 89, 0.16);
  }

  .plan-card--stack:hover .plan-price {
    letter-spacing: -0.02em;
    transform: translateY(-1px);
    text-shadow: 0 0 22px rgba(197, 160, 89, 0.18);
  }

  .plan-card--stack:hover .plan-card__btn {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(197, 160, 89, 0.12);
  }
}

html[data-theme="light"] .plan-card--stack {
  box-shadow: 0 16px 34px rgba(87, 60, 24, 0.08);
}

html[data-theme="light"] .plan-card--featured {
  box-shadow:
    0 22px 48px rgba(87, 60, 24, 0.12),
    0 0 0 1px rgba(155, 111, 31, 0.12) inset;
}

@media (max-width: 960px) {
  .plans-page__guide {
    justify-content: flex-start;
    margin-inline: 0;
  }

  .plan-grid--stack {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .plans-page__intro {
    text-align: left;
    margin: 0;
  }
}

/* New horizontal plan grid styles */
.plan-grid--horizontal {
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1440px;
  margin: 2rem auto 0;
}

.plan-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(217, 217, 217, 0.08);
  background:
    radial-gradient(circle at top center, rgba(197, 160, 89, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--bg-elevated);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
  position: relative;
}

.plan-card--featured {
  border-color: rgba(197, 160, 89, 0.32);
  background:
    radial-gradient(circle at top center, rgba(197, 160, 89, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
    var(--bg-elevated);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(197, 160, 89, 0.08) inset;
}

.plan-card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 15%, rgba(255, 255, 255, 0.12) 40%, transparent 65%);
  transform: translateX(-120%);
  opacity: 0.6;
  pointer-events: none;
  animation: planShimmer 4.2s ease-in-out infinite;
}

.plan-card__top {
  flex: 3;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.plan-card__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
  line-height: 1.1;
}

.plan-card__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.plan-card__features {
  flex: 1;
}

.plan-card__feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-card__feature-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.95rem;
}

.plan-card__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-weight: bold;
  font-size: 1.1rem;
}

.plan-card__timeframes {
  flex: 2;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(217, 217, 217, 0.08);
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeframe-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(217, 217, 217, 0.06);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.timeframe-option:hover {
  background: rgba(197, 160, 89, 0.08);
  border-color: rgba(197, 160, 89, 0.2);
  transform: translateY(-1px);
}

.timeframe-option.selected {
  background: rgba(197, 160, 89, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.1);
}

.timeframe-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.timeframe-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.popular-badge {
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.92), rgba(197, 160, 89, 0.62));
  color: #101214;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .plan-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 160, 89, 0.22);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(197, 160, 89, 0.06) inset;
  }
}

@media (max-width: 1024px) {
  .plan-grid--horizontal {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .plan-card__top {
    padding: 1.5rem;
  }

  .plan-card__timeframes {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .plans-page {
    padding: 1.55rem 0 3.2rem;
  }

  .plan-grid--stack {
    margin-top: 1.15rem;
    gap: 1rem;
  }

  .plan-card--stack {
    padding: 1rem;
    border-radius: 20px;
  }

  .plan-card__summary {
    padding: 0.9rem;
  }

  .plan-card__feature-shell {
    padding: 0.9rem;
  }

  .plan-card__btn {
    min-height: 50px;
  }
}

html[data-lang="en"] .lang-panel.lang-en.plan-grid--stack,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.plan-grid--stack,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.plan-grid--stack {
  display: grid;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}
.data-table th {
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold);
}

.compare-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
}

.compare-table {
  table-layout: fixed;
  width: 100%;
}

.compare-table__metric {
  width: 34%;
}

.compare-table__horse {
  width: 33%;
  min-width: 33%;
  max-width: 33%;
}

.compare-table th:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(2),
.compare-table td:nth-child(3) {
  width: 33%;
}

.compare-table th,
.compare-table td {
  vertical-align: top;
  word-break: break-word;
}

.compare-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-style: normal;
  font-size: 0.68rem;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.compare-badge--better {
  color: #065f46;
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.42);
}

.compare-badge--worse {
  color: #9f1239;
  background: rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.42);
}

.compare-badge--draw {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.is-open {
  display: flex;
}
.modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.modal h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
}
.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.auth-tab {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.auth-tab.is-on {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(197, 160, 89, 0.12);
}
.form-row {
  margin-bottom: 0.85rem;
}
.form-row label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}
.form-row input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.state-panel,
.state-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    var(--bg-elevated);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.08);
}

.state-panel {
  margin: 0 0 0.85rem;
  padding: 0.8rem 0.9rem;
  font-size: 0.84rem;
  line-height: 1.55;
}

.state-panel.hidden,
.toast.hidden {
  display: none;
}

.state-panel--success {
  border-color: rgba(34, 197, 94, 0.32);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03)), var(--bg-elevated);
}

.state-panel--error {
  border-color: rgba(248, 113, 113, 0.32);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.08), rgba(248, 113, 113, 0.03)), var(--bg-elevated);
}

.state-panel--info {
  border-color: rgba(96, 165, 250, 0.3);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(96, 165, 250, 0.03)), var(--bg-elevated);
}

.state-card {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 1.15rem;
  text-align: left;
}

.plan-grid--stack > .state-card {
  grid-column: 1 / -1;
}

.state-card h3 {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.state-card p {
  margin: 0;
  color: var(--text-muted);
}

.state-card__action {
  display: inline-flex;
  margin-top: 0.9rem;
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.65rem;
  width: min(340px, calc(100vw - 2rem));
  z-index: 95;
  pointer-events: none;
}

.toast {
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    var(--bg-card);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.5;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast--success {
  border-color: rgba(34, 197, 94, 0.32);
}

.toast--error {
  border-color: rgba(248, 113, 113, 0.32);
}

.toast--info {
  border-color: rgba(96, 165, 250, 0.28);
}

/* Cookie bar CSS removed (cookie banner is no longer shown) */

@keyframes planShimmer {
  0%,
  72%,
  100% {
    transform: translateX(-120%);
  }
  82% {
    transform: translateX(120%);
  }
}

@keyframes featuredPulse {
  0%,
  100% {
    box-shadow:
      0 22px 48px rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(197, 160, 89, 0.08) inset,
      0 0 0 rgba(197, 160, 89, 0);
  }
  50% {
    box-shadow:
      0 24px 52px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(197, 160, 89, 0.14) inset,
      0 0 26px rgba(197, 160, 89, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .plan-card--stack,
  .plan-card--stack.is-visible,
  .reveal-up,
  .reveal-up.is-visible,
  .plan-card__feature,
  .toast {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .plan-card--featured {
    animation: none;
  }

  .plan-card--featured::after {
    display: none;
    animation: none;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  background: var(--bg-elevated);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  font-size: 0.88rem;
}
.footer-grid h4 {
  font-family: var(--font-display);
  color: var(--gold);
  margin: 0 0 0.75rem;
}
.mylife-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
  background: #000;
  border-radius: 10px;
  border: 1px solid var(--border);
}
html[data-theme="light"] .mylife-badge {
  background: #d8d8d8;
}
.mylife-badge .mylife-logo,
.mylife-badge img {
  max-height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* Sigma quant: locked section */
.heat-locked {
  position: relative;
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  min-height: 120px;
}
.heat-locked-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 8, 0.7);
  filter: none;
  border-radius: 12px;
  pointer-events: auto;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

code.horse-code {
  font-family: ui-monospace, monospace;
  background: rgba(197, 160, 89, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

/* Legal: show one language panel */
.lang-panel {
  display: none;
  margin-top: 1rem;
}
html[data-lang="en"] .lang-panel.lang-en,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans {
  display: block;
}

/* Sigma Quant */
.sigma-quant-page {
  padding: 2rem 0 4rem;
}

.sigma-quant-shell {
  display: grid;
  gap: 1.5rem;
}

.quant-page-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.06), rgba(255, 255, 255, 0.015));
}

.quant-page-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.quant-page-nav__link:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 160, 89, 0.28);
  color: var(--gold);
  text-decoration: none;
}

.quant-page-nav__link.is-disabled,
.quant-page-nav__link[aria-disabled="true"] {
  opacity: 0.48;
  pointer-events: none;
  transform: none;
}

.quant-page-nav__link.is-locked-link {
  position: relative;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 60px;
}

.quant-page-nav__link.is-locked-link::after {
  content: attr(data-lock-label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.64rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--gold);
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.2);
}

.quant-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 1.25rem;
  padding: 1.6rem;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: var(--panel-soft-bg);
}

.quant-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 32%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

.quant-hero__copy,
.quant-hero__stats {
  position: relative;
  z-index: 1;
}

.quant-eyebrow,
.section-kicker,
.attribute-board__kicker,
.snapshot-card__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.quant-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.quant-lead,
.section-lead {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  max-width: 70ch;
}

.quant-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.quant-hero__about-links .btn {
  font-size: 0.84rem;
}

.quant-hero__stats {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.quant-stat {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(197, 160, 89, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}

.quant-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.quant-stat strong {
  display: block;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
}

.quant-section {
  display: grid;
  gap: 1rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.section-head--with-chip {
  align-items: start;
}

.section-head--compact {
  margin-bottom: 0.75rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.1;
  color: var(--gold);
}

.heat-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  min-width: min(520px, 100%);
}

.heat-summary__pill {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.15);
}

.heat-summary__pill span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.heat-summary__pill strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.heat-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.heat-chip {
  min-width: 92px;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.12), rgba(255, 255, 255, 0.03));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.heat-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 160, 89, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.heat-chip span,
.heat-chip small {
  display: block;
}

.heat-chip span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.heat-chip strong {
  display: block;
  margin: 0.2rem 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.heat-chip small {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.heat-chip.is-active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.24), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.16), 0 12px 28px rgba(0, 0, 0, 0.3);
}

.heat-chip.is-locked {
  opacity: 0.74;
}

.heat-chip:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.55;
}

.heat-chip:disabled:hover {
  transform: none;
  box-shadow: none;
}

.attribute-board {
  display: grid;
  gap: 1rem;
}

.attribute-board__summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.1), rgba(255, 255, 255, 0.03));
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.attribute-board__summary::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.95), transparent);
  pointer-events: none;
}

.attribute-board__summary > * {
  position: relative;
  z-index: 1;
}

.attribute-board__summary h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
}

.attribute-board__summary p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.attribute-board__summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 320px;
}

.attribute-board__summary-stats div {
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.attribute-board__summary-stats span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.attribute-board__summary-stats strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.attribute-board__legend {
  display: grid;
  gap: 0.16rem;
  width: 100%;
  margin-top: 0.45rem;
}

.attribute-board__legend small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.attribute-board__rows {
  display: grid;
  gap: 0.9rem;
}

.attribute-board__stack {
  position: relative;
}

.attribute-board__rows--locked {
  filter: blur(7px);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

.attribute-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 64px minmax(0, 1.45fr) minmax(140px, 0.8fr) minmax(320px, 1.3fr);
  gap: 0.9rem;
  align-items: center;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: var(--panel-soft-bg);
  box-shadow: var(--panel-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.attribute-row__gate {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(197, 160, 89, 0.38), var(--bg-card));
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--panel-shadow);
}

.attribute-row__identity h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 100%;
  word-break: break-word;
}

.snapshot-card__owner {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted, #a0a0a0);
  max-width: 100%;
  word-break: break-word;
}
.snapshot-card__owner-label {
  font-weight: 600;
  color: var(--text-muted, #a0a0a0);
  margin-right: 0.25rem;
}
.attribute-row__owner {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted, #a0a0a0);
  word-break: break-word;
}
.attribute-row__owner-label {
  font-weight: 600;
  margin-right: 0.25rem;
}
.snapshot-card__horse strong {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.attribute-row__identity p,
.snapshot-card__horse span {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.attribute-row__titleblock {
  display: grid;
  gap: 0.18rem;
}

.attribute-row__name-stack {
  display: grid;
  gap: 0.16rem;
}

.attribute-row__english {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.attribute-row__eyebrow {
  display: inline-block;
  margin-bottom: 0.2rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
}

.attribute-row__meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}

/* Sigma Quant runner strip - desktop: row1 rider/trainer/draw/score; row2 carry/priority + gear×2. Mobile: 6-col bands */
.attribute-row__meta-grid--runner {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attribute-row__meta-grid--runner .attribute-meta-chip {
  padding: 0.48rem 0.52rem;
  min-width: 0;
}

.attribute-row__meta-grid--runner .attribute-meta-chip small {
  font-size: 0.62rem;
}

.attribute-row__meta-grid--runner .attribute-meta-chip strong {
  font-size: 0.78rem;
  word-break: break-word;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--rider {
  grid-column: 1;
  grid-row: 1;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--trainer {
  grid-column: 2;
  grid-row: 1;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--draw {
  grid-column: 3;
  grid-row: 1;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--score {
  grid-column: 4;
  grid-row: 1;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--carry {
  grid-column: 1;
  grid-row: 2;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--priority {
  grid-column: 2;
  grid-row: 2;
}

.attribute-row__meta-grid--runner .attribute-meta-chip-slot--gear {
  grid-column: 3 / span 2;
  grid-row: 2;
  align-items: start;
}

.runner-meta-gear-lines {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  align-items: flex-start;
  width: 100%;
}

.runner-meta-gear-line {
  display: block;
  line-height: 1.35;
}

.attribute-meta-chip__gear-value {
  font-weight: 700;
  white-space: normal;
}

@media (max-width: 640px) {
  .attribute-row__meta-grid--runner {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--rider {
    grid-column: 1 / span 2;
    grid-row: 1;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--trainer {
    grid-column: 3 / span 4;
    grid-row: 1;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--draw {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--score {
    grid-column: 3 / span 2;
    grid-row: 2;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--carry {
    grid-column: 5 / span 2;
    grid-row: 2;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--priority {
    grid-column: 1 / span 2;
    grid-row: 3;
  }

  .attribute-row__meta-grid--runner .attribute-meta-chip-slot--gear {
    grid-column: 3 / span 4;
    grid-row: 3;
  }
}

.attribute-meta-chip {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem 0.62rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
}

.attribute-meta-chip small {
  color: var(--text-muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.attribute-meta-chip strong {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.attribute-row__signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.attribute-row__signal-row .model-rank,
.attribute-row__signal-row .model-rank--primary {
  display: none;
}

.attribute-row__headline-metrics {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.headline-chip {
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: var(--chip-soft-bg);
  border: 1px solid var(--chip-soft-border);
  overflow: hidden;
}

.headline-chip--place {
  position: relative;
  display: grid;
  gap: 0.08rem;
  padding: 0.62rem 0.75rem 0.68rem 0.9rem;
  min-height: 74px;
}

.headline-chip--win {
  position: relative;
  display: grid;
  gap: 0.08rem;
  padding: 0.62rem 0.75rem 0.68rem 0.9rem;
  min-height: 74px;
}

.headline-chip span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
}

.headline-chip strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
}

.headline-chip small {
  display: block;
  margin-top: 0.24rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.attribute-row--popular-qualified,
.attribute-row--popular-qualified .headline-chip--place {
  --tier-row-border: var(--tier-qualified-border);
  --tier-row-bg: var(--tier-qualified-bg);
  --tier-row-rail: var(--tier-qualified-rail);
  --tier-chip-bg: var(--tier-qualified-chip-bg);
  --tier-chip-border: var(--tier-qualified-chip-border);
  --tier-chip-text: var(--tier-qualified-chip-text);
  --tier-name-text: var(--tier-qualified-name);
  --tier-number-bg: var(--tier-qualified-number-bg);
  --tier-shadow: var(--tier-qualified-shadow);
}

.attribute-row--popular-confidence,
.attribute-row--popular-confidence .headline-chip--place,
.attribute-row--popular-strong,
.attribute-row--popular-strong .headline-chip--place {
  --tier-row-border: var(--tier-strong-border);
  --tier-row-bg: var(--tier-strong-bg);
  --tier-row-rail: var(--tier-strong-rail);
  --tier-chip-bg: var(--tier-strong-chip-bg);
  --tier-chip-border: var(--tier-strong-chip-border);
  --tier-chip-text: var(--tier-strong-chip-text);
  --tier-name-text: var(--tier-strong-name);
  --tier-number-bg: var(--tier-strong-number-bg);
  --tier-shadow: var(--tier-strong-shadow);
}

.attribute-row--popular-elite,
.attribute-row--popular-elite .headline-chip--place {
  --tier-row-border: var(--tier-elite-border);
  --tier-row-bg: var(--tier-elite-bg);
  --tier-row-rail: var(--tier-elite-rail);
  --tier-chip-bg: var(--tier-elite-chip-bg);
  --tier-chip-border: var(--tier-elite-chip-border);
  --tier-chip-text: var(--tier-elite-chip-text);
  --tier-name-text: var(--tier-elite-name);
  --tier-number-bg: var(--tier-elite-number-bg);
  --tier-shadow: var(--tier-elite-shadow);
}

.attribute-row--popular-qualified,
.attribute-row--popular-confidence,
.attribute-row--popular-strong,
.attribute-row--popular-elite {
  border-color: var(--tier-row-border);
  background:
    linear-gradient(90deg, var(--tier-row-bg), rgba(255, 255, 255, 0.012) 72%),
    var(--panel-soft-bg);
  box-shadow:
    inset 0 0 0 1px var(--tier-row-border),
    inset 6px 0 0 var(--tier-row-rail),
    0 12px 28px var(--tier-shadow);
}

.attribute-row--popular-confidence,
.attribute-row--popular-strong {
  box-shadow:
    inset 0 0 0 1px var(--tier-row-border),
    inset 8px 0 0 var(--tier-row-rail),
    0 14px 30px var(--tier-shadow);
}

.attribute-row--popular-elite {
  background:
    linear-gradient(90deg, var(--tier-row-bg), rgba(255, 255, 255, 0.01) 60%),
    var(--panel-soft-bg);
  box-shadow:
    inset 0 0 0 1px var(--tier-row-border),
    inset 10px 0 0 var(--tier-row-rail),
    0 16px 34px var(--tier-shadow);
}

.attribute-row--popular-qualified .attribute-row__gate,
.attribute-row--popular-confidence .attribute-row__gate,
.attribute-row--popular-strong .attribute-row__gate,
.attribute-row--popular-elite .attribute-row__gate {
  border-width: 2px;
  border-color: var(--tier-row-border);
  color: var(--tier-chip-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 2px var(--tier-row-border);
}

.attribute-row--popular-qualified .attribute-row__gate {
  background: radial-gradient(circle at 30% 30%, var(--tier-number-bg), var(--bg-card));
}

.attribute-row--popular-confidence .attribute-row__gate,
.attribute-row--popular-strong .attribute-row__gate {
  background: radial-gradient(circle at 30% 30%, var(--tier-number-bg), var(--bg-card));
}

.attribute-row--popular-elite .attribute-row__gate {
  background: radial-gradient(circle at 30% 30%, var(--tier-number-bg), var(--bg-card));
}

.attribute-row--popular-qualified .attribute-row__identity h3,
.attribute-row--popular-confidence .attribute-row__identity h3,
.attribute-row--popular-strong .attribute-row__identity h3,
.attribute-row--popular-elite .attribute-row__identity h3 {
  color: var(--tier-name-text);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.attribute-row--popular-qualified .attribute-row__identity p,
.attribute-row--popular-confidence .attribute-row__identity p,
.attribute-row--popular-strong .attribute-row__identity p,
.attribute-row--popular-elite .attribute-row__identity p {
  color: var(--tier-chip-text);
  opacity: 0.82;
}

.attribute-row--popular-qualified .attribute-row__eyebrow,
.attribute-row--popular-confidence .attribute-row__eyebrow,
.attribute-row--popular-strong .attribute-row__eyebrow,
.attribute-row--popular-elite .attribute-row__eyebrow {
  color: var(--tier-chip-text);
  opacity: 0.74;
}

.attribute-row--popular-qualified .headline-chip--place,
.attribute-row--popular-confidence .headline-chip--place,
.attribute-row--popular-strong .headline-chip--place,
.attribute-row--popular-elite .headline-chip--place {
  background: var(--tier-chip-bg);
  border-color: var(--tier-chip-border);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 5px 0 0 var(--tier-row-rail),
    0 8px 18px var(--tier-shadow);
}

.attribute-row--popular-qualified .headline-chip--place span,
.attribute-row--popular-confidence .headline-chip--place span,
.attribute-row--popular-strong .headline-chip--place span,
.attribute-row--popular-elite .headline-chip--place span {
  color: var(--tier-chip-text);
  font-weight: 800;
}

.attribute-row--popular-qualified .headline-chip--place strong,
.attribute-row--popular-confidence .headline-chip--place strong,
.attribute-row--popular-strong .headline-chip--place strong,
.attribute-row--popular-elite .headline-chip--place strong {
  color: var(--tier-chip-text);
  font-size: 1.03rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.attribute-row--popular-qualified .headline-chip--place small,
.attribute-row--popular-confidence .headline-chip--place small,
.attribute-row--popular-strong .headline-chip--place small,
.attribute-row--popular-elite .headline-chip--place small {
  color: var(--tier-chip-text);
  opacity: 0.82;
  font-weight: 700;
}

.attribute-row--popular-elite .headline-chip--place strong {
  font-size: 1.08rem;
}

.attribute-row--popular-elite .attribute-row__gate {
  font-size: 1.08rem;
}

html[data-theme="light"] .attribute-row--popular-qualified,
html[data-theme="light"] .attribute-row--popular-confidence,
html[data-theme="light"] .attribute-row--popular-strong,
html[data-theme="light"] .attribute-row--popular-elite {
  background:
    linear-gradient(90deg, var(--tier-row-bg), rgba(255, 255, 255, 0.7) 68%),
    var(--panel-soft-bg);
}

html[data-theme="light"] .attribute-row--popular-confidence,
html[data-theme="light"] .attribute-row--popular-strong {
  box-shadow:
    inset 0 0 0 1px var(--tier-row-border),
    inset 9px 0 0 var(--tier-row-rail),
    0 16px 30px var(--tier-shadow);
}

html[data-theme="light"] .attribute-row--popular-elite {
  box-shadow:
    inset 0 0 0 1px var(--tier-row-border),
    inset 12px 0 0 var(--tier-row-rail),
    0 18px 34px var(--tier-shadow);
}

html[data-theme="light"] .attribute-row--popular-elite .attribute-row__identity h3,
html[data-theme="light"] .attribute-row--popular-elite .headline-chip--place strong {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.attribute-row__abilities {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.attribute-row__abilities > .ability-cell {
  grid-column: span 2;
}

.attribute-row__abilities:has(> .ability-cell:nth-child(5):last-child) > .ability-cell:nth-child(4) {
  grid-column: 2 / span 2;
}

.attribute-row__abilities:has(> .ability-cell:nth-child(5):last-child) > .ability-cell:nth-child(5) {
  grid-column: 4 / span 2;
}

.ability-cell {
  position: relative;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: var(--panel-soft-solid);
  border: 1px solid var(--panel-soft-border);
  min-height: 78px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.15rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  text-align: center;
}

.ability-cell--strong {
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.16), rgba(255, 255, 255, 0.04));
  border-color: rgba(197, 160, 89, 0.24);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.ability-cell--strong::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.95), transparent);
  pointer-events: none;
}

.ability-cell--muted {
  opacity: 0.74;
  filter: saturate(0.92);
}

.ability-cell__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ability-cell__meta {
  display: block;
  margin-top: 0.24rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.quant-meter {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
}

.quant-meter__dial {
  position: relative;
  width: 84px;
  height: 48px;
  overflow: hidden;
}

.quant-meter__arc {
  position: absolute;
  inset: 0;
  border-radius: 84px 84px 0 0;
  background:
    conic-gradient(
      from 180deg at 50% 100%,
      rgba(239, 68, 68, 0.7) 0deg 54deg,
      rgba(245, 158, 11, 0.75) 54deg 117deg,
      rgba(34, 197, 94, 0.8) 117deg 180deg
    );
}

.quant-meter__arc::after {
  content: "";
  position: absolute;
  inset: 10px 10px -10px;
  border-radius: 70px 70px 0 0;
  background: var(--bg-card);
  border-top: 1px solid var(--surface-contrast);
}

.quant-meter__needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 34px;
  border-radius: 999px;
  background: var(--text);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(calc(-90deg + (var(--meter-value) * 180deg)));
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.18);
}

.quant-meter__hub {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, 50%);
  box-shadow: 0 0 0 3px var(--bg-card);
}

.quant-meter__score {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.quant-meter__caption {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.quant-meter--empty {
  min-height: 48px;
  min-width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--panel-soft-border);
  border-radius: 10px;
  background: var(--panel-soft-solid);
}

.quant-stars {
  display: inline-flex;
  gap: 0.14rem;
  color: var(--empty-star);
}

.quant-star.is-filled {
  color: var(--gold-star);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.22);
}

.quant-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--bar-track);
  overflow: hidden;
}

.quant-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.9), rgba(245, 158, 11, 0.85));
}

.quant-bar--small {
  height: 7px;
}

.attribute-row__tags,
.snapshot-card__topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.attribute-row__tags {
  grid-column: 1 / -1;
}

.attribute-row__trials {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.38rem;
}

.attribute-row__trials-label {
  color: var(--gold-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.attribute-row__trials-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trial-link-card {
  display: grid;
  gap: 0.12rem;
  min-width: 138px;
  padding: 0.45rem 0.58rem;
  border-radius: 12px;
  background: var(--panel-soft-solid);
  border: 1px solid var(--panel-soft-border);
  box-shadow: inset 0 1px 0 var(--panel-soft-highlight);
  text-decoration: none;
}

.trial-link-card:hover {
  text-decoration: none;
  border-color: rgba(197, 160, 89, 0.26);
  box-shadow: var(--panel-shadow);
  transform: translateY(-1px);
}

.trial-link-card strong {
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.2;
}

.trial-link-card span {
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.28;
}

.attribute-row__cta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--gold);
  border: 1px solid rgba(197, 160, 89, 0.22);
  border-radius: 999px;
  padding: 0.24rem 0.56rem;
  background: rgba(197, 160, 89, 0.08);
  font-weight: 700;
}

.fact-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.fact-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
}

.fact-good {
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.22);
}

.fact-warn {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.22);
}

html[data-theme="light"] .fact-good {
  background: rgba(16, 185, 129, 0.26);
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.46);
}

html[data-theme="light"] .fact-warn {
  background: rgba(244, 114, 182, 0.3);
  color: #9d174d;
  border-color: rgba(236, 72, 153, 0.5);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

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

.snapshot-grid--five {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.snapshot-grid--five > .snapshot-card:nth-child(-n+3) {
  grid-column: span 2;
}

.snapshot-grid--five > .snapshot-card:nth-child(n+4) {
  grid-column: span 3;
}

@media (max-width: 1100px) {
  .snapshot-grid--six,
  .snapshot-grid--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-grid--five > .snapshot-card:nth-child(-n+3),
  .snapshot-grid--five > .snapshot-card:nth-child(n+4) {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .snapshot-grid--six,
  .snapshot-grid--five {
    grid-template-columns: 1fr;
  }
}

.snapshot-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: 1.1rem;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.snapshot-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.95), transparent);
  pointer-events: none;
}

.snapshot-card.is-locked {
  min-height: 260px;
}

.snapshot-card--heat-locked .snapshot-card__rows {
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

.snapshot-card--heat-locked .snapshot-card__topline strong {
  color: rgba(248, 250, 252, 0.72);
}

html[data-theme="light"] .snapshot-card--heat-locked .snapshot-card__topline strong {
  color: var(--text);
}

.heat-chip--locked {
  border-style: dashed;
  opacity: 0.92;
}

.quant-heat-lock {
  padding: 1.35rem 1.1rem;
  text-align: center;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  border: 1px dashed rgba(197, 160, 89, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.quant-heat-lock p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 28rem;
}

.quant-heat-lock--overlay {
  position: absolute;
  inset: 1rem;
  display: grid;
  align-content: center;
  justify-items: center;
  background: rgba(6, 8, 14, 0.62);
  backdrop-filter: blur(10px);
  z-index: 2;
}

html[data-theme="light"] .quant-heat-lock {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="light"] .quant-heat-lock p {
  color: #334155;
}

html[data-theme="light"] .quant-heat-lock--overlay {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.26);
}

.snapshot-card.is-locked .snapshot-card__head,
.snapshot-card.is-locked .snapshot-card__topline,
.snapshot-card.is-locked .snapshot-card__rows {
  opacity: 0.28;
  filter: grayscale(1);
}

.snapshot-card__row--locked {
  pointer-events: none;
}

.snapshot-card__row--locked .snapshot-card__horse strong {
  color: var(--gold);
}

html[data-theme="light"] .snapshot-card__row--locked {
  color: var(--text);
}

html[data-theme="light"] .snapshot-card__row--locked .snapshot-card__horse span {
  color: #334155;
}

.snapshot-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.snapshot-card__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}

.snapshot-card__badge {
  display: grid;
  justify-items: end;
  text-align: right;
  min-width: 64px;
}

.snapshot-card__badge span {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
}

.snapshot-card__badge small {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.snapshot-card__topline {
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.snapshot-card__topline strong {
  color: var(--text);
  font-size: 0.82rem;
}

.snapshot-card__rows {
  display: grid;
  gap: 0.55rem;
}

.snapshot-card__row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "number horse"
    "number prob";
  gap: 0.35rem 0.72rem;
  align-items: start;
  padding: 0.42rem 0;
}

.snapshot-card__row.is-selected {
  padding: 0.65rem 0.75rem;
}

.snapshot-card__number {
  grid-area: number;
  align-self: center;
  min-width: 42px;
}

.snapshot-card__horse {
  grid-area: horse;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.snapshot-card__horse strong,
.snapshot-card__horse span {
  display: block;
  overflow-wrap: break-word;
  word-break: normal;
}

.snapshot-card__horse strong {
  line-height: 1.25;
}

.snapshot-card__horse span {
  line-height: 1.35;
}

.snapshot-card__prob {
  grid-area: prob;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr);
  gap: 0.55rem;
  align-items: center;
}

.snapshot-card__prob strong {
  white-space: normal;
  line-height: 1.25;
  font-size: 0.8rem;
}

.snapshot-card__row--top-1,
.snapshot-card__row--top-2 {
  position: relative;
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
}

.snapshot-card__row--top-1 {
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(126, 34, 206, 0.18)),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 0 0 1px rgba(250, 204, 21, 0.34),
    0 10px 22px rgba(76, 29, 149, 0.16);
}

.snapshot-card__row--top-2 {
  background:
    linear-gradient(135deg, rgba(226, 232, 240, 0.2), rgba(148, 163, 184, 0.16)),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 0 0 1px rgba(203, 213, 225, 0.34),
    0 10px 18px rgba(148, 163, 184, 0.14);
}

.snapshot-card__row--top-1 .snapshot-card__horse strong,
.snapshot-card__row--top-1 .snapshot-card__number {
  color: #fde68a;
}

.snapshot-card__row--top-2 .snapshot-card__horse strong,
.snapshot-card__row--top-2 .snapshot-card__number {
  color: #f8fafc;
}

html[data-theme="light"] .snapshot-card__row--top-1 {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(147, 51, 234, 0.14)),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(180, 83, 9, 0.22),
    0 10px 18px rgba(124, 58, 237, 0.1);
}

html[data-theme="light"] .snapshot-card__row--top-2 {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.94)),
    rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.22),
    0 10px 18px rgba(148, 163, 184, 0.12);
}

html[data-theme="light"] .snapshot-card__row--top-1 .snapshot-card__horse strong,
html[data-theme="light"] .snapshot-card__row--top-1 .snapshot-card__number {
  color: #6b21a8;
}

html[data-theme="light"] .snapshot-card__row--top-2 .snapshot-card__horse strong,
html[data-theme="light"] .snapshot-card__row--top-2 .snapshot-card__number {
  color: #0f172a;
}

.snapshot-card__number,
.snapshot-card__rank {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.snapshot-lock {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  display: grid;
  gap: 0.65rem;
  place-items: center;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(6, 6, 8, 0.72);
  border: 1px solid rgba(197, 160, 89, 0.16);
  backdrop-filter: blur(6px);
}

.snapshot-lock p {
  margin: 0;
  text-align: center;
  color: var(--text);
  font-size: 0.85rem;
}

.quant-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.quant-tool-card {
  position: relative;
  min-width: 0;
}

.quant-tool-card.is-locked > :not(.quant-tool-lock) {
  opacity: 0.72;
  filter: grayscale(0.18) blur(1.4px);
  pointer-events: none;
}

.quant-tool-lock {
  position: absolute;
  inset: 1rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(6, 8, 14, 0.62);
  border: 1px solid rgba(197, 160, 89, 0.28);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.quant-tool-lock.hidden {
  display: none;
}

.quant-tool-lock__body {
  display: grid;
  gap: 0.7rem;
  text-align: center;
}

.quant-tool-lock__body strong {
  color: var(--text);
  font-size: 1rem;
}

.quant-tool-lock__body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

html[data-theme="light"] .quant-tool-lock {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="light"] .quant-tool-lock__body p {
  color: #475569;
}

.quant-inline-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.quant-inline-controls input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.72rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.quant-inline-controls input::placeholder {
  color: var(--text-muted);
}

.quant-result-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.02);
  overflow: auto;
}

.quant-empty {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px dashed rgba(197, 160, 89, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}

.quant-result-panel .data-table {
  min-width: 100%;
}

.double-scraper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
}

.qin-setup-layout {
  grid-template-columns: minmax(0, 1fr);
}

.double-scraper-form-card,
.double-scraper-summary-card {
  min-width: 0;
}

.double-scraper-active {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.double-scraper-active__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.double-scraper-active__head strong {
  font-size: 0.92rem;
}

.double-scraper-active__head span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.double-scraper-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.double-scraper-chip {
  appearance: none;
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.double-scraper-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 160, 89, 0.34);
  background: rgba(197, 160, 89, 0.14);
}

.double-scraper-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.double-scraper-field {
  display: grid;
  gap: 0.38rem;
}

.double-scraper-field span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.double-scraper-field input,
.double-scraper-field select {
  width: 100%;
  min-width: 0;
  padding: 0.78rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.double-scraper-field.is-disabled {
  opacity: 0.55;
}

.double-scraper-actions {
  display: flex;
  gap: 0.65rem;
  align-items: end;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.double-scraper-status {
  min-height: 1.5rem;
  margin-top: 0.9rem;
  color: var(--text-muted);
}

.double-scraper-status:empty {
  display: none;
}

.double-scraper-status.is-success {
  color: #7ee0b0;
}

.double-scraper-status.is-error {
  color: #ff928b;
}

.double-scraper-status.is-warning {
  color: #f5c16c;
}

[data-theme="light"] .double-scraper-status.is-error {
  color: #991b1b;
}

[data-theme="light"] .double-scraper-status.is-warning {
  color: #92400e;
}

.double-scraper-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.double-summary-item {
  padding: 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.double-summary-item span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.double-summary-item strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.35;
}

.double-scraper-results {
  display: grid;
  gap: 1rem;
}

.odds-change-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.odds-change-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.odds-change-card__head strong {
  color: var(--gold);
}

.odds-change-card__head span,
.odds-change-card__note,
.odds-change-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.odds-change-card__note,
.odds-change-empty {
  margin: 0;
}

.odds-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.odds-change-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.odds-change-grid h4 {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  color: var(--text);
}

.odds-change-card__meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.odds-change-card__meta span {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.odds-change-list {
  display: grid;
  gap: 0.55rem;
}

.odds-change-chip {
  display: grid;
  gap: 0.12rem;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
}

.odds-change-chip strong,
.odds-change-chip em {
  font-variant-numeric: tabular-nums;
}

.odds-change-chip span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.odds-change-chip em {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}

.odds-change-chip.is-shortening {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.08);
}

.odds-change-chip.is-shortening em {
  color: #fca5a5;
}

.odds-change-chip.is-drifting {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.odds-change-chip.is-drifting em {
  color: var(--text-muted);
}

.dbl-table-card {
  display: grid;
  gap: 0.9rem;
}

.dbl-subtable {
  display: grid;
  gap: 0.55rem;
}

.dbl-subtable__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.dbl-subtable__head strong {
  color: var(--gold);
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.dbl-subtable__head span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.dbl-table-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: start;
}

.dbl-table-card__head h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.5rem;
}

.dbl-table-card__meta,
.dbl-table-card__links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.dbl-table-card__meta span,
.dbl-table-card__links span {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.dbl-table-card__note {
  margin: -0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.odds-dbl-carry-strip .dbl-carry-prev-rank {
  margin: 0;
  padding: 0.52rem 0.62rem 0.58rem;
  border-top: 1px solid rgba(197, 160, 89, 0.1);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.odds-dbl-carry-strip .dbl-carry-prev-rank strong {
  color: var(--text);
  font-weight: 650;
}

[data-theme="light"] .odds-dbl-carry-strip .dbl-carry-prev-rank {
  border-top-color: rgba(120, 90, 40, 0.14);
}

.dbl-matrix-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.14);
}

.dbl-matrix {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

.dbl-matrix th,
.dbl-matrix td {
  padding: 0.58rem 0.62rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.08);
  border-right: 1px solid rgba(197, 160, 89, 0.08);
  text-align: center;
  font-size: 0.82rem;
}

.dbl-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(10, 10, 13, 0.96);
  color: var(--gold);
}

.dbl-matrix thead th:first-child {
  left: 0;
  z-index: 3;
  background: rgba(10, 10, 13, 0.98);
}

.dbl-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(14, 14, 18, 0.96);
  color: var(--gold);
}

.dbl-matrix td {
  color: var(--text);
}

.dbl-matrix td.is-short {
  background: rgba(254, 226, 226, 0.92);
  color: #b91c1c;
  font-weight: 800;
}

.dbl-matrix td.is-mid {
  color: var(--text);
}

.dbl-matrix td.is-long {
  color: var(--text-muted);
}

.dbl-matrix td.is-hot {
  background: rgba(220, 38, 38, 0.18);
  color: #7f1d1d;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.4);
}

.dbl-table-card .dbl-matrix td.is-short,
.dbl-table-card .dbl-matrix td.is-mid,
.dbl-table-card .dbl-matrix td.is-long {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 400;
}

.dbl-table-card .dbl-matrix td.is-short.has-value,
.dbl-table-card .dbl-matrix td.is-mid.has-value,
.dbl-table-card .dbl-matrix td.is-long.has-value {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.dbl-table-card .dbl-matrix td.is-hot {
  background: rgba(239, 68, 68, 0.22);
  color: #7f1d1d;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.52);
}

.dbl-table-card .dbl-matrix td.is-empty {
  background: rgba(255, 255, 255, 0.015);
  color: rgba(255, 255, 255, 0.28);
}

.dbl-strip-wrap {
  border-style: dashed;
}

.dbl-strip-table {
  min-width: 540px;
}

.dbl-strip-table tbody th {
  background: rgba(14, 14, 18, 0.98);
}

.dbl-strip-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.dbl-strip-cell.is-shortening {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.dbl-strip-cell.is-drifting {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.dbl-strip-cell.is-partial {
  box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.35);
}

.qin-table-card .dbl-matrix td.is-short {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font-weight: 400;
}

.qin-table-card .dbl-matrix td.is-mid {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.qin-table-card .dbl-matrix td.is-long {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.qin-table-card .dbl-matrix td.is-hot {
  background: rgba(239, 68, 68, 0.22);
  color: #7f1d1d;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.52);
}

.qin-table-card .dbl-matrix td.is-empty {
  background: rgba(255, 255, 255, 0.96);
  color: #cbd5e1;
}

.attribute-row--clickable,
.snapshot-card__row--clickable {
  cursor: pointer;
}

.attribute-row--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  border-color: rgba(197, 160, 89, 0.28);
}

.attribute-row.is-selected,
.snapshot-card__row.is-selected {
  position: relative;
}

.attribute-row.is-selected {
  border-color: rgba(197, 160, 89, 0.44);
  box-shadow:
    inset 0 0 0 1px rgba(197, 160, 89, 0.22),
    0 16px 30px rgba(197, 160, 89, 0.12);
}

.attribute-row.is-selected::after,
.snapshot-card__row.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(197, 160, 89, 0.3);
}

.snapshot-card__row.is-selected {
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.12), rgba(255, 255, 255, 0.03));
  padding: 0.35rem 0.45rem;
}

.attribute-row--popular-qualified.attribute-row--clickable:hover {
  border-color: var(--tier-qualified-border);
}

.attribute-row--popular-confidence.attribute-row--clickable:hover,
.attribute-row--popular-strong.attribute-row--clickable:hover {
  border-color: var(--tier-strong-border);
}

.attribute-row--popular-elite.attribute-row--clickable:hover {
  border-color: var(--tier-elite-border);
}

.attribute-row--clickable:focus-visible,
.snapshot-card__row--clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 10px;
}

.attribute-row__subline .model-rank {
  display: none;
}

.quant-horse-workspace__status {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--gold-chip-border);
  background: var(--gold-chip-bg);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}

.quant-horse-modal__dialog {
  width: min(1120px, 100%);
}

.quant-horse-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.quant-horse-modal__head-copy {
  display: grid;
  gap: 0.3rem;
}

.quant-horse-modal__head-copy h2 {
  margin: 0;
}

.quant-horse-modal__head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.quant-horse-modal__content {
  margin-top: 0.8rem;
  display: grid;
  gap: 1rem;
}

.quant-horse-modal__intro p {
  margin: 0;
}

.quant-horse-modal__intro {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.12);
}

.quant-horse-modal__intro p:last-child {
  color: var(--text-muted);
}

.quant-horse-modal__chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 0.6rem;
}

.quant-horse-modal__section--hero {
  position: relative;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(197, 160, 89, 0.16);
  border-radius: 16px;
  background: var(--hero-shell-bg);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.quant-horse-modal__section--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--hero-shell-sheen);
  opacity: 0.9;
}

.quant-horse-modal__section--hero > * {
  position: relative;
  z-index: 1;
}

.quant-horse-modal__eyebrow {
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

.quant-horse-modal__chip {
  border: 1px solid rgba(197, 160, 89, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);

  /* Compact homepage hero and CTA behavior to reduce vertical scroll */
  .home-hero__intro .hero-lead {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .home-hero__actions {
    margin-top: 0.45rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
  }
  .home-hero__btn--primary { flex: 1 1 auto; min-width: 140px; }
  .home-hero__btn--secondary { flex: 1 1 auto; min-width: 110px; }

  /* Slightly denser cards for compact mobile flow */
  .home-pillars article { padding: 0.6rem; }
  .home-proof__grid { gap: 0.6rem; }
  .home-trust-card p { margin: 0; font-size: 0.95rem; }

  /* Make the mobile sticky CTA less intrusive */
  .sigma-quant-cta--sticky { display: block; left: 50%; transform: translateX(-50%); bottom: 12px; padding: 0.6rem 1rem; border-radius: 999px; z-index: 12000; }
  padding: 0.6rem 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quant-horse-modal__chip span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.quant-horse-modal__chip strong {
  color: var(--gold);
  font-size: 0.9rem;
}

.quant-horse-modal__verdict {
  min-width: 168px;
  padding: 0.72rem 0.82rem;
  border-radius: 14px;
  border: 2px solid rgba(197, 160, 89, 0.22);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

.quant-horse-modal__verdict span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.quant-horse-modal__verdict strong {
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1.1;
}

.quant-horse-modal__verdict small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.quant-horse-modal__verdict--qualified {
  border-color: var(--tier-qualified-border);
  background: var(--tier-qualified-chip-bg);
}

.quant-horse-modal__verdict--qualified span,
.quant-horse-modal__verdict--qualified strong {
  color: var(--tier-qualified-chip-text);
}

.quant-horse-modal__verdict--confidence,
.quant-horse-modal__verdict--strong {
  border-color: var(--tier-strong-border);
  background: var(--tier-strong-chip-bg);
}

.quant-horse-modal__verdict--confidence span,
.quant-horse-modal__verdict--confidence strong,
.quant-horse-modal__verdict--strong span,
.quant-horse-modal__verdict--strong strong {
  color: var(--tier-strong-chip-text);
}

.quant-horse-modal__verdict--elite {
  border-color: var(--tier-elite-border);
  background: var(--tier-elite-chip-bg);
  box-shadow: 0 16px 26px var(--tier-elite-shadow);
}

.quant-horse-modal__verdict--elite span,
.quant-horse-modal__verdict--elite strong {
  color: var(--tier-elite-chip-text);
}

.quant-horse-modal__verdict--label-only {
  align-self: start;
  min-width: 7.5rem;
}

.quant-horse-modal__verdict--label-only span {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.quant-horse-modal__section {
  display: grid;
  gap: 0.45rem;
}

.quant-horse-modal__section--tabs {
  gap: 1rem;
}

.quant-horse-modal__tablist {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.4rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  z-index: 2;
}

.quant-horse-modal__tablist::-webkit-scrollbar {
  display: none;
}

.quant-horse-modal__tab {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.58rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel-soft-solid);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.quant-horse-modal__tab:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 160, 89, 0.28);
  color: var(--text);
}

.quant-horse-modal__tab[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
  border-style: dashed;
  transform: none;
}

.quant-horse-modal__tab[aria-disabled="true"] {
  position: relative;
  cursor: pointer;
  opacity: 0.72;
  border-style: dashed;
}

.quant-horse-modal__tab[aria-disabled="true"][data-lock-label]:hover::after,
.quant-horse-modal__tab[aria-disabled="true"][data-lock-label]:focus-visible::after {
  content: attr(data-lock-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  z-index: 4;
  width: max-content;
  max-width: min(14rem, 72vw);
  padding: 0.36rem 0.58rem;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.3);
  background: rgba(12, 12, 16, 0.96);
  color: var(--gold);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .quant-horse-modal__tab[aria-disabled="true"][data-lock-label]:hover::after,
html[data-theme="light"] .quant-horse-modal__tab[aria-disabled="true"][data-lock-label]:focus-visible::after {
  background: rgba(255, 255, 255, 0.98);
  color: #7e5b22;
  border-color: rgba(155, 111, 31, 0.32);
  box-shadow: 0 10px 20px rgba(87, 60, 24, 0.12);
}

.quant-horse-modal__tab[disabled]:hover {
  transform: none;
  border-color: var(--panel-soft-border);
  color: var(--text-muted);
}

.quant-horse-modal__tab.is-active {
  border-color: rgba(197, 160, 89, 0.34);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.18), rgba(255, 255, 255, 0.03));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.18), 0 10px 18px rgba(0, 0, 0, 0.12);
}

.quant-horse-modal__tab small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.16);
  color: inherit;
  font-size: 0.68rem;
  line-height: 1;
}

.quant-horse-modal__panels {
  display: grid;
  gap: 0.8rem;
}

.quant-horse-modal__tabpanel {
  display: grid;
  gap: 0.8rem;
}

.quant-horse-modal__tabpanel.is-hidden,
.quant-horse-modal__tabpanel[hidden] {
  display: none !important;
}

.quant-horse-modal__tabpanel.is-active {
  display: grid;
}

.quant-training-cal {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quant-training-cal__subtitle {
  margin: 0;
}

.quant-training-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.quant-training-cal__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.quant-training-cal__legend-item::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.quant-training-cal__legend-item--swim::before {
  background: rgba(96, 165, 250, 0.85);
}

.quant-training-cal__legend-item--trot::before {
  background: rgba(52, 211, 153, 0.85);
}

.quant-training-cal__legend-item--mill::before {
  background: rgba(192, 132, 252, 0.85);
}

.quant-training-cal__legend-item--gallop::before {
  background: rgba(251, 191, 36, 0.9);
}

html[data-theme="light"] .quant-training-cal__legend-item--swim::before {
  background: rgba(37, 99, 235, 0.78);
}

html[data-theme="light"] .quant-training-cal__legend-item--trot::before {
  background: rgba(5, 150, 105, 0.78);
}

html[data-theme="light"] .quant-training-cal__legend-item--mill::before {
  background: rgba(126, 34, 206, 0.72);
}

html[data-theme="light"] .quant-training-cal__legend-item--gallop::before {
  background: rgba(180, 83, 9, 0.82);
}

.quant-training-cal__gridhead {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.quant-training-cal__dow {
  padding: 0.15rem 0;
}

.quant-training-cal__grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quant-training-cal__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.quant-training-cal__cell {
  border: 1px solid var(--panel-soft-border);
  border-radius: 10px;
  background: var(--panel-soft-solid);
  min-height: 5.25rem;
  padding: 0.35rem 0.38rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.quant-training-cal__cell--pad {
  visibility: hidden;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: none;
}

.quant-training-cal__cell-head {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.quant-training-cal__cell-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.quant-training-cal__cell-empty {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.65;
}

.quant-training-cal__pill {
  font-size: 0.63rem;
  line-height: 1.25;
  padding: 0.18rem 0.28rem;
  border-radius: 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  border: 1px solid transparent;
  color: var(--text);
}

.quant-training-cal__pill-title {
  font-weight: 700;
}

.quant-training-cal__pill-count {
  opacity: 0.82;
  font-weight: 600;
  font-size: 0.6rem;
}

.quant-training-cal__pill--swim {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.32);
}

.quant-training-cal__pill--trot {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.32);
}

.quant-training-cal__pill--mill {
  background: rgba(192, 132, 252, 0.14);
  border-color: rgba(192, 132, 252, 0.32);
}

.quant-training-cal__pill--gallop {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.38);
}

.quant-training-cal__pill--race {
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.38);
}

html[data-theme="light"] .quant-training-cal__pill--swim {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .quant-training-cal__pill--trot {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.22);
}

html[data-theme="light"] .quant-training-cal__pill--mill {
  background: rgba(126, 34, 206, 0.09);
  border-color: rgba(126, 34, 206, 0.2);
}

html[data-theme="light"] .quant-training-cal__pill--gallop {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.26);
}

html[data-theme="light"] .quant-training-cal__pill--race {
  background: rgba(219, 39, 119, 0.1);
  border-color: rgba(219, 39, 119, 0.28);
}

.quant-training-cal__gallop-stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.quant-training-cal__gallop-detail {
  font-size: 0.62rem;
  line-height: 1.35;
  padding: 0.28rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-soft-border);
  color: var(--text-muted);
}

html[data-theme="light"] .quant-training-cal__gallop-detail {
  background: rgba(0, 0, 0, 0.028);
}

.quant-training-cal__gallop-k {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.2rem;
}

.quant-training-cal__gallop-v {
  word-break: break-word;
}

.quant-horse-modal__overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.quant-horse-modal__hero-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: flex-start;
}

.quant-horse-modal__evidence-blurb {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.quant-horse-modal__subhead {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.94rem;
}

.quant-horse-modal__subhead--spaced {
  margin-top: 1rem;
}

.quant-horse-modal__profile-grid,
.quant-horse-modal__technical-grid {
  display: grid;
  align-items: stretch;
}

.quant-horse-modal__profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

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

.quant-horse-modal__profile-grid--five {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.quant-horse-modal__profile-grid--five > .quant-horse-modal__insight-card:nth-child(-n + 3) {
  grid-column: span 2;
}

.quant-horse-modal__profile-grid--five > .quant-horse-modal__insight-card:nth-child(n + 4) {
  grid-column: span 3;
}

.quant-horse-modal__technical-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
}

.quant-horse-modal__section h3 {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quant-horse-modal__section-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.quant-horse-modal__insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

.quant-horse-modal__insight-card {
  position: relative;
  border: 1px solid rgba(197, 160, 89, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  padding: 0.75rem;
  display: grid;
  gap: 0.34rem;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.quant-horse-modal__profile-grid .quant-horse-modal__insight-card {
  border-color: rgba(197, 160, 89, 0.22);
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.16);
}

.quant-horse-modal__insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.95), transparent);
  pointer-events: none;
}

.quant-horse-modal__insight-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 180, 68, 0.4), transparent);
  pointer-events: none;
}

.quant-horse-modal__story-card--strength::before,
.quant-horse-modal__story-card--support::before,
.quant-horse-modal__story-card--risks::before,
.quant-horse-modal__story-card--risk::before {
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.95), transparent);
}

.quant-horse-modal__story-card--strength::before {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), transparent);
}

.quant-horse-modal__story-card--support::before {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), transparent);
}

.quant-horse-modal__story-card--risks::before,
.quant-horse-modal__story-card--risk::before {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), transparent);
}

.quant-horse-modal__insight-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.quant-horse-modal__badge {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
}

.quant-horse-modal__insight-meaning,
.quant-horse-modal__insight-meta,
.quant-horse-modal__insight-raw,
.quant-horse-modal__insight-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.quant-horse-modal__insight-stars {
  font-size: 0.8rem;
}

.quant-horse-modal__insight-meaning {
  color: var(--gold-dim);
  font-weight: 600;
}

.quant-horse-modal__insight-stars {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.quant-horse-modal__insight-meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(245, 245, 245, 0.82);
}

html[data-theme="light"] .quant-horse-modal__insight-meta {
  color: var(--text-muted);
}

.quant-horse-modal__insight-raw {
  font-size: 0.72rem;
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid rgba(197, 160, 89, 0.12);
  color: var(--text-muted);
}

.quant-horse-modal__insight-text {
  color: var(--text);
  line-height: 1.45;
}

.quant-horse-modal__comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.quant-horse-modal__comparison-card {
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel-soft-bg);
  padding: 0.82rem;
  box-shadow: var(--panel-shadow);
  display: grid;
  gap: 0.5rem;
}

.quant-horse-modal__comparison-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.quant-horse-modal__comparison-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.quant-horse-modal__comparison-head span {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.84rem;
}

.quant-horse-modal__comparison-card.is-top {
  border-color: rgba(34, 197, 94, 0.24);
}

.quant-horse-modal__comparison-card.is-top .quant-horse-modal__comparison-bar span {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.88), rgba(16, 185, 129, 0.88));
}

.quant-horse-modal__comparison-card.is-low {
  border-color: rgba(239, 68, 68, 0.2);
}

.quant-horse-modal__comparison-card.is-low .quant-horse-modal__comparison-bar span {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.88), rgba(239, 68, 68, 0.9));
}

.trial-preview--inline {
  margin-top: 0.1rem;
}

.is-trial-preview-open {
  border-color: rgba(197, 160, 89, 0.28);
}

.trial-preview__panel {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.15rem;
}

.trial-preview__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.trial-preview__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}

.trial-preview__frame {
  position: relative;
  width: 100%;
  height: clamp(280px, 42vh, 420px);
  min-height: 280px;
  max-height: 76vh;
  max-width: 100%;
  resize: vertical;
  border-radius: 14px;
  overflow: auto;
  background: var(--panel-soft-solid);
  border: 1px solid var(--panel-soft-border);
}

.trial-preview__frame iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  display: block;
}

.trial-preview__loading,
.trial-preview__fallback {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 280px;
  padding: 1rem;
  text-align: center;
}

.trial-preview__actions,
.trial-preview__fallback {
  margin-top: 0.1rem;
}

.trial-preview__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quant-horse-modal__history-card {
  background: var(--panel-soft-bg);
  border: 1px solid var(--panel-soft-border);
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
  box-shadow: var(--panel-shadow);
  display: grid;
  gap: 0.65rem;
}

.quant-horse-modal__history-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: flex-start;
}

.quant-horse-modal__history-card-head h5 {
  margin: 0.3rem 0 0;
  font-size: 0.92rem;
  color: var(--text);
}

.quant-horse-modal__history-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--gold-chip-border);
  background: var(--gold-chip-bg);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quant-horse-modal__history-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.quant-horse-modal__history-metric-row > div {
  border-radius: 12px;
  padding: 0.45rem 0.55rem;
  background: var(--panel-soft-solid);
  border: 1px solid var(--panel-soft-border);
}

.quant-horse-modal__history-metric-row > div span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quant-horse-modal__history-metric-row > div strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.92rem;
  color: var(--text);
}

.quant-horse-modal__history-chip-row,
.quant-horse-modal__history-odds-row,
.quant-horse-modal__history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.quant-horse-modal__history-chip-row span,
.quant-horse-modal__history-odds-row span {
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  background: var(--panel-soft-solid);
  border: 1px solid var(--panel-soft-border);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.quant-horse-modal__history-odds-row span {
  border-color: rgba(197, 160, 89, 0.22);
  background: var(--gold-chip-bg);
  color: var(--text);
  font-weight: 700;
}

.quant-horse-modal__section--comparison .quant-horse-modal__comparison-bar span {
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.25);
}

/* Peer reference line: base .insight-meta uses light-on-dark text; cards are light in default theme */
.quant-horse-modal__comparison-card .quant-horse-modal__comparison-peers {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.quant-horse-modal__section--technical .quant-field-label span {
  color: var(--text);
  font-weight: 700;
}

.quant-horse-modal__section--technical .quant-horse-modal__table tbody tr:hover {
  transform: translateY(-1px);
}

.quant-horse-modal__section--technical .quant-horse-modal__table tbody tr td {
  text-wrap: balance;
}

.quant-horse-modal__section--technical .quant-horse-modal__table tbody tr td:last-child {
  font-size: 0.92rem;
}

.quant-horse-modal__section--evidence .quant-horse-modal__history-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(197, 160, 89, 0.14);
}

.quant-horse-modal__section--evidence .quant-horse-modal__history-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
}

.quant-horse-modal__section--evidence .quant-horse-modal__history-chip,
.quant-horse-modal__section--evidence .quant-horse-modal__badge {
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.12);
}

.quant-radar {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid rgba(197, 160, 89, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

.quant-radar__head {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.2rem;
}

.quant-radar__head span {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.quant-radar__head small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.quant-radar__svg {
  width: 100%;
  height: auto;
}

.quant-radar__grid-polygon {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.quant-radar__axis {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.quant-radar__shape {
  fill: rgba(197, 160, 89, 0.28);
  stroke: rgba(245, 180, 68, 0.95);
  stroke-width: 2;
}

.quant-radar__label {
  fill: var(--text-muted);
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.quant-radar__legend {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.quant-radar__legend-item {
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.quant-radar__legend-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.quant-radar__legend-row span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.quant-radar__legend-row strong {
  color: var(--text);
  font-size: 0.82rem;
}

.quant-horse-modal__raw-fields {
  border: 1px solid rgba(197, 160, 89, 0.12);
  border-radius: 12px;
  padding: 0.82rem 0.85rem 0.75rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.1);
}

.quant-horse-modal__tech-card {
  position: relative;
  overflow: hidden;
}

.quant-horse-modal__tech-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.9), transparent);
  pointer-events: none;
}

.quant-horse-modal__raw-fields summary {
  cursor: pointer;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.quant-horse-modal__raw-fields summary::-webkit-details-marker {
  display: none;
}

.quant-horse-modal__raw-fields[open] summary {
  margin-bottom: 0.65rem;
}

.quant-horse-modal__raw-fields .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.55rem;
}

.quant-horse-modal__raw-fields .data-table tbody {
  display: grid;
  gap: 0.55rem;
}

.quant-horse-modal__raw-fields .data-table tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(130px, 0.82fr);
  gap: 0.55rem;
  align-items: stretch;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.12);
  background: linear-gradient(180deg, rgba(197, 160, 89, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quant-horse-modal__raw-fields .data-table tbody th,
.quant-horse-modal__raw-fields .data-table tbody td {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.quant-horse-modal__raw-fields .data-table tbody th {
  text-align: left;
}

.quant-horse-modal__raw-fields .data-table tbody td {
  align-self: center;
  justify-self: end;
  text-align: right;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quant-horse-modal__group + .quant-horse-modal__group {
  margin-top: 0.7rem;
}

.quant-horse-modal__group h4 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.quant-horse-modal__group h4 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: space-between;
  align-items: center;
}

.quant-horse-modal__group h4 span {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  background: rgba(197, 160, 89, 0.08);
  color: var(--gold-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quant-horse-modal__table {
  font-size: 0.78rem;
}

.quant-horse-modal__group .quant-horse-modal__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.45rem;
  min-width: 760px;
}

.quant-horse-modal__group .quant-horse-modal__table thead,
.quant-horse-modal__group .quant-horse-modal__table tbody {
  display: block;
}

.quant-horse-modal__group .quant-horse-modal__table thead tr,
.quant-horse-modal__group .quant-horse-modal__table tbody tr {
  display: grid;
  grid-template-columns:
    minmax(42px, 0.55fr)
    minmax(56px, 0.65fr)
    minmax(76px, 0.95fr)
    minmax(56px, 0.72fr)
    minmax(72px, 0.9fr)
    minmax(72px, 0.9fr)
    minmax(58px, 0.72fr)
    minmax(72px, 0.95fr)
    minmax(84px, 1fr)
    minmax(62px, 0.8fr)
    minmax(62px, 0.8fr);
  align-items: center;
  gap: 0.25rem;
}

.quant-horse-modal__group .quant-horse-modal__table thead th {
  padding: 0.35rem 0.35rem 0.45rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quant-horse-modal__group .quant-horse-modal__table tbody tr {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(197, 160, 89, 0.12);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quant-horse-modal__group .quant-horse-modal__table tbody tr td,
.quant-horse-modal__group .quant-horse-modal__table thead tr th {
  display: block;
}

.quant-horse-modal__group .quant-horse-modal__table tbody td {
  padding: 0.52rem 0.4rem;
  border-top: 0;
  border-bottom: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.quant-horse-modal__group .quant-horse-modal__table tbody td::before {
  display: none;
}

.quant-horse-modal__group .quant-horse-modal__table tbody tr td:nth-child(4),
.quant-horse-modal__group .quant-horse-modal__table tbody tr td:nth-child(5) {
  color: var(--gold);
  font-weight: 700;
}

.quant-horse-modal__group .quant-horse-modal__table tbody tr:hover {
  background: rgba(197, 160, 89, 0.06);
}

.quant-horse-modal__chips .quant-horse-modal__chip:nth-child(5) {
  border-color: rgba(245, 158, 11, 0.42);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(197, 160, 89, 0.1)),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.quant-horse-modal__chips .quant-horse-modal__chip:nth-child(5) span {
  color: var(--gold-dim);
  font-weight: 800;
}

.quant-horse-modal__chips .quant-horse-modal__chip:nth-child(5) strong {
  color: var(--gold);
  font-size: 1rem;
}

.quant-horse-modal__empty {
  margin: 0;
  color: var(--text-muted);
}

.quant-field-label {
  display: grid;
  gap: 0.24rem;
}

.quant-field-label small {
  display: inline-flex;
  align-self: start;
  width: fit-content;
  padding: 0.17rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.16);
  background: rgba(197, 160, 89, 0.08);
  color: var(--gold-dim);
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.2;
}

.double-scraper-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.double-scraper-form select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font: inherit;
}

.double-scraper-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.double-summary-grid,
.double-results-grid {
  display: grid;
  gap: 1rem;
}

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

.double-scraper-status {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel-soft-bg);
  color: var(--text-muted);
}

.double-scraper-status[data-tone="loading"] {
  color: var(--gold);
  border-color: var(--gold-chip-border);
  background: var(--gold-chip-bg);
}

.double-scraper-status[data-tone="success"] {
  color: var(--tier-qualified-chip-text);
  border-color: var(--tier-qualified-chip-border);
  background: var(--tier-qualified-bg);
}

.double-scraper-status[data-tone="error"] {
  color: #fecaca;
  border-color: rgba(196, 68, 68, 0.35);
  background: rgba(196, 68, 68, 0.12);
}

.double-scraper-status[data-tone="warning"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

[data-theme="light"] .double-scraper-status[data-tone="error"] {
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(254, 226, 226, 0.92);
}

[data-theme="light"] .double-scraper-status[data-tone="warning"] {
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.42);
  background: rgba(254, 243, 199, 0.95);
}

.double-table-card {
  display: grid;
  gap: 1rem;
}

.double-table-card__head,
.double-table-card__meta,
.double-table-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.double-table-card__head h3 {
  margin: 0.2rem 0 0;
}

.double-table-card__actions {
  display: flex;
  gap: 0.5rem;
}

.double-table-card__meta span,
.double-table-card__foot span {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--panel-soft-bg);
  border: 1px solid var(--panel-soft-border);
  color: var(--text-muted);
}

.double-table-card__meta strong,
.double-table-card__foot strong {
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.double-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--panel-soft-border);
  border-radius: 16px;
}

.double-data-table {
  min-width: 780px;
  margin: 0;
}

.double-data-table th:first-child {
  min-width: 98px;
}

.double-data-table td {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.double-cell-empty {
  color: var(--text-muted);
}

.is-disabled {
  opacity: 0.55;
}

@media (max-width: 1080px) {
  .quant-hero,
  .quant-tools-grid {
    grid-template-columns: 1fr;
  }

  .double-scraper-layout {
    grid-template-columns: 1fr;
  }

  .double-scraper-summary {
    grid-template-columns: 1fr 1fr;
  }

  .quant-page-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attribute-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .attribute-row__headline-metrics {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .attribute-row__abilities,
  .attribute-row__tags {
    grid-column: 1 / -1;
  }

  .attribute-row__abilities {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .attribute-board__summary {
    align-items: start;
    flex-direction: column;
  }

  .attribute-board__summary-stats,
  .heat-summary {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .sigma-quant-page {
    padding-top: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .quant-hero,
  .quant-section,
  .quant-tool-card,
  .snapshot-card {
    padding: 1rem;
  }

  .heat-summary,
  .attribute-board__summary-stats,
  .quant-tools-grid {
    grid-template-columns: 1fr;
  }

  .double-scraper-form,
  .double-scraper-summary {
    grid-template-columns: 1fr;
  }

  .odds-change-grid {
    grid-template-columns: 1fr;
  }

  .double-scraper-actions .btn {
    width: 100%;
  }

  .odds-race-control {
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  }

  .odds-race-apply {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .quant-stat {
    padding: 0.75rem 0.7rem;
  }

  .quant-stat strong {
    font-size: 1.05rem;
  }

  .quant-page-nav {
    grid-template-columns: 1fr;
  }

  .dbl-matrix {
    min-width: 560px;
  }

  .attribute-row {
    gap: 0.7rem;
    padding: 0.9rem;
  }

  .attribute-row__headline-metrics {
    grid-template-columns: 1fr;
  }

  .attribute-row__abilities {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .attribute-row__abilities > .ability-cell {
    grid-column: span 2;
  }

  .attribute-row__abilities:has(> .ability-cell:nth-child(5):last-child) > .ability-cell:nth-child(4),
  .attribute-row__abilities:has(> .ability-cell:nth-child(5):last-child) > .ability-cell:nth-child(5) {
    grid-column: span 2;
  }

  .heat-chip {
    min-width: 0;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .heat-picker {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .heat-picker::-webkit-scrollbar {
    display: none;
  }

  .snapshot-card__row {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "number horse"
      "number prob";
    gap: 0.35rem 0.72rem;
    align-items: start;
    padding: 0.42rem 0;
  }

  .snapshot-card__row.is-selected {
    padding: 0.65rem 0.75rem;
  }

  .snapshot-card__number {
    grid-area: number;
    align-self: center;
    min-width: 42px;
  }

  .snapshot-card__horse {
    grid-area: horse;
    min-width: 0;
    display: grid;
    gap: 0.1rem;
  }

  .snapshot-card__horse strong,
  .snapshot-card__horse span {
    display: block;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .snapshot-card__horse strong {
    line-height: 1.25;
  }

  .snapshot-card__horse span {
    line-height: 1.35;
  }

  .snapshot-card__prob {
    grid-area: prob;
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(96px, 1fr);
    gap: 0.55rem;
    align-items: center;
  }

  .snapshot-card__prob strong {
    white-space: nowrap;
    line-height: 1;
  }

  .ability-cell {
    padding: 0.5rem 0.55rem;
    min-height: 72px;
  }

  .ability-cell .quant-stars {
    font-size: 0.82rem;
  }

  .quant-horse-modal__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quant-horse-modal__head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .quant-horse-modal__verdict {
    width: 100%;
    min-width: 0;
  }

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

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

  .quant-radar {
    grid-template-columns: 1fr;
  }

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

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

  .quant-horse-modal__tablist::-webkit-scrollbar {
    display: none;
  }

  .quant-horse-modal__tab {
    padding-inline: 0.7rem;
  }

  .quant-training-cal__cell {
    min-height: 4.55rem;
    padding: 0.28rem 0.3rem 0.34rem;
  }

  .quant-training-cal__pill {
    font-size: 0.58rem;
    padding: 0.14rem 0.22rem;
  }

  .quant-training-cal__gallop-detail {
    font-size: 0.58rem;
    padding: 0.22rem;
  }

  .trial-preview__toolbar {
    flex-direction: column;
  }

  .trial-preview__toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .trial-preview__frame,
  .trial-preview__frame iframe,
  .trial-preview__loading,
  .trial-preview__fallback {
    min-height: 220px;
  }

  .trial-preview__frame {
    width: 100%;
    height: min(52vh, 360px);
    resize: none;
  }
}

@media (max-width: 640px) {
  .double-scraper-form,
  .double-summary-grid {
    grid-template-columns: 1fr;
  }

  .double-table-card__head,
  .double-table-card__meta,
  .double-table-card__foot {
    flex-direction: column;
  }

  .double-data-table {
    min-width: 640px;
  }

  .quant-horse-modal__content {
    gap: 0.85rem;
  }

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

  .quant-horse-modal__group .quant-horse-modal__table,
  .quant-horse-modal__raw-fields .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quant-horse-modal__group .quant-horse-modal__table {
    min-width: 920px;
  }

  .quant-horse-modal__raw-fields .data-table tbody tr {
    grid-template-columns: 1fr;
  }

  .quant-horse-modal__history-card-head,
  .quant-horse-modal__hero-head {
    flex-direction: column;
  }

  .quant-horse-modal__history-metric-row {
    grid-template-columns: 1fr;
  }

  .quant-horse-modal__group .quant-horse-modal__table thead th {
    white-space: nowrap;
  }

  .quant-horse-modal__group .quant-horse-modal__table tbody td,
  .quant-horse-modal__raw-fields .data-table tbody td {
    white-space: nowrap;
  }
}

/* Double scraper */
.dbl-page {
  padding: 2rem 0 4rem;
}

.dbl-shell {
  display: grid;
  gap: 1.5rem;
}

.dbl-hero {
  position: relative;
  overflow: hidden;
}

.dbl-panel,
.dbl-summary-card,
.dbl-result-card {
  background: var(--panel-soft-bg);
  border: 1px solid var(--panel-soft-border);
  box-shadow: var(--panel-shadow);
}

.dbl-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.dbl-form .form-row {
  margin: 0;
}

.dbl-form input,
.dbl-form select {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

html[data-theme="light"] .dbl-form input,
html[data-theme="light"] .dbl-form select {
  background: rgba(255, 255, 255, 0.8);
}

.dbl-submit {
  min-height: 46px;
}

.dbl-form-note {
  margin: 0.9rem 0 0;
}

.dbl-feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--text-muted);
}

.dbl-feedback.is-error {
  color: #fca5a5;
}

.dbl-feedback.is-success {
  color: #86efac;
}

.dbl-meeting-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dbl-pill,
.dbl-pill-empty {
  border-radius: 999px;
  border: 1px solid var(--chip-soft-border);
  background: var(--chip-soft-bg);
  padding: 0.6rem 0.95rem;
  color: var(--text);
}

.dbl-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dbl-pill:hover {
  border-color: var(--gold-chip-border);
  color: var(--gold);
}

.dbl-overview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dbl-summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dbl-summary-grid article,
.dbl-guide-list p {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
}

.dbl-summary-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dbl-summary-grid strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
}

.dbl-results-section {
  display: grid;
  gap: 1rem;
}

.dbl-results {
  display: grid;
  gap: 1rem;
}

.dbl-result-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.dbl-result-card__head h3 {
  margin: 0;
}

.dbl-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dbl-chip {
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
  color: var(--gold);
  border: 1px solid var(--gold-chip-border);
  background: var(--gold-chip-bg);
}

.dbl-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  font-size: 0.92rem;
}

.dbl-matrix-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
}

.dbl-matrix-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.12);
}

.dbl-matrix-table th,
.dbl-matrix-table td {
  padding: 0.7rem;
  text-align: center;
  border-bottom: 1px solid var(--panel-soft-border);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.dbl-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elevated);
}

.dbl-matrix-table tbody th {
  background: rgba(255, 255, 255, 0.03);
}

.dbl-matrix-table th.is-active,
.dbl-matrix-table tbody th.is-active {
  color: var(--gold);
}

.dbl-matrix-table td.has-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dbl-matrix-table td.is-empty {
  color: var(--text-muted);
}

.dbl-empty {
  padding: 1rem 1.15rem;
  color: var(--text-muted);
}

.qin-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.qin-summary-stat {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}

.qin-summary-stat span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qin-summary-stat strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.qin-summary-list {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.qin-summary-line {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(197, 160, 89, 0.08);
}

.qin-summary-line dt {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.qin-summary-line dd {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
}

.qin-top-pairs-block {
  margin-top: 0.9rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.03);
}

.qin-top-pairs-block__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.qin-top-pairs-block__head span {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.qin-top-pairs-block__head strong {
  color: var(--gold);
  font-size: 1rem;
}

.qin-top-pairs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.qin-top-pair {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.qin-top-pair__rank {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  width: 2rem;
  flex: 0 0 auto;
}

.qin-top-pair__pair {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
  flex: 1 1 auto;
}

.qin-top-pair__odds {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
  font-size: 1rem;
  flex: 0 0 auto;
}

.qin-top-pair.is-favourite {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.qin-top-pairs__empty {
  margin: 0;
  color: var(--text-muted);
}

.qin-top-pairs-inline {
  margin-bottom: 0.85rem;
}

.qin-top-pairs-bar {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
}

.qin-top-pairs-bar__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qin-top-chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.qin-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.12);
  background: rgba(0, 0, 0, 0.14);
}

.qin-top-chip span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.qin-top-chip strong {
  color: var(--text);
  font-size: 0.92rem;
}

.qin-top-chip em {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}

.qin-top-chip.is-favourite {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}

.qin-pool-toggle {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.qin-pool-toggle__btn {
  appearance: none;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.qin-pool-toggle__btn.is-active {
  border-color: var(--gold-chip-border);
  background: var(--gold-chip-bg);
  color: var(--gold);
}

.qin-table-card {
  gap: 1.1rem;
}

.qin-table-card .dbl-matrix {
  min-width: 880px;
}

.qin-table-note {
  margin: 0.45rem 0 0;
  max-width: 44rem;
  color: var(--text-muted);
}

.qin-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: min(420px, 100%);
}

.qin-table-card .qin-meta-grid {
  min-width: min(390px, 100%);
}

.qin-meta-grid span {
  display: grid;
  gap: 0.16rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.qin-meta-grid strong {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.qin-link-row span {
  color: var(--text-muted);
}

.qin-hot-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.95rem;
}

.qin-hot-panel {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(0, 0, 0, 0.12);
}

.qin-hot-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.qin-hot-panel__head span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qin-hot-panel__head strong {
  color: #fca5a5;
  font-size: 0.95rem;
}

.qin-hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.qin-hot-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.qin-hot-item__rank {
  color: #fca5a5;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.qin-hot-item__pair {
  color: var(--text);
  font-size: 0.98rem;
}

.qin-hot-item__odds {
  color: #f87171;
  font-style: normal;
  font-weight: 800;
  font-size: 0.96rem;
}

.qin-hot-item.is-hot {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.08);
}

.qin-hot-empty {
  color: var(--text-muted);
  padding: 0.3rem 0;
}

.dbl-matrix td.qin-cell-diagonal {
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.28);
}

.dbl-matrix td.qin-triangle-spacer {
  background: transparent;
  border-right: none;
  border-bottom-color: rgba(255, 255, 255, 0.03);
}

.dbl-matrix td.has-value {
  font-variant-numeric: tabular-nums;
}

.dbl-matrix td.is-short.has-value {
  background: rgba(220, 38, 38, 0.18);
  color: #fee2e2;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.25);
}

.dbl-matrix td.is-mid.has-value {
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.12);
}

.dbl-matrix td.is-long.has-value {
  color: var(--text);
}

.dbl-table-card .dbl-matrix td.is-short.has-value,
.dbl-table-card .dbl-matrix td.is-mid.has-value,
.dbl-table-card .dbl-matrix td.is-long.has-value {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 400;
  box-shadow: none;
}

.dbl-table-card .dbl-matrix td.is-hot,
.dbl-table-card .dbl-matrix td.is-hot.has-value {
  background: rgba(185, 28, 28, 0.64);
  color: #fff1f2;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 1px rgba(252, 165, 165, 0.56),
    0 0 0 1px rgba(127, 29, 29, 0.18);
}

html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-short,
html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-mid,
html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-long,
html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-empty,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.is-empty {
  background: rgba(17, 19, 26, 0.92);
  color: rgba(232, 224, 207, 0.58);
  border-color: rgba(197, 160, 89, 0.1);
}

html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.has-value,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.has-value {
  background: rgba(24, 27, 36, 0.96);
  color: rgba(248, 244, 235, 0.88);
  font-weight: 650;
}

html:not([data-theme="light"]) .dbl-matrix td.is-shortening.has-value,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.is-shortening.has-value {
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(20, 83, 45, 0.2)),
    rgba(16, 24, 20, 0.96);
  color: #bbf7d0;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.36);
}

html:not([data-theme="light"]) .dbl-matrix td.is-drifting.has-value,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.is-drifting.has-value {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(127, 29, 29, 0.18)),
    rgba(28, 18, 20, 0.96);
  color: #fecaca;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34);
}

html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-hot,
html:not([data-theme="light"]) .qin-table-card .dbl-matrix td.is-hot.has-value,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.is-hot,
html:not([data-theme="light"]) .dbl-table-card .dbl-matrix td.is-hot.has-value {
  background:
    radial-gradient(circle at 50% 18%, rgba(251, 191, 36, 0.3), transparent 54%),
    linear-gradient(135deg, rgba(185, 28, 28, 0.72), rgba(69, 10, 10, 0.8));
  color: #fff7ed;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(252, 211, 77, 0.42),
    0 0 18px rgba(239, 68, 68, 0.18);
}

html[data-theme="light"] .qin-top-pair {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .qin-summary-stat,
html[data-theme="light"] .qin-hot-panel,
html[data-theme="light"] .qin-meta-grid span,
html[data-theme="light"] .qin-top-pairs-block {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .qin-hot-item.is-hot {
  background: rgba(254, 226, 226, 0.92);
  border-color: rgba(239, 68, 68, 0.38);
}

html[data-theme="light"] .qin-hot-item.is-hot .qin-hot-item__rank,
html[data-theme="light"] .qin-hot-item.is-hot .qin-hot-item__odds {
  color: #b91c1c;
}

html[data-theme="light"] .dbl-matrix td.is-short {
  background: rgba(254, 226, 226, 0.98);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.32);
}

html[data-theme="light"] .dbl-matrix td.is-mid {
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  border-color: rgba(209, 213, 219, 0.28);
}

html[data-theme="light"] .dbl-matrix td.is-long {
  color: #6b7280;
}

html[data-theme="light"] .dbl-matrix td.is-hot {
  background: rgba(254, 202, 202, 0.98);
  color: #7f1d1d;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.5);
}

html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-short,
html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-mid,
html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-long {
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
  border-color: rgba(209, 213, 219, 0.28);
}

html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-hot {
  background: rgba(254, 202, 202, 0.98);
  color: #7f1d1d;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.5);
}

html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-empty {
  background: rgba(255, 255, 255, 0.98);
  color: #cbd5e1;
}

html[data-theme="light"] .qin-table-card .dbl-matrix td.is-short {
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
}

html[data-theme="light"] .qin-table-card .dbl-matrix td.is-mid {
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
}

html[data-theme="light"] .qin-table-card .dbl-matrix td.is-long {
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
}

html[data-theme="light"] .qin-table-card .dbl-matrix td.is-empty {
  background: rgba(255, 255, 255, 0.98);
  color: #cbd5e1;
}

html[data-theme="light"] .dbl-matrix td.is-shortening.has-value,
html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-shortening.has-value {
  background: rgba(220, 252, 231, 0.98);
  color: #14532d;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.34);
}

html[data-theme="light"] .dbl-matrix td.is-drifting.has-value,
html[data-theme="light"] .dbl-table-card .dbl-matrix td.is-drifting.has-value {
  background: rgba(254, 226, 226, 0.98);
  color: #7f1d1d;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.34);
}

.odds-workspace-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.qin-setup-layout .double-scraper-form-card {
  display: grid;
  gap: 1rem;
}

.odds-refresh-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.14);
}

.odds-refresh-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-refresh-pill[data-tone="live"] {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.14);
  color: #a7f3d0;
}

.odds-refresh-pill[data-tone="loading"] {
  border-color: rgba(197, 160, 89, 0.28);
  background: rgba(197, 160, 89, 0.16);
  color: #f8e4b6;
}

.odds-refresh-pill[data-tone="warning"] {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.odds-refresh-pill[data-tone="admin"] {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.odds-refresh-detail {
  flex: 1 1 18rem;
  min-width: min(100%, 18rem);
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.odds-pool-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
}

.odds-pool-field > span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-race-field {
  grid-column: 1 / -1;
}

.odds-race-field > label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-race-control {
  display: grid;
  grid-template-columns: 2.9rem minmax(6rem, 1fr) 2.9rem auto;
  gap: 0.55rem;
  align-items: stretch;
}

.odds-race-control input {
  text-align: center;
}

.odds-race-step {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.odds-race-step:hover {
  border-color: rgba(197, 160, 89, 0.32);
  color: var(--gold);
}

.odds-race-apply {
  min-height: 46px;
  white-space: nowrap;
}

.odds-pool-switch {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.odds-pool-chip {
  appearance: none;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 14px;
  min-height: 3rem;
  padding: 0.72rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.odds-pool-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 160, 89, 0.28);
}

.odds-pool-chip.is-active {
  border-color: rgba(197, 160, 89, 0.32);
  background: rgba(197, 160, 89, 0.14);
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.1);
}

.odds-pool-chip:focus-visible,
.double-scraper-chip:focus-visible,
.double-scraper-actions .btn:focus-visible {
  outline: 2px solid rgba(197, 160, 89, 0.44);
  outline-offset: 2px;
}

.odds-workspace-actions {
  justify-content: space-between;
  align-items: center;
}

.odds-auto-note {
  margin: 0;
  flex: 1 1 18rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.odds-admin-controls {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-soft-border);
}

.odds-admin-controls strong {
  font-size: 0.88rem;
  color: var(--text);
}

.odds-results-topline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
}

.odds-results-topline__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.24);
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-results-topline__meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.odds-workspace-stack {
  display: grid;
  gap: 1rem;
}

.odds-primary-board {
  display: grid;
  gap: 0.95rem;
}

.odds-primary-board__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: start;
}

.odds-primary-board__head h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.42rem;
}

.odds-primary-board__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: min(520px, 100%);
}

.odds-primary-board__stats span {
  display: grid;
  gap: 0.16rem;
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.odds-primary-board__stats strong {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.odds-primary-board__links {
  align-items: center;
}

.odds-primary-board__table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(197, 160, 89, 0.14);
}

.odds-core-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

.odds-core-table th,
.odds-core-table td {
  padding: 0.72rem 0.76rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.08);
  text-align: left;
  font-size: 0.84rem;
}

.odds-core-table thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 13, 0.96);
  color: var(--gold);
  z-index: 1;
}

.odds-core-table tbody tr.is-hot {
  background: rgba(197, 160, 89, 0.06);
}

.odds-core-table__odds {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.odds-core-signal,
.odds-core-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.odds-core-signal.is-active,
.odds-core-state.is-hot {
  border-color: rgba(197, 160, 89, 0.24);
  background: rgba(197, 160, 89, 0.14);
  color: var(--gold);
}

.odds-secondary-shell {
  display: grid;
  gap: 0.8rem;
}

.odds-results-topline--secondary {
  margin-bottom: 0;
}

.odds-secondary-card {
  gap: 1rem;
}

.odds-highlight-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.odds-highlight-card {
  display: grid;
  gap: 0.28rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.odds-highlight-card span,
.odds-highlight-card small {
  color: var(--text-muted);
}

.odds-highlight-card strong {
  color: #fca5a5;
}

.odds-highlight-card--muted {
  border-color: var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
}

.odds-highlight-card--muted strong {
  color: var(--text);
}

.odds-history-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.025);
}

.odds-history-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.odds-history-card__head strong {
  color: var(--gold);
}

.odds-history-card__head span,
.odds-history-card__note {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.odds-history-card__note {
  margin: 0;
}

.odds-history-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.odds-history-card__grid span {
  display: grid;
  gap: 0.14rem;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.odds-history-card__grid strong {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-runner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.8rem;
}

.odds-runner-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--panel-soft-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.14);
}

.odds-runner-card.is-favourite {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
}

.odds-runner-card__main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.odds-runner-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: rgba(197, 160, 89, 0.1);
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 800;
}

.odds-runner-card__main p {
  margin: 0.18rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.odds-runner-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.odds-runner-card__meta small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-symbol-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--panel-soft-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.odds-symbol-pill.is-active {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.odds-runner-card__head,
.odds-runner-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.odds-runner-card__head strong {
  font-size: 1.15rem;
}

.odds-runner-card__body {
  display: grid;
  gap: 0.2rem;
}

.odds-runner-card__body span,
.odds-runner-card__foot span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.odds-runner-card__body strong {
  font-size: 1.05rem;
}

.odds-signal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.odds-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.odds-signal-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.odds-signal-card span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds-signal-card strong {
  color: #fca5a5;
  font-size: 1rem;
}

.odds-signal-card--up strong {
  color: var(--gold);
}

.odds-core-signal.odds-signal-mark--sig-1,
.odds-symbol-pill.odds-signal-mark--sig-1,
.odds-signal-card strong.odds-signal-mark--sig-1,
.odds-change-chip em.odds-signal-mark--sig-1 {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.odds-core-signal.odds-signal-mark--sig-2,
.odds-symbol-pill.odds-signal-mark--sig-2,
.odds-signal-card strong.odds-signal-mark--sig-2,
.odds-change-chip em.odds-signal-mark--sig-2 {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}

.odds-core-signal.odds-signal-mark--sig-3,
.odds-symbol-pill.odds-signal-mark--sig-3,
.odds-signal-card strong.odds-signal-mark--sig-3,
.odds-change-chip em.odds-signal-mark--sig-3 {
  border-color: rgba(239, 68, 68, 0.46);
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.odds-signal-card strong.odds-signal-mark--sig-1,
.odds-signal-card strong.odds-signal-mark--sig-2,
.odds-signal-card strong.odds-signal-mark--sig-3 {
  letter-spacing: 0.08em;
}

.odds-core-signal.odds-signal-mark--money-in,
.odds-symbol-pill.odds-signal-mark--money-in,
.odds-signal-card strong.odds-signal-mark--money-in,
.odds-change-chip em.odds-signal-mark--money-in {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  animation: oddsMoneyInPulse 1.85s ease-in-out infinite;
}

.odds-core-signal.odds-signal-mark--money-in.odds-signal-mark--sig-2,
.odds-symbol-pill.odds-signal-mark--money-in.odds-signal-mark--sig-2,
.odds-signal-card strong.odds-signal-mark--money-in.odds-signal-mark--sig-2,
.odds-change-chip em.odds-signal-mark--money-in.odds-signal-mark--sig-2 {
  background: rgba(34, 197, 94, 0.22);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.24);
}

.odds-core-signal.odds-signal-mark--money-in.odds-signal-mark--sig-3,
.odds-symbol-pill.odds-signal-mark--money-in.odds-signal-mark--sig-3,
.odds-signal-card strong.odds-signal-mark--money-in.odds-signal-mark--sig-3,
.odds-change-chip em.odds-signal-mark--money-in.odds-signal-mark--sig-3 {
  background: rgba(34, 197, 94, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(134, 239, 172, 0.34),
    0 0 14px rgba(34, 197, 94, 0.12);
  animation-name: oddsMoneyInPulseStrong;
}

.odds-core-signal.odds-signal-mark--money-out,
.odds-symbol-pill.odds-signal-mark--money-out,
.odds-signal-card strong.odds-signal-mark--money-out,
.odds-change-chip em.odds-signal-mark--money-out {
  border-color: rgba(239, 68, 68, 0.46);
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  animation: oddsMoneyOutPulse 1.85s ease-in-out infinite;
}

.odds-core-signal.odds-signal-mark--money-out.odds-signal-mark--sig-2,
.odds-symbol-pill.odds-signal-mark--money-out.odds-signal-mark--sig-2,
.odds-signal-card strong.odds-signal-mark--money-out.odds-signal-mark--sig-2,
.odds-change-chip em.odds-signal-mark--money-out.odds-signal-mark--sig-2 {
  background: rgba(239, 68, 68, 0.24);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.24);
}

.odds-core-signal.odds-signal-mark--money-out.odds-signal-mark--sig-3,
.odds-symbol-pill.odds-signal-mark--money-out.odds-signal-mark--sig-3,
.odds-signal-card strong.odds-signal-mark--money-out.odds-signal-mark--sig-3,
.odds-change-chip em.odds-signal-mark--money-out.odds-signal-mark--sig-3 {
  background: rgba(239, 68, 68, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(252, 165, 165, 0.34),
    0 0 14px rgba(239, 68, 68, 0.12);
  animation-name: oddsMoneyOutPulseStrong;
}

@keyframes oddsMoneyInPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: saturate(1);
  }
  50% {
    transform: translate(1px, -1px);
    filter: saturate(1.18);
  }
}

@keyframes oddsMoneyInPulseStrong {
  0%,
  100% {
    transform: translateY(0);
    filter: saturate(1);
  }
  50% {
    transform: translate(1px, -1px);
    filter: saturate(1.3) brightness(1.08);
  }
}

@keyframes oddsMoneyOutPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: saturate(1);
  }
  50% {
    transform: translate(1px, 1px);
    filter: saturate(1.16);
  }
}

@keyframes oddsMoneyOutPulseStrong {
  0%,
  100% {
    transform: translateY(0);
    filter: saturate(1);
  }
  50% {
    transform: translate(1px, 1px);
    filter: saturate(1.28) brightness(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .odds-core-signal.odds-signal-mark--money-in,
  .odds-symbol-pill.odds-signal-mark--money-in,
  .odds-signal-card strong.odds-signal-mark--money-in,
  .odds-change-chip em.odds-signal-mark--money-in,
  .odds-core-signal.odds-signal-mark--money-out,
  .odds-symbol-pill.odds-signal-mark--money-out,
  .odds-signal-card strong.odds-signal-mark--money-out,
  .odds-change-chip em.odds-signal-mark--money-out {
    animation: none;
  }
}

.odds-cell-stack {
  display: grid;
  gap: 0.18rem;
  justify-items: center;
}

.odds-cell-stack small {
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 800;
}

.odds-panel-empty {
  margin: 0;
  color: var(--text-muted);
}

.odds-main-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.odds-main-pill.is-live-highlight {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.08);
}

.attribute-row--live-odds,
.snapshot-card__row--live-odds {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}
html[data-theme="light"] .attribute-row--live-odds,
html[data-theme="light"] .snapshot-card__row--live-odds {
  box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.35);
}

html[data-theme="light"] .odds-highlight-card {
  background: rgba(254, 226, 226, 1);
  border-color: rgba(185, 28, 28, 0.28);
}

html[data-theme="light"] .odds-refresh-strip,
html[data-theme="light"] .odds-pool-field,
html[data-theme="light"] .odds-results-topline,
html[data-theme="light"] .odds-runner-card,
html[data-theme="light"] .odds-signal-card {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .odds-pool-chip.is-active,
html[data-theme="light"] .odds-results-topline__pill,
html[data-theme="light"] .odds-runner-card__number {
  background: rgba(155, 111, 31, 0.12);
}

html[data-theme="light"] .odds-refresh-pill[data-tone="live"] {
  color: #047857;
}

html[data-theme="light"] .odds-refresh-pill[data-tone="warning"] {
  color: #b45309;
}

html[data-theme="light"] .odds-refresh-pill[data-tone="admin"] {
  color: #1d4ed8;
}

html[data-theme="light"] .odds-highlight-card strong,
html[data-theme="light"] .odds-signal-chip,
html[data-theme="light"] .odds-cell-stack small,
html[data-theme="light"] .odds-main-pill.is-live-highlight {
  color: #b91c1c;
}

html[data-theme="light"] .odds-symbol-pill.is-active,
html[data-theme="light"] .odds-signal-card strong {
  color: #0f766e;
}

html[data-theme="light"] .odds-symbol-pill.is-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(15, 118, 110, 0.42);
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--sig-1,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--sig-1,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--sig-1,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--sig-1 {
  border-color: rgba(180, 83, 9, 0.38);
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--sig-2 {
  border-color: rgba(194, 65, 12, 0.42);
  background: rgba(251, 146, 60, 0.18);
  color: #9a3412;
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--sig-3 {
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(248, 113, 113, 0.16);
  color: #991b1b;
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-in,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-in,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-in,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-in {
  border-color: rgba(22, 101, 52, 0.42);
  background: rgba(187, 247, 208, 0.72);
  color: #166534;
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-in.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-in.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-in.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-in.odds-signal-mark--sig-2 {
  background: rgba(187, 247, 208, 0.9);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.26);
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-in.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-in.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-in.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-in.odds-signal-mark--sig-3 {
  background: rgba(134, 239, 172, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(22, 101, 52, 0.3),
    0 0 0 2px rgba(187, 247, 208, 0.5);
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-out,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-out,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-out,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-out {
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(254, 202, 202, 0.82);
  color: #991b1b;
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-out.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-out.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-out.odds-signal-mark--sig-2,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-out.odds-signal-mark--sig-2 {
  background: rgba(254, 202, 202, 0.96);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.26);
}

html[data-theme="light"] .odds-core-signal.odds-signal-mark--money-out.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-symbol-pill.odds-signal-mark--money-out.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-signal-card strong.odds-signal-mark--money-out.odds-signal-mark--sig-3,
html[data-theme="light"] .odds-change-chip em.odds-signal-mark--money-out.odds-signal-mark--sig-3 {
  background: rgba(252, 165, 165, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(153, 27, 27, 0.3),
    0 0 0 2px rgba(254, 202, 202, 0.58);
}

html[data-theme="light"] .odds-main-pill.is-live-highlight {
  background: rgba(254, 226, 226, 1);
  border-color: rgba(185, 28, 28, 0.42);
}

@media (max-width: 1080px) {
  .dbl-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dbl-overview-grid,
  .dbl-summary-grid,
  .dbl-form {
    grid-template-columns: 1fr;
  }

  .qin-summary-stack,
  .qin-top-pairs,
  .qin-meta-grid,
  .qin-summary-strip,
  .qin-hot-pairs,
  .odds-history-card__grid,
  .odds-workspace-layout {
    grid-template-columns: 1fr;
  }

  .double-scraper-summary {
    grid-template-columns: 1fr;
  }

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

  .qin-summary-line {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .odds-primary-board__stats {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .dbl-result-card__head,
  .dbl-chip-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .odds-refresh-strip,
  .odds-results-topline,
  .odds-workspace-actions,
  .odds-primary-board__head,
  .odds-primary-board__links {
    align-items: flex-start;
  }

  .odds-pool-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .odds-auto-note,
  .odds-refresh-detail,
  .odds-results-topline__meta {
    font-size: 0.82rem;
  }
}

/* --- Genetics + field comparison bars (Sigma Quant modal) --- */
.attribute-row__lineage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted, rgba(255, 255, 255, 0.72));
}

.attribute-row__lineage span {
  padding: 0.24rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="light"] .attribute-row__lineage {
  color: rgba(15, 23, 42, 0.72);
}

.quant-genetics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.quant-genetics-scale {
  position: relative;
  height: 40px;
  border-radius: 10px;
  background: var(--panel-soft-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--panel-soft-border, rgba(255, 255, 255, 0.12));
  overflow: visible;
}

.quant-genetics-scale__band {
  position: absolute;
  top: 10px;
  height: 10px;
  border-radius: 4px;
  opacity: 0.85;
  z-index: 2;
}

.quant-genetics-scale__band--father {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.75), rgba(37, 99, 235, 0.95));
  border: 1px solid rgba(30, 64, 175, 0.8);
}

.quant-genetics-scale__band--mother {
  top: 10px;
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.65), rgba(219, 39, 119, 0.9));
  border: 1px dashed rgba(190, 24, 93, 0.95);
  z-index: 3;
}

.quant-genetics-scale__marker {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  font-size: 16px;
  line-height: 1;
  color: #d97706;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 5;
}

.quant-genetics-scale__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  z-index: 1;
}

.quant-genetics-scale__tick em {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.62rem;
  color: var(--muted, rgba(255, 255, 255, 0.52));
  white-space: nowrap;
}

.quant-genetics-legend {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.35rem;
}

.quant-genetics-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted, rgba(255, 255, 255, 0.72));
}

.quant-genetics-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.quant-genetics-legend__dot--father {
  background: #2563eb;
}

.quant-genetics-legend__dot--mother {
  background: #db2777;
}

html[data-theme="light"] .quant-genetics-scale__band--father {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.55), rgba(37, 99, 235, 0.8));
  border-color: rgba(30, 64, 175, 0.7);
}

html[data-theme="light"] .quant-genetics-scale__band--mother {
  background: linear-gradient(90deg, rgba(219, 39, 119, 0.45), rgba(219, 39, 119, 0.72));
  border-color: rgba(190, 24, 93, 0.8);
}

html[data-theme="light"] .quant-genetics-scale__marker {
  color: #b45309;
}

html[data-theme="light"] .quant-genetics-scale__tick em,
html[data-theme="light"] .quant-genetics-legend__item {
  color: rgba(15, 23, 42, 0.72);
}

html[data-theme="light"] .quant-genetics-scale__ticks {
  color: rgba(15, 23, 42, 0.9);
  font-weight: 600;
}

html[data-theme="light"] .quant-genetics-panel .quant-horse-modal__insight-meta {
  color: rgba(15, 23, 42, 0.78);
}

.quant-genetics-scale__ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-top: 0.35rem;
  color: var(--muted, rgba(255, 255, 255, 0.55));
}

.quant-genetics-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag-pill--ok {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag-pill--warn {
  background: rgba(234, 179, 8, 0.18);
  color: #ca8a04;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.quant-comparison-bars {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

@media (max-width: 720px) {
  .quant-comparison-bars {
    grid-template-columns: 1fr;
  }
}

.quant-comparison-bars__panel {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--panel-soft-border, rgba(255, 255, 255, 0.12));
  background: var(--panel-soft-bg, rgba(255, 255, 255, 0.04));
}

.quant-comparison-bars__title {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.quant-comparison-bars__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quant-comparison-bars__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(52px, 72px);
  gap: 0.35rem;
  align-items: center;
}

.quant-comparison-bars__row--self {
  background: rgba(197, 160, 89, 0.1);
  border-radius: 8px;
  padding: 0.2rem 0.25rem;
  margin: 0 -0.15rem;
}

.quant-comparison-bars__label {
  font-size: 0.72rem;
  line-height: 1.25;
  min-width: 0;
}

.quant-comparison-bars__label strong {
  font-weight: 700;
}

.quant-comparison-bars__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

html[data-theme="light"] .quant-comparison-bars__track {
  background: rgba(15, 23, 42, 0.08);
}

.quant-comparison-bars__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.5), rgba(197, 160, 89, 0.85));
}

.quant-comparison-bars__row--self .quant-comparison-bars__fill {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.55), rgba(37, 99, 235, 0.9));
}

.sigma-performance-panel {
  margin: 1.5rem 0;
}

.sigma-performance-panel__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--text);
}

.sigma-performance-panel__lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.sigma-performance-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.sigma-performance-panel__metric {
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--gold);
}

.sigma-performance-panel__label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.sigma-performance-panel__value {
  font-size: 1.35rem;
  color: var(--text);
}

.sigma-performance-panel__disclaimer {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Sigma Wagering homepage redesign: 1a Cinematic Data */
:root {
  --sw-ink-950: #07080a;
  --sw-ink-900: #0b0d10;
  --sw-ink-800: #111419;
  --sw-ink-700: #1a1f26;
  --sw-gold-300: #e8cc82;
  --sw-gold-400: #d8b75f;
  --sw-gold-500: #c9a24a;
  --sw-gold-600: #a98232;
  --sw-cream-050: #fff9ed;
  --sw-cream-100: #f6ebcf;
  --sw-cream-200: #e7dcbf;
  --sw-text-primary: #f4ecd9;
  --sw-text-secondary: rgba(231, 220, 191, 0.78);
  --sw-text-muted: rgba(231, 220, 191, 0.55);
  --sw-border-subtle: rgba(201, 162, 74, 0.18);
  --sw-border-strong: rgba(201, 162, 74, 0.58);
  --sw-data-positive: #8ac79a;
  --sw-data-negative: #d07b74;
  --sw-surface: rgba(13, 15, 18, 0.92);
  --sw-elevated: rgba(17, 20, 25, 0.96);
  --sw-page-bg: #07080a;
  --sw-header-bg: rgba(7, 8, 10, 0.92);
  --sw-menu-bg: rgba(7, 8, 10, 0.96);
  --sw-footer-bg: #07080a;
  --sw-badge-bg: rgba(255, 255, 255, 0.025);
  --sw-card-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  --sw-gold-fill-hover: #e8cc82;
  --sw-shadow-card: 0 30px 60px rgba(0, 0, 0, 0.4);
  --sw-pulse-shadow-low: 0 0 44px rgba(201, 162, 74, 0.12), 0 28px 70px rgba(0, 0, 0, 0.45);
  --sw-pulse-shadow-high: 0 0 80px rgba(201, 162, 74, 0.26), 0 28px 70px rgba(0, 0, 0, 0.45);
  --sw-font-display: "Cinzel", "Songti TC", "PMingLiU", Georgia, serif;
  --sw-font-serif: "Cormorant Garamond", "Songti TC", "PMingLiU", Georgia, serif;
  --sw-font-sans: "Manrope", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --sw-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --sw-ink-950: #f7f1e8;
  --sw-ink-900: #f1e8da;
  --sw-ink-800: #e9ddcc;
  --sw-ink-700: #ded0ba;
  --sw-gold-300: #6f4a0d;
  --sw-gold-400: #7a5213;
  --sw-gold-500: #c9a24a;
  --sw-gold-600: #765018;
  --sw-cream-050: #231a17;
  --sw-cream-100: #332620;
  --sw-cream-200: #493b32;
  --sw-text-primary: #231a17;
  --sw-text-secondary: #4f453d;
  --sw-text-muted: #6d6258;
  --sw-border-subtle: rgba(118, 80, 24, 0.24);
  --sw-border-strong: rgba(118, 80, 24, 0.62);
  --sw-data-positive: #166534;
  --sw-data-negative: #b42318;
  --sw-surface: rgba(255, 253, 248, 0.96);
  --sw-elevated: rgba(255, 250, 243, 0.98);
  --sw-page-bg: #f7f1e8;
  --sw-header-bg: rgba(255, 250, 243, 0.94);
  --sw-menu-bg: rgba(255, 253, 248, 0.99);
  --sw-footer-bg: #f1e8da;
  --sw-badge-bg: rgba(255, 253, 248, 0.92);
  --sw-card-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(155, 111, 31, 0.025));
  --sw-gold-fill-hover: #dec47d;
  --sw-shadow-card: 0 24px 55px rgba(87, 60, 24, 0.13);
  --sw-pulse-shadow-low: 0 0 38px rgba(155, 111, 31, 0.08), 0 24px 58px rgba(87, 60, 24, 0.11);
  --sw-pulse-shadow-high: 0 0 62px rgba(155, 111, 31, 0.14), 0 24px 58px rgba(87, 60, 24, 0.13);
}

@keyframes sw-kenburns {
  from { transform: scale(1.02); }
  to { transform: scale(1.14) translateY(-1.5%); }
}

@keyframes sw-fadeup {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sw-sweep {
  from { width: 0; opacity: 0; }
  to { width: 110px; opacity: 1; }
}

@keyframes sw-pulse {
  0%, 100% { box-shadow: var(--sw-pulse-shadow-low); }
  50% { box-shadow: var(--sw-pulse-shadow-high); }
}

/* Shared vertical band for both brand marks; only phase differs. */
@keyframes sw-float {
  0%, 100% { transform: translateY(-12px) rotate(-0.6deg); }
  50% { transform: translateY(12px) rotate(0.6deg); }
}

@keyframes sw-float-alt {
  0%, 100% { transform: translateY(12px) rotate(0.6deg); }
  50% { transform: translateY(-12px) rotate(-0.6deg); }
}

@keyframes sw-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sw-font-sans);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--sw-border-subtle);
  background: var(--sw-header-bg);
  backdrop-filter: blur(16px);
}

.site-header .container {
  max-width: 1280px;
}

.header-inner {
  min-height: 74px;
  gap: 1.3rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(201, 162, 74, 0.16));
}

.brand-text strong {
  color: var(--sw-gold-400);
  font-family: var(--sw-font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-text span {
  color: var(--sw-text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-main a,
.nav-products__toggle {
  color: var(--sw-text-secondary);
  font-family: var(--sw-font-sans);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-main a:hover,
.nav-main a.is-active,
.nav-products:hover .nav-products__toggle,
.nav-products.is-active .nav-products__toggle {
  color: var(--sw-gold-400);
}

.nav-products__menu {
  border-color: var(--sw-border-subtle);
  background: var(--sw-menu-bg);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.46);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.4rem;
  white-space: nowrap;
}

.header-controls,
.header-inner,
.nav-main {
  flex-wrap: nowrap;
}

.header-controls {
  white-space: nowrap;
}

.lang-switch {
  gap: 0.25rem;
  border: 0;
  background: transparent;
}

.lang-switch button {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--sw-text-muted);
  font-weight: 800;
}

.lang-switch button.is-on {
  border-color: rgba(201, 162, 74, 0.4);
  background: rgba(201, 162, 74, 0.12);
  color: var(--sw-gold-400);
}

.btn {
  border-radius: 4px;
  border-color: rgba(201, 162, 74, 0.34);
  background: var(--sw-gold-500);
  color: #07080a;
  font-family: var(--sw-font-sans);
  font-weight: 800;
}

.btn:hover {
  border-color: var(--sw-gold-300);
  background: var(--sw-gold-fill-hover);
  color: #07080a;
}

.btn-ghost {
  background: transparent;
  color: var(--sw-cream-200);
}

.btn-ghost:hover {
  background: rgba(201, 162, 74, 0.08);
  color: var(--sw-gold-300);
}

.seo-bridge-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-jump-ai {
  border-color: #ffe08a;
  background: linear-gradient(180deg, #ffe9a8 0%, #f5c84c 55%, #e8b02a 100%);
  color: #1a1200;
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.35), 0 8px 24px rgba(245, 200, 76, 0.35);
  font-weight: 800;
}

.btn-jump-ai:hover {
  border-color: #fff1c2;
  background: linear-gradient(180deg, #fff3c4 0%, #ffd76a 55%, #f0bc3a 100%);
  color: #120c00;
  box-shadow: 0 0 0 1px rgba(255, 241, 194, 0.5), 0 10px 28px rgba(255, 215, 106, 0.45);
}

.sw-home-redesign {
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 5%, rgba(201, 162, 74, 0.08), transparent 26rem),
    linear-gradient(180deg, var(--sw-page-bg) 0%, var(--sw-ink-900) 44%, var(--sw-page-bg) 100%);
  color: var(--sw-text-primary);
  font-family: var(--sw-font-sans);
}

/* Image-led sections stay cinematic while the surrounding page follows the
   selected light or dark palette. */
.sw-hero,
.sw-cinematic-break {
  --sw-ink-950: #07080a;
  --sw-ink-900: #0b0d10;
  --sw-ink-800: #111419;
  --sw-ink-700: #1a1f26;
  --sw-gold-300: #e8cc82;
  --sw-gold-400: #d8b75f;
  --sw-gold-500: #c9a24a;
  --sw-gold-600: #a98232;
  --sw-cream-050: #fff9ed;
  --sw-cream-100: #f6ebcf;
  --sw-cream-200: #e7dcbf;
  --sw-text-primary: #f4ecd9;
  --sw-text-secondary: rgba(231, 220, 191, 0.78);
  --sw-text-muted: rgba(231, 220, 191, 0.68);
  --sw-border-subtle: rgba(201, 162, 74, 0.18);
  --sw-border-strong: rgba(201, 162, 74, 0.58);
}

.sw-home-redesign ~ .sigma-quant-cta--sticky {
  display: none !important;
}

.sw-lang {
  display: none !important;
}

html[data-lang="en"] .sw-lang.lang-en,
html[data-lang="zh-Hant"] .sw-lang.lang-zh-Hant,
html[data-lang="zh-Hans"] .sw-lang.lang-zh-Hans {
  display: contents !important;
}

/* Public SEO / AEO / GEO knowledge pages */
.seo-knowledge-page {
  min-height: 70vh;
  color: var(--sw-text-primary, var(--text));
  background:
    radial-gradient(circle at 78% 8%, rgba(201, 162, 74, 0.09), transparent 28rem),
    var(--sw-ink-950, var(--bg));
}

body:has([data-fixed-page-lang]) .lang-switch:not(.lang-switch--routes) {
  display: none;
}

.seo-knowledge-shell {
  width: min(100% - 32px, 1480px);
  margin-inline: auto;
  padding: 38px 0 96px;
}

.seo-knowledge-shell--wide {
  width: min(100% - 32px, 1560px);
}

.seo-knowledge-shell--wide .seo-knowledge-hero {
  max-width: none;
  width: 100%;
}

.seo-knowledge-shell--wide .seo-knowledge-hero h1 {
  max-width: none;
  width: 100%;
}

.seo-knowledge-shell--wide .seo-direct-answer {
  max-width: none;
  width: min(100%, 90rem);
}

.seo-insight-grid--flat {
  gap: 18px 22px;
}

.seo-insight-grid--flat article {
  min-height: 0;
  padding: 22px 24px;
}

.nav-products__menu--wide {
  min-width: min(22rem, calc(100vw - 2rem));
  max-width: min(28rem, calc(100vw - 2rem));
}

.nav-products__menu--wide a {
  white-space: normal;
  line-height: 1.35;
  padding: 0.55rem 0.7rem;
}

.smart-odds-bridge {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(circle at 78% 8%, rgba(201, 162, 74, 0.09), transparent 28rem),
    var(--sw-ink-950, var(--bg));
}

.smart-odds-bridge__shell {
  width: min(100%, 46rem);
  margin-inline: auto;
}

.smart-odds-bridge__hero {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  text-align: center;
}

.smart-odds-bridge__hero h1 {
  margin: 0.4rem 0 0.75rem;
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.smart-odds-bridge__hero p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.7;
}

.smart-odds-bridge__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

.smart-odds-bridge__card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.smart-odds-bridge__card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.smart-odds-bridge__card p {
  margin: 0;
  flex: 1;
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.65;
}

.smart-odds-bridge__card .btn {
  align-self: flex-start;
}

.smart-odds-bridge__card.is-placeholder {
  opacity: 0.78;
}

@media (min-width: 761px) {
  .smart-odds-bridge {
    padding: 3rem 1.5rem 4.5rem;
  }

  .smart-odds-bridge__shell {
    width: min(100%, 54rem);
  }

  .smart-odds-bridge__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.maintenance-page {
  min-height: 70vh;
  padding: 3rem 0 4.5rem;
  background:
    radial-gradient(circle at 78% 8%, rgba(201, 162, 74, 0.09), transparent 28rem),
    var(--sw-ink-950, var(--bg));
}

.maintenance-page__shell {
  width: min(100% - 48px, 720px);
  margin-inline: auto;
}

.maintenance-page h1 {
  margin: 0.35rem 0 1rem;
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
}

.maintenance-page__lead {
  margin: 0 0 2.25rem;
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: 1.08rem;
  line-height: 1.75;
}

.maintenance-page__about,
.maintenance-page__contact {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sw-border-subtle, var(--border));
}

.maintenance-page__about h2,
.maintenance-page__contact h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.maintenance-page__about p,
.maintenance-page__contact li {
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.7;
}

.maintenance-page__contact ul {
  margin: 0;
  padding-left: 1.1rem;
}

.maintenance-page__contact a {
  color: var(--sw-gold-400, var(--gold));
}

@media (max-width: 760px) {
  .smart-odds-bridge {
    padding: 2rem 0.85rem 3.5rem;
  }
}

.seo-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 68px;
  color: var(--sw-text-muted, var(--text-muted));
  font-size: 0.76rem;
}

.seo-breadcrumbs a {
  color: var(--sw-gold-400, var(--gold));
}

.seo-knowledge-hero {
  max-width: none;
  width: 100%;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--sw-border-strong, var(--border));
}

.seo-knowledge-hero h1 {
  max-width: none;
  margin: 12px 0 24px;
  font-family: var(--sw-font-serif, "Noto Serif HK", "Cormorant Garamond", serif);
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: wrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.seo-insights-index .seo-knowledge-hero h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
}

.seo-insights-index .seo-direct-answer {
  max-width: none;
  width: 100%;
}

.seo-direct-answer {
  max-width: none;
  width: min(100%, 90rem);
  margin: 0;
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: clamp(1.03rem, 1.6vw, 1.18rem);
  line-height: 1.75;
}

.seo-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  color: var(--sw-text-muted, var(--text-muted));
  font-family: var(--sw-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.seo-byline a {
  color: var(--sw-gold-400, var(--gold));
}

.seo-language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.seo-language-links a {
  padding: 8px 12px;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 999px;
  color: var(--sw-gold-300, var(--gold));
  font-size: 0.78rem;
  text-decoration: none;
}

.seo-language-links a:hover {
  border-color: var(--sw-border-strong, var(--gold));
  background: rgba(201, 162, 74, 0.05);
}

.seo-key-points {
  margin: 48px 0;
  padding: 30px 34px;
  border: 1px solid var(--sw-border-strong, var(--border));
  border-radius: 14px;
  background: rgba(201, 162, 74, 0.045);
}

.seo-key-points h2,
.seo-sources h2,
.seo-related h2,
.seo-page-faq > h2 {
  margin: 8px 0 20px;
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
}

.seo-key-points ul,
.seo-knowledge-body ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.7;
}

.seo-knowledge-body {
  max-width: min(100%, 980px);
  margin-top: 24px;
}

.cms-insight-article .tag {
  display: none; /* topic tag already shown in hero byline; keep HTML intact */
}

.cms-insight-article h3 {
  display: none; /* title already in page h1; keep original HTML intact */
}

.cms-insight-article p {
  margin: 0;
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: 1.02rem;
  line-height: 1.9;
}

.seo-topic-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 999px;
  color: var(--sw-gold-400, var(--gold));
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.seo-card-tag {
  margin: 0 0 0.65rem;
}

.seo-byline:empty {
  display: none;
}


.seo-knowledge-body section {
  padding: 46px 0;
  border-bottom: 1px solid var(--sw-border-subtle, var(--border));
}

.seo-knowledge-body h2 {
  margin: 0 0 20px;
  color: var(--sw-cream-050, var(--text));
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.18;
}

.seo-knowledge-body p {
  margin: 0 0 18px;
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: 1rem;
  line-height: 1.92;
}

.seo-table-scroll {
  max-width: 100%;
  margin-top: 26px;
  overflow-x: auto;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 12px;
}

.seo-table-scroll:focus-visible {
  outline: 2px solid var(--sw-gold-400, var(--gold));
  outline-offset: 3px;
}

.seo-explainer-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.018);
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: 0.86rem;
  line-height: 1.6;
}

.seo-explainer-table caption {
  padding: 16px 18px;
  border-bottom: 1px solid var(--sw-border-subtle, var(--border));
  color: var(--sw-cream-050, var(--text));
  font-weight: 700;
  text-align: left;
}

.seo-explainer-table th,
.seo-explainer-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--sw-border-subtle, var(--border));
  text-align: left;
  vertical-align: top;
}

.seo-explainer-table th {
  color: var(--sw-gold-300, var(--gold));
  font-family: var(--sw-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.seo-explainer-table tbody tr:last-child td {
  border-bottom: 0;
}

.seo-table-note {
  margin-top: 12px !important;
  color: var(--sw-text-muted, var(--text-muted)) !important;
  font-size: 0.78rem !important;
}

.seo-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 30px 0 24px;
  border: 1px solid var(--sw-border-strong, var(--border));
  border-radius: 14px;
  overflow: hidden;
}

.seo-metric-grid > div {
  min-width: 0;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.02);
}

.seo-metric-grid > div + div {
  border-left: 1px solid var(--sw-border-subtle, var(--border));
}

.seo-metric-grid dt {
  min-height: 3.6em;
  color: var(--sw-text-muted, var(--text-muted));
  font-size: 0.76rem;
  line-height: 1.55;
}

.seo-metric-grid dd {
  margin: 14px 0 0;
  font-family: var(--sw-font-mono, monospace);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.seo-risk-note {
  padding: 18px 20px;
  border-left: 2px solid var(--sw-gold-500, var(--gold));
  background: rgba(201, 162, 74, 0.05);
  font-size: 0.82rem !important;
}

.seo-sources {
  max-width: min(100%, 980px);
  margin-top: 54px;
  padding: 28px 30px;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.seo-sources > p:not(.sw-eyebrow),
.seo-sources ol {
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.75;
}

.seo-sources ol {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 1.3rem;
}

.seo-sources a {
  color: var(--sw-gold-300, var(--gold));
  text-underline-offset: 0.22em;
}

.seo-page-faq,
.seo-related {
  margin-top: 72px;
}

.seo-faq-list {
  display: grid;
  gap: 12px;
}

.seo-faq-list details {
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.seo-faq-list details[open] {
  border-color: var(--sw-border-strong, var(--border));
}

.seo-faq-list summary {
  padding: 20px 22px;
  color: var(--sw-cream-050, var(--text));
  cursor: pointer;
  font-weight: 700;
  line-height: 1.5;
}

.seo-faq-list p {
  margin: 0;
  padding: 0 22px 22px;
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.8;
}

.seo-related {
  padding-top: 48px;
  border-top: 1px solid var(--sw-border-strong, var(--border));
}

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

.seo-related-grid a {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 20px;
  align-items: center;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 10px;
  color: var(--sw-text-primary, var(--text));
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.seo-related-grid a:hover {
  border-color: var(--sw-border-strong, var(--gold));
  background: rgba(201, 162, 74, 0.05);
}

.seo-insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 52px;
}

.seo-insight-grid.seo-insight-grid--flat {
  margin-top: 52px;
  gap: 18px 22px;
}

@media (min-width: 640px) {
  .seo-insight-grid:not(.seo-insight-grid--flat) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seo-insight-grid.seo-insight-grid--flat {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .seo-insight-grid.seo-insight-grid--flat {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.seo-insight-grid article {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 28px;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.seo-insight-grid h2 {
  margin: 14px 0;
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
}

.seo-insight-grid h2 a {
  color: var(--sw-cream-050, var(--text));
  text-decoration: none;
}

.seo-insight-grid article > p:not(.sw-eyebrow) {
  color: var(--sw-text-secondary, var(--text-muted));
  line-height: 1.75;
}

.seo-insight-grid article > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--sw-text-muted, var(--text-muted));
  font-family: var(--sw-font-mono, monospace);
  font-size: 0.68rem;
}

.seo-read-link {
  margin-top: 20px;
  color: var(--sw-gold-400, var(--gold));
  font-weight: 700;
  text-decoration: none;
}

.horse-directory-grid,
.horse-fact-grid,
.horse-split-grid {
  margin-top: clamp(2rem, 5vw, 4rem);
}

.horse-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.horse-entity-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 1rem;
  background: var(--sw-card-sheen), var(--sw-elevated);
}

.horse-entity-card h3 {
  margin: 0.2rem 0 0;
  font-family: var(--sw-font-serif, "Noto Serif HK", serif);
  font-size: 1.35rem;
}

.horse-entity-card h3 a {
  color: var(--sw-cream-050, var(--text));
  text-decoration: none;
}

.horse-entity-card > p:not(.sw-eyebrow) {
  margin: 0.35rem 0 1rem;
  color: var(--sw-text-muted, var(--text-muted));
}

.horse-entity-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.2rem;
}

.horse-entity-card dl div {
  padding-top: 0.65rem;
  border-top: 1px solid var(--sw-border-subtle, var(--border));
}

.horse-entity-card dt {
  color: var(--sw-text-muted, var(--text-muted));
  font-size: 0.78rem;
}

.horse-entity-card dd {
  margin: 0.2rem 0 0;
  color: var(--sw-cream-050, var(--text));
  font-weight: 700;
}

.horse-card-link {
  margin-top: auto;
  color: var(--sw-gold-300, var(--gold));
  text-decoration: none;
}

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

.horse-split-grid > div {
  padding: 1.25rem;
  border: 1px solid var(--sw-border-subtle, var(--border));
  border-radius: 1rem;
  background: var(--sw-card-sheen), var(--sw-elevated);
}

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

.prediction-archive-page code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  .seo-knowledge-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 24px;
  }

  .seo-knowledge-shell--wide {
    width: min(100% - 24px, 1560px);
  }

  .seo-breadcrumbs {
    margin-bottom: 42px;
  }

  .seo-knowledge-hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .seo-insights-index .seo-knowledge-hero h1 {
    font-size: clamp(1.85rem, 7vw, 2.5rem);
    word-break: keep-all;
  }

  .seo-metric-grid,
  .seo-insight-grid,
  .seo-related-grid,
  .horse-card-grid,
  .horse-split-grid {
    grid-template-columns: 1fr;
  }

  .seo-metric-grid > div + div {
    border-top: 1px solid var(--sw-border-subtle, var(--border));
    border-left: 0;
  }

  .seo-insight-grid article {
    min-height: 0;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .horse-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .horse-metric-grid > div:nth-child(3) {
    border-left: 0;
  }

  .horse-metric-grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--sw-border-subtle, var(--border));
  }
}

.sw-container {
  width: min(100% - 48px, 1120px);
  margin-inline: auto;
}

.sw-hero {
  position: relative;
  min-height: clamp(820px, calc(100dvh - 74px), 900px);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  border-bottom: 1px solid rgba(201, 162, 74, 0.12);
}

.sw-hero__image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 60% 40%;
  animation: sw-kenburns 26s ease-out infinite alternate;
}

.sw-hero__video {
  background: var(--sw-ink-950) url("../design_assets/hero-quant.png") center / cover no-repeat;
  filter: saturate(0.72) brightness(0.68) contrast(1.08);
}

.sw-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.35) 0%, rgba(7, 8, 10, 0.25) 45%, var(--sw-ink-950) 100%);
}

.sw-hero__content {
  width: min(100% - 48px, 900px);
  min-height: inherit;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0 5rem;
  text-align: center;
}

.sw-eyebrow {
  margin: 0;
  color: var(--sw-gold-400);
  font-family: var(--sw-font-display);
  font-size: 0.76rem;
  letter-spacing: 0.28em;
  line-height: 1.4;
  text-transform: uppercase;
}

.sw-hero__eyebrow {
  margin-bottom: 0.8rem;
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.1s both;
}

.sw-hero__mark {
  display: block;
  width: clamp(132px, 12vw, 164px);
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.34));
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.19s both;
}

.sw-hero h1,
.sw-hero-title {
  max-width: 860px;
  margin: 0;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-serif);
  font-size: clamp(2.75rem, 5vw, 3.625rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.28s both;
}

.sw-scramble-word {
  display: inline;
  white-space: nowrap;
}

.sw-mobile-break {
  display: none;
}

.sw-hero__divider {
  width: 110px;
  height: 1px;
  margin: 1.3rem auto 1.6rem;
  background: var(--sw-gold-500);
  animation: sw-sweep 1.1s cubic-bezier(.22,.61,.36,1) 0.7s both;
}

.sw-hero__lead {
  max-width: 700px;
  margin: 0 auto;
  color: var(--sw-cream-200);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.78;
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.5s both;
}

.sw-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.sw-principle-row {
  display: grid;
  width: min(100%, 740px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2rem auto 0;
  padding: 0.3rem 0;
  border-block: 1px solid rgba(201, 162, 74, 0.3);
  background: linear-gradient(90deg, transparent, rgba(7, 8, 10, 0.38) 15%, rgba(7, 8, 10, 0.38) 85%, transparent);
  list-style: none;
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.68s both;
}

.sw-principle-row li {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  padding: 0.65rem 1rem;
  text-align: left;
  transition: background 0.25s ease;
}

.sw-principle-row li + li {
  border-inline-start: 1px solid rgba(231, 220, 191, 0.14);
}

.sw-principle-row li:hover {
  background: rgba(201, 162, 74, 0.07);
}

.sw-principle-row__index {
  color: var(--sw-gold-400);
  font-family: var(--sw-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.sw-principle-row__text {
  color: var(--sw-cream-200);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.sw-hero__actions {
  margin-top: 2rem;
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.86s both;
}

.sw-btn-primary,
.sw-btn-secondary {
  min-width: 180px;
  min-height: 48px;
  justify-content: center;
  padding-inline: 1.5rem;
}

.sw-btn-primary {
  background: var(--sw-gold-500);
  color: #07080a;
  box-shadow: 0 18px 48px rgba(201, 162, 74, 0.2);
}

.sw-btn-secondary {
  border-color: rgba(201, 162, 74, 0.52);
  background: rgba(7, 8, 10, 0.28);
  color: var(--sw-gold-300);
}

/* 1C comparison: the moving image has its own column, so it never obscures the copy. */
.sw-hero--1c {
  min-height: clamp(820px, calc(100dvh - 74px), 900px);
  background:
    radial-gradient(circle at 78% 42%, rgba(201, 162, 74, 0.14), transparent 30rem),
    linear-gradient(145deg, #111216 0%, var(--sw-ink-950) 58%);
}

.sw-hero--1c .sw-hero__scrim {
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.22), transparent 58%),
    linear-gradient(180deg, transparent 55%, var(--sw-ink-950) 100%);
}

.sw-hero--1c .sw-hero__content {
  width: min(100% - 48px, 1180px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.75rem);
  padding: 3.5rem 0 4rem;
  text-align: left;
}

.sw-hero--1c .sw-hero__copy {
  min-width: 0;
}

.sw-hero--1c h1 {
  max-width: 620px;
  font-size: clamp(2.7rem, 4.15vw, 3.7rem);
}

.sw-hero--1c .sw-hero__divider {
  margin-inline: 0;
}

.sw-hero--1c .sw-hero__lead {
  max-width: 590px;
  margin-inline: 0;
}

.sw-hero--1c .sw-hero__actions {
  justify-content: flex-start;
}

.sw-hero--1c .sw-principle-row {
  margin-inline: 0;
}

.sw-hero--1c .sw-hero__mark {
  margin-inline: 0;
}

.sw-hero-1c__media {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--sw-border-strong);
  border-radius: 14px;
  background: var(--sw-elevated);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.42),
    0 0 54px rgba(201, 162, 74, 0.08);
  animation: sw-fadeup 0.9s cubic-bezier(.22,.61,.36,1) 0.42s both;
}

.sw-hero-1c__media::after {
  position: absolute;
  inset: 46px 0 0;
  border: 1px solid rgba(231, 220, 191, 0.06);
  content: "";
  pointer-events: none;
}

.sw-hero-1c__media-head {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--sw-border-subtle);
  color: var(--sw-gold-300);
  font-family: var(--sw-font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}

.sw-hero-1c__status {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sw-gold-400);
  box-shadow: 0 0 14px rgba(201, 162, 74, 0.88);
}

.sw-hero-1c__video-frame {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #07080a;
}

.sw-hero-1c__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  filter: saturate(0.68) brightness(0.78) contrast(1.08);
}

.sw-section {
  padding: 5.5rem 0;
}

.sw-section--tight {
  padding-top: 3.5rem;
}

.sw-section-head {
  max-width: 760px;
  margin: 0 auto 3rem;
  text-align: center;
}

.sw-section-head h2,
.sw-performance h2 {
  margin: 0.8rem 0;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-serif);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 600;
  line-height: 1.12;
}

.sw-section-head p,
.sw-muted {
  margin: 0;
  color: var(--sw-text-muted);
  font-size: 0.98rem;
  line-height: 1.72;
}

.sw-quick-answers__contact {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.18s ease;
}

.sw-quick-answers__contact:hover {
  color: var(--sw-gold-400);
}

.sw-performance {
  border: 1px solid var(--sw-border-strong);
  border-radius: 14px;
  padding: clamp(1.6rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 75% 20%, rgba(201, 162, 74, 0.12), transparent 20rem),
    var(--sw-elevated);
  animation: sw-pulse 5s ease-in-out infinite;
}

.sw-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
  margin-top: 2.3rem;
}

.sw-data-records-grid {
  display: grid;
  gap: 1.1rem;
}

.sw-data-records {
  --sw-records-bg: #0a0c10;
  --sw-records-border: rgba(255, 255, 255, 0.08);
  --sw-records-divider: rgba(255, 255, 255, 0.1);
  --sw-records-title: #f6ebcf;
  --sw-records-subtitle: rgba(245, 247, 251, 0.55);
  --sw-records-label: rgba(245, 247, 251, 0.48);
  --sw-records-value: #ffffff;
  --sw-records-unit: rgba(245, 247, 251, 0.55);
  --sw-records-more-border: rgba(255, 255, 255, 0.16);
  --sw-records-more-color: #f6ebcf;
  --sw-records-more-hover-border: rgba(246, 235, 207, 0.55);
  --sw-records-more-hover-bg: rgba(201, 162, 74, 0.14);
  --sw-records-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--sw-records-border);
  border-radius: 10px;
  background:
    var(--sw-records-sheen),
    var(--sw-records-bg);
  color: var(--sw-records-value);
  box-shadow: none;
}

html[data-theme="light"] .sw-data-records {
  --sw-records-bg: #fffdf8;
  --sw-records-border: rgba(118, 80, 24, 0.22);
  --sw-records-divider: rgba(118, 80, 24, 0.14);
  --sw-records-title: #7a5213;
  --sw-records-subtitle: #6d6258;
  --sw-records-label: #6d6258;
  --sw-records-value: #231a17;
  --sw-records-unit: #6d6258;
  --sw-records-more-border: rgba(118, 80, 24, 0.28);
  --sw-records-more-color: #7a5213;
  --sw-records-more-hover-border: rgba(122, 82, 19, 0.55);
  --sw-records-more-hover-bg: rgba(201, 162, 74, 0.16);
  --sw-records-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(155, 111, 31, 0.04));
  box-shadow: 0 14px 34px rgba(87, 60, 24, 0.08);
}

.sw-data-records__head {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.9rem;
}

.sw-data-records__head strong {
  color: var(--sw-records-title);
  font-family: var(--sw-font-display, Cinzel, "Cormorant Garamond", serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.sw-data-records__head span {
  color: var(--sw-records-subtitle);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sw-data-records__stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  min-width: 0;
}

.sw-data-records__stats > div {
  min-width: 0;
  padding: 0.35rem 0.9rem 0.15rem 0;
  border-right: 1px solid var(--sw-records-divider);
}

.sw-data-records__stats > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.sw-data-records__stats dt {
  margin: 0 0 0.45rem;
  color: var(--sw-records-label);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.sw-data-records__stats dd {
  margin: 0;
  color: var(--sw-records-value);
  font-family: var(--sw-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.1;
}

.sw-data-records__stats dd small {
  color: var(--sw-records-unit);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sw-data-records__more {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sw-records-more-border);
  border-radius: 50%;
  color: var(--sw-records-more-color);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sw-data-records__more:hover {
  border-color: var(--sw-records-more-hover-border);
  background: var(--sw-records-more-hover-bg);
  transform: translateX(2px);
}

@media (max-width: 1100px) {
  .sw-data-records {
    grid-template-columns: 1fr;
  }

  .sw-data-records__stats {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .sw-data-records__stats > div {
    min-width: 7.5rem;
  }

  .sw-data-records__more {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}

.sw-stat {
  min-width: 0;
  padding-right: 1.8rem;
  border-right: 1px solid var(--sw-border-subtle);
}

.sw-stat:last-child {
  padding-right: 0;
  border-right: 0;
}

.sw-stat__value {
  display: block;
  color: var(--sw-gold-400);
  font-family: var(--sw-font-mono);
  font-size: clamp(2.4rem, 4.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
}

.sw-stat span {
  display: block;
  margin-top: 0.8rem;
  color: var(--sw-text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.sw-positive { color: var(--sw-data-positive) !important; }
.sw-negative { color: var(--sw-data-negative) !important; }
.sw-gold { color: var(--sw-gold-400) !important; }

.sw-caveat {
  margin: 2rem 0 0;
  color: var(--sw-text-muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.sw-cinematic-break {
  padding: 0 0 5.5rem;
}

.sw-cinematic-break__frame {
  position: relative;
  min-height: clamp(390px, 52vw, 620px);
  overflow: hidden;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 14px;
  background: var(--sw-ink-900) url("../design_assets/hero-quant.png") center / cover no-repeat;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  isolation: isolate;
}

.sw-cinematic-break__video,
.sw-cinematic-break__scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sw-cinematic-break__video {
  z-index: -2;
  object-fit: cover;
  object-position: 68% 45%;
  filter: saturate(0.58) brightness(0.68) contrast(1.08);
}

.sw-cinematic-break__scrim {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.9) 0%, rgba(7, 8, 10, 0.5) 46%, rgba(7, 8, 10, 0.12) 76%),
    linear-gradient(180deg, rgba(7, 8, 10, 0.18) 38%, rgba(7, 8, 10, 0.8) 100%);
}

.sw-cinematic-break__copy {
  display: flex;
  min-height: inherit;
  max-width: 650px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 6vw, 4.5rem);
}

.sw-cinematic-break h2 {
  margin: 0;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-serif);
  font-size: clamp(2.35rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.56);
  text-wrap: balance;
}

.sw-cinematic-break p {
  max-width: 540px;
  margin: 1.15rem 0 0;
  color: var(--sw-cream-200);
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.7;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.62);
}

.sw-model-card {
  overflow: hidden;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 14px;
  background: var(--sw-surface);
  box-shadow: var(--sw-shadow-card);
}

.sw-model-card__top,
.sw-model-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.8rem;
  border-bottom: 1px solid var(--sw-border-subtle);
  background: var(--sw-elevated);
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.sw-model-card__top span:first-child {
  color: var(--sw-gold-400);
}

.sw-model-card__foot {
  border-top: 1px solid var(--sw-border-subtle);
  border-bottom: 0;
  font-family: var(--sw-font-sans);
  letter-spacing: 0;
  line-height: 1.6;
}

.sw-model-grid {
  display: grid;
  grid-template-columns: 60px 1.2fr 100px 100px 100px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.8rem;
}

.sw-model-grid--head {
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.sw-model-row {
  border-top: 1px solid var(--sw-border-subtle);
  color: var(--sw-cream-200);
  font-family: var(--sw-font-mono);
  font-size: 0.86rem;
  transition: background-color 0.22s ease;
}

.sw-model-row:hover {
  background: rgba(201, 162, 74, 0.04);
}

.sw-model-row strong {
  color: var(--sw-cream-050);
  font-family: var(--sw-font-sans);
  font-size: 0.95rem;
}

.sw-model-no {
  color: var(--sw-gold-300);
}

.sw-edge-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sw-ink-700);
}

.sw-edge-bar i {
  display: block;
  width: var(--edge);
  height: 100%;
  transform-origin: left;
  border-radius: inherit;
  background: var(--sw-gold-500);
  animation: sw-bar 1.2s cubic-bezier(.22,.61,.36,1) both;
}

.sw-quant-preview {
  overflow: hidden;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 14px;
  background: var(--sw-surface);
  box-shadow: var(--sw-shadow-card);
}

.sw-quant-preview__top,
.sw-quant-preview__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.8rem;
  background: var(--sw-elevated);
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.sw-quant-preview__top {
  border-bottom: 1px solid var(--sw-border-subtle);
}

.sw-quant-preview__brand {
  color: var(--sw-gold-400);
}

.sw-quant-preview__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.sw-quant-preview__status i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sw-data-positive);
  box-shadow: 0 0 12px rgba(95, 183, 148, 0.55);
}

.sw-quant-preview__board {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.sw-quant-preview__intro {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(520px, 1.28fr);
  gap: 2rem;
  align-items: end;
}

.sw-quant-preview__intro .sw-eyebrow {
  margin: 0 0 0.6rem;
}

.sw-quant-preview__intro h3 {
  margin: 0;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-serif);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1.08;
}

.sw-quant-preview dl,
.sw-quant-preview dt,
.sw-quant-preview dd {
  margin: 0;
}

.sw-quant-preview__meeting {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.sw-quant-preview__meeting > div,
.sw-quant-preview__summary > div,
.sw-preview-runner__meta > div {
  min-width: 0;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.sw-quant-preview__meeting > div {
  padding: 0.82rem 0.9rem;
}

.sw-quant-preview dt,
.sw-preview-runner small {
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.sw-quant-preview__meeting dd {
  margin-top: 0.4rem;
  overflow: hidden;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-quant-preview__races {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.sw-quant-preview__races > span {
  display: grid;
  min-width: 0;
  min-height: 76px;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.2rem 0.55rem;
  align-items: end;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 8px;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-mono);
  font-size: 1.2rem;
}

.sw-quant-preview__races > span small {
  grid-column: 1 / -1;
  color: var(--sw-text-muted);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
}

.sw-quant-preview__races > span strong {
  min-width: 0;
  align-self: center;
  color: var(--sw-gold-400);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: right;
}

.sw-quant-preview__races > span em {
  color: var(--sw-text-muted);
  font-size: 0.52rem;
  font-style: normal;
  letter-spacing: 0.04em;
}

.sw-quant-preview__races > span.is-active {
  border-color: var(--sw-gold-500);
  background: rgba(201, 162, 74, 0.09);
  box-shadow: inset 0 2px 0 var(--sw-gold-500);
}

.sw-quant-preview__races > span.is-locked {
  border-style: dashed;
  color: var(--sw-text-muted);
  opacity: 0.68;
}

.sw-quant-preview__summary {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.7fr 0.8fr;
  gap: 0.65rem;
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(201, 162, 74, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(112deg, rgba(201, 162, 74, 0.1), rgba(201, 162, 74, 0.015) 58%),
    var(--sw-elevated);
}

.sw-quant-preview__summary > div {
  padding: 0.72rem 0.85rem;
}

.sw-quant-preview__summary dd {
  margin-top: 0.4rem;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.sw-quant-preview__summary dd b {
  color: var(--sw-gold-300);
  font-weight: 600;
}

.sw-quant-preview__runners {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.sw-preview-runner {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.02), transparent 48%),
    var(--sw-elevated);
}

.sw-preview-runner--top {
  border-color: rgba(201, 162, 74, 0.56);
  background:
    linear-gradient(145deg, rgba(201, 162, 74, 0.14), rgba(201, 162, 74, 0.018) 52%),
    var(--sw-elevated);
  box-shadow: inset 4px 0 0 var(--sw-gold-500);
}

.sw-preview-runner__identity {
  display: flex;
  min-width: 0;
  gap: 0.8rem;
  align-items: center;
}

.sw-preview-runner__number {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(201, 162, 74, 0.48);
  border-radius: 50%;
  background: rgba(201, 162, 74, 0.1);
  color: var(--sw-gold-300);
  font-family: var(--sw-font-mono);
  font-size: 0.92rem;
  font-weight: 600;
}

.sw-preview-runner__identity > div {
  min-width: 0;
}

.sw-preview-runner__identity h4 {
  margin: 0.24rem 0 0;
  overflow: hidden;
  color: var(--sw-cream-050);
  font-family: var(--sw-font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-preview-runner__identity p {
  margin: 0.25rem 0 0;
  overflow: hidden;
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-preview-runner__meta {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr 0.75fr;
  gap: 0.45rem;
  margin-top: 0.85rem !important;
}

.sw-preview-runner__meta > div {
  padding: 0.58rem 0.62rem;
}

.sw-preview-runner__meta dd {
  margin-top: 0.28rem;
  overflow: hidden;
  color: var(--sw-cream-200);
  font-size: 0.7rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-preview-runner__probabilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.sw-preview-runner__probabilities > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.68rem;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 8px;
}

.sw-preview-runner__probabilities > span.is-primary {
  border-color: rgba(201, 162, 74, 0.46);
  background: rgba(201, 162, 74, 0.07);
}

.sw-preview-runner__probabilities strong {
  color: var(--sw-cream-050);
  font-family: var(--sw-font-mono);
  font-size: 1rem;
}

.sw-preview-runner__probabilities .is-primary strong {
  color: var(--sw-gold-300);
}

.sw-preview-runner__signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.45rem;
}

.sw-preview-runner__signals > span {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  gap: 0.26rem 0.35rem;
  padding: 0.62rem;
  border: 1px solid var(--sw-border-subtle);
  border-radius: 8px;
}

.sw-preview-runner__signals small {
  grid-column: 1 / -1;
  overflow: hidden;
  font-size: 0.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-preview-runner__signals strong {
  color: var(--sw-cream-050);
  font-family: var(--sw-font-mono);
  font-size: 0.84rem;
}

.sw-preview-runner__signals i {
  position: relative;
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sw-ink-700);
}

.sw-preview-runner__signals i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--signal);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sw-gold-600), var(--sw-gold-300));
  content: "";
}

.sw-preview-runner__signals em {
  color: var(--sw-text-muted);
  font-family: var(--sw-font-mono);
  font-size: 0.55rem;
  font-style: normal;
}

.sw-quant-preview__foot {
  justify-content: flex-end;
  border-top: 1px solid var(--sw-border-subtle);
  font-family: var(--sw-font-sans);
  letter-spacing: 0;
  line-height: 1.6;
}

.sw-quant-preview__foot > span {
  max-width: 730px;
}

.sw-small-btn {
  min-width: 168px;
  min-height: 36px;
  justify-content: center;
  white-space: nowrap;
}

.sw-pillar-grid,
.sw-plan-grid,
.sw-faq-grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.sw-pillar,
.sw-plan,
.sw-faq-card {
  border: 1px solid var(--sw-border-subtle);
  border-radius: 14px;
  background:
    var(--sw-card-sheen),
    var(--sw-surface);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.sw-pillar:hover,
.sw-plan:hover,
.sw-faq-card:hover {
  transform: translateY(-5px);
  border-color: var(--sw-border-strong);
}

.sw-pillar {
  padding: 1.75rem;
}

.sw-pillar > span {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid var(--sw-border-strong);
  border-radius: 50%;
  color: var(--sw-gold-500);
  font-family: var(--sw-font-display);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.sw-pillar h3,
.sw-plan h3,
.sw-faq-card h3 {
  margin: 0 0 0.7rem;
  color: var(--sw-cream-050);
  font-size: 1.05rem;
  line-height: 1.25;
}

.sw-pillar p,
.sw-faq-card p {
  margin: 0;
  color: var(--sw-text-secondary);
  font-size: 0.9rem;
  line-height: 1.68;
}

.sw-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 2rem;
}

.sw-plan--featured {
  border-color: var(--sw-border-strong);
  background:
    radial-gradient(circle at 75% 0%, rgba(201, 162, 74, 0.12), transparent 16rem),
    var(--sw-elevated);
  animation: sw-pulse 5s ease-in-out infinite;
}

.sw-plan__badge-row {
  position: absolute;
  top: -12px;
  left: 2rem;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sw-plan > .sw-plan__badge {
  position: absolute;
  top: -12px;
  left: 2rem;
}

.sw-plan__badge,
.sw-plan__badge--value,
.sw-plan__badge--discount {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0.18rem 0.8rem;
  border-radius: 999px;
  background: var(--sw-gold-500);
  color: #07080a;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.sw-plan__badge--discount {
  background: #c45c26;
  color: #fff8f0;
}

.sw-plan__period,
.sw-plan__original,
.sw-plan__yearly {
  margin: 0.35rem 0 0;
  color: var(--sw-text-secondary, var(--text-muted));
  font-size: 0.82rem;
}

.sw-plan__original {
  text-decoration: line-through;
  opacity: 0.85;
}

.sw-plan strong {
  color: var(--sw-gold-300);
  font-family: var(--sw-font-mono);
  font-size: 0.95rem;
  font-weight: 500;
}

.sw-plan ul {
  display: grid;
  gap: 0.8rem;
  margin: 1.2rem 0 1.6rem;
  padding: 0;
  list-style: none;
  color: var(--sw-text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.sw-plan li {
  position: relative;
  padding-left: 1.2rem;
}

.sw-plan li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--sw-gold-500);
}

.sw-plan .btn {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  margin-top: auto;
}

.sw-faq-card {
  padding: 1.6rem;
}

.sw-brand-band {
  padding: 0 0 6rem;
}

.sw-brand-band__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 4.5rem 0;
  border-top: 1px solid var(--sw-border-subtle);
  border-bottom: 1px solid var(--sw-border-subtle);
  text-align: center;
}

.sw-brand-band__marks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  min-height: 132px;
}

.sw-brand-band__mark {
  display: flex;
  flex: 0 0 100px;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  line-height: 0;
  will-change: transform;
}

.sw-brand-band__mark picture {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 0;
}

.sw-brand-band__mark img {
  display: block;
  width: 100px;
  height: 100px;
  margin: 0;
  object-fit: contain;
  object-position: center;
  vertical-align: middle;
  filter: drop-shadow(0 0 34px rgba(201, 162, 74, 0.28));
}

.sw-brand-band__mark--quant {
  animation: sw-float 7.5s ease-in-out infinite;
}

.sw-brand-band__mark--ball {
  animation: sw-float-alt 7.5s ease-in-out infinite;
}

.sw-brand-band__ball {
  filter: drop-shadow(0 0 34px rgba(120, 170, 220, 0.22));
}

html[data-theme="light"] .sw-brand-band__mark img {
  filter: drop-shadow(0 8px 18px rgba(87, 60, 24, 0.18));
}

html[data-theme="light"] .sw-brand-band__ball {
  filter: drop-shadow(0 8px 18px rgba(40, 70, 110, 0.16));
}

.sw-brand-band strong {
  color: var(--sw-gold-400);
  font-family: var(--sw-font-display);
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-align: center;
}

.sw-brand-band__inner > span {
  width: 110px;
  height: 1px;
  background: var(--sw-gold-600);
}

.sw-brand-band p {
  margin: 0;
  color: var(--sw-cream-200);
  font-family: var(--sw-font-serif);
  font-size: 1.55rem;
  font-style: normal;
}

.sw-brand-band small {
  color: var(--sw-text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
}

.sw-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(.22,.61,.36,1), transform 0.9s cubic-bezier(.22,.61,.36,1);
}

.sw-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  margin-top: 0;
  border-top: 1px solid var(--sw-border-subtle);
  background: var(--sw-footer-bg);
  color: var(--sw-text-secondary);
}

.footer-grid h4 {
  color: var(--sw-cream-200);
  font-family: var(--sw-font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--sw-text-secondary);
}

.site-footer a:hover {
  color: var(--sw-gold-300);
}

.mylife-badge {
  border-color: var(--sw-border-subtle);
  border-radius: 8px;
  background: var(--sw-badge-bg);
}

html[data-theme="light"] .mylife-badge {
  background: var(--sw-badge-bg);
}

.mylife-copy {
  min-width: 0;
}

.mylife-partnership,
.mylife-relationship {
  margin: 0;
}

.mylife-partnership {
  color: var(--sw-gold-400);
  font-family: var(--sw-font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.mylife-company-name {
  display: block;
  margin-top: 0.35rem;
  color: var(--sw-cream-050);
  font-size: 0.95rem;
}

.mylife-relationship {
  margin-top: 0.25rem;
  color: var(--sw-text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.disclaimer {
  border-color: var(--sw-border-subtle);
  color: var(--sw-text-muted);
}

@media (max-width: 980px) {
  .sw-hero--1c .sw-hero__content {
    width: min(100% - 48px, 760px);
    grid-template-columns: 1fr;
    gap: 2.75rem;
    padding: 4rem 0;
  }

  .sw-hero--1c .sw-hero__copy {
    text-align: center;
  }

  .sw-hero--1c .sw-hero__divider,
  .sw-hero--1c .sw-hero__lead {
    margin-inline: auto;
  }

  .sw-hero--1c .sw-hero__actions {
    justify-content: center;
  }

  .sw-hero--1c .sw-principle-row {
    margin-inline: auto;
  }

  .sw-hero--1c .sw-hero__mark {
    margin-inline: auto;
  }

  .sw-hero-1c__media {
    width: 100%;
  }

  .sw-stats,
  .sw-pillar-grid,
  .sw-plan-grid,
  .sw-faq-grid {
    grid-template-columns: 1fr;
  }

  .sw-data-records__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.75rem;
  }

  .sw-data-records__stats > div {
    padding: 0 0 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--sw-records-divider);
  }

  .sw-data-records__stats > div:nth-last-child(-n + 2) {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .sw-data-records__more {
    align-self: start;
    margin-top: 1.6rem;
  }

  .seo-bridge-cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .seo-bridge-cta__actions .btn {
    justify-content: center;
    text-align: center;
  }

  .sw-stat {
    padding: 0 0 1.4rem;
    border-right: 0;
    border-bottom: 1px solid var(--sw-border-subtle);
  }

  .sw-stat:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .sw-model-card {
    overflow-x: auto;
  }

  .sw-model-grid,
  .sw-model-card__top,
  .sw-model-card__foot {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .sw-home-redesign,
  .sw-hero {
    width: 100vw;
    max-width: 100vw;
  }

  .nav-products__menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 32px);
  }

  .sw-container,
  .sw-hero__content {
    width: min(100% - 32px, 1120px);
  }

  .sw-hero__content {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin-inline: auto;
  }

  .sw-hero {
    min-height: 840px;
  }

  .sw-hero--1c {
    min-height: auto;
  }

  .sw-hero--1c .sw-hero__content {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    gap: 2.25rem;
    padding: 3.25rem 0 4rem;
  }

  .sw-hero--1c .sw-hero__copy,
  .sw-hero--1c h1 {
    width: 100%;
    max-width: 100%;
  }

  .sw-hero-1c__media {
    border-radius: 8px;
  }

  .sw-hero-1c__video-frame {
    aspect-ratio: 4 / 3;
  }

  .sw-hero h1,
  .sw-hero-title {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    font-size: clamp(1.95rem, 8vw, 2.5rem);
    overflow-wrap: anywhere;
    text-wrap: wrap;
    word-break: break-word;
  }

  .sw-hero__copy,
  .sw-hero__lead {
    min-width: 0;
    max-width: 100%;
  }

  .sw-hero__copy {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .sw-hero__lead {
    width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
    padding-inline: 0.25rem;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    text-wrap: wrap;
    word-break: break-all;
  }

  .sw-scramble-word {
    min-inline-size: 0;
  }

  .sw-mobile-break {
    display: block;
  }

  .sw-hero__mark {
    width: 118px;
    height: auto;
    margin-bottom: 1.1rem;
  }

  .sw-hero__actions .btn {
    width: 100%;
  }

  .sw-principle-row {
    width: 100%;
    grid-template-columns: 1fr;
    padding: 0;
    border: 1px solid rgba(201, 162, 74, 0.28);
    background: rgba(7, 8, 10, 0.42);
  }

  .sw-principle-row li {
    min-height: 48px;
    padding: 0.65rem 1rem;
  }

  .sw-principle-row li + li {
    border-block-start: 1px solid rgba(231, 220, 191, 0.14);
    border-inline-start: 0;
  }

  .sw-performance,
  .sw-pillar,
  .sw-plan,
  .sw-faq-card {
    border-radius: 8px;
  }

  .sw-section {
    padding: 4rem 0;
  }

  .sw-cinematic-break {
    padding-bottom: 4rem;
  }

  .sw-cinematic-break__frame {
    min-height: 460px;
    border-radius: 8px;
  }

  .sw-cinematic-break__video {
    object-position: 58% 45%;
  }

  .sw-cinematic-break__scrim {
    background:
      linear-gradient(90deg, rgba(7, 8, 10, 0.78), rgba(7, 8, 10, 0.28)),
      linear-gradient(180deg, rgba(7, 8, 10, 0.1) 28%, rgba(7, 8, 10, 0.88) 100%);
  }

  .sw-cinematic-break__copy {
    padding: 1.5rem;
  }

  .sw-cinematic-break h2 {
    font-size: clamp(2.25rem, 11vw, 3.2rem);
  }

  .sw-model-card__top,
  .sw-model-card__foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-hero__image,
  .sw-brand-band__mark,
  .sw-brand-band img,
  .sw-performance,
  .sw-plan--featured,
  .sw-edge-bar i {
    animation: none;
  }

  .sw-reveal {
    opacity: 1;
    transform: none;
  }

  .sw-hero__eyebrow,
  .sw-hero__mark,
  .sw-hero h1,
  .sw-hero-title,
  .sw-hero__divider,
  .sw-hero__lead,
  .sw-principle-row,
  .sw-hero__actions {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .sw-hero-1c__media {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .sw-hero__divider {
    width: 110px;
  }
}
.sw-hero__video {
  animation: none;
  background: #07080a;
  object-fit: cover;
  object-position: 68% 45%;
  transform: none;
}

/* Flask ports of the shadcn interactive and plan button treatments. */
.sw-home-redesign .sw-hover-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(7, 8, 10, 0.78);
  color: var(--sw-cream-050);
}

.sw-home-redesign .sw-hover-button:hover {
  border-color: var(--sw-gold-300);
  background: rgba(7, 8, 10, 0.78);
  color: var(--sw-cream-050);
}

.sw-hover-button__label,
.sw-hover-button__hover {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sw-hover-button__label {
  transform: translateX(0.25rem);
}

.sw-hover-button__hover {
  position: absolute;
  inset: 0;
  transform: translateX(3rem);
  opacity: 0;
}

.sw-hover-button__arrow {
  font-size: 1.2em;
  line-height: 1;
}

.sw-hover-button__fill {
  position: absolute;
  top: 40%;
  left: 20%;
  z-index: 1;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 8px;
  background: var(--sw-gold-500);
  transition: inset 0.3s ease, width 0.3s ease, height 0.3s ease, transform 0.3s ease;
}

.sw-hover-button:hover .sw-hover-button__label,
.sw-hover-button:focus-visible .sw-hover-button__label {
  transform: translateX(3rem);
  opacity: 0;
}

.sw-hover-button:hover .sw-hover-button__hover,
.sw-hover-button:focus-visible .sw-hover-button__hover {
  transform: translateX(0);
  opacity: 1;
}

.sw-hover-button:hover .sw-hover-button__fill,
.sw-hover-button:focus-visible .sw-hover-button__fill {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.8);
}

/* Keep the hero CTA visually present before, during and after the hover transition. */
.sw-home-redesign .sw-btn-primary.sw-hover-button {
  min-width: 220px;
  border-color: var(--sw-gold-400);
  border-radius: 4px;
  background: var(--sw-gold-500);
  color: #07080a;
  box-shadow: 0 18px 48px rgba(201, 162, 74, 0.2);
}

.sw-home-redesign .sw-btn-primary.sw-hover-button:hover,
.sw-home-redesign .sw-btn-primary.sw-hover-button:focus-visible {
  border-color: var(--sw-cream-100);
  background: var(--sw-gold-500);
  color: #07080a;
  box-shadow: 0 16px 42px rgba(201, 162, 74, 0.3);
}

.sw-btn-primary.sw-hover-button .sw-hover-button__label {
  transform: none;
}

.sw-btn-primary.sw-hover-button .sw-hover-button__hover {
  color: #07080a;
}

.sw-btn-primary.sw-hover-button .sw-hover-button__fill {
  top: 50%;
  right: 1.05rem;
  left: auto;
  background: var(--sw-cream-100);
  transform: translateY(-50%);
}

.sw-btn-primary.sw-hover-button:hover .sw-hover-button__fill,
.sw-btn-primary.sw-hover-button:focus-visible .sw-hover-button__fill {
  top: 0;
  right: 0;
  left: 0;
  transform: scale(1.8);
}

.sw-home-redesign .sw-plan__cta {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--sw-gold-400);
  border-radius: 4px;
  background: var(--sw-gold-500);
  color: #07080a;
  box-shadow: 0 12px 30px rgba(201, 162, 74, 0.16);
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.sw-home-redesign .sw-plan__cta:hover,
.sw-home-redesign .sw-plan__cta:focus-visible {
  border-color: var(--sw-cream-100);
  background: var(--sw-gold-400);
  color: #07080a;
  box-shadow: 0 14px 34px rgba(201, 162, 74, 0.24);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .sw-hover-button__label,
  .sw-hover-button__hover,
  .sw-hover-button__fill,
  .sw-home-redesign .sw-plan__cta {
    animation: none;
    transition: none;
  }
}

/* Fluid production shell: fill desktop canvases while keeping readable 4K bounds. */
:root {
  --sw-shell-max: 96rem;
  --sw-shell-gutters: clamp(2rem, 8vw, 10rem);
}

.container,
.sw-container {
  width: min(calc(100% - var(--sw-shell-gutters)), var(--sw-shell-max));
  max-width: none;
}

.site-header .container {
  max-width: none;
}

/* The desktop header keeps its inline layout; the details element becomes a
   disclosure menu only on compact screens. */
.site-nav-shell,
.site-nav-panel {
  display: contents;
}

.site-nav-toggle,
.site-nav-summary {
  display: none;
}

.header-lang-switch {
  flex: 0 0 auto;
}

/* Shared intrinsic-size guards keep grids, cards and controls inside the
   viewport without flattening the editorial desktop layout. */
main,
section,
article,
form,
fieldset,
.card,
.card-grid > *,
.answer-grid > *,
.footer-grid > *,
.sigma-quant-shell > *,
.checkout-shell > *,
.payment-shell > * {
  min-width: 0;
}

img,
picture,
video,
svg,
canvas {
  max-width: 100%;
}

img,
picture {
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.sigma-quant-shell > *,
.quant-hero,
.quant-page-nav,
.quant-section,
.quant-tool-card,
.snapshot-card {
  width: 100%;
  max-width: 100%;
}

.checkout-shell dd,
.payment-shell dd,
.card p,
.state-panel,
.muted {
  overflow-wrap: anywhere;
}

/* Wide editorial pages: the page uses the desktop canvas while individual
   text blocks retain a comfortable reading width. */
.content-page {
  padding-block: clamp(2.5rem, 5vw, 5rem);
}

.content-page__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.75rem);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.content-page__header h1 {
  margin: 0;
  max-width: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  line-height: 1.18;
  text-wrap: wrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.content-page__header > p {
  width: min(100%, 70ch);
  margin: 0;
  justify-self: start;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.15vw, 1.08rem);
}

.content-page__meta {
  font-size: 0.85rem !important;
}

.insights-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
  margin-top: 0;
}

html[data-lang="en"] .lang-panel.lang-en.insights-grid,
html[data-lang="zh-Hant"] .lang-panel.lang-zh-Hant.insights-grid,
html[data-lang="zh-Hans"] .lang-panel.lang-zh-Hans.insights-grid {
  display: grid;
}

.insights-grid > .card {
  height: 100%;
  margin-top: 0 !important;
}

.faq-page .faq-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
}

.faq-page .faq-item {
  height: 100%;
}

.contact-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;
  gap: 1.25rem;
}

.contact-page__details,
.contact-page__intro {
  min-width: 0;
  margin-top: 0;
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.contact-page__intro {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.legal-page > .lang-panel {
  column-width: 28rem;
  column-count: 3;
  column-gap: clamp(2rem, 4vw, 4rem);
  column-rule: 1px solid var(--border);
  margin-top: 0;
}

.legal-page > .lang-panel h2 {
  break-after: avoid;
  margin-top: 0;
  padding-top: 0.2rem;
}

.legal-page > .lang-panel p,
.legal-page > .lang-panel ol {
  break-inside: avoid;
  margin-bottom: 1.6rem;
}

.sw-hero__content {
  width: min(calc(100% - var(--sw-shell-gutters)), 84rem);
  max-width: none;
}

/* Preserve useful density between desktop and phone instead of jumping to one column. */
@media (min-width: 761px) and (max-width: 1100px) {
  .sw-pillar-grid,
  .sw-plan-grid,
  .sw-faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-grid,
  .faq-page .faq-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-page__header {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-page__header > p {
    justify-self: start;
  }

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

  .sw-stat {
    padding: 0 1.25rem 0 0;
    border-right: 1px solid var(--sw-border-subtle);
    border-bottom: 0;
  }

  .sw-stat:last-child {
    padding: 0;
    border-right: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --sw-shell-gutters: 2rem;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .container,
  .sw-container,
  .site-header .container,
  .sw-hero__content {
    width: calc(100% - var(--sw-shell-gutters));
    max-width: none;
  }

  /* Compact disclosure header: every action is visible without horizontal swiping. */
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding-block: 0.55rem;
  }

  .brand {
    min-width: 0;
    gap: 0.55rem;
  }

  .brand-cluster {
    gap: 0.35rem;
  }

  .brand-logo,
  .brand-logo--ball {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
  }

  .brand-text strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .brand-text span {
    display: none;
  }

  .site-nav-shell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    grid-column: 2;
    grid-row: 1;
  }

  .header-lang-switch {
    display: flex;
    order: 1;
  }

  .site-nav-summary {
    display: inline-flex;
    order: 2;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
    color: var(--text);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    list-style: none;
  }

  .site-nav-toggle {
    position: absolute;
    display: block;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .site-nav-toggle:focus-visible ~ .site-nav-summary {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }

  .site-nav-summary::-webkit-details-marker {
    display: none;
  }

  .site-nav-summary__icon {
    display: grid;
    width: 18px;
    gap: 4px;
  }

  .site-nav-summary__icon i {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .site-nav-toggle:checked ~ .site-nav-summary .site-nav-summary__icon i:first-child {
    transform: translateY(5px) rotate(45deg);
  }

  .site-nav-toggle:checked ~ .site-nav-summary .site-nav-summary__icon i:nth-child(2) {
    opacity: 0;
  }

  .site-nav-toggle:checked ~ .site-nav-summary .site-nav-summary__icon i:last-child {
    transform: translateY(-5px) rotate(-45deg);
  }

  .site-nav-toggle:not(:checked) ~ .site-nav-panel {
    display: none !important;
  }

  .site-nav-toggle:checked ~ .site-nav-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    order: 3;
    display: grid !important;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  }

  .header-lang-switch button {
    min-width: 40px;
    min-height: 40px;
  }

  .nav-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.4rem;
    overflow: visible;
  }

  .nav-main > a,
  .nav-main > button,
  .nav-products,
  .nav-products__toggle {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }

  .nav-products {
    grid-column: 1 / -1;
  }

  .nav-products__toggle {
    display: none;
  }

  .nav-products__menu {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-products__menu a {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    text-align: center;
  }

  .nav-products__menu-item.is-disabled {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 9px;
    text-align: center;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .header-controls .theme-toggle {
    min-height: 44px;
  }

  .sigma-quant-cta--sticky {
    display: none !important;
  }

  .card-grid,
  .answer-grid,
  .footer-grid,
  .insights-grid,
  .faq-page .faq-list,
  .contact-page__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-page {
    padding-block: 2rem 3.5rem;
  }

  .content-page__header {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.25rem;
  }

  .content-page__header h1 {
    font-size: clamp(2rem, 11vw, 3.25rem);
  }

  .content-page__header > p {
    justify-self: start;
  }

  .legal-page > .lang-panel {
    column-count: 1;
    column-width: auto;
    column-rule: 0;
  }

  .form-row,
  .form-row > div,
  .phone-row,
  .mylife-badge {
    min-width: 0;
    max-width: 100%;
  }

  .form-row input,
  .form-row select,
  .form-row textarea,
  .phone-row input,
  .phone-row select {
    width: 100%;
    min-width: 0 !important;
  }

  .modal {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }

  .sw-home-redesign,
  .sw-hero {
    width: 100%;
    max-width: 100%;
  }

  .sw-hero__copy,
  .sw-hero h1,
  .sw-hero-title,
  .sw-hero__lead {
    width: 100%;
    max-width: 100%;
  }

  .sw-hero h1,
  .sw-hero-title {
    font-size: clamp(1.75rem, 7.4vw, 2.35rem);
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .sw-hero__lead {
    padding-inline: 0;
    font-size: clamp(0.9rem, 3.8vw, 1rem);
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .sw-mobile-break {
    display: initial;
  }

  /* Replace the oversized desktop table scroller with readable runner cards. */
  .sw-model-card {
    overflow: hidden;
  }

  .sw-model-grid--head {
    display: none;
  }

  .sw-model-grid,
  .sw-model-card__top,
  .sw-model-card__foot {
    min-width: 0;
  }

  .sw-model-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 0.75rem;
    padding: 1.1rem;
  }

  .sw-model-row > * {
    min-width: 0;
  }

  .sw-model-row > *::before {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--sw-text-muted);
    content: attr(data-label);
    font-family: var(--sw-font-mono);
    font-size: 0.61rem;
    font-weight: 500;
    letter-spacing: 0.08em;
  }

  .sw-model-row .sw-model-no {
    grid-column: 1;
  }

  .sw-model-row > strong {
    grid-column: 2 / -1;
  }

  .sw-edge-bar {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    height: auto;
    overflow: visible;
    background: transparent;
  }

  .sw-edge-bar::before {
    margin: 0;
    white-space: nowrap;
  }

  .sw-edge-bar i {
    height: 6px;
    border-radius: 999px;
    background: var(--sw-gold-500);
  }

  .sw-model-card__top,
  .sw-model-card__foot {
    width: 100%;
    align-items: stretch;
  }

  .sw-small-btn {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .sw-quant-preview__intro {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .sw-quant-preview__runners {
    grid-template-columns: 1fr;
  }

  .sw-preview-runner {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(250px, 1.1fr);
    gap: 0.5rem 0.8rem;
  }

  .sw-preview-runner__meta {
    grid-row: 2;
  }

  .sw-preview-runner__probabilities {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .sw-preview-runner__signals {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0.85rem;
  }
}

@media (max-width: 760px) {
  .sw-quant-preview {
    border-radius: 8px;
  }

  .sw-quant-preview__top,
  .sw-quant-preview__foot {
    align-items: stretch;
    padding: 0.9rem 1rem;
  }

  .sw-quant-preview__top {
    flex-direction: column;
    gap: 0.5rem;
  }

  .sw-quant-preview__board {
    padding: 1rem;
  }

  .sw-quant-preview__meeting,
  .sw-quant-preview__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sw-quant-preview__races {
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    margin-inline: -1rem;
    padding-inline: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: inline proximity;
  }

  .sw-quant-preview__races > span {
    scroll-snap-align: start;
  }

  .sw-preview-runner {
    display: block;
  }

  .sw-preview-runner__probabilities {
    margin-top: 0.45rem;
  }

  .sw-preview-runner__signals {
    margin-top: 0.45rem;
  }

  .sw-quant-preview__foot {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .container,
  .sw-container,
  .site-header .container,
  .sw-hero__content {
    width: calc(100% - 2rem);
  }

  .nav-main,
  .nav-products__menu {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-nav-summary__label {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .plan-card:hover,
  .sw-plan:hover,
  .sw-pillar:hover {
    transform: none;
  }
}

/* Evidence-gated research papers */
.research-key-finding {
  border-left: 3px solid var(--gold);
}

.research-disclosure {
  margin-top: 1.25rem;
}

.research-figure {
  margin: 1.5rem 0 0.8rem;
}

.research-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(218, 181, 109, 0.2);
  border-radius: 16px;
  background: rgba(8, 10, 13, 0.78);
}

.research-figure figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  line-height: 1.65;
}

.quant-ssr-preview {
  grid-column: 1 / -1;
}

.quant-ssr-preview .data-table th small {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

/* Liquid-glass button material.
   The homepage hero fill and featured-plan gold CTA keep their bespoke
   treatment, while every standard .btn retains its existing markup and hooks. */
.btn:not(.sw-hover-button):not(.sw-plan__cta) {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(232, 204, 130, 0.38);
  background: rgba(16, 18, 22, 0.46);
  color: var(--sw-gold-300, var(--gold));
  text-shadow: 0 1px 12px rgba(201, 162, 74, 0.2);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 1px 1px 0 rgba(255, 255, 255, 0.18),
    inset -1px -1px 0 rgba(201, 162, 74, 0.12),
    inset 0 0 18px rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta)::before,
.btn:not(.sw-hover-button):not(.sw-plan__cta)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta)::before {
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 30%),
    radial-gradient(circle at 80% 120%, rgba(201, 162, 74, 0.18), transparent 55%);
  opacity: 0.78;
  transition: opacity 220ms ease;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta)::after {
  inset: 1px;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.06),
    inset -2px -2px 5px rgba(0, 0, 0, 0.16);
}

.btn:not(.sw-hover-button):not(.sw-plan__cta) > * {
  position: relative;
  z-index: 1;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta):hover {
  transform: translateY(-1px);
  border-color: rgba(232, 204, 130, 0.68);
  background: rgba(201, 162, 74, 0.12);
  color: var(--sw-cream-050, var(--text));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.26),
    0 0 18px rgba(201, 162, 74, 0.12),
    inset 1px 1px 0 rgba(255, 255, 255, 0.24),
    inset -1px -1px 0 rgba(201, 162, 74, 0.16);
  text-decoration: none;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta):hover::before {
  opacity: 1;
}

.btn:not(.sw-hover-button):not(.sw-plan__cta):active {
  transform: translateY(0);
  background: rgba(201, 162, 74, 0.08);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.2),
    inset 1px 1px 4px rgba(0, 0, 0, 0.18),
    inset -1px -1px 0 rgba(255, 255, 255, 0.1);
}

.btn-ghost:not(.sw-hover-button):not(.sw-plan__cta) {
  border-color: rgba(231, 220, 191, 0.2);
  background: rgba(255, 255, 255, 0.035);
  color: var(--sw-cream-200, var(--text));
}

.btn-ghost:not(.sw-hover-button):not(.sw-plan__cta):hover {
  border-color: rgba(232, 204, 130, 0.5);
  background: rgba(201, 162, 74, 0.085);
  color: var(--sw-gold-300, var(--gold));
}

.btn:not(.sw-hover-button):not(.sw-plan__cta):disabled,
.btn:not(.sw-hover-button):not(.sw-plan__cta)[aria-disabled="true"] {
  transform: none;
  border-color: rgba(201, 162, 74, 0.18);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .btn:not(.sw-hover-button):not(.sw-plan__cta) {
  border-color: rgba(118, 80, 24, 0.34);
  background: rgba(255, 253, 248, 0.55);
  color: var(--sw-gold-300, var(--gold));
  text-shadow: 0 1px 10px rgba(118, 80, 24, 0.1);
  box-shadow:
    0 8px 22px rgba(87, 60, 24, 0.1),
    inset 1px 1px 0 rgba(255, 255, 255, 0.9),
    inset -1px -1px 0 rgba(118, 80, 24, 0.1),
    inset 0 0 16px rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] .btn:not(.sw-hover-button):not(.sw-plan__cta)::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), transparent 34%),
    radial-gradient(circle at 80% 120%, rgba(201, 162, 74, 0.22), transparent 58%);
}

html[data-theme="light"] .btn:not(.sw-hover-button):not(.sw-plan__cta):hover {
  border-color: rgba(118, 80, 24, 0.58);
  background: rgba(255, 250, 243, 0.74);
  color: var(--sw-cream-050, var(--text));
  box-shadow:
    0 10px 26px rgba(87, 60, 24, 0.14),
    0 0 18px rgba(155, 111, 31, 0.08),
    inset 1px 1px 0 rgba(255, 255, 255, 0.96),
    inset -1px -1px 0 rgba(118, 80, 24, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .btn:not(.sw-hover-button):not(.sw-plan__cta) {
    transition: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn:not(.sw-hover-button):not(.sw-plan__cta) {
    min-height: 44px;
  }

  .btn:not(.sw-hover-button):not(.sw-plan__cta):hover {
    transform: none;
  }
}

/* Release guard: the compact navigation must remain visible and reachable at
   phone widths even when an earlier header rule is cached or overridden. */
@media (max-width: 820px) {
  .site-header .site-nav-shell {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
  }

  .site-header .header-lang-switch {
    display: flex !important;
    visibility: visible;
    opacity: 1;
  }

  .site-header .site-nav-summary {
    display: inline-flex !important;
    visibility: visible;
    opacity: 1;
  }
}

/* Horse DB tools embedded on /database catalogue */
.seo-horse-db-tools {
  margin: 1.25rem 0 1.75rem;
  display: grid;
  gap: 0.85rem;
}

.seo-horse-db-tools__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.quant-tools-crosslink {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.quant-tools-crosslink a {
  color: var(--gold);
  text-decoration: none;
}

.quant-tools-crosslink a:hover {
  text-decoration: underline;
}

.horse-db-tools-page .horse-db-tools {
  margin-top: 0.5rem;
}
