:root {
  --v3-bg: #f3efe6;
  --v3-ink: #0a1628;
  --v3-accent: #163528;
  --v3-card: #fffdf8;
  /* Soft sage-cream pair for zebra lists (light / deeper) */
  --v3-card-alt: #f3f6f1;
  --v3-card-alt-deep: #e2ebe0;
  --v3-top: #0a1628;
  --v3-safe-top: env(safe-area-inset-top, 0px);
  --v3-safe-bottom: env(safe-area-inset-bottom, 0px);
  --v3-safe-left: env(safe-area-inset-left, 0px);
  --v3-safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--v3-bg);
  color: var(--v3-ink);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.v3-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(22, 53, 40, 0.12), transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(10, 22, 40, 0.08), transparent 50%),
    var(--v3-bg);
}

.v3-top {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: calc(0.65rem + var(--v3-safe-top)) calc(1rem + var(--v3-safe-right)) 0.65rem calc(1rem + var(--v3-safe-left));
  background: var(--v3-top);
  color: #f7f2e8;
}

.v3-top-art {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  max-width: min(11.5rem, 46%);
  object-fit: contain;
  object-position: right center;
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.v3-top-row,
.v3-top-user {
  position: relative;
  z-index: 1;
}

.v3-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.v3-top-user {
  font-size: 0.78rem;
  opacity: 0.78;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2.75rem; /* keep clear of menu hit area above */
}

.v3-menu-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(247, 242, 232, 0.28);
  background: rgba(10, 22, 40, 0.45);
  backdrop-filter: blur(2px);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.v3-menu-btn:hover,
.v3-menu-btn:focus-visible {
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
}

.v3-menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 1.05rem;
}

.v3-menu-icon span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: #f7f2e8;
}

.v3-brand {
  font-size: 1.02rem;
  text-transform: lowercase;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(10, 22, 40, 0.55);
}

.v3-brand:hover {
  color: inherit;
  text-decoration: none;
}

.v3-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.v3-brand-name {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.v3-brand-plus {
  color: #f9e2af;
}

.v3-brand-models {
  display: inline-block;
  margin-top: -0.12rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #f9e2af;
  white-space: nowrap;
  transform: rotate(-12deg);
  transform-origin: left center;
  pointer-events: none;
}

.v3-main {
  flex: 1;
  padding: 1.25rem calc(1rem + var(--v3-safe-right)) calc(1.5rem + var(--v3-safe-bottom)) calc(1rem + var(--v3-safe-left));
  max-width: 28rem;
  width: 100%;
  margin: 0 auto;
}

.v3-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.85rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.v3-lead {
  color: rgba(10, 22, 40, 0.7);
  margin-bottom: 1.25rem;
}

.v3-placeholder {
  background: var(--v3-card);
  border-radius: 1rem !important;
}

.v3-center {
  text-align: center;
  max-width: 22rem;
  margin: 0 auto;
}

.v3-empty-layout {
  min-height: 100dvh;
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(22, 53, 40, 0.35), transparent 60%),
    #0a1628;
}

.v3-login {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(2rem + var(--v3-safe-top)) calc(1rem + var(--v3-safe-right)) calc(2rem + var(--v3-safe-bottom)) calc(1rem + var(--v3-safe-left));
}

.v3-login-card {
  width: 100%;
  max-width: 24rem;
  background: rgba(255, 253, 248, 0.96);
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem 1.75rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color: var(--v3-ink);
}

.v3-login-brand {
  font-size: 1.2rem;
  margin-bottom: 0.15rem;
  color: var(--v3-ink);
}

.v3-login-brand .v3-brand-plus,
.v3-login-brand .v3-brand-models {
  color: #9a7a20;
}

.v3-login-tag {
  color: rgba(10, 22, 40, 0.65);
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.v3-login-lang {
  margin: 0 0 1.1rem;
}

.v3-login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border-radius: 0.85rem;
  background: rgba(10, 22, 40, 0.06);
}

.v3-login-tab {
  border: 0;
  border-radius: 0.7rem;
  padding: 0.55rem 0.5rem;
  background: transparent;
  color: rgba(14, 22, 36, 0.62);
  font-size: 0.92rem;
  font-weight: 600;
}

.v3-login-tab.is-active {
  background: #fff;
  color: var(--v3-ink);
  box-shadow: 0 1px 4px rgba(10, 22, 40, 0.12);
}

.v3-login .btn-primary,
.v3-main .btn-primary {
  background: linear-gradient(90deg, #14233a, #163528);
  border: none;
}

.v3-login .btn-primary:hover,
.v3-main .btn-primary:hover {
  background: linear-gradient(90deg, #0e1624, #1a4a32);
}

.v3-login .btn-success {
  background: linear-gradient(90deg, #163528, #1f5a3c);
  border: none;
}

.v3-login .btn-success:hover {
  background: linear-gradient(90deg, #0f2a1c, #163528);
}

.v3-install-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
  padding: 0.7rem calc(1rem + var(--v3-safe-right)) 0.7rem calc(1rem + var(--v3-safe-left));
  background: #163528;
  color: #f7f2e8;
  line-height: 1.45;
}

.v3-install-hint-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
  font-size: 0.84rem;
}

.v3-install-hint-body strong {
  font-size: 0.9rem;
}

.v3-install-hint-body span {
  opacity: 0.88;
}

.v3-install-hint-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.v3-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem calc(1rem + var(--v3-safe-right)) 0.55rem calc(1rem + var(--v3-safe-left));
  background: #1a446e;
  color: #f7f2e8;
  font-size: 0.88rem;
  font-weight: 600;
}

.v3-settings-card {
  background: var(--v3-card);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.v3-settings-h {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
}

.v3-settings-steps {
  padding-left: 1.15rem;
  margin: 0;
}

.v3-settings-steps li + li {
  margin-top: 0.35rem;
}

.v3-lang-switch {
  display: flex;
  gap: 0.4rem;
}

.v3-lang-btn {
  flex: 1;
  min-height: 2.4rem;
  border: 1px solid rgba(10, 22, 40, 0.18);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.65);
  color: rgba(10, 22, 40, 0.75);
  font-weight: 600;
  font-size: 0.95rem;
}

.v3-lang-btn.is-active {
  background: var(--v3-ink, #0a1628);
  border-color: transparent;
  color: #fff;
}

.v3-lang-btn:disabled:not(.is-active) {
  opacity: 0.55;
}

/* ── Today / Race (Phase 1) ─────────────────────────────────────────────── */

.v3-today-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.v3-today-head .v3-title {
  margin-bottom: 0.2rem;
}

.v3-refresh {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 0.65rem;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--v3-accent);
  border-color: rgba(22, 53, 40, 0.25);
}

.v3-meeting-chip-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.v3-focus-note {
  font-size: 0.78rem;
  color: rgba(10, 22, 40, 0.55);
}

.v3-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.22rem 0.55rem;
  border-radius: 0.45rem;
  white-space: nowrap;
  background: rgba(10, 22, 40, 0.08);
  color: var(--v3-ink);
}

.chip-ready {
  background: rgba(22, 53, 40, 0.16);
  color: #0f3a28;
}

.chip-live {
  background: rgba(180, 45, 45, 0.14);
  color: #8a1c1c;
}

.chip-done {
  background: rgba(10, 22, 40, 0.1);
  color: rgba(10, 22, 40, 0.7);
}

.chip-wait {
  background: rgba(140, 95, 20, 0.14);
  color: #6b4a10;
}

.chip-prep {
  background: rgba(30, 80, 140, 0.12);
  color: #1a446e;
}

.chip-upcoming {
  background: rgba(22, 53, 40, 0.1);
  color: #163528;
}

.chip-sched {
  background: rgba(10, 22, 40, 0.07);
  color: rgba(10, 22, 40, 0.65);
}

.chip-fail {
  background: rgba(120, 40, 40, 0.12);
  color: #6e1f1f;
}

.v3-meeting-nav {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.v3-meeting-nav .btn {
  flex: 1;
  border-radius: 0.65rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.v3-course-map-wrap {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  background: rgba(255, 253, 248, 0.9);
  border-radius: 0.9rem;
  padding: 0.75rem;
}

.v3-course-map {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: auto;
}

.v3-race-hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.v3-race-hero-map {
  display: block;
  width: 5.75rem;
  height: auto;
  max-height: 3.6rem;
  object-fit: contain;
  object-position: right center;
  background: #fff;
  border-radius: 0.35rem;
  padding: 0.15rem;
  border: 1px solid rgba(10, 22, 40, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 253, 248, 0.9),
    0 1px 2px rgba(10, 22, 40, 0.08);
  image-rendering: auto;
}

.v3-silk {
  width: 40px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid rgba(10, 22, 40, 0.08);
  background: #fff;
  border-radius: 0.25rem;
}

.v3-silk-empty {
  display: inline-block;
  background: rgba(10, 22, 40, 0.04);
}

/* Meeting hero — Today first viewport */
.v3-meeting-hero {
  position: relative;
  overflow: hidden;
  margin: -1.25rem calc(-1rem - var(--v3-safe-right)) 1rem calc(-1rem - var(--v3-safe-left));
  padding: 1.15rem calc(1rem + var(--v3-safe-right)) 1.35rem calc(1rem + var(--v3-safe-left));
  min-height: 11.5rem;
  color: #f7f2e8;
  animation: v3-fade-up 0.5s ease both;
}

.v3-meeting-hero.is-st {
  background:
    radial-gradient(90% 120% at 85% 10%, rgba(212, 175, 55, 0.28), transparent 50%),
    linear-gradient(145deg, #0f2a1c 0%, #163528 45%, #0a1628 100%);
}

.v3-meeting-hero.is-hv {
  background:
    radial-gradient(80% 100% at 90% 0%, rgba(255, 170, 70, 0.32), transparent 48%),
    linear-gradient(155deg, #1a1020 0%, #2a1830 40%, #0a1628 100%);
}

.v3-meeting-hero.is-unknown {
  background:
    linear-gradient(145deg, #122033 0%, #0a1628 100%);
}

.v3-meeting-hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 22, 40, 0.55) 0%, rgba(10, 22, 40, 0.15) 70%, transparent 100%);
  pointer-events: none;
}

.v3-meeting-hero-top,
.v3-meeting-hero-venue,
.v3-meeting-hero-date,
.v3-meeting-hero-meta,
.v3-meeting-forecast {
  position: relative;
  z-index: 1;
}

.v3-meeting-forecast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.v3-meeting-forecast.is-busy {
  color: #fff8e8;
}

.v3-meeting-forecast.is-ok {
  color: #e8fff2;
}

.v3-meeting-forecast.is-fail {
  color: #ffe8e8;
}

.v3-meeting-hero-venue,
.v3-meeting-hero-date,
.v3-meeting-hero-meta {
  padding-right: min(46%, 12.5rem);
}

.v3-meeting-hero-lede {
  position: absolute;
  right: calc(1rem + var(--v3-safe-right));
  bottom: 1.35rem;
  z-index: 1;
  margin: 0;
  width: min(46%, 11.5rem);
  text-align: right;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.78;
  pointer-events: none;
}

.v3-meeting-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.v3-meeting-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.v3-meeting-hero-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.v3-meeting-hero-disclaimer {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(247, 242, 232, 0.88);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}

.v3-meeting-hero-disclaimer:hover,
.v3-meeting-hero-disclaimer:focus-visible {
  color: #fff;
}

.v3-meeting-hero-refresh {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 0.6rem;
  border: 1px solid rgba(247, 242, 232, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f2e8;
  font-size: 1.05rem;
  line-height: 1;
}

.v3-disclaimer-cue {
  margin: 0.15rem 0 0.45rem;
}

.v3-disclaimer-cue-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--v3-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.v3-disclaimer {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(22, 53, 40, 0.12);
  scroll-margin-top: 5.5rem;
}

.v3-disclaimer-title {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(14, 22, 36, 0.78);
}

.v3-disclaimer-body {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(14, 22, 36, 0.55);
}

.v3-meeting-hero-venue {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  font-weight: 600;
  margin: 0 0 0.2rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.v3-meeting-hero-date {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  opacity: 0.82;
}

.v3-meeting-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.v3-meeting-hero .v3-chip {
  background: rgba(255, 255, 255, 0.14);
  color: #f7f2e8;
}

.v3-meeting-hero .v3-focus-note {
  color: rgba(247, 242, 232, 0.72);
}

.v3-meeting-hero .chip-live {
  background: rgba(220, 70, 70, 0.55);
  color: #fff;
}

.v3-meeting-hero .chip-ready,
.v3-meeting-hero .chip-prep,
.v3-meeting-hero .chip-upcoming {
  background: rgba(120, 190, 140, 0.35);
  color: #f3fff6;
}

@keyframes v3-fade-up {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ★ Place — red pulse so starred tickets stand out on small screens */
@keyframes v3-star-flash {
  0%, 100% {
    background: rgba(196, 42, 42, 0.10);
    box-shadow: inset 4px 0 0 rgba(196, 42, 42, 0.55);
  }
  50% {
    background: rgba(196, 42, 42, 0.28);
    box-shadow: inset 4px 0 0 rgba(196, 42, 42, 1);
  }
}

@keyframes v3-star-label-flash {
  0%, 100% { color: #c42a2a; opacity: 0.85; }
  50% { color: #e01818; opacity: 1; }
}

.v3-forecast-panel {
  background: var(--v3-card);
  border-radius: 1rem !important;
}

.v3-section-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
}

.v3-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--v3-card-alt);
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(22, 53, 40, 0.08);
}

.v3-rank-row {
  display: grid;
  grid-template-columns: 2rem 2rem 40px 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  background: var(--v3-card-alt);
  border-bottom: 1px solid rgba(10, 22, 40, 0.05);
}

.v3-rank-row:nth-child(even) {
  background: var(--v3-card-alt-deep);
}

.v3-rank-row:last-child {
  border-bottom: none;
}

.v3-rank-pos {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--v3-accent);
  line-height: 1.35;
}

.v3-rank-num {
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(10, 22, 40, 0.65);
  line-height: 1.35;
}

.v3-rank-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.v3-rank-name {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-rank-people {
  font-size: 0.75rem;
  color: rgba(10, 22, 40, 0.58);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-rank-sep {
  margin: 0 0.2rem;
  opacity: 0.55;
}

.v3-model-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.28rem;
}

.v3-mbadge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.12rem 0.38rem;
  border-radius: 0.35rem;
  line-height: 1.2;
  white-space: nowrap;
}

.v3-mbadge-ai {
  background: rgba(30, 80, 140, 0.12);
  color: #1a446e;
}

.v3-mbadge-lr {
  background: rgba(22, 53, 40, 0.12);
  color: #0f3a28;
}

.v3-mbadge-lgbm {
  background: rgba(140, 95, 20, 0.14);
  color: #6b4a10;
}

.v3-mbadge-rrf {
  background: rgba(10, 22, 40, 0.1);
  color: rgba(10, 22, 40, 0.75);
}

.v3-ai-block {
  background: var(--v3-card);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem 1.1rem;
}

.v3-ai-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(10, 22, 40, 0.88);
}

.v3-ai-body.markdown-body > *:first-child {
  margin-top: 0;
}

.v3-ai-body.markdown-body > *:last-child {
  margin-bottom: 0;
}

.v3-ai-body.markdown-body h1,
.v3-ai-body.markdown-body h2,
.v3-ai-body.markdown-body h3,
.v3-ai-body.markdown-body h4 {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(10, 22, 40, 0.95);
}

.v3-ai-body.markdown-body h1 { font-size: 1.05rem; }
.v3-ai-body.markdown-body h2 { font-size: 1rem; }
.v3-ai-body.markdown-body h3 { font-size: 0.95rem; }

.v3-ai-body.markdown-body p {
  margin: 0 0 0.65rem;
}

.v3-ai-body.markdown-body ul,
.v3-ai-body.markdown-body ol {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
}

.v3-ai-body.markdown-body li {
  margin: 0.2rem 0;
}

.v3-ai-body.markdown-body strong {
  font-weight: 700;
  color: rgba(10, 22, 40, 0.95);
}

.v3-ai-body.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.82rem;
}

.v3-ai-body.markdown-body th,
.v3-ai-body.markdown-body td {
  border: 1px solid rgba(10, 22, 40, 0.12);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.v3-ai-body.markdown-body th {
  background: rgba(10, 22, 40, 0.05);
  font-weight: 600;
}

.v3-ai-body.markdown-body hr {
  border: 0;
  border-top: 1px solid rgba(10, 22, 40, 0.12);
  margin: 0.75rem 0;
}

.v3-ai-body.markdown-body code {
  font-size: 0.85em;
  background: rgba(10, 22, 40, 0.06);
  padding: 0.1em 0.3em;
  border-radius: 0.25rem;
}

.v3-meeting-pl {
  margin-bottom: 1rem;
}

.v3-meeting-pl-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--v3-card);
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
}

.v3-meeting-pl-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(10, 22, 40, 0.5);
}

.v3-meeting-pl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.v3-meeting-pl-value {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.v3-meeting-pl-amount {
  min-width: 0;
}

.v3-meeting-pl-thumb {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
}

.v3-meeting-pl-value.gain {
  color: #0f3a28;
}

.v3-meeting-pl-value.loss {
  color: #8a2a2a;
}

.v3-meeting-pl-value.flat {
  color: rgba(10, 22, 40, 0.75);
}

.v3-meeting-pl-toggle {
  flex-shrink: 0;
  min-width: 2.25rem;
  padding: 0.15rem 0.45rem;
  line-height: 1.2;
}

.v3-meeting-pl-meta {
  font-size: 0.72rem;
  color: rgba(10, 22, 40, 0.55);
}

.v3-meeting-pl-races {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0.35rem 0 0;
  border-top: 1px solid rgba(10, 22, 40, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.v3-meeting-pl-race {
  width: 100%;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  border: none;
  background: transparent;
  padding: 0.35rem 0.1rem;
  text-align: left;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.v3-meeting-pl-race:active {
  opacity: 0.75;
}

.v3-meeting-pl-race-no {
  font-weight: 700;
  font-size: 0.88rem;
}

.v3-meeting-pl-race-meta {
  font-size: 0.72rem;
  color: rgba(10, 22, 40, 0.55);
}

.v3-meeting-pl-race-pl {
  font-weight: 700;
  font-size: 0.88rem;
}

.v3-meeting-pl-race-pl.gain {
  color: #0f3a28;
}

.v3-meeting-pl-race-pl.loss {
  color: #8a2a2a;
}

.v3-meeting-pl-race-pl.flat {
  color: rgba(10, 22, 40, 0.55);
}

.v3-place-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.v3-place-summary {
  color: rgba(10, 22, 40, 0.62);
  flex: 1;
  min-width: 0;
}

.v3-place-clock {
  text-align: right;
  flex-shrink: 0;
}

.v3-place-countdown {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--v3-ink);
  font-variant-numeric: tabular-nums;
}

.v3-place-countdown-cap {
  font-size: 0.72rem;
  color: rgba(10, 22, 40, 0.55);
  margin-top: 0.1rem;
}

.v3-place-summary.v3-place-pl.gain {
  color: #0f3a28;
  font-weight: 600;
}

.v3-place-summary.v3-place-pl.loss {
  color: #8a2a2a;
  font-weight: 600;
}

.v3-place-summary.v3-place-pl.flat {
  color: rgba(10, 22, 40, 0.7);
  font-weight: 600;
}

.v3-place-hint {
  margin-top: -0.15rem;
  line-height: 1.35;
}

.v3-place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--v3-card);
  border-radius: 0.9rem;
  overflow: hidden;
}

.v3-place-cols,
.v3-place-row {
  display: grid;
  grid-template-columns: 2rem 1.5rem 40px minmax(0, 1fr) auto;
  gap: 0.4rem 0.45rem;
  align-items: start;
  padding: 0.7rem 0.85rem;
}

.v3-place-cols {
  align-items: end;
  padding-top: 0.45rem;
  padding-bottom: 0.4rem;
  background: rgba(22, 53, 40, 0.06);
  border-bottom: 1px solid rgba(10, 22, 40, 0.08);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(10, 22, 40, 0.55);
}

.v3-place-row {
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
}

.v3-place-row:last-child {
  border-bottom: none;
}

.v3-place-row.is-star {
  background: rgba(196, 42, 42, 0.12);
  box-shadow: inset 4px 0 0 rgba(196, 42, 42, 0.85);
  animation: v3-star-flash 1.35s ease-in-out infinite;
}

.v3-place-slot,
.v3-place-num {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.35;
  color: rgba(10, 22, 40, 0.7);
}

.v3-place-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.v3-place-name {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-place-decision {
  font-size: 0.72rem;
  color: rgba(10, 22, 40, 0.55);
}

.v3-place-row.is-star .v3-place-decision {
  color: #c42a2a;
  font-weight: 700;
  animation: v3-star-label-flash 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .v3-place-row.is-star,
  .v3-place-row.is-star .v3-place-decision {
    animation: none;
  }

  .v3-place-row.is-star {
    background: rgba(196, 42, 42, 0.18);
    box-shadow: inset 4px 0 0 #c42a2a;
  }

  .v3-place-row.is-star .v3-place-decision {
    color: #c42a2a;
    opacity: 1;
  }
}

.v3-place-result {
  font-size: 0.72rem;
  font-weight: 600;
}

.v3-place-result.hit {
  color: #0f3a28;
}

.v3-place-result.miss {
  color: #8a2a2a;
}

.v3-place-result.pending {
  color: rgba(10, 22, 40, 0.5);
}

.v3-place-odds {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.18rem;
  line-height: 1.25;
  min-width: 6.5rem;
}

.v3-place-odds-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3rem;
  white-space: nowrap;
}

.v3-place-odds-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(10, 22, 40, 0.5);
}

.v3-place-odds-val {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 1.8rem;
  text-align: right;
}

.v3-place-needs-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(10, 22, 40, 0.62);
  min-width: 1.8rem;
  text-align: right;
}

.v3-race-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.v3-race-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  border: 1px solid rgba(22, 53, 40, 0.08);
  background: var(--v3-card-alt);
  border-radius: 0.9rem;
  padding: 0.85rem 0.9rem;
  box-shadow: 0 1px 0 rgba(10, 22, 40, 0.03);
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.v3-race-list li:nth-child(even) .v3-race-row {
  background: var(--v3-card-alt-deep);
}

.v3-race-row:active {
  transform: scale(0.985);
  filter: brightness(0.97);
}

.v3-race-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.v3-race-no {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 2.4rem;
}

.v3-race-mark {
  flex-shrink: 0;
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  background: linear-gradient(160deg, #2a6fbf, #1a446e);
  color: #f7f2e8;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}

.v3-race-mark.is-coming {
  background: linear-gradient(160deg, #d64545, #8a1c1c);
}

.v3-race-list .v3-race-row {
  animation: v3-fade-up 0.4s ease both;
}

.v3-race-list li:nth-child(1) .v3-race-row { animation-delay: 0.02s; }
.v3-race-list li:nth-child(2) .v3-race-row { animation-delay: 0.05s; }
.v3-race-list li:nth-child(3) .v3-race-row { animation-delay: 0.08s; }
.v3-race-list li:nth-child(4) .v3-race-row { animation-delay: 0.11s; }
.v3-race-list li:nth-child(5) .v3-race-row { animation-delay: 0.14s; }
.v3-race-list li:nth-child(6) .v3-race-row { animation-delay: 0.17s; }

.v3-race-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.v3-race-title {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-race-time {
  font-size: 0.78rem;
  color: rgba(10, 22, 40, 0.55);
}

.v3-refresh-meta {
  margin-top: 0.9rem;
}

.v3-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--v3-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.v3-back:hover {
  text-decoration: underline;
}

.v3-race-hero {
  margin-bottom: 0.35rem;
  animation: v3-fade-up 0.4s ease both;
}

.v3-race-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.v3-race-hero-mark-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.v3-race-hero-mark {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, #163528, #0a1628);
  color: #f7f2e8;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(10, 22, 40, 0.18);
}

.v3-race-hero.is-hv .v3-race-hero-mark {
  background: linear-gradient(160deg, #5a2a18, #1a1020);
}

.v3-race-hero-copy {
  min-width: 0;
  padding-top: 0.15rem;
}

.v3-race-hero-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--v3-ink);
}

.v3-race-sub {
  line-height: 1.4;
  color: rgba(10, 22, 40, 0.62);
}

.v3-nowrap {
  white-space: nowrap;
}
