:root {
  color: #172033;
  background: #f4f6fb;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

body { margin: 0; }

.page-shell { max-width: 700px; margin: 0 auto; padding: 28px 16px 48px; }
.site-header { padding: 10px 4px 24px; }
.site-brand-row { flex-basis: 100%; }
.site-brand { align-items: center; background: #050b16; border: 1px solid #1c2a40; border-radius: 12px; display: flex; gap: 12px; justify-content: flex-start; min-height: 72px; overflow: hidden; padding: 8px 16px; width: 100%; }
.site-brand-logo { display: block; flex: 0 0 auto; height: 56px; max-width: 100px; object-fit: contain; width: auto; }
.site-brand-name { color: #fff; font-size: clamp(1.08rem, 3vw, 1.45rem); font-weight: 900; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.site-header-copy { min-width: 0; }
.eyebrow { color: #237a57; font-weight: 800; font-size: .76rem; letter-spacing: .12em; margin: 0 0 8px; }
h1 { font-size: clamp(1.7rem, 7vw, 2.35rem); letter-spacing: -.04em; margin: 0; }
.subtitle { color: #5b6475; margin: 10px 0 0; }

.race-card { background: #fff; border: 1px solid #e3e7f0; border-radius: 20px; box-shadow: 0 12px 32px rgba(30, 45, 80, .08); overflow: hidden; }
.race-heading { background: #172033; color: #fff; padding: 20px; }
.race-heading h2 { font-size: 1.3rem; margin: 0 0 8px; }
.race-meta { color: #c6d0e3; font-size: .9rem; margin: 0; }
.environment { color: #dce8dc; font-size: .78rem; margin: 9px 0 0; }
.race-list { list-style: none; padding: 0; margin: 0; }
.runner { border-top: 1px solid #edf0f5; padding: 17px 18px; }
.runner-top { align-items: center; display: flex; gap: 10px; }
.rank { align-items: center; background: #e8f5ee; border-radius: 999px; color: #147248; display: inline-flex; font-size: .78rem; font-weight: 800; height: 29px; justify-content: center; min-width: 51px; }
.horse-name { flex: 1; font-size: 1.08rem; font-weight: 800; }
.odds { color: #526078; font-size: .86rem; text-align: right; }
.metrics { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.metric { background: #f6f8fc; border-radius: 10px; padding: 10px; }
.metric-label { color: #667087; display: block; font-size: .72rem; margin-bottom: 3px; }
.metric-value { font-size: 1.02rem; font-weight: 800; }
.emphasis { color: #156747; }
.status { color: #687389; font-size: .78rem; line-height: 1.55; padding: 17px 18px 19px; }
.disclaimer { color: #5a6578; font-size: .82rem; line-height: 1.6; margin: 22px 4px; }
.disclaimer strong { color: #29354b; }
.disclaimer p { margin-top: 4px; }
.error { color: #a12635; padding: 20px; }

@media (min-width: 540px) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Phase 1 memo-horse UI. Persistence is isolated in memo-repository.js. */
.memo-summary { background: #fffdf6; border: 1px solid #f0df9d; border-radius: 16px; margin: 0 0 16px; padding: 15px; }
.section-heading h2 { font-size: 1.05rem; margin: 0; }
.memo-empty { color: #667087; font-size: .86rem; margin: 9px 0 0; }
.memo-summary-list { display: grid; gap: 9px; list-style: none; margin: 13px 0 0; padding: 0; }
.memo-summary-item { background: #fff; border-left: 4px solid var(--memo-color); border-radius: 9px; display: grid; font-size: .8rem; gap: 3px; padding: 10px; }
.memo-summary-name { font-size: .96rem; font-weight: 800; }
.memo-color-amber { --memo-color: #ce8b00; --memo-bg: #fffaf0; }.memo-color-blue { --memo-color: #2978bd; --memo-bg: #f2f8ff; }.memo-color-pink { --memo-color: #c34678; --memo-bg: #fff5f8; }.memo-color-green { --memo-color: #26815b; --memo-bg: #f1fbf6; }
.runner.is-memo { background: var(--memo-bg); border-left: 5px solid var(--memo-color); padding-left: 13px; }
.runner.memo-style-outline { background: #fff; }
.memo-badge { background: #fff0c5; border-radius: 999px; color: #805300; font-size: .68rem; font-weight: 800; padding: 3px 7px; }
.memo-actions { display: flex; gap: 8px; margin-top: 11px; }.memo-actions button, .memo-editor-actions button { background: #fff; border: 1px solid #b9c3d4; border-radius: 8px; color: #25334b; cursor: pointer; font-size: .79rem; font-weight: 700; padding: 7px 10px; }.memo-actions .memo-toggle, .memo-editor-actions button[type="submit"] { background: #edf7f1; border-color: #83b99d; color: #145d40; }.memo-remove { color: #8f3041 !important; }
.memo-editor { background: #f8fafc; border: 1px solid #dbe1ed; border-radius: 10px; margin-top: 11px; padding: 11px; }.memo-editor label, .memo-editor legend { color: #4e5d74; display: block; font-size: .78rem; font-weight: 700; }.memo-editor textarea { border: 1px solid #cbd4e3; border-radius: 8px; display: block; margin-top: 5px; min-height: 76px; padding: 8px; resize: vertical; width: 100%; }.memo-editor fieldset { border: 0; margin: 10px 0; padding: 0; }.tag-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }.tag-option { background: #fff; border: 1px solid #d2d9e5; border-radius: 999px; color: #4f5c71 !important; font-size: .71rem !important; font-weight: 600 !important; padding: 4px 7px; }.tag-option input { margin-right: 3px; }.memo-editor select { border: 1px solid #cbd4e3; border-radius: 7px; margin: 5px 0 0; padding: 5px; }.memo-editor-actions { display: flex; gap: 7px; margin-top: 11px; }
@media (max-width: 539px) { .page-shell { padding: 22px 12px 44px; }.runner { padding: 14px; }.runner.is-memo { padding-left: 9px; }.runner-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; }.horse-name { overflow-wrap: anywhere; }.memo-badge { grid-column: 2; justify-self: start; }.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }.metric { padding: 8px; } }

/* Phase 2: thin lists, strong AI judgement, detail on demand. */
.attention-skeleton, .race-selectors, .race-list-section, .race-detail { margin: 16px 0; }
.attention-skeleton { background: #f1f5ff; border: 1px solid #d7e1fb; border-radius: 16px; color: #435371; padding: 15px; }.attention-skeleton p { font-size: .84rem; line-height: 1.55; margin: 9px 0 0; }
.race-selectors { background: #fff; border: 1px solid #e3e7f0; border-radius: 16px; display: grid; gap: 14px; padding: 14px; }.selector-label { color: #67728a; font-size: .72rem; font-weight: 800; letter-spacing: .07em; margin: 0 0 7px; }.tab-row { display: flex; flex-wrap: wrap; gap: 7px; }.tab-row button, .horse-tabs button { background: #f6f8fc; border: 1px solid #dce2ed; border-radius: 999px; color: #4c5b74; cursor: pointer; font-size: .82rem; font-weight: 750; padding: 8px 12px; }.tab-row button.is-selected, .horse-tabs button.is-selected { background: #172033; border-color: #172033; color: #fff; }
.race-list-section { padding: 2px 0; }.race-list-cards { display: grid; gap: 9px; margin-top: 11px; }.race-list-card { align-items: center; background: #fff; border: 1px solid #e2e7f0; border-radius: 14px; color: #24324a; cursor: pointer; display: grid; gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 12px; text-align: left; width: 100%; }.race-number { background: #e8f5ee; border-radius: 8px; color: #176b49; font-size: .78rem; font-weight: 850; padding: 7px 6px; }.race-list-main { display: grid; gap: 4px; min-width: 0; }.race-list-main strong { font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.race-list-main small { color: #647089; font-size: .75rem; }.race-memo-count { color: #8a5c00; font-size: .78rem; font-weight: 800; }.empty-state { color: #687389; padding: 12px 2px; }
.back-button { align-items: center; background: #f6f8fc; border: 1px solid #dce2ed; border-radius: 9px; color: #2b7151; cursor: pointer; display: inline-flex; font-weight: 800; min-height: 42px; padding: 8px 12px; }.back-button:hover, .back-button:focus-visible { background: #eef5ff; border-color: #9ab7d9; outline: 2px solid #c7d9ef; outline-offset: 2px; }.page-context-back { margin: 0 0 10px; }.race-detail > .back-button { margin-bottom: 10px; }.horse-panel-back { margin-bottom: 12px; width: 100%; }.detail-heading { background: #172033; border-radius: 17px; color: #fff; padding: 18px; }.detail-heading p { color: #cbd6e7; font-size: .82rem; margin: 0 0 5px; }.detail-heading h2 { font-size: 1.3rem; margin: 0 0 8px; }.runner-stack { display: grid; gap: 9px; margin-top: 12px; }.runner-card { background: #fff; border: 1px solid #e2e7f0; border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; }.runner-card.is-memo { border-left: 5px solid var(--memo-color); }.runner-main { align-items: center; background: transparent; border: 0; color: #1e2c43; cursor: pointer; display: grid; gap: 7px 9px; grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 12px; text-align: left; width: 100%; }.horse-number { align-items: center; background: #eef2f8; border-radius: 7px; display: inline-flex; font-size: .86rem; font-weight: 850; height: 30px; justify-content: center; width: 30px; }.runner-name { display: grid; gap: 3px; min-width: 0; }.runner-name strong { font-size: 1rem; overflow-wrap: anywhere; }.runner-name em { color: #8a5c00; font-size: .68rem; font-style: normal; font-weight: 800; }.runner-rank { color: #19704c; font-size: .78rem; font-weight: 850; text-align: right; white-space: nowrap; }.runner-value { background: #f5f7fb; border-radius: 7px; display: grid; font-size: .88rem; font-weight: 850; padding: 6px 7px; text-align: center; }.runner-value b, .runner-top3 { color: #6a7589; font-size: .62rem; font-weight: 700; }.value-positive { color: #136d47; }.runner-top3 { grid-column: 2 / -1; }.runner-memo-button { background: #fff9e9; border: 0; border-left: 1px solid #f0e5c6; color: #805300; cursor: pointer; font-size: .72rem; font-weight: 850; padding: 0 9px; }
.horse-panel { background: #fff; border: 1px solid #cdd6e4; border-radius: 20px 20px 0 0; bottom: 0; box-shadow: 0 -12px 34px rgba(20, 33, 55, .22); left: 0; max-height: 84vh; overflow: auto; padding: 16px; position: fixed; right: 0; z-index: 10; }.horse-panel-header { align-items: start; display: flex; justify-content: space-between; }.horse-panel-header p { color: #687389; font-size: .76rem; margin: 0 0 3px; }.horse-panel-header h2 { font-size: 1.25rem; margin: 0; }.horse-panel-header button { background: #edf1f7; border: 0; border-radius: 50%; color: #42516a; cursor: pointer; font-size: 1.2rem; height: 34px; width: 34px; }.horse-tabs { display: flex; gap: 7px; margin: 16px 0; }.horse-detail-metrics { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }.horse-detail-metrics div { background: #f6f8fc; border-radius: 10px; padding: 10px; }.horse-detail-metrics dt { color: #687389; font-size: .72rem; }.horse-detail-metrics dd { font-size: 1rem; font-weight: 850; margin: 4px 0 0; }.horse-memo-form textarea { border: 1px solid #cbd4e3; border-radius: 8px; display: block; margin-top: 5px; min-height: 92px; padding: 8px; width: 100%; }.horse-memo-form label, .horse-memo-form legend { color: #4e5d74; display: block; font-size: .8rem; font-weight: 750; }.horse-memo-form fieldset { border: 0; margin: 12px 0; padding: 0; }.horse-memo-form select { border: 1px solid #cbd4e3; border-radius: 7px; margin: 5px 0 0; padding: 5px; }.bottom-nav { background: rgba(255,255,255,.96); border-top: 1px solid #dfe5ef; bottom: 0; display: flex; gap: 8px; justify-content: center; left: 0; padding: 9px 14px calc(9px + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 8; }.bottom-nav button { background: transparent; border: 0; border-radius: 999px; color: #61708a; cursor: pointer; font-size: .78rem; font-weight: 800; padding: 8px 16px; }.bottom-nav button.is-active { background: #172033; color: #fff; }.page-shell { padding-bottom: 92px; }
@media (min-width: 680px) { .horse-panel { bottom: 24px; left: 50%; max-width: 600px; right: auto; transform: translateX(-50%); border-radius: 20px; }.runner-main { grid-template-columns: auto minmax(0, 1.3fr) auto repeat(3, auto); }.runner-top3 { grid-column: auto; }.bottom-nav { left: 50%; max-width: 500px; right: auto; transform: translateX(-50%); border: 1px solid #dfe5ef; border-bottom: 0; border-radius: 16px 16px 0 0; } }

/* Phase 2.1 visual hierarchy: wider desktop canvas, stronger race navigation. */
.page-shell { max-width: 1120px; padding: 26px clamp(18px, 3vw, 38px) 106px; }
.site-header { border-bottom: 1px solid #e1e6ef; display: flex; flex-wrap: wrap; gap: 0 18px; padding: 8px 0 22px; }.site-header .eyebrow { flex-basis: 100%; }.site-header h1 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); }.site-header .subtitle { align-self: center; margin: 5px 0 0; }
.memo-summary, .attention-skeleton, .race-selectors { border-radius: 14px; }.memo-summary { margin-top: 18px; }.memo-summary-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }.memo-summary-item { min-height: 91px; padding: 12px 13px; }
.attention-skeleton { background: #f7f9fd; border-color: #e2e7f0; color: #5e6980; }.attention-skeleton .eyebrow { color: #5b759d; }.attention-skeleton p { margin-top: 7px; }
.race-selectors { box-shadow: 0 5px 16px rgba(36, 53, 80, .045); padding: 16px; }.selector-label { font-size: .76rem; }.tab-row button { min-height: 40px; padding: 9px 15px; }.tab-row button.is-selected { box-shadow: 0 3px 8px rgba(23, 32, 51, .18); }
.race-list-section { margin-top: 24px; }.race-list-section .section-heading { align-items: end; border-bottom: 2px solid #263a59; display: flex; justify-content: space-between; padding-bottom: 9px; }.race-list-section .section-heading .eyebrow { margin-bottom: 0; }.race-list-cards { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; margin-top: 14px; }.race-list-card { border-color: #d7dfeb; box-shadow: 0 4px 14px rgba(35, 51, 78, .045); grid-template-columns: auto auto minmax(0, 1fr) auto auto; min-height: 88px; padding: 14px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }.race-list-card:hover, .race-list-card:focus-visible { border-color: #7b9ac6; box-shadow: 0 10px 22px rgba(35, 51, 78, .12); outline: none; transform: translateY(-1px); }.race-number { border-radius: 9px; font-size: .88rem; min-width: 45px; padding: 10px 7px; text-align: center; }.race-time { color: #4e607b; font-size: .77rem; font-weight: 800; white-space: nowrap; }.race-list-main strong { font-size: 1.03rem; }.race-list-main small { font-size: .8rem; }.race-memo-count { background: #fff7df; border-radius: 999px; color: #825600; font-size: .72rem; padding: 5px 8px; white-space: nowrap; }.race-arrow { color: #59708f; font-size: 1.6rem; font-weight: 300; line-height: 1; }
.detail-heading { box-shadow: 0 9px 22px rgba(23, 32, 51, .15); display: grid; gap: 1px; }.detail-heading h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); }.runner-stack { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }.runner-card { border-color: #d9e1ec; box-shadow: 0 3px 10px rgba(35, 51, 78, .04); min-height: 104px; }.runner-main { gap: 8px 10px; padding: 14px; }.horse-number { background: #e8eef7; font-size: .95rem; height: 34px; width: 34px; }.runner-name strong { font-size: 1.08rem; }.runner-rank { background: #e8f5ee; border-radius: 999px; color: #176b49; padding: 5px 7px; }.runner-value { min-width: 64px; padding: 7px 8px; }.runner-value b { letter-spacing: .03em; }.runner-memo-button { min-width: 54px; }.value-positive { background: #eaf7ef; }.bottom-nav { box-shadow: 0 -5px 18px rgba(35, 51, 78, .10); }.bottom-nav button { min-height: 39px; padding: 8px 18px; }
@media (max-width: 679px) { .page-shell { max-width: none; padding: 18px 12px 98px; }.site-header { display: block; padding-bottom: 17px; }.site-header h1 { font-size: 1.9rem; }.site-header .subtitle { font-size: .92rem; }.memo-summary { margin-top: 14px; }.memo-summary-list { grid-template-columns: 1fr; }.race-list-section { margin-top: 20px; }.race-list-section .section-heading { border-bottom-width: 1px; }.race-list-cards { grid-template-columns: 1fr; gap: 9px; }.race-list-card { grid-template-columns: auto auto minmax(0, 1fr) auto; min-height: 84px; padding: 12px; }.race-list-main { grid-column: 3; }.race-list-main small { white-space: normal; }.race-memo-count { grid-column: 2 / 4; justify-self: start; }.race-arrow { grid-column: 4; grid-row: 1 / 3; align-self: center; }.runner-stack { grid-template-columns: 1fr; }.runner-card { min-height: 112px; }.runner-main { grid-template-columns: auto minmax(0, 1fr) auto; }.runner-rank { justify-self: end; }.runner-value { min-width: 0; }.runner-top3 { grid-column: 2 / -1; }.runner-memo-button { min-width: 48px; }.bottom-nav { gap: 4px; }.bottom-nav button { flex: 1; font-size: .75rem; padding-inline: 8px; } }
/* Archive view additions: Japanese labels, day/venue/race navigation, and result badges. */
.archive-date-tabs, .day-summary { background: #fff; border: 1px solid #e2e7f0; border-radius: 14px; margin-top: 12px; padding: 12px; }
.day-summary { color: #31415a; font-size: .86rem; }
.day-summary strong { display: block; margin-bottom: 4px; }
.day-summary p { margin: 0; }
.day-summary-heading { align-items: start; display: flex; gap: 10px; justify-content: space-between; }
.day-summary-heading p { color: #687389; font-size: .76rem; line-height: 1.45; }
.day-record-status { background: #e8f5ee; border-radius: 999px; color: #176b49; flex: 0 0 auto; font-size: .7rem; font-weight: 850; padding: 5px 8px; }
.day-record-grid { display: grid; gap: 7px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 11px 0 0; }
.day-record-metric { background: #f6f8fc; border-radius: 9px; padding: 8px 9px; }
.day-record-metric dt { color: #687389; font-size: .68rem; line-height: 1.35; }
.day-record-metric dd { color: #1f304a; font-size: .92rem; font-weight: 850; margin: 4px 0 0; }
.day-summary-pending { background: #fffaf0; border-color: #ead9a7; }
@media (max-width: 539px) { .day-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.day-record-metric { min-height: 57px; }.day-record-metric dd { font-size: .84rem; } }
.runner-diagnosis, .runner-history, .runner-result { background: #f5f7fb; border-radius: 7px; color: #4d5a70; font-size: .72rem; font-weight: 800; padding: 6px 7px; text-align: center; }
.runner-result { grid-column: 2 / -1; }
.runner-history { color: #8a5c00; }
.runner-basic { color: #60708a; font-size: .73rem; font-weight: 700; grid-column: 2 / -1; line-height: 1.45; }
.graded-badge { background: #dbe9fb; border-radius: 999px; color: #295584; display: inline-block; font-size: .68rem; font-weight: 800; margin-left: 9px; padding: 4px 8px; vertical-align: middle; white-space: nowrap; }
.full-field-button { background: #fff; border: 1px solid #7894bd; border-radius: 10px; color: #244f82; cursor: pointer; font-size: .86rem; font-weight: 800; margin: 13px 0 0; min-height: 44px; padding: 10px 14px; width: 100%; }
.full-field-button:hover, .full-field-button:focus-visible { background: #eef5ff; outline: 2px solid #9ab7e0; outline-offset: 2px; }
@media (max-width: 679px) { .graded-badge { display: table; margin: 8px 0 0; }.runner-basic { grid-column: 2 / -1; }.full-field-button { min-height: 48px; } }

/* Public guide, policy and legal pages.  These retain the same narrow-reading
   rhythm on phones while using the wider desktop canvas already used by races. */
.guide-page { background: #fff; border: 1px solid #e0e6f0; border-radius: 16px; box-shadow: 0 5px 16px rgba(35, 51, 78, .05); margin: 20px 0; padding: clamp(18px, 3vw, 34px); }
.guide-page header { border-bottom: 1px solid #e8edf4; margin-bottom: 21px; padding-bottom: 17px; }.guide-page h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.03em; margin: 0; }.guide-lead { color: #52627b; font-size: 1rem; line-height: 1.8; margin: 12px 0 0; }.guide-page section { margin: 25px 0; }.guide-page h3 { color: #213652; font-size: 1.08rem; margin: 0 0 9px; }.guide-page p { color: #45546b; font-size: .95rem; line-height: 1.85; margin: 8px 0; }
.site-footer { border-top: 1px solid #dfe5ef; color: #5d6a7f; margin: 30px 0 10px; padding: 22px 0 8px; }.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }.site-footer a { color: #285f9a; font-size: .84rem; font-weight: 750; text-decoration: none; }.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; }.gambling-notice { background: #fff8e8; border: 1px solid #efdca5; border-radius: 12px; margin-top: 17px; padding: 13px; }.gambling-notice strong { color: #60491b; font-size: .88rem; }.gambling-notice p { font-size: .79rem; line-height: 1.6; margin: 6px 0 0; }.gambling-notice p:last-child { display: flex; flex-wrap: wrap; gap: 5px 13px; }.footer-note { font-size: .76rem; line-height: 1.6; margin: 15px 0 0; }
@media (max-width: 679px) { .guide-page { border-radius: 13px; margin: 16px 0; padding: 17px; }.guide-page p { font-size: .93rem; line-height: 1.8; }.site-footer { margin-top: 24px; }.site-footer nav { gap: 10px 13px; }.site-footer a { font-size: .82rem; }.gambling-notice { padding: 12px; } }

/* Mobile operations: next-week watchlist, compact lower ranks, and frame accents. */
html, body { max-width: 100%; overflow-x: hidden; }
.next-week-section { background: #fff; border: 1px solid #dfe6f0; border-radius: 16px; margin: 16px 0; padding: 15px; }
.next-week-section .section-heading { display: grid; gap: 5px; }
.next-week-section .section-heading h2 { font-size: clamp(1.05rem, 3vw, 1.25rem); }
.next-week-note { color: #6a7589; font-size: .78rem; line-height: 1.5; margin: 0; }
.next-week-cards { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.next-week-race { background: #f8fafc; border: 1px solid #dfe6f0; border-radius: 13px; overflow: hidden; }
.next-week-race-card { align-items: stretch; background: transparent; border: 0; color: #24324a; cursor: pointer; display: grid; gap: 10px; grid-template-columns: minmax(92px, 31%) minmax(0, 1fr); min-height: 104px; padding: 10px; text-align: left; width: 100%; }
.next-week-race-card:focus-visible { outline: 3px solid #9ab7e0; outline-offset: -3px; }
.next-week-race-info { align-content: start; display: grid; gap: 5px; min-width: 0; }
.next-week-race-card strong { font-size: 1rem; overflow-wrap: anywhere; }
.next-week-race-meta { color: #647089; font-size: .76rem; font-weight: 750; }
.next-week-class { color: #2b5d91; font-size: .76rem; font-weight: 850; }
.next-week-toggle { align-self: end; color: #237a57; font-size: .78rem; font-weight: 850; min-height: 24px; padding-top: 5px; }
.next-week-race.is-expanded { border-color: #9bb8d9; }
.featured-race-visual { aspect-ratio: 1671 / 941; margin: 12px auto 0; max-width: 760px; position: relative; width: 100%; }
.featured-race-visual img { aspect-ratio: 1671 / 941; border-radius: 9px; display: block; height: auto; max-width: 100%; width: 100%; }
.featured-race-visual-text { align-content: center; align-items: center; aspect-ratio: auto; background: linear-gradient(135deg, #0b2018, #123527 58%, #172033); border: 1px solid rgba(195, 162, 90, .45); border-radius: 9px; color: #f8f4e9; display: grid; gap: 6px; justify-items: center; min-height: clamp(150px, 20vw, 220px); padding: clamp(24px, 5vw, 48px) 20px; text-align: center; }
.featured-race-visual-kicker { color: #c3a25a; font-size: clamp(.68rem, 1.8vw, .82rem); font-weight: 800; letter-spacing: .16em; }
.featured-race-visual-text strong { font-size: clamp(1.35rem, 4vw, 2.25rem); letter-spacing: .08em; }
.featured-race-visual-text small { color: #c8d1c9; font-size: clamp(.72rem, 1.8vw, .84rem); }
.featured-race-visual.is-fallback { background: linear-gradient(135deg, #172033, #9a7844); border-radius: 9px; min-height: 160px; }
.featured-race-fallback { align-items: center; color: #fff; display: grid; font-size: .9rem; font-weight: 800; inset: 0; justify-items: center; position: absolute; }
.featured-race-fallback[hidden] { display: none; }
.featured-race-tabs { display: flex; gap: 8px; margin-top: 8px; }
.featured-race-tab { background: #f6f8fc; border: 1px solid #dce2ed; border-radius: 10px; color: #4c5b74; cursor: pointer; flex: 1; font-size: .86rem; font-weight: 800; min-height: 44px; padding: 8px 10px; }
.featured-race-tab.is-selected { background: #172033; border-color: #172033; color: #fff; }
.featured-race-tab[data-next-week-race-id="next-week-20260830-niigata-kinen"] { background: #fffaf0; border-color: #d8b65a; color: #7c5e00; }
.featured-race-tab[data-next-week-race-id="next-week-20260830-niigata-kinen"].is-selected { background: #c6a33a; border-color: #a98520; color: #fff; }
.featured-race-tab[data-next-week-race-id="next-week-20260830-chukyo-2s"] { background: #f2f6ff; border-color: #7d9ed7; color: #295584; }
.featured-race-tab[data-next-week-race-id="next-week-20260830-chukyo-2s"].is-selected { background: #4c78c8; border-color: #3562ac; color: #fff; }
.featured-race-selected { border-top: 1px solid #dfe6f0; margin-top: 12px; padding-top: 12px; }
.featured-race-selected h3 { font-size: 1.08rem; margin: 3px 0 0; }
.next-week-toggle-button { background: #fff; border: 1px solid #9bb8d9; border-radius: 9px; color: #237a57; cursor: pointer; font-size: .78rem; font-weight: 850; min-height: 42px; padding: 8px 12px; width: 100%; }
.planned-horses { border-top: 1px solid #dfe6f0; padding: 11px 13px 13px; }
.planned-horses-list { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.planned-horses-list li { align-items: center; background: #fff; border-radius: 8px; display: flex; gap: 8px; min-height: 36px; padding: 6px 8px; }
.planned-horse-no { color: #66758b; font-size: .76rem; min-width: 34px; }
.planned-horses-list strong { font-size: .82rem; overflow-wrap: anywhere; }
.planned-horses-empty, .planned-horses-disclaimer { color: #687389; font-size: .77rem; line-height: 1.5; margin: 0; }
.planned-horses-disclaimer { margin-top: 9px; }

.runner-card-top3 { min-height: 96px; }
.runner-card-top3-1 { border-top: 2px solid #c6a33a; }
.runner-card-top3-2 { border-top: 2px solid #9aa4b2; }
.runner-card-top3-3 { border-top: 2px solid #b77a55; }
.runner-card-top3-1 .runner-rank { background: #fbf4d9; color: #7c5e00; }
.runner-card-top3-2 .runner-rank { background: #eef1f4; color: #566170; }
.runner-card-top3-3 .runner-rank { background: #f7e9df; color: #7f4c2f; }
.runner-card-compact { min-height: 0; }
.runner-card-compact .runner-main { gap: 5px 7px; padding: 8px 10px; }
.runner-card-compact .runner-name strong { font-size: .92rem; }
.runner-card-compact .runner-rank { font-size: .72rem; }
.runner-card-compact .runner-value { font-size: .78rem; padding: 4px 5px; }
.runner-card-compact .runner-value b { font-size: .58rem; }
.runner-card-compact .runner-memo-button { font-size: .68rem; }
.runner-main { min-width: 0; }
.runner-card.is-memo .runner-name strong,
.runner-card.is-memo .runner-name em,
.memo-summary-item[class*="memo-color-"] > strong { color: var(--memo-color); }
.horse-number.frame-color-1 { background: #fff; border: 1px solid #cbd3df; color: #303b4d; }
.horse-number.frame-color-2 { background: #222831; color: #fff; }
.horse-number.frame-color-3 { background: #c94d5a; color: #fff; }
.horse-number.frame-color-4 { background: #4c78c8; color: #fff; }
.horse-number.frame-color-5 { background: #e2b72f; color: #382d00; }
.horse-number.frame-color-6 { background: #4a9968; color: #fff; }
.horse-number.frame-color-7 { background: #e4873c; color: #fff; }
.horse-number.frame-color-8 { background: #d47bad; color: #fff; }

@media (max-width: 679px) {
  .next-week-section { margin: 14px 0; padding: 13px; }
  .featured-race-visual { max-width: 100%; width: 100%; }
  .next-week-cards { grid-template-columns: 1fr; }
  .next-week-race-card { grid-template-columns: 92px minmax(0, 1fr); min-height: 92px; padding: 9px; }
  .runner-card-top3 { min-height: 104px; }
  .runner-card-compact { min-height: 0; }
  .runner-card-compact .runner-main { grid-template-columns: auto minmax(0, 1fr) auto; padding: 7px 9px; }
  .runner-card-compact .runner-name strong { font-size: .88rem; line-height: 1.25; }
  .runner-card-compact .runner-value { min-width: 0; }
  .runner-card-compact .runner-memo-button { min-width: 46px; padding-inline: 6px; }
}

@media (min-width: 680px) {
  /* Keep the three primary AI cards readable on the desktop canvas. */
  .runner-card-top3 { grid-column: 1 / -1; }
  .runner-card-top3 .runner-main { grid-template-columns: auto minmax(220px, 1fr) auto repeat(3, minmax(72px, auto)); }
  .runner-card-top3 .runner-name strong { overflow-wrap: break-word; word-break: normal; }
}

/* Weekly operation hub: date first, then venue, then races. */
.operation-date-tabs { margin-top: 12px; padding: 14px; }
.date-tabs-heading { align-items: end; display: flex; gap: 12px; justify-content: space-between; }
.date-tabs-heading h2 { font-size: 1.08rem; margin: 0; }
.date-tabs-help { color: #65738a; font-size: .76rem; margin: 0; text-align: right; }
.operation-date-row { display: flex; gap: 8px; margin-top: 11px; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
.date-tab { align-items: center; background: #f6f8fc; border: 1px solid #dce2ed; border-radius: 11px; color: #4c5b74; cursor: pointer; display: inline-flex; flex: 0 0 auto; gap: 6px; justify-content: space-between; min-height: 48px; min-width: 112px; padding: 8px 11px; text-align: left; }
.date-tab span { font-size: .84rem; font-weight: 800; white-space: nowrap; }
.date-tab small { border-radius: 999px; font-size: .65rem; font-weight: 850; padding: 3px 5px; }
.date-tab-archive small { background: #e8edf5; color: #5c6b83; }
.date-tab-forecast { background: #fffaf0; border-color: #ead9a7; }
.date-tab-forecast small { background: #fff0c3; color: #806000; }
.date-tab.is-selected { background: #172033; border-color: #172033; box-shadow: 0 3px 8px rgba(23, 32, 51, .18); color: #fff; }
.date-tab.is-selected small { background: rgba(255,255,255,.16); color: #fff; }
.selector-empty { color: #687389; font-size: .82rem; margin: 0; }
.day-summary-empty { background: #fffaf0; border-color: #ead9a7; }

.featured-races-section { background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); }
.featured-races-section > .section-heading { margin-top: 14px; }
.next-week-course { color: #405f82; font-size: .76rem; font-weight: 850; }
.featured-ai-list { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.featured-ai-list li { background: #fff; border-radius: 8px; display: grid; gap: 2px; padding: 7px 8px; }
.featured-ai-list strong { font-size: .78rem; }
.featured-ai-list span, .featured-race-note { color: #687389; font-size: .72rem; }
.featured-race-note { line-height: 1.45; margin: 8px 0 0; }

@media (max-width: 679px) {
  .site-brand { gap: 10px; min-height: 64px; padding: 7px 12px; }
  .site-brand-logo { height: 48px; max-width: 88px; }
  .site-brand-name { font-size: 1.08rem; }
  .date-tabs-heading { align-items: start; display: grid; gap: 2px; }
  .date-tabs-help { text-align: left; }
  .operation-date-row { margin-top: 9px; }
  .date-tab { min-width: 108px; }
}


/* CORTEX data-lab theme: calm racing analysis palette.  Layout and data
   semantics remain unchanged; this layer only remaps visual tokens. */
:root {
  --cortex-bg: #0b2018;
  --cortex-surface: #123527;
  --cortex-surface-raised: #194534;
  --cortex-card: #f8f4e9;
  --cortex-card-muted: #f1ecdf;
  --cortex-text: #1d352b;
  --cortex-text-muted: #58685f;
  --cortex-on-dark: #f6f2e7;
  --cortex-on-dark-muted: #c8d1c9;
  --cortex-brand-gold: #c3a25a;
  --cortex-gold-muted: #80632a;
  --cortex-analytic: #2f6e67;
  --cortex-warning: #b77a2d;
  --cortex-negative: #8d625f;
  --cortex-pending: #9aa4b2;
  --cortex-border-light: #d8ceba;
  --cortex-border-dark: rgba(200, 209, 201, .25);
  --cortex-card-border: var(--cortex-border-light);
  --cortex-ink: var(--cortex-text);
  --cortex-ink-muted: var(--cortex-text-muted);
  --cortex-text-on-dark: var(--cortex-on-dark);
  --cortex-text-on-dark-muted: var(--cortex-on-dark-muted);
  --cortex-gold: var(--cortex-brand-gold);
  --cortex-gold-deep: var(--cortex-gold-muted);
  --cortex-amber: var(--cortex-warning);
  --cortex-teal: var(--cortex-analytic);
  --cortex-skip: var(--cortex-negative);
  --cortex-shadow: 0 8px 24px rgba(4, 20, 14, .13);
  color: var(--cortex-text-on-dark);
  background: var(--cortex-bg);
}

html,
body {
  background: var(--cortex-bg);
  color: var(--cortex-text-on-dark);
}

body {
  min-height: 100vh;
}

.site-header {
  border-bottom-color: rgba(195, 162, 90, .34);
}

.site-header .eyebrow {
  color: var(--cortex-gold);
}

.site-header h1,
.site-header .subtitle {
  color: var(--cortex-text-on-dark);
}

.site-header .subtitle,
.site-footer,
.disclaimer {
  color: var(--cortex-text-on-dark-muted);
}

.site-brand {
  background: var(--cortex-surface);
  border-color: rgba(195, 162, 90, .55);
  box-shadow: var(--cortex-shadow);
}

.site-brand-name {
  color: var(--cortex-text-on-dark);
}

.race-card,
.memo-summary,
.race-selectors,
.next-week-section,
.archive-date-tabs,
.day-summary,
.guide-page,
.race-list-card,
.runner-card,
.next-week-race {
  background: var(--cortex-card);
  border-color: var(--cortex-card-border);
  box-shadow: var(--cortex-shadow);
  color: var(--cortex-ink);
}

.attention-skeleton,
.featured-races-section {
  background: var(--cortex-card-muted);
  border-color: var(--cortex-card-border);
  color: var(--cortex-ink);
}

.race-heading,
.detail-heading {
  background: var(--cortex-surface);
  color: var(--cortex-text-on-dark);
}

.race-meta,
.detail-heading p,
.environment {
  color: var(--cortex-text-on-dark-muted);
}

.race-heading h2,
.detail-heading h2 {
  color: var(--cortex-text-on-dark);
}

.runner,
.featured-race-selected,
.planned-horses {
  border-color: var(--cortex-card-border);
}

.runner-main {
  color: var(--cortex-ink);
}

.runner-name strong,
.horse-name,
.race-list-card,
.race-list-main strong,
.next-week-race-card,
.next-week-race-card strong,
.planned-horses-list strong {
  color: var(--cortex-ink);
}

.runner-name em,
.runner-history,
.race-memo-count,
.next-week-class {
  color: var(--cortex-gold-deep);
}

.rank,
.race-number,
.runner-rank {
  background: #e7efe8;
  color: var(--cortex-ink);
}

.metric,
.runner-value,
.runner-diagnosis,
.runner-result,
.day-record-metric,
.horse-detail-metrics div,
.planned-horses-list li,
.featured-ai-list li {
  background: var(--cortex-card-muted);
  color: var(--cortex-ink);
}

.metric-label,
.runner-value b,
.runner-top3,
.runner-basic,
.horse-detail-metrics dt,
.day-record-metric dt,
.next-week-note,
.planned-horses-empty,
.planned-horses-disclaimer,
.featured-race-note {
  color: var(--cortex-ink-muted);
}

.metric-value,
.horse-detail-metrics dd,
.day-record-metric dd {
  color: var(--cortex-ink);
}

.emphasis,
.value-positive {
  color: var(--cortex-teal);
}

.value-positive {
  background: #e4f0e9;
}

.tab-row button,
.horse-tabs button,
.date-tab,
.featured-race-tab,
.back-button,
.full-field-button,
.next-week-toggle-button {
  background: var(--cortex-card-muted);
  border-color: var(--cortex-card-border);
  color: var(--cortex-ink);
}

.tab-row button:hover,
.tab-row button:focus-visible,
.horse-tabs button:hover,
.horse-tabs button:focus-visible,
.date-tab:hover,
.date-tab:focus-visible,
.featured-race-tab:hover,
.featured-race-tab:focus-visible,
.back-button:hover,
.back-button:focus-visible,
.full-field-button:hover,
.full-field-button:focus-visible,
.next-week-toggle-button:hover,
.next-week-toggle-button:focus-visible {
  border-color: var(--cortex-gold);
  outline-color: var(--cortex-gold);
}

.tab-row button.is-selected,
.horse-tabs button.is-selected,
.date-tab.is-selected,
.featured-race-tab.is-selected,
.bottom-nav button.is-active {
  background: var(--cortex-surface);
  border-color: var(--cortex-surface);
  color: var(--cortex-text-on-dark);
}

.race-list-section .section-heading {
  border-bottom-color: var(--cortex-gold);
}

.race-memo-count {
  background: #f5ead0;
}

.graded-badge {
  background: #e3eee8;
  color: var(--cortex-teal);
}

.next-week-race.is-expanded {
  border-color: var(--cortex-gold);
}

.featured-race-visual.is-fallback {
  background: var(--cortex-surface-raised);
}

.featured-race-tab[data-next-week-race-id="next-week-20260830-niigata-kinen"],
.featured-race-tab[data-next-week-race-id="next-week-20260830-chukyo-2s"] {
  background: var(--cortex-card-muted);
  border-color: var(--cortex-card-border);
  color: var(--cortex-ink);
}

.featured-race-tab[data-next-week-race-id="next-week-20260830-niigata-kinen"].is-selected,
.featured-race-tab[data-next-week-race-id="next-week-20260830-chukyo-2s"].is-selected {
  background: var(--cortex-surface);
  border-color: var(--cortex-gold);
  color: var(--cortex-text-on-dark);
}

.memo-summary {
  border-color: rgba(195, 162, 90, .7);
}

.memo-summary-item {
  background: var(--cortex-card);
}

.memo-badge {
  background: #f3e5bc;
  color: var(--cortex-gold-deep);
}

.memo-actions button,
.memo-editor-actions button,
.memo-editor,
.tag-option,
.horse-memo-form textarea,
.horse-memo-form select {
  background: var(--cortex-card);
  border-color: var(--cortex-card-border);
  color: var(--cortex-ink);
}

.memo-actions .memo-toggle,
.memo-editor-actions button[type="submit"] {
  background: #e4f0e9;
  border-color: #9dbbab;
  color: var(--cortex-teal);
}

.memo-remove {
  color: var(--cortex-skip) !important;
}

.horse-panel {
  background: var(--cortex-card);
  border-color: var(--cortex-card-border);
  box-shadow: 0 -12px 34px rgba(4, 20, 14, .32);
  color: var(--cortex-ink);
}

.horse-panel-header h2,
.horse-panel-header p,
.horse-tabs {
  color: var(--cortex-ink);
}

.horse-panel-header p {
  color: var(--cortex-ink-muted);
}

.horse-panel-header button {
  background: var(--cortex-card-muted);
  color: var(--cortex-ink);
}

.bottom-nav {
  background: rgba(18, 53, 39, .97);
  border-color: rgba(195, 162, 90, .42);
  box-shadow: 0 -8px 24px rgba(4, 20, 14, .28);
}

.bottom-nav button {
  color: var(--cortex-text-on-dark-muted);
}

.bottom-nav button:focus-visible {
  outline: 2px solid var(--cortex-gold);
  outline-offset: 2px;
}

.bottom-nav button.is-active {
  background: var(--cortex-gold);
  border-color: var(--cortex-gold);
  color: var(--cortex-ink);
}

.site-footer {
  border-top-color: rgba(195, 162, 90, .38);
}

.site-footer a {
  color: #dec47f;
}

.gambling-notice {
  background: #f4ead3;
  border-color: #d4b56d;
  color: var(--cortex-ink);
}

.gambling-notice strong {
  color: var(--cortex-gold-deep);
}

.guide-page h3,
.guide-page p,
.day-summary,
.day-summary-heading p {
  color: var(--cortex-ink);
}

.guide-page header {
  border-bottom-color: var(--cortex-card-border);
}

.error {
  color: #d7a09a;
}

@media (max-width: 679px) {
  .bottom-nav {
    padding-bottom: calc(9px + env(safe-area-inset-bottom));
  }
}


/* CORTEX refinement: wide header mark, softer lab cards, and quieter desktop navigation. */
.site-brand {
  aspect-ratio: 4.8 / 1;
  background: var(--cortex-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.site-brand-logo {
  display: block;
  flex: 0 0 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.site-brand-name {
  display: none;
}

.site-brand-fallback {
  color: var(--cortex-text-on-dark);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.site-brand-fallback:not([hidden]) {
  align-items: center;
  display: grid;
  height: 100%;
  justify-items: center;
  text-align: center;
  width: 100%;
}

.race-card,
.memo-summary,
.race-selectors,
.next-week-section,
.archive-date-tabs,
.day-summary,
.guide-page,
.race-list-card,
.runner-card,
.next-week-race {
  border-color: var(--cortex-card-border);
  box-shadow: var(--cortex-shadow);
}

@media (min-width: 680px) {
  .bottom-nav {
    bottom: auto;
    left: auto;
    margin: 18px auto 0;
    max-width: calc(100% - 32px);
    opacity: .86;
    padding: 6px 10px;
    position: static;
    right: auto;
    transform: none;
    width: max-content;
    border: 1px solid rgba(195, 162, 90, .28);
    border-radius: 999px;
    box-shadow: none;
  }

  .bottom-nav button {
    min-height: 36px;
    padding: 7px 14px;
  }

  .page-shell {
    padding-bottom: 48px;
  }
}

@media (max-width: 679px) {
  .site-brand {
    aspect-ratio: 4.8 / 1;
  }

  .site-brand-logo {
    height: 100%;
  }

  .bottom-nav button {
    min-height: 44px;
  }
}

/* Keep the empty state readable on the deep-green race list without turning it
   into a visually dominant card. */
.race-list-section .empty-state {
  background: rgba(248, 244, 233, .06);
  border: 1px solid rgba(195, 162, 90, .28);
  border-radius: 10px;
  color: var(--cortex-text-on-dark-muted);
  line-height: 1.6;
  margin: 12px 0 0;
  padding: 14px 16px;
}

.disclaimer strong {
  color: var(--cortex-text-on-dark);
}

.disclaimer p {
  color: var(--cortex-text-on-dark-muted);
}

/* Diagnosis summary controls: compact, race-level filters with accessible tap targets. */
.analysis-diagnosis-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.analysis-diagnosis-button {
  background: var(--cortex-card);
  border: 1px solid var(--cortex-card-border);
  border-radius: 999px;
  color: var(--cortex-ink);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
  min-height: 44px;
  padding: 9px 13px;
  white-space: nowrap;
}

.analysis-diagnosis-button:hover,
.analysis-diagnosis-button:focus-visible,
.analysis-diagnosis-button[aria-pressed="true"] {
  background: var(--cortex-surface);
  border-color: var(--cortex-gold);
  color: var(--cortex-text-on-dark);
}

.analysis-diagnosis-button:focus-visible {
  outline: 2px solid var(--cortex-gold);
  outline-offset: 2px;
}

.analysis-diagnosis-unknown {
  color: var(--cortex-ink-muted);
  font-weight: 700;
}

.analysis-diagnosis-legend {
  color: var(--cortex-ink-muted);
}

.next-week-ai-status {
  color: var(--cortex-gold-deep);
  font-size: .8rem;
  font-weight: 800;
  margin: 8px 0 0;
}

@media (max-width: 679px) {
  .analysis-diagnosis-controls {
    gap: 6px;
  }

  .analysis-diagnosis-button {
    padding-inline: 11px;
  }
}

/* Weather/track disclosure: display status without guessing a current condition. */
.track-condition-note {
  border-left: 2px solid rgba(195, 162, 90, .55);
  color: var(--cortex-text-on-dark-muted);
  display: grid;
  gap: 2px;
  line-height: 1.5;
  margin: 10px 0 0;
  max-width: 100%;
  padding-left: 9px;
}
.track-condition-note span {
  color: var(--cortex-text-on-dark);
  font-size: .76rem;
  font-weight: 700;
}
.track-condition-note small {
  color: var(--cortex-text-on-dark-muted);
  font-size: .72rem;
  overflow-wrap: anywhere;
}


.race-detail-navigation {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.race-detail-navigation .race-list-back,
.race-detail-navigation .race-neighbor-link {
  min-height: 44px;
}

.race-detail-navigation .race-list-back {
  flex: 0 1 auto;
  margin: 0;
}

.race-neighbor-nav {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.race-neighbor-link {
  min-width: 0;
  white-space: nowrap;
}

.race-detail-navigation-bottom {
  margin-top: 12px;
}

@media (max-width: 679px) {
  .race-detail-navigation {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }

  .race-detail-navigation .race-list-back,
  .race-neighbor-nav {
    flex: 1 1 100%;
    width: 100%;
  }

  .race-detail-navigation .race-list-back {
    justify-content: center;
  }

  .race-neighbor-nav {
    justify-content: space-between;
  }

  .race-neighbor-link {
    flex: 1 1 0;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    padding-inline: 8px;
    text-overflow: ellipsis;
  }
}

/* Public performance: plain-language results, separate from live prediction cards. */
.performance-section {
  background: linear-gradient(145deg, rgba(18, 53, 39, .98), rgba(11, 32, 24, .98));
  border: 1px solid rgba(195, 162, 90, .38);
  border-radius: 18px;
  color: var(--cortex-text-on-dark);
  margin: 16px 0;
  padding: clamp(15px, 2.5vw, 24px);
}
.performance-section .section-heading {
  display: grid;
  gap: 5px;
}
.performance-section .section-heading h2 {
  color: var(--cortex-text-on-dark);
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
}
.performance-intro,
.performance-subheading p,
.performance-note,
.performance-footnotes {
  color: var(--cortex-text-on-dark-muted);
  font-size: .78rem;
  line-height: 1.6;
  margin: 0;
}
.performance-metric-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 0;
}
.performance-metric {
  background: rgba(248, 244, 233, .08);
  border: 1px solid rgba(200, 209, 201, .2);
  border-radius: 12px;
  min-width: 0;
  padding: 11px 12px;
}
.performance-metric-emphasis {
  background: rgba(195, 162, 90, .14);
  border-color: rgba(195, 162, 90, .62);
}
.performance-metric dt {
  color: var(--cortex-text-on-dark-muted);
  font-size: .72rem;
  line-height: 1.45;
}
.performance-metric dd {
  margin: 8px 0 0;
}
.performance-metric dd strong {
  display: block;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.performance-metric dd span {
  color: var(--cortex-gold);
  display: block;
  font-size: .82rem;
  font-weight: 800;
  margin-top: 4px;
}
.performance-purchase {
  border-top: 1px solid rgba(200, 209, 201, .18);
  margin-top: 20px;
  padding-top: 18px;
}
.performance-subheading {
  display: grid;
  gap: 4px;
}
.performance-subheading h3 {
  color: var(--cortex-text-on-dark);
  font-size: 1rem;
  margin: 0;
}
.performance-purchase-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 11px;
}
.performance-purchase-card {
  background: var(--cortex-card);
  border: 1px solid var(--cortex-card-border);
  border-radius: 13px;
  color: var(--cortex-ink);
  min-width: 0;
  padding: 13px;
}
.performance-purchase-emphasis {
  border-color: var(--cortex-gold);
  box-shadow: inset 0 2px 0 var(--cortex-gold);
}
.performance-purchase-card h3 {
  font-size: .86rem;
  margin: 0 0 10px;
}
.performance-purchase-card dl {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.performance-purchase-card dl div {
  background: var(--cortex-card-muted);
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
}
.performance-purchase-card dt {
  color: var(--cortex-ink-muted);
  font-size: .68rem;
}
.performance-purchase-card dd {
  font-size: .98rem;
  font-weight: 850;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.performance-purchase-card .performance-roi {
  color: var(--cortex-teal);
  font-size: 1.25rem;
}
.performance-note {
  margin-top: 9px;
}
.performance-daily {
  border-top: 1px solid rgba(200, 209, 201, .18);
  margin-top: 18px;
  padding-top: 13px;
}
.performance-daily summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 44px;
}
.performance-daily summary::-webkit-details-marker {
  display: none;
}
.performance-daily summary span {
  color: var(--cortex-text-on-dark);
  font-size: .92rem;
  font-weight: 800;
}
.performance-daily summary small {
  color: var(--cortex-text-on-dark-muted);
  font-size: .72rem;
}
.performance-daily-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}
.performance-daily-card {
  background: rgba(248, 244, 233, .07);
  border: 1px solid rgba(200, 209, 201, .17);
  border-radius: 11px;
  min-width: 0;
  padding: 10px;
}
.performance-daily-heading {
  align-items: baseline;
  display: flex;
  gap: 7px;
  justify-content: space-between;
}
.performance-daily-heading h3 {
  color: var(--cortex-gold);
  font-size: .9rem;
  margin: 0;
}
.performance-daily-heading span {
  color: var(--cortex-text-on-dark-muted);
  font-size: .7rem;
  white-space: nowrap;
}
.performance-daily-card dl {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
}
.performance-daily-card dl div {
  align-items: baseline;
  display: flex;
  gap: 5px;
  justify-content: space-between;
}
.performance-daily-card dt {
  color: var(--cortex-text-on-dark-muted);
  font-size: .68rem;
  line-height: 1.35;
}
.performance-daily-card dd {
  color: var(--cortex-text-on-dark);
  font-size: .82rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
}
.performance-daily-purchase {
  border-top: 1px solid rgba(200, 209, 201, .16);
  color: var(--cortex-text-on-dark-muted);
  font-size: .68rem;
  line-height: 1.55;
  margin: 10px 0 0;
  padding-top: 8px;
}
.performance-daily-purchase strong {
  color: var(--cortex-text-on-dark);
  display: block;
  font-size: .76rem;
}
.performance-daily-purchase span {
  color: var(--cortex-gold);
  display: block;
  font-weight: 800;
  margin-top: 2px;
}
.performance-footnotes {
  border-top: 1px solid rgba(200, 209, 201, .18);
  display: grid;
  gap: 4px;
  margin-top: 15px;
  padding-top: 12px;
}
.performance-footnotes p {
  margin: 0;
}

@media (max-width: 679px) {
  .performance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .performance-metric {
    padding: 10px;
  }
  .performance-metric dt {
    font-size: .68rem;
  }
  .performance-metric dd strong {
    font-size: 1.2rem;
  }
  .performance-purchase-grid,
  .performance-daily-grid {
    grid-template-columns: 1fr;
  }
  .performance-purchase-card dl {
    gap: 6px;
  }
}

/* Phase A-B: shared CORTEX identity for the operation hub and navigation. */
.operation-date-tabs {
  background: linear-gradient(145deg, rgba(18, 53, 39, .96), rgba(11, 32, 24, .98));
  border-color: rgba(195, 162, 90, .38);
  box-shadow: 0 12px 28px rgba(4, 20, 14, .2);
  color: var(--cortex-on-dark);
  padding: clamp(16px, 2.4vw, 22px);
}

.date-tabs-heading h2 {
  color: var(--cortex-on-dark);
  font-size: clamp(1.08rem, 2.2vw, 1.35rem);
}

.date-tabs-help {
  color: var(--cortex-on-dark-muted);
}

.operation-date-row {
  gap: 10px;
  margin-top: 14px;
  padding: 2px 1px 6px;
}

.date-tab {
  align-items: start;
  background: rgba(246, 242, 231, .06);
  border-color: var(--cortex-border-dark);
  border-radius: 12px;
  color: var(--cortex-on-dark-muted);
  display: grid;
  gap: 7px;
  justify-content: start;
  min-height: 58px;
  min-width: 104px;
  padding: 10px 13px;
  text-align: left;
}

.date-tab span {
  color: inherit;
  font-size: .9rem;
  font-weight: 850;
}

.date-tab small {
  background: rgba(200, 209, 201, .12);
  color: var(--cortex-on-dark-muted);
  font-size: .65rem;
  justify-self: start;
  padding: 3px 7px;
}

.date-tab:hover,
.date-tab:focus-visible {
  background: rgba(195, 162, 90, .12);
  border-color: var(--cortex-brand-gold);
  color: var(--cortex-on-dark);
}

.date-tab.is-selected {
  background: linear-gradient(145deg, rgba(195, 162, 90, .24), rgba(18, 53, 39, .96));
  border-color: var(--cortex-brand-gold);
  box-shadow: inset 0 0 0 1px rgba(195, 162, 90, .22), 0 5px 12px rgba(4, 20, 14, .22);
  color: var(--cortex-on-dark);
}

.date-tab.is-selected small {
  background: rgba(195, 162, 90, .22);
  color: var(--cortex-on-dark);
}

.tab-row button {
  min-height: 44px;
  background: var(--cortex-card-muted);
  border-color: var(--cortex-border-light);
  color: var(--cortex-text);
}

.tab-row button:hover,
.tab-row button:focus-visible {
  border-color: var(--cortex-brand-gold);
  outline-color: var(--cortex-brand-gold);
}

.tab-row button.is-selected {
  background: var(--cortex-surface);
  border-color: var(--cortex-brand-gold);
  color: var(--cortex-on-dark);
}

.featured-races-section {
  background: linear-gradient(180deg, rgba(251, 250, 244, .98), rgba(242, 239, 229, .98));
  padding: clamp(16px, 2.6vw, 24px);
}

.featured-races-section > .section-heading {
  margin-top: 0;
}

.featured-race-tabs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.featured-race-tab {
  align-items: start;
  background: rgba(18, 53, 39, .05);
  border-color: rgba(18, 53, 39, .2);
  border-radius: 12px;
  color: var(--cortex-text-muted);
  display: grid;
  gap: 5px;
  justify-items: start;
  min-height: 60px;
  padding: 11px 13px;
  text-align: left;
}

.featured-race-tab span {
  color: inherit;
  font-size: clamp(.82rem, 1.6vw, .94rem);
  font-weight: 850;
  line-height: 1.35;
}

.featured-race-tab small {
  color: var(--cortex-text-muted);
  font-size: .68rem;
  font-weight: 750;
}

.featured-race-tab:hover,
.featured-race-tab:focus-visible {
  background: rgba(195, 162, 90, .12);
  border-color: var(--cortex-brand-gold);
  color: var(--cortex-text);
}

.featured-race-tab.is-selected {
  background: linear-gradient(145deg, var(--cortex-surface), var(--cortex-surface-raised));
  border-color: var(--cortex-brand-gold);
  box-shadow: inset 0 0 0 1px rgba(195, 162, 90, .2), 0 6px 14px rgba(4, 20, 14, .14);
  color: var(--cortex-on-dark);
}

.featured-race-tab.is-selected span,
.featured-race-tab.is-selected small {
  color: var(--cortex-on-dark);
}

.featured-race-tab:focus-visible,
.date-tab:focus-visible,
.tab-row button:focus-visible {
  outline: 2px solid var(--cortex-brand-gold);
  outline-offset: 2px;
}

.featured-race-visual {
  border-radius: 12px;
  margin-top: 16px;
  overflow: hidden;
}

.featured-race-visual-text {
  background: linear-gradient(135deg, var(--cortex-bg), var(--cortex-surface) 58%, #172033);
  border-color: rgba(195, 162, 90, .45);
}

.featured-race-selected {
  border-top-color: var(--cortex-border-light);
  margin-top: 16px;
  padding-top: 16px;
}

.featured-race-selected h3 {
  font-size: clamp(1.08rem, 2.3vw, 1.35rem);
  line-height: 1.5;
}

.featured-races-empty .next-week-note {
  color: var(--cortex-text-muted);
}

.bottom-nav button {
  border: 1px solid transparent;
  min-height: 44px;
}

.bottom-nav button.is-active {
  background: rgba(195, 162, 90, .18);
  border-color: var(--cortex-brand-gold);
  box-shadow: inset 0 0 0 1px rgba(195, 162, 90, .12);
  color: var(--cortex-on-dark);
}

@media (max-width: 679px) {
  .date-tab {
    min-width: 96px;
  }

  .featured-race-tabs {
    gap: 8px;
  }

  .featured-race-tab {
    min-height: 60px;
    padding: 10px;
  }
}

@media (min-width: 680px) {
  .bottom-nav button {
    min-height: 36px;
  }
}

/* Phase C: premium home composition. Keep the ivory data surfaces intact;
   this layer concentrates the visual upgrade on the brand and Featured area. */
.site-header-home {
  border-bottom-color: rgba(195, 162, 90, .46);
  margin-bottom: 2px;
  padding: clamp(14px, 2.4vw, 24px) 0 clamp(22px, 3.4vw, 34px);
  position: relative;
}

.site-header-home::after {
  background: linear-gradient(90deg, var(--cortex-brand-gold), rgba(195, 162, 90, 0));
  bottom: -1px;
  content: "";
  height: 1px;
  left: 0;
  opacity: .62;
  position: absolute;
  width: min(320px, 42%);
}

.site-header-home .site-brand-row {
  margin-bottom: clamp(18px, 2.8vw, 28px);
}

.site-header-home .site-brand {
  border: 1px solid rgba(195, 162, 90, .52);
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(4, 20, 14, .24), inset 0 0 0 1px rgba(200, 209, 201, .08);
}

.site-header-home .site-header-copy {
  border-left: 2px solid rgba(195, 162, 90, .62);
  max-width: 820px;
  padding-left: clamp(14px, 2.2vw, 22px);
}

.site-header-home .site-header-copy .eyebrow {
  letter-spacing: .18em;
  margin-bottom: 9px;
}

.site-header-home h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  letter-spacing: -.055em;
  line-height: 1.14;
}

.site-header-home .subtitle {
  font-size: clamp(.92rem, 1.6vw, 1.05rem);
  letter-spacing: .01em;
  line-height: 1.7;
  margin-top: 10px;
  max-width: 660px;
}

.featured-races-section {
  isolation: isolate;
  margin-top: clamp(20px, 3vw, 32px);
  overflow: hidden;
  padding: clamp(20px, 3.2vw, 36px);
  position: relative;
}

.featured-races-section::before {
  background-image: linear-gradient(rgba(47, 110, 103, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 110, 103, .055) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(115deg, #000 0%, transparent 68%);
  opacity: .72;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.featured-races-section::after {
  background: radial-gradient(circle at 92% 8%, rgba(195, 162, 90, .13), transparent 28%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.featured-section-heading {
  border-bottom: 1px solid rgba(18, 53, 39, .18);
  display: grid;
  gap: 7px;
  padding-bottom: clamp(15px, 2.2vw, 22px);
  position: relative;
}

.featured-section-heading .eyebrow {
  color: var(--cortex-gold-muted);
  letter-spacing: .18em;
  margin-bottom: 0;
}

.featured-section-heading h2 {
  color: var(--cortex-text);
  font-size: clamp(1.4rem, 2.8vw, 2.08rem);
  letter-spacing: -.045em;
  line-height: 1.22;
}

.featured-section-heading .next-week-note {
  font-size: clamp(.78rem, 1.25vw, .9rem);
  line-height: 1.7;
  max-width: 720px;
}

.featured-race-tabs,
.featured-race-visual,
.featured-race-selected {
  position: relative;
  z-index: 1;
}

.featured-race-tabs {
  gap: 12px;
  margin-top: clamp(18px, 2.5vw, 24px);
}

.featured-race-tab {
  border-color: rgba(18, 53, 39, .24);
  border-radius: 14px;
  min-height: 76px;
  padding: 14px 16px 14px 18px;
  position: relative;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.featured-race-tab::before {
  background: transparent;
  border-radius: 2px;
  content: "";
  inset: 14px auto 14px 8px;
  position: absolute;
  width: 2px;
}

.featured-race-tab:hover {
  box-shadow: 0 8px 18px rgba(4, 20, 14, .1);
  transform: translateY(-1px);
}

.featured-race-tab.is-selected {
  border-color: rgba(195, 162, 90, .84);
  box-shadow: inset 0 0 0 1px rgba(195, 162, 90, .18), 0 10px 20px rgba(4, 20, 14, .16);
}

.featured-race-tab.is-selected::before {
  background: var(--cortex-brand-gold);
}

.featured-race-tab span {
  font-size: clamp(.86rem, 1.7vw, 1rem);
  letter-spacing: -.015em;
  line-height: 1.45;
}

.featured-race-tab small {
  letter-spacing: .02em;
  line-height: 1.4;
}

.featured-race-visual {
  box-shadow: inset 0 0 0 1px rgba(200, 209, 201, .08), 0 16px 28px rgba(4, 20, 14, .18);
  margin-top: clamp(20px, 3vw, 28px);
  max-width: 920px;
}

.featured-race-visual-text {
  background: linear-gradient(135deg, var(--cortex-bg) 0%, var(--cortex-surface) 56%, #172033 100%);
  border-color: rgba(195, 162, 90, .58);
  min-height: clamp(180px, 21vw, 270px);
}

.featured-race-visual-text::before {
  background-image: linear-gradient(115deg, transparent 0 46%, rgba(195, 162, 90, .14) 46.2% 46.35%, transparent 46.55%), linear-gradient(25deg, transparent 0 68%, rgba(47, 110, 103, .22) 68.2% 68.35%, transparent 68.55%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.featured-race-visual-text::after {
  border: 1px solid rgba(200, 209, 201, .18);
  border-radius: 50%;
  content: "";
  height: 160%;
  opacity: .45;
  position: absolute;
  right: -25%;
  top: -32%;
  width: 55%;
}

.featured-race-visual-kicker,
.featured-race-visual-text strong,
.featured-race-visual-text small {
  position: relative;
  z-index: 1;
}

.featured-race-visual-kicker {
  letter-spacing: .2em;
}

.featured-race-visual-text strong {
  letter-spacing: .105em;
  line-height: 1.1;
}

.featured-race-visual-text small {
  letter-spacing: .04em;
}

.featured-race-selected {
  border-top-color: rgba(18, 53, 39, .22);
  display: grid;
  gap: 9px;
  margin-top: clamp(20px, 3vw, 28px);
  padding-top: clamp(18px, 2.6vw, 24px);
}

.featured-race-selected .next-week-race-meta {
  border-left: 2px solid var(--cortex-brand-gold);
  color: var(--cortex-gold-muted);
  font-size: clamp(.75rem, 1.2vw, .84rem);
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1.5;
  margin: 0;
  padding-left: 10px;
}

.featured-race-selected h3 {
  color: var(--cortex-text);
  font-size: clamp(1.18rem, 2.5vw, 1.65rem);
  letter-spacing: -.035em;
  line-height: 1.45;
  margin: 1px 0 0;
  max-width: 760px;
}

.featured-race-selected .next-week-course {
  align-self: start;
  background: rgba(47, 110, 103, .08);
  border-left: 2px solid var(--cortex-analytic);
  color: var(--cortex-text);
  font-size: .8rem;
  line-height: 1.45;
  margin: 0;
  padding: 7px 10px;
  width: fit-content;
}

.next-week-ai-status {
  align-items: center;
  background: rgba(47, 110, 103, .075);
  border: 1px solid rgba(47, 110, 103, .26);
  border-left: 3px solid var(--cortex-analytic);
  border-radius: 12px;
  display: grid;
  gap: 3px 12px;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 5px 0 0;
  max-width: 620px;
  padding: 11px 14px;
}

.next-week-ai-status span {
  color: var(--cortex-analytic);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.next-week-ai-status strong {
  color: var(--cortex-text);
  font-size: .88rem;
  font-weight: 850;
}

.next-week-toggle-button {
  justify-self: start;
  margin-top: 4px;
  min-height: 44px;
  min-width: 180px;
  transition: background-color .18s ease, border-color .18s ease;
}

.featured-races-section .planned-horses {
  border-top-color: rgba(18, 53, 39, .18);
  margin-top: 7px;
  padding-top: 14px;
}

.featured-races-section + .day-summary,
.featured-races-section + .performance-section,
.featured-races-section + .memo-summary {
  margin-top: clamp(22px, 3vw, 30px);
}

@media (max-width: 679px) {
  .site-header-home {
    padding-bottom: 24px;
  }

  .site-header-home .site-brand-row {
    margin-bottom: 17px;
  }

  .site-header-home .site-brand {
    border-radius: 12px;
  }

  .site-header-home .site-header-copy {
    border-left: 0;
    border-top: 1px solid rgba(195, 162, 90, .46);
    padding-left: 0;
    padding-top: 14px;
  }

  .site-header-home h1 {
    font-size: clamp(1.9rem, 9vw, 2.35rem);
  }

  .featured-races-section {
    margin-top: 18px;
    padding: 18px 16px 20px;
  }

  .featured-section-heading {
    gap: 6px;
    padding-bottom: 15px;
  }

  .featured-section-heading h2 {
    font-size: 1.42rem;
  }

  .featured-section-heading .next-week-note {
    line-height: 1.65;
  }

  .featured-race-tabs {
    gap: 8px;
    margin-top: 16px;
  }

  .featured-race-tab {
    min-height: 70px;
    padding: 11px 9px 11px 14px;
  }

  .featured-race-tab::before {
    inset: 12px auto 12px 6px;
  }

  .featured-race-tab span {
    font-size: .8rem;
  }

  .featured-race-tab small {
    font-size: .64rem;
  }

  .featured-race-visual {
    margin-top: 18px;
  }

  .featured-race-visual-text {
    min-height: 176px;
  }

  .featured-race-selected {
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
  }

  .featured-race-selected h3 {
    font-size: 1.18rem;
    line-height: 1.5;
  }

  .next-week-ai-status {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .next-week-toggle-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-race-tab,
  .next-week-toggle-button {
    transition: none;
  }
}

/* Premium home refinement: keep the CORTEX palette, but make the home read
   like a quiet analysis workspace instead of a stack of promotional cards. */
.page-shell {
  max-width: 1240px;
  padding-inline: clamp(16px, 3vw, 42px);
  padding-block: 18px 96px;
}

.site-header-home {
  margin-bottom: 0;
  padding: clamp(10px, 1.8vw, 18px) 0 clamp(14px, 2.2vw, 22px);
}

.site-header-home .site-brand-row {
  margin-bottom: clamp(10px, 1.8vw, 16px);
}

.site-header-home .site-brand {
  aspect-ratio: 6.2 / 1;
  border-radius: 10px;
  max-height: 176px;
  box-shadow: none;
}

.site-header-home .site-brand-logo {
  object-position: center;
}

.site-header-home .site-header-copy {
  align-items: baseline;
  border-left: 0;
  border-top: 1px solid rgba(195, 162, 90, .4);
  column-gap: clamp(12px, 2vw, 22px);
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  max-width: none;
  padding: 11px 0 0;
  width: 100%;
}

.site-header-home .site-header-copy .eyebrow {
  grid-column: 1 / -1;
  letter-spacing: .18em;
  margin-bottom: 2px;
}

.site-header-home h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  letter-spacing: -.045em;
  line-height: 1.2;
}

.site-header-home .subtitle {
  font-size: clamp(.82rem, 1.35vw, .96rem);
  justify-self: end;
  line-height: 1.55;
  margin: 0;
  max-width: 520px;
  text-align: right;
}

.operation-date-tabs {
  background: transparent;
  border-bottom: 1px solid rgba(195, 162, 90, .35);
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  border-top: 1px solid rgba(195, 162, 90, .25);
  box-shadow: none;
  margin-top: clamp(12px, 2vw, 18px);
  padding: 10px 0 8px;
}

.date-tabs-heading {
  align-items: baseline;
  gap: 14px;
}

.date-tabs-heading h2 {
  font-size: .96rem;
  letter-spacing: -.015em;
}

.date-tabs-help {
  color: var(--cortex-on-dark-muted);
  font-size: .72rem;
}

.operation-date-row {
  gap: 6px;
  margin-top: 7px;
  padding: 2px 0 4px;
  scroll-padding-inline: 10px;
}

.date-tab {
  background: rgba(246, 242, 231, .045);
  border-color: rgba(200, 209, 201, .28);
  border-radius: 7px;
  gap: 7px;
  min-height: 44px;
  min-width: 96px;
  padding: 7px 10px;
}

.date-tab span {
  font-size: .78rem;
  font-weight: 800;
}

.date-tab small {
  font-size: .61rem;
  padding: 2px 5px;
}

.date-tab:hover,
.date-tab:focus-visible {
  background: rgba(195, 162, 90, .1);
}

.date-tab.is-selected {
  background: rgba(195, 162, 90, .14);
  border-color: var(--cortex-brand-gold);
  box-shadow: inset 0 -2px 0 var(--cortex-brand-gold);
}

.date-tab.is-selected small {
  background: rgba(195, 162, 90, .2);
}

.featured-races-section {
  background: var(--cortex-card);
  border: 1px solid var(--cortex-card-border);
  border-radius: 10px;
  box-shadow: none;
  isolation: auto;
  margin-top: clamp(16px, 2.6vw, 26px);
  overflow: hidden;
  padding: clamp(16px, 2.4vw, 24px);
}

.featured-races-section::before,
.featured-races-section::after {
  display: none;
}

.featured-races-empty {
  background: transparent;
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  box-shadow: none;
  margin-top: clamp(14px, 2vw, 20px);
  padding: 0 0 4px;
}

.featured-races-empty .featured-section-heading {
  border-bottom: 0;
  padding-bottom: 0;
}

.featured-section-heading {
  gap: 5px;
  padding-bottom: 12px;
}

.featured-section-heading .eyebrow {
  letter-spacing: .16em;
}

.featured-section-heading h2 {
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  letter-spacing: -.04em;
  line-height: 1.25;
}

.featured-section-heading .next-week-note {
  font-size: .78rem;
  line-height: 1.55;
  max-width: 680px;
}

.featured-race-tabs {
  gap: 8px;
  margin-top: 12px;
}

.featured-race-tab {
  background: rgba(18, 53, 39, .035);
  border-color: rgba(18, 53, 39, .22);
  border-radius: 7px;
  box-shadow: none;
  min-height: 62px;
  padding: 10px 12px 10px 15px;
  transition: background-color .18s ease, border-color .18s ease;
}

.featured-race-tab::before {
  inset: 10px auto 10px 7px;
}

.featured-race-tab:hover {
  box-shadow: none;
  transform: none;
}

.featured-race-tab.is-selected {
  box-shadow: inset 0 0 0 1px rgba(195, 162, 90, .2);
}

.featured-race-tab span {
  font-size: clamp(.82rem, 1.4vw, .94rem);
  line-height: 1.35;
}

.featured-race-tab small {
  font-size: .65rem;
  line-height: 1.35;
}

.featured-race-visual {
  box-shadow: none;
  margin-top: 14px;
  max-width: 600px;
}

.featured-race-visual-text {
  background: var(--cortex-surface);
  border-radius: 8px;
  min-height: clamp(112px, 12vw, 160px);
  padding: 22px 18px;
}

.featured-race-visual-text::before,
.featured-race-visual-text::after {
  display: none;
}

.featured-races-empty {
  background: rgba(248, 244, 233, .07);
  border-bottom: 1px solid rgba(200, 209, 201, .24);
  border-top: 1px solid rgba(200, 209, 201, .24);
  color: var(--cortex-on-dark);
  padding: 13px 14px 14px;
}

.featured-races-empty .featured-section-heading h2 {
  color: var(--cortex-on-dark);
}

.featured-races-empty .next-week-note {
  color: var(--cortex-on-dark-muted);
}

.featured-race-visual-text strong {
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  letter-spacing: .08em;
}

.featured-race-visual-text small {
  font-size: .7rem;
}

.featured-race-selected {
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
}

.featured-race-selected h3 {
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  line-height: 1.42;
}

.featured-race-selected .next-week-course {
  font-size: .76rem;
  padding: 6px 9px;
}

.next-week-ai-status {
  border-radius: 6px;
  margin-top: 3px;
  max-width: 520px;
  padding: 8px 10px;
}

.next-week-toggle-button {
  margin-top: 3px;
  min-height: 44px;
}

.race-list-card,
.runner-card,
.memo-summary,
.day-summary {
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(4, 20, 14, .1);
}

.race-list-card {
  min-height: 76px;
  padding: 11px 12px;
}

.race-list-card:hover,
.race-list-card:focus-visible {
  box-shadow: 0 6px 14px rgba(4, 20, 14, .14);
  transform: none;
}

.bottom-nav {
  border-radius: 10px;
}

@media (max-width: 679px) {
  .page-shell {
    padding: 14px 12px 98px;
  }

  .site-header-home .site-brand {
    aspect-ratio: 6.2 / 1;
    border-radius: 8px;
  }

  .site-header-home .site-header-copy {
    display: block;
    padding-top: 10px;
  }

  .site-header-home h1 {
    font-size: clamp(1.55rem, 7.5vw, 1.9rem);
  }

  .site-header-home .subtitle {
    font-size: .82rem;
    margin-top: 5px;
    max-width: 100%;
    text-align: left;
  }

  .date-tabs-heading {
    align-items: start;
    gap: 3px;
  }

  .date-tabs-help {
    text-align: left;
  }

  .operation-date-row {
    margin-top: 6px;
  }

  .featured-races-section {
    margin-top: 16px;
    padding: 15px 14px 17px;
  }

  .featured-race-tabs {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .featured-race-tab {
    min-height: 56px;
    padding: 9px 11px 9px 14px;
  }

  .featured-race-visual {
    margin-top: 12px;
  }

  .featured-race-visual-text {
    min-height: 112px;
    padding: 18px 14px;
  }

  .featured-race-selected {
    margin-top: 12px;
    padding-top: 12px;
  }

  .featured-race-selected h3 {
    font-size: 1.08rem;
  }
}

@media (min-width: 680px) {
  .featured-race-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phase D: compress the Home information architecture into one quiet
   analysis shell. The existing data, controls, and palette stay intact. */
.site-header-home {
  align-items: center;
  column-gap: clamp(18px, 3vw, 38px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  margin-bottom: 0;
  padding: 10px 0 12px;
}

.site-header-home .site-brand-row {
  margin-bottom: 0;
  min-width: 0;
}

.site-header-home .site-brand {
  aspect-ratio: 4.8 / 1;
  border-radius: 8px;
  max-height: none;
  min-height: 0;
}

.site-header-home .site-header-copy {
  align-self: center;
  border-left: 1px solid rgba(195, 162, 90, .35);
  border-top: 0;
  display: block;
  max-width: none;
  padding: 0 0 0 clamp(14px, 2.2vw, 24px);
  width: auto;
}

.site-header-home .site-header-copy .eyebrow {
  letter-spacing: .16em;
  margin: 0 0 5px;
}

.site-header-home .site-header-title {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header-home .subtitle {
  color: var(--cortex-on-dark-muted);
  font-size: clamp(.78rem, 1.2vw, .9rem);
  line-height: 1.5;
  margin: 0;
  max-width: none;
  text-align: left;
}

.operation-date-tabs {
  margin-top: 10px;
  padding: 8px 0 6px;
}

.date-tabs-heading {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.date-tabs-heading .eyebrow {
  font-size: .66rem;
  letter-spacing: .15em;
  margin: 0;
}

.date-tabs-label {
  color: var(--cortex-on-dark);
  font-size: .82rem;
  font-weight: 800;
}

.date-tabs-help {
  font-size: .68rem;
  margin: 0 0 0 auto;
}

.operation-date-row {
  gap: 6px;
  margin-top: 6px;
  padding: 2px 0 4px;
}

.date-tab {
  border-radius: 7px;
  min-height: 44px;
  min-width: 96px;
  padding: 7px 10px;
}

.featured-races-section {
  margin-top: 10px;
  padding: 14px 16px 15px;
}

.featured-section-heading {
  align-items: baseline;
  display: flex;
  gap: 10px;
  padding-bottom: 8px;
}

.featured-section-heading .eyebrow {
  flex: 0 0 auto;
  margin: 0;
}

.featured-section-heading h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.25;
  margin: 0;
}

.featured-section-heading .next-week-note {
  font-size: .72rem;
  line-height: 1.4;
  margin: 0 0 0 auto;
  max-width: none;
  text-align: right;
}

.featured-race-tabs {
  gap: 8px;
  margin-top: 10px;
}

.featured-race-tab {
  border-radius: 7px;
  box-shadow: none;
  min-height: 60px;
  padding: 9px 12px 9px 15px;
}

.featured-race-tab:hover {
  box-shadow: none;
  transform: none;
}

.featured-race-selected {
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
}

.featured-race-selected h3 {
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  line-height: 1.4;
}

/* The previous decorative panel repeated the same section meaning and is no
   longer part of the Home information path. Keep the old class safe for any
   stale fixture markup without allowing it to reintroduce visual duplication. */
.featured-race-visual {
  display: none;
}

.featured-races-empty {
  padding: 10px 14px 12px;
}

.featured-races-empty .featured-section-heading {
  align-items: baseline;
  display: flex;
  padding-bottom: 0;
}

.featured-races-empty > .next-week-note {
  font-size: .74rem;
  margin: 4px 0 0;
}

@media (max-width: 679px) {
  .site-header-home {
    display: block;
    padding: 8px 0 10px;
  }

  .site-header-home .site-brand-row {
    margin-bottom: 8px;
  }

  .site-header-home .site-header-copy {
    border-left: 0;
    border-top: 1px solid rgba(195, 162, 90, .3);
    padding: 8px 0 0;
  }

  .site-header-home .subtitle {
    font-size: .78rem;
  }

  .date-tabs-heading {
    gap: 7px;
  }

  .date-tabs-help {
    font-size: .64rem;
  }

  .featured-races-section {
    margin-top: 10px;
    padding: 12px 13px 14px;
  }

  .featured-section-heading {
    align-items: start;
    display: grid;
    gap: 3px 8px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .featured-section-heading h2 {
    font-size: 1.2rem;
  }

  .featured-section-heading .next-week-note {
    grid-column: 1 / -1;
    margin: 0;
    text-align: left;
  }

  .featured-race-tab {
    min-height: 56px;
    padding: 8px 10px 8px 13px;
  }

  .featured-race-selected {
    margin-top: 9px;
    padding-top: 9px;
  }

  .featured-races-empty .featured-section-heading {
    display: flex;
  }
}

/* Phase E: treat the Home header as application chrome, not a hero banner. */
.site-header-home {
  align-items: center;
  column-gap: clamp(18px, 3vw, 34px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px 0 11px;
}

.site-header-home .site-brand-row {
  flex-basis: auto;
  margin-bottom: 0;
  min-width: 156px;
}

.site-brand-lockup {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
}

.site-brand-wordmark {
  color: var(--cortex-on-dark, #f8f4e9);
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
}

.site-brand-caption {
  color: var(--cortex-brand-gold, #c3a25a);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
}

.primary-nav {
  align-items: center;
  display: flex;
  gap: clamp(4px, 1vw, 14px);
  justify-content: center;
  min-width: 0;
}

.primary-nav button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--cortex-on-dark-muted, rgba(248, 244, 233, .72));
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .03em;
  min-height: 44px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-nav button:hover,
.primary-nav button.is-active {
  color: var(--cortex-on-dark, #f8f4e9);
}

.primary-nav button.is-active {
  border-bottom-color: var(--cortex-brand-gold, #c3a25a);
}

.primary-nav button:focus-visible {
  outline: 2px solid var(--cortex-brand-gold, #c3a25a);
  outline-offset: 2px;
}

.site-system-status {
  align-items: center;
  border-left: 1px solid rgba(195, 162, 90, .32);
  color: var(--cortex-on-dark-muted, rgba(248, 244, 233, .72));
  display: flex;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  margin: 0;
  min-height: 32px;
  padding-left: clamp(12px, 2vw, 20px);
  white-space: nowrap;
}

.site-header-home .site-header-copy {
  display: none;
}

@media (min-width: 680px) {
  .bottom-nav {
    display: none;
  }
}

@media (max-width: 679px) {
  .site-header-home {
    column-gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 0 9px;
  }

  .site-header-home .site-brand-row {
    min-width: 0;
  }

  .site-brand-lockup {
    gap: 6px;
  }

  .site-brand-wordmark {
    font-size: clamp(1.35rem, 7vw, 1.7rem);
    letter-spacing: .06em;
  }

  .site-brand-caption {
    font-size: .63rem;
  }

  .primary-nav {
    display: none;
  }

  .site-system-status {
    border-left: 1px solid rgba(195, 162, 90, .28);
    font-size: .58rem;
    letter-spacing: .07em;
    min-height: 30px;
    padding-left: 8px;
  }
}
