:root {
    --bg: #f5efe3;
    --bg-deep: #efe1ca;
    --paper: rgba(255, 250, 241, 0.88);
    --paper-strong: rgba(255, 248, 235, 0.95);
    --ink: #1f1a17;
    --muted: #6b5c51;
    --accent: #a52323;
    --accent-soft: #d9b16a;
    --border: rgba(31, 26, 23, 0.12);
    --shadow: 0 18px 40px rgba(41, 21, 8, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    background:
        radial-gradient(circle at top, rgba(217, 177, 106, 0.45), transparent 35%),
        linear-gradient(180deg, #f7f0e5 0%, #eadcc4 100%);
    font-family: "Noto Sans JP", sans-serif;
}

body {
    position: relative;
    padding: 32px 20px 56px;
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.sky-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 255, 255, 0.62), transparent 18%),
        radial-gradient(circle at 85% 10%, rgba(255, 236, 204, 0.45), transparent 20%);
}

.glass {
    background: var(--paper);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.page-header,
.main-nav,
.page-main {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
}

.page-header {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 420px);
    gap: 24px;
    align-items: start;
}

.brand-wrap {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.torii-trigger {
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(165, 35, 35, 0.22);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 246, 235, 0.96), rgba(242, 225, 196, 0.86));
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.brand-mark {
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(165, 35, 35, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 246, 235, 0.96), rgba(242, 225, 196, 0.86));
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
}

.torii-trigger:hover,
.brand-mark:hover {
    transform: translateY(-2px);
    border-color: rgba(165, 35, 35, 0.42);
}

.torii-icon {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-copy h1,
.view-head h2,
.section-headline h3,
.history-race-item strong,
.race-card strong {
    font-family: "Zen Old Mincho", serif;
}

.brand-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.1;
}

.eyebrow,
.section-kicker,
.card-kicker {
    margin: 0 0 10px;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 700;
}

.subtitle,
.section-copy,
.helper-text,
.section-headline p,
.long-copy,
.status-text,
.meta-label {
    color: var(--muted);
}

.status-panel {
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}

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

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #8e8a84;
    box-shadow: 0 0 0 8px rgba(142, 138, 132, 0.16);
}

.status-dot.active {
    background: #239d4a;
    box-shadow: 0 0 0 8px rgba(35, 157, 74, 0.16);
}

.status-dot.error {
    background: #d67a00;
    box-shadow: 0 0 0 8px rgba(214, 122, 0, 0.16);
}

.status-label,
.metric-label {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.status-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.status-clock {
    margin-top: 18px;
    font-size: 0.9rem;
}

.main-nav {
    margin-top: 24px;
    padding: 12px;
    border-radius: 999px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nav-button,
.date-chip,
.ghost-button,
.primary-button,
.danger-button,
.snapshot-button {
    border: 1px solid transparent;
    border-radius: 999px;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: transparent;
    color: var(--ink);
}

.nav-button.is-active,
.date-chip.is-active,
.snapshot-button.is-active {
    background: linear-gradient(135deg, #a52323, #7a1919);
    color: #fff7ef;
}

.nav-button.secret {
    background: rgba(165, 35, 35, 0.08);
    color: var(--accent);
}

.page-main {
    margin-top: 26px;
}

.view,
.page-section {
    display: grid;
    gap: 24px;
}

.view-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.hero-grid,
.detail-grid,
.summary-strip {
    display: grid;
    gap: 20px;
}

.hero-grid,
.detail-grid.history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid {
    grid-template-columns: 1.15fr 0.85fr;
}

.hero-card,
.detail-card,
.list-panel,
.history-filter-card,
.summary-card,
.newspaper-card,
.secret-card,
.venue-card {
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}

.hero-metrics,
.secret-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.date-chip-row,
.venue-tab-row,
.race-card-list,
.race-list,
.ability-bars {
    display: grid;
    gap: 12px;
}

.date-chip-row {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.venue-tab-row {
    grid-template-columns: repeat(auto-fit, minmax(110px, max-content));
    margin-bottom: 18px;
}

.date-chip {
    padding: 14px 12px;
    border-color: rgba(31, 26, 23, 0.09);
    background: rgba(255, 255, 255, 0.55);
    text-align: left;
}

.venue-tab {
    padding: 12px 14px;
    border: 1px solid rgba(31, 26, 23, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--text);
    text-align: center;
    white-space: nowrap;
}

.venue-tab.is-active {
    background: linear-gradient(135deg, rgba(192, 52, 50, 0.88), rgba(149, 30, 30, 0.92));
    color: #fffaf4;
    border-color: rgba(149, 30, 30, 0.35);
    box-shadow: 0 12px 24px rgba(149, 30, 30, 0.2);
}

.date-chip span,
.date-chip strong {
    display: block;
}

.date-chip span {
    font-size: 0.8rem;
}

.race-card,
.history-race-item {
    display: block;
    width: 100%;
    border: 1px solid rgba(31, 26, 23, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    background: rgba(255, 255, 255, 0.52);
    text-align: left;
}

.race-card:hover,
.history-race-item:hover,
.nav-button:hover,
.primary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.snapshot-button:hover,
.date-chip:hover,
.venue-tab:hover {
    transform: translateY(-2px);
}

.race-card-meta,
.history-race-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.race-card strong,
.history-race-item strong {
    display: block;
    margin-top: 8px;
    line-height: 1.45;
    word-break: keep-all;
}

.race-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.race-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
}

.race-status-badge.is-plan {
    background: rgba(217, 177, 106, 0.22);
    color: #7a5418;
    border: 1px solid rgba(217, 177, 106, 0.35);
}

.race-status-badge.is-purchased {
    background: rgba(35, 157, 74, 0.14);
    color: #1c6c3a;
    border: 1px solid rgba(35, 157, 74, 0.26);
}

.vector-ranking-card {
    margin-top: 22px;
}

.win5-panel {
    display: grid;
    gap: 18px;
}

.win5-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.win5-summary-card,
.win5-leg-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(31, 26, 23, 0.08);
}

.win5-strategy-note {
    margin: 0;
    color: var(--muted);
}

.win5-leg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.win5-leg-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 8px;
}

.win5-leg-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(165, 35, 35, 0.12);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
}

.win5-leg-meta,
.win5-leg-sub,
.win5-pick-copy small {
    color: var(--muted);
}

.win5-leg-title {
    display: block;
    margin-bottom: 4px;
    line-height: 1.45;
}

.win5-leg-sub {
    margin: 0 0 14px;
    font-size: 0.86rem;
}

.win5-pick-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.win5-pick-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}

.win5-pick-copy {
    display: grid;
    gap: 4px;
}

.vector-ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.vector-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(31, 26, 23, 0.08);
}

.vector-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.vector-card-head h4 {
    margin: 0;
}

.vector-card-head span {
    font-size: 0.76rem;
    color: var(--muted);
}

.vector-card-list {
    display: grid;
    gap: 8px;
}

.vector-card-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(165, 35, 35, 0.1);
    background: rgba(165, 35, 35, 0.04);
    text-align: left;
    color: var(--text);
}

.vector-card-item:hover {
    transform: translateY(-1px);
}

.vector-card-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(165, 35, 35, 0.12);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.vector-card-name {
    min-width: 0;
}

.vector-card-value {
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.recommended-bets-card {
    display: grid;
    align-content: start;
}

.longshot-profile-card {
    margin-top: 22px;
}

.recommended-bet-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.longshot-profile-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.recommended-bet-summary > div,
.longshot-profile-summary > div,
.longshot-profile-item,
.recommended-bet-item {
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(31, 26, 23, 0.08);
}

.recommended-bet-summary > div,
.longshot-profile-summary > div {
    padding: 12px 14px;
}

.recommended-bet-summary span,
.recommended-bet-summary strong,
.longshot-profile-summary span,
.longshot-profile-summary strong {
    display: block;
}

.recommended-bet-list,
.longshot-profile-list {
    display: grid;
    gap: 10px;
}

.recommended-bet-item,
.longshot-profile-item {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.longshot-profile-item.is-eligible {
    border-color: rgba(165, 35, 35, 0.24);
    background: rgba(255, 246, 238, 0.72);
}

.longshot-profile-item.is-recommended {
    border-color: rgba(33, 116, 84, 0.28);
    background: rgba(240, 251, 245, 0.76);
}

.recommended-bet-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.longshot-profile-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.rank-badge {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(31, 26, 23, 0.08);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.ticket-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(165, 35, 35, 0.12);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-type-pill.is-recommended {
    background: rgba(33, 116, 84, 0.14);
    color: #217454;
}

.recommended-bet-horses {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.45;
}

.recommended-bet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.longshot-profile-meta,
.longshot-profile-signals,
.longshot-profile-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    color: var(--muted);
    font-size: 0.78rem;
}

.longshot-profile-signals span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(31, 26, 23, 0.06);
}

.longshot-profile-methods {
    color: var(--ink-soft);
}

.longshot-profile-methods.is-recommended {
    color: #217454;
    font-weight: 700;
}

.section-headline {
    margin-bottom: 18px;
}

.detail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.detail-field {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.54);
}

.detail-field span,
.detail-field strong {
    display: block;
}

.long-copy {
    margin-top: 16px;
    line-height: 1.8;
}

.pace-summary {
    display: flex;
    gap: 22px;
    margin-bottom: 16px;
}

.lineup-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.lineup-column {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.56);
}

.lineup-column h4 {
    margin: 0 0 10px;
}

.lineup-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.lineup-column li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.horse-no,
.plan-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.76rem;
}

.horse-no {
    min-width: 28px;
    height: 28px;
    background: rgba(165, 35, 35, 0.12);
    color: var(--accent);
}

.newspaper-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.snapshot-toggle {
    display: inline-flex;
    gap: 8px;
}

.snapshot-button,
.ghost-button,
.primary-button,
.danger-button {
    padding: 12px 18px;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.58);
    border-color: rgba(31, 26, 23, 0.1);
}

.primary-button {
    background: linear-gradient(135deg, #a52323, #7a1919);
    color: #fff7ef;
}

.danger-button {
    background: linear-gradient(135deg, #6b4630, #4f3221);
    color: #fff7ef;
}

.table-scroller {
    overflow-x: auto;
}

.news-table,
.compact-table {
    width: 100%;
    border-collapse: collapse;
}

.news-table th,
.news-table td,
.compact-table th,
.compact-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(31, 26, 23, 0.08);
    text-align: left;
    vertical-align: top;
}

.news-table td[data-label],
.compact-table td[data-label] {
    position: relative;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
}

.plan-pill {
    margin-left: 8px;
    padding: 3px 8px;
    background: rgba(217, 177, 106, 0.28);
    color: #6b4620;
}

.result-horse-cell,
.result-gap-wrap {
    display: grid;
    gap: 6px;
}

.result-horse-link {
    text-align: left;
    font-size: 0.98rem;
}

.result-horse-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.result-rank-chip,
.result-gap-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.result-rank-chip {
    background: rgba(31, 26, 23, 0.08);
    color: var(--ink);
}

.result-gap-chip {
    color: #fff7ef;
}

.result-gap-chip.is-up {
    background: linear-gradient(135deg, #b64b28, #8f2f19);
}

.result-gap-chip.is-down {
    background: linear-gradient(135deg, #6f5a4f, #4f4038);
}

.result-gap-chip.is-even {
    background: linear-gradient(135deg, #8d6b43, #6e502d);
}

.result-gap-wrap small {
    color: var(--muted);
    line-height: 1.4;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-grid label {
    display: grid;
    gap: 8px;
}

.filter-grid input {
    padding: 12px 14px;
    border: 1px solid rgba(31, 26, 23, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card strong,
.hero-metrics strong,
.status-meta strong,
.secret-status strong,
.ability-meta strong {
    font-family: "Zen Old Mincho", serif;
    font-size: 1.35rem;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.control-message {
    margin-top: 18px;
    color: var(--muted);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 16, 10, 0.45);
}

.modal-card {
    position: relative;
    max-width: 840px;
    margin: 5vh auto 0;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(31, 26, 23, 0.12);
    background: rgba(255, 255, 255, 0.8);
}

.ability-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.radar-wrap {
    display: flex;
    justify-content: center;
}

.radar-chart {
    width: min(100%, 420px);
    height: auto;
}

.radar-ring,
.radar-axis {
    fill: none;
    stroke: rgba(31, 26, 23, 0.15);
    stroke-width: 1;
}

.radar-fill {
    fill: rgba(165, 35, 35, 0.2);
    stroke: rgba(165, 35, 35, 0.78);
    stroke-width: 2;
}

.radar-label {
    font-size: 12px;
    fill: var(--muted);
    text-anchor: middle;
}

.ability-row {
    display: grid;
    grid-template-columns: 110px 1fr 52px;
    gap: 12px;
    align-items: center;
}

.ability-bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(31, 26, 23, 0.08);
    overflow: hidden;
}

.ability-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #d9b16a, #a52323);
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 30;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(26, 19, 15, 0.92);
    color: #fff7ef;
    box-shadow: var(--shadow);
}

.toast.is-error {
    background: rgba(123, 29, 29, 0.94);
}

.empty-panel,
.empty-note {
    color: var(--muted);
}

@media (max-width: 1080px) {
    .page-header,
    .hero-grid,
    .detail-grid,
    .detail-grid.history-grid,
    .summary-strip,
    .filter-grid,
    .hero-metrics,
    .secret-status,
    .status-meta,
    .ability-meta {
        grid-template-columns: 1fr;
    }

    .win5-summary-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        gap: 18px;
    }
}

@media (max-width: 960px) {
    body {
        padding: 20px 14px 36px;
    }

    .brand-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .torii-trigger {
        width: 74px;
        height: 74px;
    }

    .brand-mark {
        width: 74px;
        height: 74px;
    }

    .brand-copy h1 {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }

    .main-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .status-panel,
    .hero-card,
    .detail-card,
    .list-panel,
    .history-filter-card,
    .summary-card,
    .newspaper-card,
    .secret-card,
    .venue-card {
        padding: 18px;
    }

    .view-head,
    .newspaper-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .pace-summary {
        flex-direction: column;
        gap: 14px;
    }

    .control-row {
        flex-direction: column;
    }

    .control-row .primary-button,
    .control-row .danger-button {
        width: 100%;
    }

    .modal-card {
        width: calc(100% - 24px);
        margin: 3vh auto 0;
        max-height: 92vh;
        overflow: auto;
    }
}

@media (max-width: 720px) {
    .page-header {
        gap: 14px;
    }

    .status-meta,
    .hero-metrics,
    .secret-status,
    .summary-strip,
    .ability-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-chip-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .venue-tab-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-fields {
        grid-template-columns: 1fr;
    }

    .recommended-bet-summary,
    .longshot-profile-summary,
    .recommended-bet-main,
    .longshot-profile-main {
        grid-template-columns: 1fr;
    }

    .table-scroller {
        overflow: visible;
    }

    .news-table,
    .compact-table,
    .news-table tbody,
    .compact-table tbody,
    .news-table tr,
    .compact-table tr,
    .news-table td,
    .compact-table td {
        display: block;
        width: 100%;
    }

    .news-table thead,
    .compact-table thead {
        display: none;
    }

    .news-table tr,
    .compact-table tr {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.62);
        border: 1px solid rgba(31, 26, 23, 0.08);
    }

    .news-table td,
    .compact-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(31, 26, 23, 0.08);
        text-align: right;
    }

    .news-table td:last-child,
    .compact-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .news-table td:first-child,
    .compact-table td:first-child {
        padding-top: 0;
    }

    .news-table td::before,
    .compact-table td::before {
        content: attr(data-label);
        flex: 0 0 88px;
        text-align: left;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
    }

    .news-table td .link-button {
        text-align: right;
    }

    .result-horse-cell,
    .result-gap-wrap {
        justify-items: end;
        text-align: right;
    }

    .result-horse-meta {
        justify-content: flex-end;
    }

    .plan-pill {
        margin-left: 0;
        margin-top: 6px;
    }

    .history-race-item,
    .race-card {
        padding: 14px;
    }

    .venue-tab {
        padding: 11px 12px;
    }
}

@media (max-width: 520px) {
    .status-meta,
    .hero-metrics,
    .secret-status,
    .summary-strip,
    .ability-meta,
    .date-chip-row {
        grid-template-columns: 1fr;
    }

    .torii-trigger {
        width: 68px;
        height: 68px;
        border-radius: 20px;
    }

    .brand-mark {
        width: 68px;
        height: 68px;
        border-radius: 20px;
    }

    .torii-icon {
        width: 36px;
        height: 36px;
    }

    .nav-button,
    .snapshot-button,
    .ghost-button,
    .primary-button,
    .danger-button {
        min-height: 44px;
    }

    .news-table td::before,
    .compact-table td::before {
        flex-basis: 72px;
    }
}
