:root { color-scheme: dark; --surface: #151e2b; --border: #2e3c4f; --muted: #a4b2c5; --accent: #82c5f3; }
body { background: #101722; color: #e3eaf4; font-size: 1rem; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: #98cefa; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #82c5f3 !important; outline-offset: 4px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 2000; background: #d8edff; color: #102333; padding: .6rem 1rem; }
.skip-link:focus { top: 1rem; }
.sidebar { --bs-offcanvas-width: 236px; width: 236px; background: #111a26 !important; border-right: 1px solid var(--border); }
.sidebar-body { padding: 2.2rem 1.25rem; }
.brand { color: #eaf4ff; text-decoration: none; font-size: 1.2rem; font-weight: 750; letter-spacing: -.03em; }
.sidebar-caption { color: var(--muted); font-size: .875rem; margin: .4rem 0 2.5rem; }
.sidebar .nav-link { color: #b9c7d9; padding: .7rem 1rem; border-radius: 7px; }
.sidebar .nav-link:hover { background: #1b2a3c; color: white; }
.sidebar .nav-link.active { color: #c2e5ff; background: #203851; box-shadow: inset 3px 0 #75bcf0; }
.sidebar-note { color: var(--muted); font-size: .875rem; border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.3rem; }
.mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border); }
main { min-width: 0; max-width: 1800px; padding: 2rem clamp(1rem, 3vw, 3rem); }
.sample-notice { color: #b7c8d9; font-size: .875rem; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 2.5rem; }
.sample-label { color: #c2e5ff; border: 1px solid #42617c; border-radius: 4px; padding: .1rem .5rem; }
.eyebrow { font-size: .875rem; color: #86aec9; letter-spacing: .12em; margin-bottom: .5rem; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.045em; }
.lede { color: var(--muted); margin: .6rem 0 0; font-size: 1.125rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.scope-note { color: var(--muted); max-width: 85ch; margin: 1.5rem 0; font-size: .9375rem; }
.filter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.4rem; margin: 2rem 0; }
.search-fields { display: grid; grid-template-columns: 2fr 1.2fr 1.3fr 1fr; gap: 1rem; }
.search-fields > div { min-width: 0; }
label { font-size: .875rem; color: #cad7e7; margin-bottom: .45rem; }
.form-control, .form-select { background-color: #101824; border-color: #405269; color: #e3eaf4; min-height: 44px; font-size: 1rem; }
.form-control::placeholder { color: #9baabe; }
.form-select { padding-right: 2.5rem; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.check-label { display: flex; gap: .65rem; align-items: center; margin: 0; }
.form-check-input { margin: 0; width: 1.15rem; height: 1.15rem; }
.btn { font-size: .875rem; min-height: 44px; padding: .6rem 1rem; font-weight: 600; border-radius: 6px; }
.btn-primary { --bs-btn-bg: #82c5f3; --bs-btn-color: #102333; --bs-btn-border-color: #82c5f3; --bs-btn-hover-bg: #b0ddfc; --bs-btn-hover-color: #102333; --bs-btn-hover-border-color: #b0ddfc; }
.btn-outline-light { --bs-btn-color: #d6e6f6; --bs-btn-border-color: #41556c; --bs-btn-hover-bg: #2b4058; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #7296bc; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
h2 { font-size: 1.125rem; font-weight: 650; margin: 0; }
#as-of { color: var(--muted); font-size: .875rem; margin: 0; }
.status-line { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 3.5rem; color: #b6c8db; font-size: .9375rem; }
[data-state=stale] .status-line { color: #f3cc80; }
[data-state=unavailable] .status-line, [data-state=error] .status-line { color: #ffc3c3; }
.scroll-hint { color: var(--muted); font-size: .875rem; margin: 0 0 .6rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.table { min-width: 1250px; font-size: .875rem; --bs-table-bg: #151e2b; --bs-table-color: #e3eaf4; --bs-table-border-color: #2e3c4f; }
.table th { background: #1b293a; color: #b8cbe2; font-weight: 600; white-space: nowrap; font-size: .875rem; }
.table th, .table td { padding: 1rem; }
.table td:not(:nth-child(2)):not(:nth-child(3)) { font-variant-numeric: tabular-nums; }
.table .fighter-name { min-width: 11rem; display: block; font-weight: 600; }
.fighter-number { display: block; color: var(--muted); font-size: .875rem; }
.lifecycle { white-space: nowrap; color: #c7d6e7; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; color: var(--muted); font-size: .875rem; }
.empty-state { border: 1px dashed #405269; border-radius: 10px; padding: 3rem 1rem; text-align: center; margin-top: 1rem; }
.empty-state h3 { font-size: 1.2rem; }
.empty-state p { color: var(--muted); margin: .5rem 0 0; }
footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.5rem; color: var(--muted); font-size: .875rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; margin: 2rem 0; }
.directory-card { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.directory-card p { color: var(--muted); margin: .5rem 0 0; }
.directory-card .format-label { color: #86aec9; font-size: .875rem; margin: 0 0 .75rem; }
.board-control { max-width: 20rem; margin: 1.5rem 0; }
.competition-panel { margin: 2.5rem 0; }
.competition-panel .as-of { color: var(--muted); font-size: .875rem; margin: 0; }
.competition-table .table { min-width: 580px; }
.structure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.structure-card { padding: 1.25rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.structure-card h3 { font-size: 1rem; font-weight: 650; }
.structure-card p { color: var(--muted); margin: .5rem 0 0; }
.structure-card ul { list-style: none; padding: 0; margin: 1rem 0; }
.structure-card li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.subject-number { color: var(--muted); font-size: .875rem; }
.supplied-winner { display: inline-block; color: #bce5ce; font-size: .875rem; margin-left: .5rem; }
[data-state=stale] > .status-line { color: #f3cc80; }
[data-state=unavailable] > .status-line, [data-state=error] > .status-line { color: #ffc3c3; }
@media (min-width: 992px) { .sidebar { position: fixed; inset: 0 auto 0 0; height: 100vh; } main { margin-left: 236px; } }
@media (max-width: 1199px) { .search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { main { padding-top: 1.5rem; } .search-fields { grid-template-columns: 1fr; } .filter-panel { padding: 1rem; } .sample-notice { margin-bottom: 2rem; } }

/* Branding variables arrive from the validated, same-origin theme stylesheet. */
:root { --surface: var(--theme-surface, #151e2b); --border: var(--theme-border, #2e3c4f); --muted: var(--theme-muted, #a4b2c5); --accent: var(--theme-accent, #82c5f3); }
body { background: var(--theme-background, #101722); color: var(--theme-text, #e3eaf4); }
a, :is(.eyebrow, .directory-card .format-label) { color: var(--accent); }
:focus-visible { outline-color: var(--accent) !important; }
.sidebar { background: var(--theme-sidebar, #111a26) !important; }
.brand, label, .sidebar .nav-link { color: var(--theme-text, #e3eaf4); }
.sidebar .nav-link.active { color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.form-control, .form-select { background-color: var(--theme-background, #101722); color: var(--theme-text, #e3eaf4); }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); }
.table { --bs-table-bg: var(--surface); --bs-table-color: var(--theme-text, #e3eaf4); --bs-table-border-color: var(--border); }
.settings-form { max-width: 850px; }
.auth-form { max-width: 480px; }
.settings-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-control-color { width: 100%; max-width: 10rem; }

.brand, .sidebar-note, footer { overflow-wrap: anywhere; }
