/* Canine Scorebook 3.0 final theme layer. Loaded after the legacy component sheet. */
:root,
html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #151d23;
    --shell-bg: #202a32;
    --surface-bg: #27333c;
    --surface-raised: #2b3741;
    --surface-soft: #243039;
    --header-bg: rgba(48, 63, 73, .97);
    --text-main: #d8dfe3;
    --text-soft: #aab6bd;
    --text-muted: #87969f;
    --link-color: #9fc3d8;
    --link-hover: #d0e2ec;
    --divider: #3b4852;
    --divider-strong: #52616b;
    --control-bg: #202a32;
    --row-even: #2d3943;
    --row-hover: #354550;
    --content: 1120px;
    --paper: #182128;
    --paper-deep: #222d35;
    --surface: #2b3741;
    --ink: #d8dfe3;
    --ink-soft: #aab6bd;
    --ink-faint: #7f8e97;
    --line: #3b4852;
    --line-strong: #52616b;
    --red: #e57355;
    --red-dark: #ef8b70;
    --red-wash: #3c2d2b;
    --green: #67b483;
    --green-dark: #4f8d68;
    --green-wash: #263d34;
    --amber: #d2aa62;
    --amber-wash: #403827;
    --danger: #dc7169;
    --shadow: 0 12px 30px rgba(4, 10, 14, .16);
    --chart-accent: #ff5300;
    --chart-accent-soft: rgba(255, 83, 0, .2);
    --chart-point: rgba(255, 83, 0, .34);
    --chart-trend: #ff7130;
    --chart-grid: #3d4b55;
    --chart-axis: #657681;
    --chart-label: #8f9da5;
    --chart-surface: #27333c;
}

html[data-theme="light"] {
    color-scheme: light;
    --page-bg: #cfd7da;
    --shell-bg: #e5eaec;
    --surface-bg: #edf1f2;
    --surface-raised: #f5f7f7;
    --surface-soft: #dce4e7;
    --header-bg: rgba(52, 68, 77, .985);
    --text-main: #25343d;
    --text-soft: #4c5f69;
    --text-muted: #596b74;
    --link-color: #2f6681;
    --link-hover: #204e65;
    --divider: #bbc6cb;
    --divider-strong: #98a9b1;
    --control-bg: #f2f5f6;
    --row-even: #e2e8ea;
    --row-hover: #d4dfe3;
    --paper: #cfd7da;
    --paper-deep: #e5eaec;
    --surface: #edf1f2;
    --ink: #25343d;
    --ink-soft: #4c5f69;
    --ink-faint: #596b74;
    --line: #bbc6cb;
    --line-strong: #98a9b1;
    --red: #c64b1d;
    --red-dark: #a43d18;
    --red-wash: #f1dfd7;
    --green: #287c4b;
    --green-dark: #1f6540;
    --green-wash: #e2f1e8;
    --amber: #91651d;
    --amber-wash: #f5eddc;
    --danger: #b84e47;
    --shadow: 0 10px 24px rgba(38, 52, 61, .08);
    --chart-accent: #e65012;
    --chart-accent-soft: rgba(230, 80, 18, .14);
    --chart-point: rgba(230, 80, 18, .32);
    --chart-trend: #f06a2d;
    --chart-grid: #d4dadd;
    --chart-axis: #7b8a92;
    --chart-label: #60717b;
    --chart-surface: #e8edef;
}

html,
body {
    background: var(--page-bg);
}

body {
    color: var(--text-main);
    background-image: radial-gradient(circle at 50% -18rem, rgba(91, 119, 136, .16), transparent 42rem);
    font-size: 13px;
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover);
}

.site-header {
    border-bottom-color: #43515b;
    background: var(--header-bg);
    box-shadow: 0 2px 12px rgba(4, 10, 14, .2);
}

.site-atmosphere {
    position: relative;
    height: clamp(7rem, 9vw, 9rem);
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    background-image:
        linear-gradient(90deg, rgba(21, 29, 35, .78) 0%, rgba(21, 29, 35, .52) 48%, rgba(21, 29, 35, .32) 100%),
        linear-gradient(180deg, rgba(21, 29, 35, .08), rgba(21, 29, 35, .5)),
        url('/img/scorebook-atmosphere-v3.webp');
    background-position: center 52%;
    background-size: cover;
    box-shadow: inset 0 -24px 34px rgba(11, 16, 20, .28);
}

.site-atmosphere::after {
    position: absolute;
    right: 8%;
    bottom: 0;
    width: min(22rem, 34vw);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 83, 0, .54), transparent);
    content: "";
}

.site-atmosphere + .page-shell,
.site-atmosphere + .database-shell {
    position: relative;
    z-index: 1;
    margin-top: -1.5rem;
}

.main-navigation > a,
.nav-signout button {
    color: #c4cdd2;
}

.main-navigation > a:hover,
.main-navigation > a.is-active,
.nav-signout button:hover {
    border-bottom-color: #e06a4a;
    background: rgba(255, 255, 255, .035);
    color: #fff;
}

.main-navigation > .navigation-register {
    border-color: #6c7b84;
    background: rgba(255, 255, 255, .025);
    color: #eef2f4;
}

/* One compact sport context for the whole public site. */
.site-header__inner {
    gap: .65rem;
}

.sport-view {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
}

.sport-view__focus {
    margin: 0;
}

.sport-view__focus select {
    width: 148px;
    min-height: 29px;
    padding: 4px 28px 4px 8px;
    border-color: #566671;
    border-radius: 3px 0 0 3px;
    background-color: #25313a;
    color: #dbe2e5;
    font-size: 10px;
    font-weight: 700;
}

.sport-view__manage {
    display: grid;
    width: 29px;
    min-height: 29px;
    padding: 0;
    place-items: center;
    border-color: #566671;
    border-left: 0;
    border-radius: 0 3px 3px 0;
    background: #31404a;
    color: #aebbc2;
    font-size: 16px;
    line-height: 1;
}

.sport-view.is-open .sport-view__manage,
.sport-view__manage:hover {
    background: #435765;
    color: #fff;
}

.sport-view__panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + 8px);
    right: 0;
    width: min(310px, calc(100vw - 20px));
    overflow: hidden;
    border: 1px solid #4a5963;
    border-radius: 5px;
    background: #222d35;
    box-shadow: 0 16px 34px rgba(2, 7, 10, .38);
}

.sport-view__panel[hidden] {
    display: none;
}

.sport-view__panel > header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    border-bottom: 1px solid #3d4b55;
    background: #28353e;
}

.sport-view__panel > header div,
.sport-view__panel > header strong,
.sport-view__panel > header small {
    display: block;
}

.sport-view__panel > header strong {
    color: #e1e7ea;
    font-size: 11px;
}

.sport-view__panel > header small,
.sport-view__panel form > p {
    margin: 2px 0 0;
    color: #8998a1;
    font-size: 9px;
}

.sport-view__panel > header button {
    width: 24px;
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9ba8af;
    font-size: 17px;
    box-shadow: none;
}

.sport-view__panel form {
    margin: 0;
    padding: 9px 11px 11px;
}

.sport-view__options {
    display: grid;
    gap: 2px;
    margin-bottom: 9px;
}

.sport-view__options label {
    display: flex;
    min-height: 30px;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 3px;
    color: #c5cfd4;
    font-size: 10px;
    cursor: pointer;
}

.sport-view__options label:hover {
    background: #303e49;
}

.sport-view__options input {
    width: 14px;
    min-height: 14px;
    margin: 0;
    accent-color: #e06a4a;
}

.sport-view__save {
    width: 100%;
    min-height: 30px;
    background: #4e6675;
    font-size: 10px;
}

.sport-source-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: -2px 0 10px;
    padding: 0;
}

.sport-source-switcher label {
    margin: 0;
    color: #8f9ca4;
    font-size: 9px;
    font-weight: 700;
}

.sport-source-switcher select {
    width: min(100%, 370px);
    min-height: 29px;
    font-size: 10px;
}

.database-shell > .container,
.page-shell {
    border-inline: 1px solid #2b3740;
    background: #222c34;
    box-shadow: 0 0 36px rgba(4, 10, 14, .22);
}

.dashboard-header,
.page-titlebar,
.page-header,
.page-header--compact,
.section-heading {
    border-color: var(--line);
    background: transparent;
}

.data-panel,
.settings-section,
.record-section,
.dog-rating-panel,
.profile-card,
.dog-identity,
.dog-performance-summary,
.dog-performance-details,
.performance-development,
.auth-card,
.claim-card,
.request-card,
.guide-index,
.guide-article__body,
.guide-article__lead,
.about-document,
.ewpl-panel,
.ewpl-install {
    border: 1px solid #37444e;
    border-radius: 5px;
    background: #2a3640;
    box-shadow: 0 3px 14px rgba(4, 10, 14, .1);
}

/* Editorial sections remain open; depth comes from the page and data surfaces. */
.section {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.panel-header,
.data-panel > .panel-header,
.ewpl-panel__header {
    border-bottom-color: #3b4852;
    background: #26323b;
    color: var(--ink);
}

.panel-header h2,
.panel-header a,
.panel-header span,
.panel-header__meta {
    color: #aeb9bf;
}

.panel-header h2 {
    color: #dce3e6;
}

.panel-header::after {
    display: block;
    background: #e06a4a;
    opacity: .58;
}

.database-sports {
    border: 1px solid #3a4751;
    background: #27323b;
    box-shadow: 0 2px 8px rgba(4, 10, 14, .08);
}

.database-sports a {
    border-right-color: #3a4751;
    background: transparent;
}

.database-sports a:hover,
.database-sports a.is-active {
    background: #303e49;
    color: #fff;
}

.database-sports a::after {
    background: #e06a4a;
}

.database-sports a:hover .sport-key,
.database-sports a.is-active .sport-key {
    color: #f2aa96;
}

.database-totals,
.statistics-summary,
.dog-kpis,
.rating-summary,
.stat-line {
    border-color: #3a4751;
    background: #27323b;
}

.database-totals > div,
.statistics-summary > div,
.dog-kpis > div,
.rating-summary > div,
.stat-line__item {
    border-right-color: #3a4751;
}

.filters,
.filter-panel,
.result-sort,
.statistics-sort,
.rating-controls,
.chart-toolbar,
.form-panel,
.admin-toolbar,
.admin-search {
    border-color: #394650;
    background: #28343e;
}

.discipline-tabs {
    border: 1px solid #394650;
    background: #394650;
}

.discipline-tabs a {
    background: #27333c;
    color: #aab6bd;
}

.discipline-tabs a:hover,
.discipline-tabs a.is-active {
    background: #354550;
    color: #fff;
}

input,
select,
textarea,
.field input,
.field select,
.field textarea,
.chart-toolbar button {
    border-color: #4b5963;
    background: #202a32;
    color: #dce2e5;
}

option,
optgroup {
    background: #202a32;
    color: #dce2e5;
}

select option:checked {
    background: #3c4d59;
    color: #fff;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #dce2e5;
    box-shadow: 0 0 0 1000px #202a32 inset;
    caret-color: #dce2e5;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #7d96a5;
    background: #222e37;
    outline-color: rgba(125, 150, 165, .18);
}

input::placeholder,
textarea::placeholder {
    color: #74828b;
}

button,
.button,
.btn {
    border-color: #5c7381;
    background: #4e6675;
    color: #f3f6f7;
    box-shadow: 0 1px 2px rgba(2, 7, 10, .18);
}

button:hover,
.button:hover,
.btn:hover {
    border-color: #7891a0;
    background: #607b8b;
}

.button--secondary,
.btn-secondary {
    border-color: #52616b;
    background: #27333c;
    color: #cfd7db;
}

.button--secondary:hover,
.btn-secondary:hover {
    border-color: #6e808b;
    background: #34434e;
    color: #eef2f4;
}

th,
.dense-table th,
.admin-table th {
    border-bottom-color: #3b4852;
    background: #242f38;
    color: #9eaab1;
}

td,
.dense-table td,
.admin-table td {
    border-bottom-color: #3b4852;
    color: #c8d1d5;
}

tbody tr,
.dense-table tbody tr,
.admin-table tbody tr {
    background: #2b3741;
}

tbody tr:nth-child(even),
.dense-table tbody tr:nth-child(even),
.admin-table tbody tr:nth-child(even) {
    background: #2e3a45;
}

.dense-table tbody tr:hover > td,
.admin-table tbody tr:hover > td,
.result-table tbody tr:hover > td,
table tbody tr:hover > td,
.compact-event-list > a:hover,
.performance-list > a:hover,
.compact-ranking li:hover,
.activity-feed > a:hover,
.rail-links a:hover {
    background: #354550;
    color: #e0e6e9;
}

.dense-table tbody tr,
.admin-table tbody tr,
.result-table tbody tr,
table tbody tr {
    transition: background-color .16s ease;
}

.dense-table tbody tr:hover > td:first-child,
.admin-table tbody tr:hover > td:first-child,
.result-table tbody tr:hover > td:first-child,
table tbody tr:hover > td:first-child {
    box-shadow: inset 2px 0 var(--chart-accent);
}

table tbody tr:hover a,
.dense-table tbody tr:hover a,
.admin-table tbody tr:hover a {
    color: #c6dfed;
}

.compact-event-list > a,
.compact-ranking li,
.activity-feed > a,
.guide-index > a,
.rail-links a {
    border-bottom-color: #3a4751;
    background: #2c3842;
}

.compact-event-list > a:nth-child(even),
.compact-ranking li:nth-child(even),
.activity-feed > a:nth-child(even) {
    background: #2e3b46;
}

.competition-group {
    border: 1px solid #37444e;
    background: #2a3640;
    box-shadow: 0 3px 14px rgba(4, 10, 14, .1);
}

.competition-group__header {
    border-bottom-color: #3b4852;
    background: #26323b;
    color: var(--ink);
}

.competition-group__header > time,
.competition-group__header span,
.competition-group__header > strong,
.competition-group__toggle {
    color: #9aa7af;
}

.competition-group__header h2 a {
    color: #dce3e6;
}

.event-result-section + .event-result-section {
    border-top-color: #222c34;
}

.event-result-section__header {
    border-bottom-color: #3b4852;
    background: #293640;
}

.event-result-section__header > h3 {
    margin: 0;
    color: #dce3e6;
    font-size: 11px;
}

.table-guide-link {
    color: #9fc0d4;
    text-decoration: underline;
    text-decoration-color: rgba(159, 192, 212, .45);
    text-underline-offset: 2px;
}

.event-result-details > span {
    display: block;
    white-space: nowrap;
}

.result-more {
    margin-top: 3px;
}

.result-more > summary {
    width: max-content;
    cursor: pointer;
    color: #9fc0d4;
    font-size: 9px;
    font-weight: 700;
}

.result-more dl {
    display: grid;
    gap: 3px;
    min-width: 145px;
    margin: 5px 0 1px;
    padding: 6px 7px;
    border-left: 2px solid rgba(224, 106, 74, .65);
    background: #24313a;
}

.result-more dl > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.result-more dt,
.result-more dd {
    margin: 0;
    font-size: 9px;
}

.result-more dt {
    color: #8f9da5;
}

.result-more dd {
    color: #d8dfe3;
}

.result-table--rated {
    min-width: 760px;
}

.results-start,
.data-quality-note {
    border-color: #d07359;
    background: #2a3640;
}

.empty-state,
.notice,
.error,
.success {
    border-color: #3d4a54;
    background: #29353f;
    color: #aeb9bf;
}

.ad-slot {
    border-color: #46535d;
    background: #26313a;
    color: #71818a;
}

.ad-slot--filled {
    position: relative;
    border: 1px solid rgba(132, 151, 162, .28);
    border-radius: 4px;
    background: #202a32;
    box-shadow: 0 4px 14px rgba(4, 10, 14, .1);
}

.ad-slot--filled > a {
    border-bottom: 0;
}

.ad-slot__label {
    position: absolute;
    z-index: 1;
    top: 5px;
    left: 6px;
    padding: 2px 5px;
    border-radius: 2px;
    background: rgba(17, 24, 29, .8);
    color: #b4bec4;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    pointer-events: none;
    text-transform: uppercase;
}

.page-rail:empty {
    display: none;
}

.content-with-rail:has(> .page-rail:empty) {
    grid-template-columns: minmax(0, 1fr);
}

.advertising-install {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.advertising-install p {
    margin: .3rem 0 0;
}

.advertising-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(18rem, .82fr);
    gap: 1rem;
    margin-top: 1rem;
    align-items: start;
}

.advertising-form {
    padding: 1rem;
}

.advertising-form .field small {
    display: block;
    margin-top: .3rem;
    color: var(--ink-faint);
    font-size: .68rem;
}

.advertising-creatives,
.advertising-placements {
    margin: 1.15rem 0 0;
    padding: 1rem 0 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.advertising-creatives > legend,
.advertising-placements > legend {
    padding: 0;
    color: #d9e0e3;
    font-size: .76rem;
    font-weight: 750;
}

.advertising-creatives {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, .48fr);
    gap: 1rem;
}

.advertising-creatives > legend {
    grid-column: 1 / -1;
}

.advertising-creatives label {
    display: block;
    margin-bottom: .45rem;
    color: var(--ink-soft);
    font-size: .7rem;
    font-weight: 700;
}

.advertising-creatives input[type="file"] {
    width: 100%;
    min-height: auto;
    padding: .55rem;
}

.advertising-creatives img {
    display: block;
    width: 100%;
    max-height: 9rem;
    margin-top: .7rem;
    object-fit: contain;
    object-position: left center;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #202a32;
}

.advertising-scope-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

.advertising-scope-primary > label,
.advertising-enabled {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #293640;
}

.advertising-scope-primary input,
.advertising-enabled input,
.advertising-placement-grid input {
    flex: 0 0 auto;
    margin-top: .16rem;
}

.advertising-scope-primary span,
.advertising-enabled span {
    display: grid;
    gap: .2rem;
}

.advertising-scope-primary small,
.advertising-enabled small {
    color: var(--ink-faint);
    font-size: .65rem;
}

.advertising-placements details,
.advertising-detail-stats {
    margin-top: .7rem;
    border-top: 1px solid rgba(82, 97, 107, .55);
}

.advertising-placements summary,
.advertising-detail-stats summary {
    padding: .7rem 0;
    color: #9fc0d4;
    cursor: pointer;
    font-size: .7rem;
}

.advertising-placement-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem 1rem;
    padding-bottom: .75rem;
}

.advertising-placement-grid label {
    color: var(--ink-soft);
    font-size: .68rem;
}

.advertising-enabled {
    margin-top: 1rem;
    border-color: rgba(103, 180, 131, .38);
    background: rgba(38, 61, 52, .62);
}

.advertising-sponsor-list > article {
    padding: .9rem;
    border-bottom: 1px solid var(--line);
}

.advertising-sponsor-list > article:last-child {
    border-bottom: 0;
}

.advertising-sponsor-head {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.ad-status {
    padding: .18rem .4rem;
    border-radius: 3px;
    background: #35424b;
    color: #a8b4ba;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ad-status--live {
    background: var(--green-wash);
    color: #83c89b;
}

.ad-status--scheduled {
    background: var(--amber-wash);
    color: #e0bd7b;
}

.ad-status--ended,
.ad-status--paused {
    background: #343e45;
    color: #929fa6;
}

.advertising-thumbnails {
    display: flex;
    gap: .45rem;
    margin-top: .7rem;
    max-height: 4rem;
}

.advertising-thumbnails img {
    min-width: 0;
    max-width: 75%;
    border: 1px solid var(--line);
    border-radius: 3px;
    object-fit: contain;
    background: #202a32;
}

.advertising-thumbnails img:last-child {
    max-width: 4.8rem;
}

.advertising-sponsor-list dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    margin: .8rem 0;
}

.advertising-sponsor-list dl div {
    min-width: 0;
}

.advertising-sponsor-list dt {
    color: var(--ink-faint);
    font-size: .58rem;
    text-transform: uppercase;
}

.advertising-sponsor-list dd {
    margin: .18rem 0 0;
    color: var(--ink);
    font-size: .68rem;
}

.advertising-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}

.advertising-actions form {
    margin: 0;
}

.advertising-actions > a:last-child {
    margin-left: auto;
    font-size: .66rem;
}

@media (max-width: 900px) {
    .advertising-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .advertising-install,
    .advertising-creatives,
    .advertising-scope-primary,
    .advertising-placement-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .advertising-sponsor-list dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* EU Cup is a Canine Athletics organization with point and team views. */
.eucup-event-page .event-summary,
.eucup-team-page .event-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.eucup-rule-note {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 5px 14px;
    margin: 8px 0;
}

.eucup-standings-grid,
.eucup-statistics-grid,
.eucup-team-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 10px;
    margin: 10px 0;
}

.eucup-event-page .eucup-standings-grid {
    grid-template-columns: 1fr;
}

.eucup-height-tabs {
    margin: 0;
    border-top: 0;
}

.eucup-individual-standings .table-wrap {
    max-height: 560px;
    overflow: auto;
}

.eucup-individual-class > h3 {
    margin: 0;
    padding: 9px 11px;
    border-top: 1px solid var(--divider);
    color: var(--text-soft);
    font-size: .76rem;
}

.rating-organization-stack {
    display: grid;
    gap: 10px;
}

.rating-inactive-state {
    margin: 10px 0;
    padding: 13px 15px;
    border-left: 2px solid var(--chart-accent);
    background: var(--surface-soft);
}

.rating-inactive-state p {
    max-width: 72ch;
    margin: 4px 0 0;
    color: var(--text-muted);
}

.guide-steps {
    display: grid;
    gap: 0;
    margin: 12px 0;
    padding: 0;
    list-style: none;
    counter-reset: guide-step;
}

.guide-steps li {
    display: grid;
    grid-template-columns: minmax(145px, .38fr) 1fr;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--divider);
    counter-increment: guide-step;
}

.guide-steps strong::before {
    content: counter(guide-step) '. ';
    color: var(--chart-accent);
}

.guide-steps span,
.eucup-rule-example p:last-child {
    color: var(--text-muted);
}

.guide-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 10px 0;
    border-block: 1px solid var(--divider);
}

.guide-comparison > div {
    display: grid;
    gap: 3px;
    padding: 12px;
}

.guide-comparison > div + div {
    border-left: 1px solid var(--divider);
}

.guide-comparison span {
    color: var(--text-muted);
}

.eucup-rule-example {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 22px;
    padding: 4px 12px 13px;
}

.eucup-rule-example p {
    margin: 0;
}

.eucup-rule-example p:last-child {
    grid-column: 1 / -1;
}

@media (max-width: 620px) {
    .guide-steps li,
    .eucup-rule-example {
        grid-template-columns: 1fr;
    }

    .guide-comparison {
        grid-template-columns: 1fr;
    }

    .guide-comparison > div + div {
        border-top: 1px solid var(--divider);
        border-left: 0;
    }
}

.eucup-individual-standings > summary,
.eucup-rule-list details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 11px;
    cursor: pointer;
    color: var(--text-main);
}

.eucup-individual-standings > summary span,
.eucup-rule-list details > summary span:first-child {
    display: grid;
    gap: 2px;
}

.eucup-individual-standings > summary small,
.eucup-rule-list details > summary small {
    color: var(--text-muted);
    font-weight: 500;
}

.eucup-rule-list {
    border-top: 1px solid var(--divider);
}

.eucup-rule-list details {
    border-bottom: 1px solid var(--divider);
}

.eucup-rule-list details[open] > summary {
    color: var(--chart-accent);
}

.eucup-rule-list .compact-facts {
    margin: 0 11px 10px;
}

.result-points strong,
.eucup-team-standings td:last-child strong {
    color: var(--green);
}

.dog-result-section .result-value small,
.dog-result-section td.numeric small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

@media (max-width: 820px) {
    .eucup-standings-grid,
    .eucup-statistics-grid,
    .eucup-team-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .eucup-event-page .event-summary,
    .eucup-team-page .event-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .eucup-rule-note {
        grid-template-columns: 1fr;
    }
}

/* Shared rule and integrity controls. These use the same restrained data
   surfaces in both themes and avoid introducing another panel style. */
.safe-fix-form,
.integrity-field-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface-soft);
}

.safe-fix-form label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-soft);
}

.safe-fix-form button {
    margin-left: auto;
}

.integrity-field-summary > span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: var(--text-muted);
}

.integrity-field-summary strong {
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.integrity-event-queue {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--divider);
}

.integrity-event-queue a {
    border-bottom: 1px solid var(--divider-strong);
}

.integrity-comparison-table td {
    vertical-align: top;
}

.integrity-comparison-table td small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
}

.integrity-row--safe td:first-child {
    box-shadow: inset 2px 0 0 var(--green);
}

.integrity-row--blocked td:first-child {
    box-shadow: inset 2px 0 0 var(--amber);
}

.rule-status {
    display: inline-block;
    color: var(--text-soft);
    text-transform: capitalize;
}

.rule-status--confirmed {
    color: var(--green);
}

.rule-status--review_required {
    color: var(--amber);
}

.rule-status--retired {
    color: var(--text-muted);
}

.admin-derived-fields output {
    display: block;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--divider);
    background: var(--surface-soft);
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .safe-fix-form {
        align-items: stretch;
        flex-direction: column;
    }

    .safe-fix-form button {
        margin-left: 0;
    }
}

.scorebook-tip {
    border: 1px solid #37444e;
    border-left: 3px solid rgba(224, 106, 74, .72);
    background: #29353f;
    box-shadow: 0 3px 12px rgba(4, 10, 14, .08);
}

.scorebook-tip > span {
    border-right-color: #3d4a54;
    color: #9ba8af;
}

.scorebook-tip p {
    color: #b7c1c6;
}

.scorebook-tip__progress {
    background: rgba(255, 255, 255, .035);
}

.scorebook-tip__progress i {
    background: #d87358;
}

.dog-performance-details > summary,
.performance-development > summary {
    border-bottom-color: #3b4852;
    background: #26323b;
    color: var(--ink);
}

.dog-records {
    border-bottom-color: #3b4852;
    background: #26323b;
    color: var(--ink);
}

.dog-records > summary {
    color: #b9c5ca;
}

.dog-records__grid {
    background: #3b4852;
}

.dog-records__grid > div {
    background: #2b3741;
}

.dog-rating-card__head > span {
    display: grid;
    gap: 1px;
}

.dog-rating-card__source {
    color: #7f8e97;
    font-size: 9px;
    font-weight: 500;
}

.lookup-results,
.lookup-results button,
.lookup-results__empty {
    border-color: #3b4852;
    background: #26323b;
    color: #d8dfe3;
}

.lookup-results button:hover {
    background: #354550;
}

.check-field,
.check-line,
.sport-preference-option,
.filter-details,
.filter-details__grid,
fieldset {
    border-color: #3b4852;
    background-color: #27333c;
    color: #c8d1d5;
}

.dog-directory {
    border-color: #394650;
    background: #29353f;
}

.dog-directory__entry,
.profile-dog,
.profile-dog--favorite {
    border-color: #3b4852;
    background: #2b3741;
}

.dog-directory__entry:nth-child(even),
.profile-dog:nth-child(even) {
    background: #2d3944;
}

.dog-directory__entry:hover,
.profile-dog:hover {
    border-color: #465660;
    background: #354550;
    box-shadow: 0 5px 17px rgba(4, 10, 14, .13);
}

.dog-directory__photo,
.profile-dog__photo,
.dog-identity__photo,
.dog-identity__placeholder {
    border-color: #46545e;
    background: #212c34;
    color: #8fa7b5;
}

.dog-directory__identity strong,
.profile-dog__body h3,
.dog-identity h1 {
    color: #e0e6e9;
}

.dog-directory__identity small,
.profile-dog__body p,
.dog-registered-name,
.dog-country-label,
.profile-dog__registered {
    color: #92a0a8;
}

.country-flag {
    display: inline-flex;
    width: 16px;
    min-width: 16px;
    height: 11px;
    margin-right: .38em;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(4, 10, 14, .2);
    vertical-align: -.08em;
}

.country-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.country-flag--emoji {
    border: 0;
    overflow: visible;
    font-size: 14px;
    line-height: 1;
    box-shadow: none;
}

.country-flag--profile.country-flag--emoji {
    font-size: 19px;
}

.country-flag--profile {
    width: 22px;
    min-width: 22px;
    height: 15px;
    margin-right: .46em;
    vertical-align: .02em;
}

.dog-country-label {
    margin-top: .25rem;
    font-size: .72rem;
}

.result-dog {
    color: #a4c5da;
}

.rating-table .rating-dog {
    display: table-cell;
    vertical-align: middle;
}

.rating-table .rating-dog .result-dog {
    display: inline-flex;
    width: auto;
    align-items: center;
}

.rating-spark {
    display: block;
    width: 64px;
    height: 28px;
    border-bottom: 0;
}

.rating-spark canvas,
.dog-activity-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-frame,
.chart-panel,
.year-chart,
.scatter-chart,
.performance-chart {
    border-color: #394650;
    background: #27333c;
}

.technical-chart,
.scorebook-line-chart,
.dog-activity-chart {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .015), transparent),
        #27333c;
}

.dog-activity-chart {
    position: relative;
    overflow: visible;
}

.dog-chart-data {
    grid-column: 1 / -1;
}

.dog-chart-data[open] {
    margin-top: 5px;
}

.technical-chart,
.scorebook-line-chart {
    position: relative;
    overflow: hidden;
}

.scorebook-line-chart {
    height: 238px;
    padding: 8px 10px 4px;
}

.scorebook-line-chart canvas,
.technical-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.scorebook-line-chart canvas.is-rendered,
.technical-chart canvas.is-rendered,
.rating-spark canvas.is-rendered,
.dog-activity-chart canvas.is-rendered {
    animation: scorebook-chart-in .42s ease-out both;
}

.chart-current,
.chart-note {
    border-top-color: #3b4852;
    background: #26323b;
    color: #8f9da5;
}

.chart-current strong {
    color: var(--chart-accent);
}

.chart-toolbar {
    border-bottom: 1px solid #35434d;
    background: #27333c;
}

.chart-toolbar button {
    border-color: transparent;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #93a1a9;
    box-shadow: none;
}

.chart-toolbar button:hover {
    border-color: transparent;
    border-bottom-color: rgba(255, 83, 0, .45);
    background: rgba(255, 83, 0, .06);
    color: #dce3e6;
}

.year-chart__grid,
.chart-grid-line,
.guide-bar-track {
    border-color: #43515b;
    background: #212c34;
}

.chart-toolbar button.is-active {
    border-color: transparent;
    border-bottom-color: var(--chart-accent);
    background: rgba(255, 83, 0, .08);
    color: #ff8a52;
}

.dog-chart-row {
    min-height: 58px;
    border-bottom-color: #3b4852;
}

.dog-chart-row > span {
    display: grid;
    gap: 2px;
}

.dog-chart-row > span strong {
    color: #cbd4d8;
    font-size: 9px;
}

.dog-chart-row > span small {
    color: #ff8650;
    font-size: 8px;
}

.dog-activity-chart {
    height: 44px;
}

.guide-bar-track {
    height: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #202a32;
}

.guide-bar-track i,
.rating-weights i {
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4300, var(--chart-accent));
    box-shadow: 0 0 8px rgba(255, 83, 0, .18);
}

@keyframes scorebook-chart-in {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rating-value--positive,
.rating-move.is-up,
.rating-delta.is-up {
    color: var(--green) !important;
}

.rating-value--neutral,
.rating-move.is-even {
    color: var(--text-main) !important;
}

.rating-value--negative,
.rating-move.is-down,
.rating-delta.is-down {
    color: var(--danger) !important;
}

.guide-index,
.guide-article__body,
.guide-article__lead {
    border-color: #37444e;
    background: #2a3640;
}

.guide-index > a:hover,
.about-guide-links a:hover {
    background: #31404b;
}

.rating-guide__flow,
.rating-guide__grid,
.rating-guide__sport-grid,
.guide-formula-flow,
.guide-callout,
.guide-callout-grid > article {
    border-color: #3b4852;
    background: #29353f;
}

.rating-guide__flow > div > span {
    background: #4e6675;
}

.about-document {
    background: #2a3640;
    box-shadow: 0 5px 22px rgba(4, 10, 14, .15);
}

.about-facts,
.about-section,
.about-guide-links,
.about-guide-links a {
    border-color: #3b4852;
}

.about-hero p,
.about-section p,
.about-contact p,
.about-facts span,
.about-guide-links span {
    color: #9aa7ae;
}

.about-database-totals span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.about-database-totals small {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.about-database-totals strong {
    color: var(--text-main);
    font-size: 18px;
    font-weight: 800;
}

.admin-navigation {
    border-bottom-color: #3a4751;
    background: rgba(34, 45, 53, .97);
}

.admin-navigation a:hover,
.admin-navigation a.is-active {
    border-bottom-color: #e06a4a;
    background: #2c3943;
    color: #edf1f3;
}

.ewpl-panel,
.ewpl-install {
    background: #2a3640;
}

.ewpl-panel__header {
    border-bottom-color: #3b4852;
    background: #25313a;
}

.ewpl-live-progress,
.ewpl-owner-new {
    border-color: #40505a;
    background: #27343d;
}

.ewpl-safety,
.ewpl-status,
.ewpl-event-state {
    background: #34414a;
    color: #b3bdc2;
}

.ewpl-status--ready,
.ewpl-event-state--ready,
.ewpl-status--live,
.ewpl-event-state--live {
    background: #2b5540;
    color: #b9ebca;
}

.ewpl-status--attention,
.ewpl-status--proposed,
.ewpl-event-state--attention {
    background: #554a2d;
    color: #ead39b;
}

.ewpl-status--danger {
    background: #573633;
    color: #efb0aa;
}

.ewpl-status--closed,
.ewpl-event-state--closed {
    background: #36424a;
    color: #9aa7ae;
}

.ewpl-candidates article,
.ewpl-event-metrics div,
.ewpl-data-list div,
.ewpl-tech-grid details,
.ewpl-owner-candidates > div {
    border-color: #3b4852;
    background: #2c3842;
}

.ewpl-candidates article.is-leading,
.ewpl-candidates article.is-selected,
.ewpl-final-map {
    border-color: #56856a;
    background: #2a4036;
}

.site-footer {
    border-top-color: #38454f;
    background: #1e2931;
}

.footer-brand,
.site-footer p,
.site-footer nav a,
.site-footer__legal,
.site-footer__legal a {
    color: #9ca9b0;
}

@media (max-width: 1040px) {
    .main-navigation {
        border-color: #43515b;
        background: #2a3842;
        box-shadow: 0 14px 30px rgba(3, 9, 13, .35);
    }

    .sport-view {
        margin-left: auto;
    }
}

@media (max-width: 720px) {
    .brand__wordmark {
        display: none;
    }

    .brand__mark {
        width: 32px;
        height: 32px;
        margin-right: 0;
    }

    .sport-view__focus select {
        width: min(43vw, 148px);
    }

    .sport-source-switcher {
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
    }

    .sport-source-switcher select {
        width: 100%;
    }

    .site-atmosphere {
        height: 5.5rem;
        background-position: 68% 56%;
    }

    .site-atmosphere + .page-shell,
    .site-atmosphere + .database-shell {
        margin-top: -1rem;
    }

    .database-shell > .container,
    .page-shell {
        border-inline: 0;
        box-shadow: none;
    }

    .country-flag {
        margin-right: .32em;
    }
}

/* Duplicate comparison keeps large datasets searchable and the decision visible. */
.merge-form {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.merge-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.merge-picker {
    position: relative;
    padding: 13px;
    border: 1px solid var(--divider);
    border-top: 2px solid var(--divider-strong);
    border-radius: 5px;
    background: var(--surface-bg);
}

.merge-picker--remove { border-top-color: var(--red); }
.merge-picker--keep { border-top-color: var(--green); }

.merge-picker > header {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 12px;
}

.merge-picker > header > span {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-main);
    font-weight: 800;
}

.merge-picker > header strong,
.merge-picker > header small,
.merge-record-preview__title strong,
.merge-record-preview__title small {
    display: block;
}

.merge-picker > header small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 500;
}

.merge-picker .field { margin: 0; }
.merge-picker .lookup-results { top: 103px; right: 13px; left: 13px; z-index: 8; }

.merge-record-preview {
    min-height: 104px;
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid var(--divider);
    color: var(--text-muted);
}

.merge-record-preview > p { margin: 0; }

.merge-record-preview__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.merge-record-preview__title img {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
}

.merge-record-preview__title small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.merge-record-preview dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 9px;
}

.merge-record-preview dl > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 7px;
    border-bottom: 1px solid var(--divider);
}

.merge-record-preview dt { color: var(--text-muted); }
.merge-record-preview dd { margin: 0; color: var(--text-main); text-align: right; }
.merge-confirmation { margin-top: 12px; padding: 10px 0; border-block: 1px solid var(--divider); }

@media (max-width: 760px) {
    .merge-picker-grid { grid-template-columns: 1fr; }
    .merge-record-preview dl { grid-template-columns: 1fr; }
}

.database-number-check .panel-header {
    align-items: center;
}

.database-number-check .panel-header p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 500;
}

.database-number-check__summary,
.database-number-check__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 10px 0;
    border-block: 1px solid var(--divider);
}

.database-number-check__summary {
    justify-content: space-between;
    margin-top: 10px;
}

.database-number-check__sources span {
    display: grid;
    gap: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.database-number-check__sources strong {
    color: var(--text-main);
    font-size: 10px;
}

.database-number-check td small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
}

.number-recovery {
    display: grid;
    gap: 2px;
    margin-top: 7px;
    padding: 7px 9px;
    border-left: 2px solid var(--divider-strong);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 9.5px;
}

.number-recovery strong {
    color: var(--text-main);
}

.number-recovery--matched {
    border-left-color: var(--green);
}

.number-recovery--matched strong {
    color: var(--green);
}

.number-recovery--ambiguous {
    border-left-color: var(--amber);
}

@media (max-width: 640px) {
    .database-number-check .panel-header {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Home news, record dogs and current-form lists. */
.home-dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 14px;
}

.home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 1px 9px;
    border-bottom: 1px solid var(--divider-strong);
}

.home-section-heading div {
    display: grid;
    gap: 1px;
}

.home-section-heading span {
    color: var(--chart-accent);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.home-section-heading h2 {
    margin: 0;
    font-size: 17px;
}

.home-section-heading > a {
    color: var(--text-muted);
    font-size: 10px;
}

.home-news-featured {
    display: grid;
    align-items: start;
    min-height: 175px;
    border-bottom: 1px solid var(--divider);
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--surface-raised) 88%, transparent), var(--surface-soft));
}

.home-news-featured.has-image {
    grid-template-columns: minmax(260px, 1.35fr) minmax(230px, .9fr);
}

.home-news-featured > img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    align-self: start;
    object-fit: cover;
    object-position: center;
}

.home-news-featured > div {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 20px;
}

.home-news-featured h3 {
    margin: 7px 0 8px;
    font-size: clamp(18px, 2.1vw, 25px);
    line-height: 1.12;
}

.home-news-featured h3 a {
    color: inherit;
    text-decoration: none;
}

.home-news-featured h3 a:hover {
    color: var(--link-hover);
}

.home-news-featured p {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 11.5px;
    line-height: 1.55;
}

.home-news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
}

.home-news-meta span {
    color: var(--chart-accent);
}

.home-news-action,
.home-news-body > summary {
    color: var(--link-color);
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.home-news-body {
    width: 100%;
}

.home-news-body > summary {
    list-style: none;
}

.home-news-body > summary::before {
    content: "+ ";
    color: var(--chart-accent);
}

.home-news-body[open] > summary::before {
    content: "- ";
}

.home-news-body > div,
.home-news-row__body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--divider);
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.65;
}

.home-news-list {
    border-bottom: 1px solid var(--divider);
}

.home-news-row,
.home-news-row > summary {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 13px;
}

.home-news-row {
    padding: 9px 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--divider) 78%, transparent);
    color: var(--text-main);
    text-decoration: none;
}

details.home-news-row {
    display: block;
}

.home-news-row > summary {
    list-style: none;
    cursor: pointer;
}

.home-news-row:last-child {
    border-bottom: 0;
}

.home-news-row:hover,
.home-news-row[open] {
    background: color-mix(in srgb, var(--row-hover) 58%, transparent);
}

.home-news-row__meta {
    display: grid;
    gap: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.home-news-row__meta b {
    overflow: hidden;
    color: var(--chart-accent);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-news-row strong {
    font-size: 12px;
}

.home-news-row small {
    grid-column: 2;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-news-row i {
    grid-column: 3;
    grid-row: 1 / span 2;
    color: var(--link-color);
    font-size: 9px;
    font-style: normal;
}

.home-activity {
    margin-top: 18px;
}

.home-activity .compact-event-list {
    border-bottom: 1px solid var(--divider);
}

.home-dog-spotlight {
    overflow: hidden;
    border: 1px solid var(--divider);
    border-radius: 5px;
    background: var(--surface-bg);
}

.home-dog-spotlight__stage {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--control-bg);
}

.home-dog-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
}

.home-dog-slide[hidden] {
    display: none;
}

.home-dog-slide.is-active {
    animation: dog-spotlight-in .42s ease both;
}

.home-dog-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 6.8s ease;
}

.home-dog-slide.is-active > img {
    transform: scale(1.035);
}

.home-dog-slide__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(7, 12, 16, .18) 52%, rgba(7, 12, 16, .94) 100%);
}

.home-dog-slide__copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 3px;
    padding: 40px 13px 14px;
}

.home-dog-slide__copy small {
    color: #d4dde1;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.home-dog-slide__copy strong {
    color: #fff;
    font-size: 19px;
}

.home-dog-slide__copy b {
    color: #ff7840;
    font-size: 12px;
}

.home-dog-spotlight__navigation {
    position: absolute;
    z-index: 3;
    top: 9px;
    right: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 4px;
    background: rgba(8, 14, 18, .58);
    color: #e7ecef;
    font-size: 9px;
    backdrop-filter: blur(5px);
}

.home-dog-spotlight__navigation button {
    width: 25px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 19px;
    line-height: 1;
}

.home-dog-spotlight__navigation button:hover,
.home-dog-spotlight__navigation button:focus-visible {
    background: rgba(255, 255, 255, .12);
}

.home-dog-spotlight__navigation > span {
    min-width: 37px;
    text-align: center;
}

.home-dog-spotlight__controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 8px;
}

.home-dog-spotlight__controls button {
    width: 18px;
    height: 3px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: var(--divider-strong);
}

.home-dog-spotlight__controls button.is-active {
    background: var(--chart-accent);
}

@keyframes dog-spotlight-in {
    from { opacity: .25; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.home-rating-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-rating-list > li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 45px;
    padding: 6px 9px;
    border-bottom: 1px solid var(--divider);
}

.home-rating-list > li:last-child {
    border-bottom: 0;
}

.home-rating-list > li > span:first-child {
    color: var(--text-muted);
    font-size: 10px;
}

.home-rating-list > li > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.home-rating-list a {
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-rating-list small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-rating-list strong {
    font-size: 13px;
}

.home-trending-list > li {
    grid-template-columns: 20px minmax(0, 1fr) 58px auto;
}

.home-trend-rating {
    color: var(--text-muted);
    font-size: 9px;
}

.home-trending-list .is-up {
    color: var(--green);
    font-size: 10px;
}

.home-rating-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px;
    color: var(--text-muted);
    font-size: 9px;
}

.home-rating-loading i {
    position: relative;
    width: 34px;
    height: 3px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--divider);
}

.home-rating-loading i::after {
    position: absolute;
    inset: 0;
    content: "";
    background: var(--chart-accent);
    transform: translateX(-100%);
    animation: home-rating-load 1.15s ease-in-out infinite;
}

@keyframes home-rating-load {
    50% { transform: translateX(30%); }
    100% { transform: translateX(100%); }
}

/* News administration. */
.admin-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
    gap: 12px;
}

.admin-news-form fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 13px;
    border: 0;
    border-bottom: 1px solid var(--divider);
}

.admin-news-form legend {
    width: 100%;
    padding: 0 0 7px;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}

.admin-news-form .field--full,
.admin-news-form .form-help,
.admin-news-form .news-sport-options {
    grid-column: 1 / -1;
}

.admin-news-form .form-help {
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
}

.news-sport-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.news-sport-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid var(--divider);
    background: var(--surface-soft);
    cursor: pointer;
}

.admin-news-image-preview {
    grid-column: 1 / -1;
    width: min(100%, 460px);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.admin-news-form .form-actions,
.admin-news-delete {
    padding: 12px;
}

.admin-news-delete {
    border-top: 1px solid var(--divider);
}

.panel-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-editor > label {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .025em;
}

.news-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin-top: 5px;
    padding: 4px;
    border: 1px solid var(--divider);
    border-bottom: 0;
    background: var(--surface-soft);
}

.news-editor__toolbar button {
    width: auto;
    min-width: 31px;
    min-height: 28px;
    padding: 4px 8px;
    border: 0;
    border-right: 1px solid var(--divider);
    border-radius: 2px;
    background: transparent;
    color: var(--text-soft);
    font-size: 10px;
}

.news-editor__toolbar button:hover,
.news-editor__toolbar button:focus-visible {
    background: var(--row-hover);
    color: var(--text-main);
}

.news-editor textarea {
    min-height: 360px;
    border-color: var(--divider);
    line-height: 1.65;
    resize: vertical;
}

.news-editor > small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 9.5px;
}

/* News stories use a calm editorial reading width instead of expanding inside
   the narrow home-page feature. */
.news-story-page > .container {
    width: min(100% - 24px, 1120px);
}

.news-story {
    max-width: 900px;
    margin: 18px auto 44px;
    padding: 0 0 28px;
    border-top: 2px solid var(--chart-accent);
    background: var(--shell-bg);
    box-shadow: 0 16px 42px rgba(5, 11, 15, .18);
}

.news-story__back {
    display: inline-block;
    margin: 15px 30px 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}

.news-story__header {
    max-width: 760px;
    margin: 0 auto;
    padding: 30px 34px 27px;
}

.news-story__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 750;
}

.news-story__meta span,
.news-story__meta strong {
    color: var(--chart-accent);
}

.news-story__header h1 {
    max-width: 22ch;
    margin: 0;
    color: var(--text-main);
    font-size: clamp(26px, 3.5vw, 38px);
    line-height: 1.08;
    letter-spacing: -.025em;
}

.news-story__lead {
    max-width: 66ch;
    margin: 17px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.news-story__image {
    margin: 0;
    background: var(--surface-soft);
}

.news-story__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.news-story__body {
    max-width: 700px;
    margin: 0 auto;
    padding: 34px 34px 12px;
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.82;
}

.news-story__body p {
    margin: 0 0 1.45em;
}

.news-story__body h2,
.news-story__body h3 {
    position: relative;
    margin: 2em 0 .72em;
    color: var(--text-main);
    line-height: 1.3;
}

.news-story__body h2 {
    padding-top: 13px;
    border-top: 1px solid var(--divider);
    font-size: 19px;
}

.news-story__body h2::before {
    position: absolute;
    top: -1px;
    left: 0;
    width: 72px;
    height: 2px;
    content: '';
    background: var(--chart-accent);
}

.news-story__body h3 {
    font-size: 15px;
}

.news-story__body a {
    color: var(--link-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.news-story__body u {
    text-decoration-color: color-mix(in srgb, var(--chart-accent) 72%, transparent);
    text-underline-offset: 3px;
}

.news-story__body ul,
.news-story__body ol {
    margin: 0 0 1.5em;
    padding-left: 1.45em;
}

.news-story__body li {
    margin: .42em 0;
    padding-left: .25em;
}

.news-story__body li::marker {
    color: var(--chart-accent);
    font-weight: 800;
}

.news-story__body blockquote {
    margin: 1.8em 0;
    padding: 16px 19px;
    border-left: 3px solid var(--chart-accent);
    background: var(--surface-soft);
    color: var(--text-main);
    font-size: 14px;
}

.news-story__body blockquote p:last-child {
    margin-bottom: 0;
}

.news-story__body hr {
    height: 1px;
    margin: 2.3em 0;
    border: 0;
    background: var(--divider);
}

.news-story__source,
.news-story__footer {
    max-width: 700px;
    margin-inline: auto;
}

.news-story__source {
    padding: 0 34px 18px;
}

.news-story__footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding: 16px 34px 0;
    border-top: 1px solid var(--divider);
    color: var(--text-muted);
    font-size: 10px;
}

.news-story-missing {
    padding: 48px 0;
}

.news-story-missing > span {
    color: var(--chart-accent);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 680px) {
    .news-story-page > .container {
        width: 100%;
    }

    .news-story {
        margin-top: 0;
        box-shadow: none;
    }

    .news-story__back {
        margin-inline: 18px;
    }

    .news-story__header,
    .news-story__body,
    .news-story__source,
    .news-story__footer {
        padding-inline: 18px;
    }

    .news-story__header {
        padding-top: 24px;
    }

    .news-story__header h1 {
        font-size: 27px;
    }

    .news-story__body {
        font-size: 13px;
        line-height: 1.75;
    }

    .news-editor__toolbar button {
        min-width: 29px;
        padding-inline: 7px;
    }
}

.admin-news-list > a {
    display: grid;
    gap: 3px;
    padding: 10px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-main);
    text-decoration: none;
}

.admin-news-list > a:hover,
.admin-news-list > a.is-active {
    background: var(--row-hover);
}

.admin-news-list > a.is-active {
    box-shadow: inset 2px 0 var(--chart-accent);
}

.admin-news-list > a > span {
    display: flex;
    gap: 5px;
}

.admin-news-list > a b {
    color: var(--chart-accent);
    font-size: 8px;
    text-transform: uppercase;
}

.admin-news-list > a small {
    color: var(--text-muted);
    font-size: 9px;
}

@media (max-width: 900px) {
    .home-dashboard-grid,
    .admin-news-layout {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-sidebar > .ad-slot {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .home-news-featured.has-image {
        grid-template-columns: 1fr;
    }

    .home-news-featured > img {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .home-news-featured > div {
        padding: 14px 10px;
    }

    .home-news-row,
    .home-news-row > summary {
        grid-template-columns: 1fr auto;
        gap: 4px 9px;
    }

    .home-news-row__meta {
        grid-column: 1 / -1;
        display: flex;
        gap: 8px;
    }

    .home-news-row small {
        grid-column: 1;
    }

    .home-news-row i {
        grid-column: 2;
        grid-row: 2 / span 2;
    }

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

    .home-sidebar > .ad-slot {
        grid-column: auto;
    }

    .home-dog-spotlight {
        width: min(100%, 380px);
        justify-self: center;
    }

    .admin-news-form fieldset {
        grid-template-columns: 1fr;
    }

    .admin-news-form .field--full,
    .admin-news-form .form-help,
    .admin-news-form .news-sport-options {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-dog-slide.is-active {
        animation: none;
    }

    .home-dog-slide.is-active > img {
        transform: none;
    }

    .home-rating-loading i::after {
        animation: none;
        transform: none;
    }
}

/* Side-by-side dog comparison. */
.comparison-dog-grid {
    display: grid;
    grid-template-columns: repeat(var(--comparison-columns), minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 20px;
}

.comparison-dog-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--divider);
    border-radius: 5px;
    background: color-mix(in srgb, var(--surface-bg) 84%, var(--shell-bg));
}

.comparison-dog-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 48px;
    gap: 10px;
}

.comparison-dog-card > header small,
.comparison-dog-card > header span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
}

.comparison-dog-card > header a {
    display: block;
    margin: 2px 0;
    font-size: 16px;
    text-decoration: none;
}

.comparison-dog-card > header b {
    padding: 3px 5px;
    border-left: 2px solid var(--chart-accent);
    color: var(--text-soft);
    font-size: 9.5px;
    white-space: nowrap;
}

.comparison-rating {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    margin: 11px 0;
    padding: 9px 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.comparison-rating > span,
.comparison-rating > small {
    color: var(--text-muted);
    font-size: 10px;
}

.comparison-rating > strong {
    grid-row: span 2;
    align-self: center;
    font-size: 20px;
}

.comparison-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 12px;
}

.comparison-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 7px;
    border-bottom: 1px solid color-mix(in srgb, var(--divider) 70%, transparent);
}

.comparison-facts dt,
.comparison-facts dd {
    margin: 0;
    font-size: 10px;
}

.comparison-facts dt {
    color: var(--text-muted);
}

.comparison-chart {
    margin-top: 10px;
}

.comparison-chart h3 {
    margin: 0 0 5px;
    font-size: 10px;
    font-weight: 700;
}

.comparison-chart .scorebook-line-chart {
    height: 140px;
}

.comparison-chart .chart-data summary {
    padding: 6px 0 0;
}

.comparison-breakdown {
    margin-top: 18px;
    border-top: 1px solid var(--divider);
}

.comparison-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0 11px;
}

.comparison-section-heading span {
    color: var(--chart-accent);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.comparison-section-heading h2,
.comparison-section-heading p {
    margin: 0;
}

.comparison-section-heading h2 {
    font-size: 17px;
}

.comparison-section-heading p {
    color: var(--text-muted);
    font-size: 10.5px;
}

.comparison-discipline {
    border-top: 1px solid var(--divider);
}

.comparison-discipline > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 2px;
}

.comparison-discipline > header h3,
.comparison-discipline > header span {
    margin: 0;
    font-size: 11px;
}

.comparison-discipline > header span {
    color: var(--text-muted);
}

.comparison-discipline__dogs {
    display: grid;
    grid-template-columns: repeat(var(--comparison-columns), minmax(0, 1fr));
    gap: 1px;
    background: var(--divider);
}

.comparison-discipline-cell {
    min-width: 0;
    padding: 11px;
    background: var(--surface-bg);
}

.comparison-discipline-cell.is-best {
    background: color-mix(in srgb, var(--green-wash) 58%, var(--surface-bg));
}

.comparison-discipline-cell__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 18px;
}

.comparison-discipline-cell__title span,
.comparison-matrix td small {
    display: block;
    color: var(--green);
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.comparison-discipline-cell > strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 19px;
}

.comparison-discipline-cell > strong small {
    color: var(--text-muted);
    font-size: 9px;
}

.comparison-scorebar {
    height: 3px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--control-bg);
}

.comparison-scorebar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--chart-accent) 72%, transparent), var(--chart-accent));
}

.comparison-discipline-cell dl {
    margin: 0;
}

.comparison-discipline-cell dl > div {
    display: flex;
    justify-content: space-between;
    gap: 7px;
    padding: 4px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--divider) 62%, transparent);
}

.comparison-discipline-cell dt,
.comparison-discipline-cell dd {
    margin: 0;
    font-size: 9.5px;
}

.comparison-discipline-cell dt {
    color: var(--text-muted);
}

.comparison-matrix th:not(:first-child),
.comparison-matrix td:not(:first-child) {
    text-align: center;
}

.comparison-matrix td.is-best {
    background: color-mix(in srgb, var(--green-wash) 65%, var(--surface-bg));
}

@media (max-width: 820px) {
    .comparison-dog-grid,
    .comparison-discipline__dogs {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .comparison-dog-card,
    .comparison-discipline-cell {
        flex: 0 0 min(82vw, 330px);
        scroll-snap-align: start;
    }

    .comparison-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

.quality-grid a.is-active {
    border-color: var(--chart-accent);
    box-shadow: inset 0 -2px var(--chart-accent);
}

.quality-details > .panel-header > div p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
}

.quality-duplicate-groups > section + section {
    border-top: 1px solid var(--divider);
}

.quality-duplicate-groups > section > header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: var(--surface-soft);
}

.quality-duplicate-groups > section > header span {
    color: var(--text-muted);
    font-size: 10px;
}

.quality-duplicate-groups > section > a {
    display: grid;
    grid-template-columns: 65px minmax(150px, .7fr) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid color-mix(in srgb, var(--divider) 70%, transparent);
    color: var(--text-main);
    text-decoration: none;
}

.quality-duplicate-groups > section > a:hover {
    background: var(--row-hover);
}

.quality-duplicate-groups > section > a span,
.quality-duplicate-groups > section > a small {
    color: var(--text-muted);
}

.quality-duplicate-groups > section > a b {
    color: var(--link-color);
    font-size: 10px;
}

@media (max-width: 620px) {
    .quality-duplicate-groups > section > a {
        grid-template-columns: auto 1fr auto;
    }

    .quality-duplicate-groups > section > a small {
        grid-column: 2 / -1;
    }
}

/* Administration and EWPL review use the active theme surfaces throughout. */
.ewpl-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-color: var(--divider);
    background: transparent;
    color: var(--text-main);
}

.ewpl-flow > div + div {
    border-color: var(--divider);
}

.ewpl-flow span {
    background: var(--surface-soft);
    color: var(--text-muted);
}

.ewpl-event-summary {
    border-block: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
}

.ewpl-event-summary strong {
    color: var(--text-main);
}

.ledger-grid,
.admin-entity-grid {
    border-color: var(--divider);
}

.page-shell .ledger-panel,
.page-shell .card,
.admin-entity-grid > a {
    border-color: var(--divider);
    background: transparent;
    color: var(--text-main);
}

.page-shell .ledger-panel:nth-child(even),
.admin-entity-grid > a:nth-child(even) {
    background: color-mix(in srgb, var(--surface-soft) 48%, transparent);
}

.page-shell .ledger-panel p,
.page-shell .card p,
.admin-entity-grid span {
    color: var(--text-soft);
}

.admin-entity-grid > a:hover,
.page-shell .ledger-panel:hover {
    background: var(--row-hover);
}

.ewpl-event-picker {
    display: grid;
    gap: 7px;
}

.ewpl-event-picker > label,
.ewpl-manual-id > label {
    margin: 0;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 750;
}

.ewpl-event-picker .lookup-field {
    width: 100%;
}

.ewpl-event-picker__actions {
    display: flex;
    margin: 0 11px;
    padding: 8px 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--divider);
}

.ewpl-event-picker__actions form {
    margin: 0;
}

.ewpl-plain-help {
    padding-top: 8px;
    border-top: 1px solid var(--divider);
    color: var(--text-muted);
    font-size: 10px;
}

.ewpl-number-check > a {
    margin: 0 11px 11px;
}

.ewpl-number-issues {
    border-top: 1px solid var(--divider);
}

.ewpl-number-issues > a {
    display: grid;
    padding: 8px 11px;
    gap: 2px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-main);
    text-decoration: none;
}

.ewpl-number-issues > a:hover {
    background: var(--row-hover);
}

.ewpl-number-issues span,
.ewpl-row-event-summary small {
    color: var(--text-muted);
    font-size: 10px;
}

.ewpl-event-suggestions {
    border-top: 1px solid var(--divider);
}

.ewpl-event-suggestions > summary {
    padding: 8px 11px;
    color: var(--link-color);
    cursor: pointer;
    font-size: 10px;
}

.ewpl-fixed-event {
    display: grid;
    margin: 4px 0 10px;
    padding: 8px 0;
    gap: 2px;
    border-block: 1px solid var(--divider);
}

.ewpl-fixed-event > span {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

button:disabled,
.button:disabled {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-muted);
    opacity: .62;
}

html[data-theme="light"] .page-shell .ledger-panel,
html[data-theme="light"] .page-shell .card,
html[data-theme="light"] .admin-entity-grid > a,
html[data-theme="light"] .ewpl-event-picker,
html[data-theme="light"] .ewpl-fixed-event,
html[data-theme="light"] .ewpl-number-issues > a {
    color: var(--text-main);
}

@media (max-width: 720px) {
    .ewpl-flow {
        grid-template-columns: 1fr;
    }

    .ewpl-event-picker__actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* 3.0 statistics, comparison and event refinements. */
.section-tools,
.rating-view-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 36px;
    margin: 0 0 10px;
    border-bottom: 1px solid var(--divider);
}

.section-tools a,
.rating-view-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    border-bottom: 2px solid transparent;
    color: var(--text-soft);
    font-weight: 700;
    text-decoration: none;
}

.section-tools a:hover,
.section-tools a.is-active,
.rating-view-tabs a:hover,
.rating-view-tabs a.is-active {
    border-bottom-color: var(--chart-accent);
    color: var(--text-main);
}

.rating-view-tabs a span {
    color: var(--text-muted);
    font-size: 10px;
}

.dvs-statistics-panel {
    margin-top: 10px;
}

.dvs-all-scores {
    border-top: 1px solid var(--divider);
}

.dvs-all-scores > summary {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--link-color);
    cursor: pointer;
    font-weight: 700;
}

.comparison-picker {
    margin-bottom: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.comparison-picker__fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 10px;
}

.comparison-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    margin-bottom: 12px;
    background: var(--divider);
}

.comparison-summary article {
    padding: 12px;
    background: var(--surface-bg);
}

.comparison-summary article > a {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.comparison-summary dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    margin: 0;
}

.comparison-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--divider);
}

.comparison-summary dt,
.comparison-summary dd {
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
}

.comparison-summary dd {
    color: var(--text-main);
}

.home-welcome {
    align-items: end;
}

.home-welcome > div:first-child {
    max-width: 610px;
}

.home-welcome__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
}

.home-welcome__links a {
    border-bottom: 1px solid color-mix(in srgb, var(--link-color) 45%, transparent);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.home-welcome + .database-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.event-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 10px;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.event-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-right: 1px solid var(--divider);
}

.event-summary > div:last-child {
    border-right: 0;
}

.event-summary span {
    color: var(--text-muted);
    font-size: 10px;
}

.event-summary strong {
    color: var(--text-main);
    font-size: 15px;
}

.event-overview {
    display: block;
    margin-bottom: 10px;
    border: 0;
    border-bottom: 1px solid var(--divider);
    background: transparent;
}

.event-overview .definition-list--facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-overview .event-description {
    display: grid;
    grid-template-columns: minmax(120px, .34fr) minmax(0, 1fr);
    gap: 16px;
    border-top: 1px solid var(--divider);
}

.event-overview .event-description p {
    margin: 0;
}

@media (max-width: 900px) {
    .comparison-picker__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .section-tools,
    .rating-view-tabs {
        gap: 12px;
        overflow-x: auto;
    }

    .comparison-picker__fields {
        grid-template-columns: 1fr;
    }

    .home-welcome {
        align-items: stretch;
    }

    .home-welcome + .database-totals,
    .event-summary {
        grid-template-columns: 1fr;
    }

    .event-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--divider);
    }

    .event-summary > div:last-child {
        border-bottom: 0;
    }

    .event-overview .definition-list--facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-overview .event-description {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* 3.0 statistics disclosures, rating alignment and light-mode readability. */
.rating-table th:nth-child(6),
.rating-table td:nth-child(6) {
    width: 94px;
    text-align: center;
}

.rating-form {
    display: block;
    min-width: 72px;
    width: 72px;
    margin-inline: auto;
}

.rating-page .rating-titlebar {
    min-height: 52px;
    padding-block: 5px;
}

.rating-page .sport-context {
    min-height: 32px;
    margin-bottom: 4px;
    padding-block: 4px;
}

.rating-page .rating-controls {
    min-height: 38px;
    margin: 4px 0;
    padding: 4px 7px;
}

.rating-page .rating-summary {
    margin: 4px 0 6px;
}

.rating-page .rating-summary > div {
    min-height: 36px;
    padding-block: 4px;
}

.statistics-disclosure {
    margin: 9px 0;
    border-left: 2px solid color-mix(in srgb, var(--chart-accent) 78%, transparent);
}

.statistics-disclosure > summary {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 7px 10px;
    align-items: center;
    gap: 8px;
    list-style: none;
    border-bottom: 0;
    background: var(--surface-soft);
    color: var(--text-main);
    cursor: pointer;
}

.statistics-disclosure > summary::-webkit-details-marker {
    display: none;
}

.statistics-disclosure > summary::before {
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    color: var(--chart-accent);
    content: "›";
    font-size: 18px;
    line-height: 1;
    transition: transform .2s ease;
}

.statistics-disclosure[open] > summary {
    border-bottom: 1px solid var(--divider);
}

.statistics-disclosure[open] > summary::before {
    transform: rotate(90deg);
}

.statistics-disclosure > summary > span:first-of-type {
    display: grid;
    gap: 1px;
}

.statistics-disclosure > summary strong {
    color: var(--text-main);
    font-size: 11px;
}

.statistics-disclosure > summary small {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
}

.statistics-disclosure__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.statistics-disclosure__meta b {
    color: var(--text-soft);
    font-size: 9.5px;
}

.statistics-disclosure__meta i {
    color: var(--link-color);
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
}

.statistics-disclosure[open] .statistics-disclosure__meta i {
    font-size: 0;
}

.statistics-disclosure[open] .statistics-disclosure__meta i::after {
    content: "Close table";
    font-size: 9.5px;
}

.dog-load-progress {
    display: grid;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface-bg);
}

.dog-load-progress > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-soft);
    font-size: 10px;
}

.dog-load-progress__track {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--divider) 70%, transparent);
}

.dog-load-progress__track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e34700, var(--chart-accent));
    box-shadow: 0 0 9px var(--chart-accent-soft);
    transition: width .28s cubic-bezier(.2, .75, .25, 1);
}

.dog-load-progress small {
    color: var(--text-muted);
}

.dog-load-progress.is-complete > div strong,
.dog-load-progress.is-complete > div span {
    color: var(--green);
}

.dog-load-progress.has-error > div strong,
.dog-load-progress.has-error > div span {
    color: var(--danger);
}

html[data-theme="light"] .competition-group__header h2,
html[data-theme="light"] .competition-group__header h2 a,
html[data-theme="light"] .event-result-section__header > h3,
html[data-theme="light"] .panel-header h2,
html[data-theme="light"] .result-dog,
html[data-theme="light"] .compact-event-list strong,
html[data-theme="light"] .performance-list strong,
html[data-theme="light"] .compact-ranking a {
    color: var(--text-main);
}

html[data-theme="light"] .competition-group__header > time,
html[data-theme="light"] .competition-group__header span,
html[data-theme="light"] .competition-group__header > strong,
html[data-theme="light"] .competition-group__toggle {
    color: var(--text-soft);
}

html[data-theme="light"] .panel-header a,
html[data-theme="light"] .table-guide-link,
html[data-theme="light"] .subtle-link,
html[data-theme="light"] .result-more > summary,
html[data-theme="light"] .chart-data > summary {
    color: var(--link-color);
}

html[data-theme="light"] .panel-header span,
html[data-theme="light"] .panel-header__meta,
html[data-theme="light"] .compact-event-list small,
html[data-theme="light"] .performance-list small {
    color: var(--text-muted);
}

html[data-theme="light"] table tbody tr:hover a,
html[data-theme="light"] .dense-table tbody tr:hover a,
html[data-theme="light"] .admin-table tbody tr:hover a {
    color: var(--link-hover);
}

html[data-theme="light"] .statistics-disclosure > summary,
html[data-theme="light"] .dog-load-progress {
    background: #d9e1e4;
}

@media (max-width: 720px) {
    .statistics-disclosure > summary {
        grid-template-columns: 16px minmax(0, 1fr);
    }

    .statistics-disclosure__meta {
        grid-column: 2;
        justify-content: space-between;
    }
}

/* 3.0 unified component system ------------------------------------------------
   Semantic tokens below are the active source of truth for both themes. */

body {
    min-width: 0;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.48;
}

html[data-theme="light"] body {
    background-image: radial-gradient(circle at 50% -15rem, rgba(92, 116, 129, .15), transparent 44rem);
}

.page-shell,
.database-shell > .container {
    border-color: color-mix(in srgb, var(--divider) 68%, transparent);
    background: var(--shell-bg);
    box-shadow: 0 0 34px color-mix(in srgb, var(--page-bg) 65%, rgba(3, 9, 13, .22));
}

.page-header h1,
.page-titlebar h1,
.dashboard-header h1 {
    letter-spacing: -.025em;
}

.page-header p,
.page-titlebar p,
.lede,
.panel-copy,
.about-section p,
.guide-article__body p,
.guide-article__lead p {
    font-size: 13px;
    line-height: 1.62;
}

.eyebrow,
label,
th,
.dense-table th,
.panel-header span,
.small,
small {
    font-size: 10px;
}

td,
.dense-table td,
.admin-table td,
input,
select,
textarea,
button,
.button {
    font-size: 11.5px;
}

/* Animated and accessible theme control. */
.theme-toggle {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    min-height: 28px;
    padding: 2px;
    place-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.theme-toggle__track {
    position: relative;
    display: block;
    width: 42px;
    height: 22px;
    overflow: hidden;
    border: 1px solid #64747e;
    border-radius: 12px;
    background: #202b33;
    transition: border-color .25s ease, background-color .25s ease;
}

.theme-toggle__thumb {
    position: absolute;
    z-index: 3;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #dce4e8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .25s ease;
}

.theme-toggle__sun,
.theme-toggle__moon {
    position: absolute;
    z-index: 2;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: opacity .25s ease, transform .35s ease;
}

.theme-toggle__sun {
    left: 6px;
    background: #f2a34d;
    box-shadow: 0 -4px 0 -3px #f2a34d, 0 4px 0 -3px #f2a34d, 4px 0 0 -3px #f2a34d, -4px 0 0 -3px #f2a34d;
    opacity: .25;
    transform: rotate(-35deg) scale(.75);
}

.theme-toggle__moon {
    right: 6px;
    background: #b9c9d2;
    box-shadow: 3px -2px 0 0 #202b33;
}

html[data-theme="light"] .theme-toggle__track {
    border-color: #9aaab3;
    background: #e2eaee;
}

html[data-theme="light"] .theme-toggle__thumb {
    background: #fff8e8;
    transform: translateX(20px);
}

html[data-theme="light"] .theme-toggle__sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="light"] .theme-toggle__moon {
    opacity: .25;
    box-shadow: 3px -2px 0 0 #e2eaee;
    transform: rotate(28deg) scale(.78);
}

/* Global sport context and organization selector. */
.sport-context {
    display: flex;
    min-height: 38px;
    margin: 0 0 10px;
    padding: 7px 9px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-block: 1px solid var(--divider);
    background: transparent;
}

.sport-context p {
    display: flex;
    margin: 0;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-muted);
    font-size: 10.5px;
}

.sport-context p span {
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sport-context p strong {
    color: var(--text-main);
    font-size: 11.5px;
}

.sport-context p b {
    color: var(--red);
}

.sport-context p em {
    color: var(--text-soft);
    font-style: normal;
}

.sport-context form {
    display: flex;
    margin: 0;
    align-items: center;
    gap: 7px;
}

.sport-context label {
    margin: 0;
    color: var(--text-muted);
}

.sport-context select {
    width: min(330px, 34vw);
    min-height: 29px;
}

.sport-source-switcher-submit {
    min-height: 29px;
    padding: 5px 9px;
}

.reveal-ready .sport-source-switcher-submit {
    display: none;
}

.rating-availability {
    display: grid;
    gap: 3px;
    margin: 8px 0 0;
    padding: 18px 2px;
    border-block: 1px solid var(--divider);
}

.rating-availability strong {
    color: var(--text-main);
    font-size: .82rem;
}

.rating-availability p {
    max-width: 68ch;
    margin: 0;
    color: var(--text-muted);
}

/* Dog profiles keep one score visible and move the deeper rating matrix behind
   a deliberate disclosure. Result history follows the same compact pattern. */
.dog-rating-summary {
    margin: 8px 0;
}

.dog-rating-summary__headline {
    display: flex;
    min-height: 54px;
    padding: 9px 11px;
    align-items: center;
    gap: 14px;
}

.dog-rating-summary__headline > div {
    display: flex;
    min-width: 150px;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.dog-rating-summary__headline span {
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.dog-rating-summary__headline strong {
    font-size: 1.32rem;
}

.dog-rating-summary__headline p {
    margin: 0;
    color: var(--text-muted);
}

.dog-rating-details {
    border-top: 1px solid var(--divider);
}

.dog-rating-details > summary,
.dog-result-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}

.dog-rating-details > summary {
    padding: 8px 11px;
    color: var(--link-color);
    font-weight: 750;
}

.dog-rating-details > summary::before,
.dog-result-section > summary::before {
    content: '›';
    color: var(--chart-accent);
    transition: transform .18s ease;
}

.dog-rating-details[open] > summary::before,
.dog-result-section[open] > summary::before {
    transform: rotate(90deg);
}

.dog-rating-list {
    border-top: 1px solid var(--divider);
}

.dog-rating-list > a {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(120px, auto) 52px;
    padding: 7px 11px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--divider);
    text-decoration: none;
}

.dog-rating-list > a:last-child {
    border-bottom: 0;
}

.dog-rating-list > a:hover {
    background: var(--row-hover);
}

.dog-rating-list span,
.dog-rating-list span strong,
.dog-rating-list span small,
.dog-result-section > summary span,
.dog-result-section > summary span strong,
.dog-result-section > summary span small {
    display: block;
}

.dog-rating-list span small,
.dog-result-section > summary span small {
    margin-top: 1px;
    color: var(--text-muted);
    font-size: .64rem;
}

.dog-rating-list em {
    color: var(--text-muted);
    font-size: .68rem;
    font-style: normal;
    text-align: right;
}

.dog-rating-list b {
    text-align: right;
}

.dog-result-section {
    margin-top: 8px;
}

.dog-result-section > summary {
    padding: 9px 10px;
}

.dog-result-section > summary > span {
    margin-right: auto;
}

.dog-result-section > summary > b {
    color: var(--text-soft);
    font-size: .7rem;
}

.dog-result-section[open] > summary {
    border-bottom: 1px solid var(--divider);
}

@media (max-width: 620px) {
    .dog-rating-summary__headline {
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
    }

    .dog-rating-list > a {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dog-rating-list em {
        display: none;
    }
}

.organization-statistics-overview td:first-child strong,
.organization-statistics-overview td:first-child small {
    display: block;
}

.organization-statistics-overview td:first-child small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .64rem;
}

.eucup-event-tabs {
    margin: 9px 0;
}

.eucup-event-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.eucup-event-tabs a span {
    color: var(--text-muted);
    font-size: .64rem;
}

.eucup-event-page [hidden] {
    display: none !important;
}

.eucup-event-page .record-section > .discipline-tabs {
    margin: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

@media (max-width: 720px) {
    .sport-context form {
        width: 100%;
    }

    .sport-context select {
        width: 100%;
    }

    .organization-statistics-overview th:nth-child(4),
    .organization-statistics-overview td:nth-child(4),
    .organization-statistics-overview th:nth-child(5),
    .organization-statistics-overview td:nth-child(5),
    .organization-statistics-overview th:nth-child(6),
    .organization-statistics-overview td:nth-child(6) {
        display: none;
    }
}

/* One restrained surface language. */
.data-panel,
.settings-section,
.record-section,
.dog-rating-panel,
.profile-card,
.dog-identity,
.dog-performance-summary,
.dog-performance-details,
.performance-development,
.auth-card,
.claim-card,
.request-card,
.ewpl-panel,
.ewpl-install,
.competition-group {
    border-color: var(--divider);
    border-radius: 4px;
    background: var(--surface-bg);
    box-shadow: 0 2px 10px rgba(4, 10, 14, .06);
}

.panel-header,
.data-panel > .panel-header,
.competition-group__header,
.event-result-section__header,
.dog-performance-details > summary,
.performance-development > summary,
.dog-records,
.ewpl-panel__header {
    border-color: var(--divider);
    background: transparent;
    color: var(--text-main);
}

.panel-header h2,
.panel-header__meta,
.panel-header span,
.event-result-section__header > h3 {
    color: var(--text-main);
}

.data-panel > .panel-header::after,
.panel-header::after {
    height: 1px;
    opacity: .65;
}

.database-totals,
.statistics-summary,
.dog-kpis,
.rating-summary,
.stat-line,
.results-overview {
    border-color: var(--divider);
    background: transparent;
}

.database-totals > div,
.statistics-summary > div,
.dog-kpis > div,
.rating-summary > div,
.stat-line__item,
.results-overview > div {
    border-color: var(--divider);
}

.content-with-rail,
.statistics-layout,
.rating-layout {
    gap: 10px;
}

.rating-layout,
.results-content {
    display: block;
}

.context-links {
    display: flex;
    margin-top: 12px;
    padding-top: 9px;
    gap: 14px;
    border-top: 1px solid var(--divider);
    font-size: 10.5px;
}

/* Open editorial reading pages: hierarchy without stacked cards. */
.about-document,
.guide-article__body,
.guide-article__lead,
.privacy-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.about-hero,
.about-facts,
.about-section,
.about-contact,
.guide-article__body > section,
.guide-article__body > details,
.guide-article__lead,
.privacy-panel {
    border-color: var(--divider);
}

.about-section,
.privacy-panel,
.guide-article__body > section {
    padding-inline: 0;
}

.privacy-panel + .privacy-panel,
.guide-article__body > section + section {
    margin-top: 0;
    border-top: 1px solid var(--divider);
}

.privacy-panel > .panel-header,
.guide-article__body .panel-header {
    padding-inline: 0;
}

.privacy-panel .panel-copy {
    padding-inline: 0;
}

.privacy-panel details {
    border-bottom: 1px solid color-mix(in srgb, var(--divider) 70%, transparent);
    background: transparent;
}

.guide-navigation {
    display: flex;
    gap: 0;
    border-block: 1px solid var(--divider);
    background: transparent;
}

.guide-navigation a {
    border: 0;
    border-right: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
}

.guide-navigation a:hover,
.guide-navigation a.is-active {
    background: var(--surface-soft);
}

.about-guide-links a {
    border: 0;
    border-bottom: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
}

/* Compact filters: the content summary stays visible before the controls. */
.filter-shell {
    margin: 10px 0;
    border-block: 1px solid var(--divider);
    background: transparent;
}

.filter-shell__header {
    display: flex;
    min-height: 39px;
    padding: 6px 0;
    align-items: center;
    gap: 10px;
}

.filter-shell__header > p {
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
}

.filter-shell__toggle {
    display: inline-flex;
    min-height: 28px;
    padding: 5px 9px;
    align-items: center;
    gap: 6px;
    border-color: var(--divider-strong);
    background: var(--surface-soft);
    color: var(--text-main);
    box-shadow: none;
}

.filter-shell__toggle b {
    display: grid;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    place-items: center;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
}

.filter-chips {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-chips span {
    padding: 2px 6px;
    border-left: 2px solid color-mix(in srgb, var(--red) 75%, transparent);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 9.5px;
}

.filter-chips a {
    margin-left: 3px;
    font-size: 9.5px;
}

.filter-shell .filters {
    margin: 0;
    padding: 9px 0 10px;
    border: 0;
    border-top: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
}

.filter-details,
.filter-details__grid {
    border-color: var(--divider);
    background: transparent;
}

.lookup-results {
    border-color: var(--divider-strong);
    background: var(--surface-raised);
}

.lookup-results button,
.lookup-results__empty {
    border-color: var(--divider);
    background: var(--surface-raised);
    color: var(--text-main);
}

.lookup-results button:hover,
.lookup-results button:focus-visible {
    background: var(--row-hover);
}

/* Tables are defined by row rhythm instead of many independent blocks. */
th,
.dense-table th,
.admin-table th {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-muted);
}

td,
.dense-table td,
.admin-table td {
    border-color: var(--divider);
    color: var(--text-main);
}

tbody tr,
.dense-table tbody tr,
.admin-table tbody tr,
.compact-event-list > a,
.compact-ranking li,
.activity-feed > a {
    background: var(--surface-raised);
}

tbody tr:nth-child(even),
.dense-table tbody tr:nth-child(even),
.admin-table tbody tr:nth-child(even),
.compact-event-list > a:nth-child(even),
.compact-ranking li:nth-child(even),
.activity-feed > a:nth-child(even) {
    background: var(--row-even);
}

.dense-table tbody tr:hover > td,
.admin-table tbody tr:hover > td,
.result-table tbody tr:hover > td,
table tbody tr:hover > td,
.compact-event-list > a:hover,
.compact-ranking li:hover,
.activity-feed > a:hover {
    background: var(--row-hover);
    color: var(--text-main);
}

.result-mobile-summary {
    display: none;
}

.definition-list--facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.definition-list--facts > div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.definition-list--facts > div:nth-child(3n) {
    border-right: 0;
}

.definition-list--facts dt,
.definition-list--facts dd {
    margin: 0;
}

.definition-list--facts dt {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.definition-list--facts dd {
    color: var(--text-main);
    font-size: 12px;
}

.event-description {
    padding: 12px;
}

/* Ratings use available width automatically; no empty guide rail. */
.dog-rating-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--divider);
}

.dog-rating-card {
    min-width: 0;
    background: var(--surface-raised);
}

.dog-rating-card:only-child {
    grid-column: 1 / -1;
}

/* Forms are tools, so grouping is visible but quiet. */
.profile-form,
.auth-form,
.form-panel,
.admin-toolbar,
.admin-search {
    border-color: var(--divider);
    background: var(--surface-bg);
}

.result-sort,
.statistics-sort,
.rating-controls,
.discipline-tabs {
    border-color: var(--divider);
    background: transparent;
}

.discipline-tabs a {
    background: var(--surface-soft);
    color: var(--text-soft);
}

.discipline-tabs a:hover,
.discipline-tabs a.is-active {
    background: var(--row-hover);
    color: var(--text-main);
}

.admin-form-groups {
    display: grid;
    gap: 16px;
}

.admin-form-group {
    min-width: 0;
    margin: 0;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid var(--divider);
    background: transparent;
}

.admin-form-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.admin-form-group legend {
    padding: 0 10px 0 0;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 750;
}

.admin-edit-form .form-note {
    margin-top: 14px;
    padding-top: 9px;
    border-top: 1px solid var(--divider);
}

.admin-navigation {
    top: 44px;
    border-color: var(--divider);
    background: color-mix(in srgb, var(--shell-bg) 96%, transparent);
}

/* Controls and charts obey both themes. */
input,
select,
textarea,
.field input,
.field select,
.field textarea,
.chart-toolbar button {
    border-color: var(--divider-strong);
    background: var(--control-bg);
    color: var(--text-main);
}

option,
optgroup {
    background: var(--control-bg);
    color: var(--text-main);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: color-mix(in srgb, var(--link-color) 70%, var(--divider-strong));
    background: var(--surface-raised);
}

.technical-chart,
.scorebook-line-chart,
.dog-activity-chart,
.chart-frame,
.chart-panel,
.year-chart,
.scatter-chart,
.performance-chart {
    border-color: var(--divider);
    background: var(--chart-surface);
}

.chart-toolbar,
.chart-current,
.chart-note {
    border-color: var(--divider);
    background: transparent;
    color: var(--text-muted);
}

.chart-tooltip {
    position: absolute;
    z-index: 6;
    min-width: 118px;
    max-width: 220px;
    padding: 6px 8px;
    border: 1px solid var(--divider-strong);
    border-radius: 3px;
    background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
    color: var(--text-main);
    box-shadow: var(--shadow);
    font-size: 10px;
    line-height: 1.4;
    pointer-events: none;
}

.chart-tooltip strong,
.chart-tooltip span {
    display: block;
}

.chart-tooltip span {
    color: var(--text-muted);
}

.chart-data {
    border-top: 1px solid var(--divider);
}

.chart-data > summary {
    padding: 7px 10px;
    color: var(--link-color);
    cursor: pointer;
    font-size: 10px;
}

.chart-data .table-wrap {
    max-height: 320px;
    overflow: auto;
}

/* Light-theme overrides for old components that previously leaked white. */
html[data-theme="light"] .site-atmosphere {
    border-color: rgba(31, 44, 52, .26);
    background-image:
        linear-gradient(90deg, rgba(28, 39, 46, .48) 0%, rgba(28, 39, 46, .28) 48%, rgba(28, 39, 46, .16) 100%),
        linear-gradient(180deg, rgba(28, 39, 46, .03), rgba(28, 39, 46, .28)),
        url('/img/scorebook-atmosphere-v3.webp');
    filter: saturate(.92) contrast(1.04);
    box-shadow: inset 0 -24px 34px rgba(31, 43, 50, .2);
}

html[data-theme="light"] .site-header {
    color-scheme: dark;
}

html[data-theme="light"] .sport-view__focus select,
html[data-theme="light"] .sport-view__manage,
html[data-theme="light"] .sport-view__panel,
html[data-theme="light"] .sport-view__panel > header,
html[data-theme="light"] .sport-view__panel form,
html[data-theme="light"] .sport-view__options label {
    color-scheme: dark;
}

html[data-theme="light"] .data-panel,
html[data-theme="light"] .settings-section,
html[data-theme="light"] .record-section,
html[data-theme="light"] .dog-rating-panel,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .dog-identity,
html[data-theme="light"] .dog-performance-summary,
html[data-theme="light"] .dog-performance-details,
html[data-theme="light"] .performance-development,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .auth-form,
html[data-theme="light"] .claim-card,
html[data-theme="light"] .request-card,
html[data-theme="light"] .competition-group,
html[data-theme="light"] .dog-directory,
html[data-theme="light"] .profile-dog,
html[data-theme="light"] .dog-directory__entry,
html[data-theme="light"] .ewpl-panel,
html[data-theme="light"] .ewpl-install,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .notice,
html[data-theme="light"] .ad-slot {
    border-color: var(--divider);
    background: var(--surface-bg);
    color: var(--text-main);
}

html[data-theme="light"] .profile-dog:nth-child(even),
html[data-theme="light"] .dog-directory__entry:nth-child(even) {
    background: var(--row-even);
}

html[data-theme="light"] .scorebook-tip,
html[data-theme="light"] .check-field,
html[data-theme="light"] .check-line,
html[data-theme="light"] .sport-preference-option,
html[data-theme="light"] .filter-details,
html[data-theme="light"] .result-more dl,
html[data-theme="light"] .guide-index,
html[data-theme="light"] .guide-index > a,
html[data-theme="light"] .guide-callout,
html[data-theme="light"] .guide-callout-grid > article,
html[data-theme="light"] .rating-guide__grid,
html[data-theme="light"] .rating-guide__sport-grid,
html[data-theme="light"] .guide-formula-flow {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-main);
}

html[data-theme="light"] .button--secondary,
html[data-theme="light"] .btn-secondary {
    border-color: var(--divider-strong);
    background: var(--surface-soft);
    color: var(--text-main);
}

html[data-theme="light"] .button--secondary:hover,
html[data-theme="light"] .btn-secondary:hover {
    background: var(--row-hover);
    color: var(--text-main);
}

html[data-theme="light"] .scorebook-tip p,
html[data-theme="light"] .about-hero p,
html[data-theme="light"] .about-section p,
html[data-theme="light"] .about-contact p,
html[data-theme="light"] .about-facts span,
html[data-theme="light"] .about-guide-links span,
html[data-theme="light"] .dog-directory__identity small,
html[data-theme="light"] .profile-dog__body p,
html[data-theme="light"] .dog-registered-name,
html[data-theme="light"] .dog-country-label,
html[data-theme="light"] .profile-dog__registered {
    color: var(--text-soft);
}

html[data-theme="light"] .dog-directory__identity strong,
html[data-theme="light"] .profile-dog__body h3,
html[data-theme="light"] .dog-identity h1,
html[data-theme="light"] .advertising-creatives > legend {
    color: var(--text-main);
}

html[data-theme="light"] .dog-chart-row > span strong {
    color: var(--text-main);
}

html[data-theme="light"] .dog-chart-row > span small {
    color: var(--red-dark);
}

html[data-theme="light"] .ewpl-panel__header,
html[data-theme="light"] .ewpl-live-progress,
html[data-theme="light"] .ewpl-owner-new,
html[data-theme="light"] .ewpl-candidates article,
html[data-theme="light"] .ewpl-event-metrics div,
html[data-theme="light"] .ewpl-data-list div,
html[data-theme="light"] .ewpl-tech-grid details,
html[data-theme="light"] .ewpl-owner-candidates > div {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-main);
}

html[data-theme="light"] .ewpl-safety,
html[data-theme="light"] .ewpl-status,
html[data-theme="light"] .ewpl-event-state {
    background: var(--surface-soft);
    color: var(--text-soft);
}

html[data-theme="light"] .ewpl-status--ready,
html[data-theme="light"] .ewpl-event-state--ready,
html[data-theme="light"] .ewpl-status--live,
html[data-theme="light"] .ewpl-event-state--live {
    background: var(--green-wash);
    color: var(--green-dark);
}

html[data-theme="light"] .ewpl-status--attention,
html[data-theme="light"] .ewpl-status--proposed,
html[data-theme="light"] .ewpl-event-state--attention {
    background: var(--amber-wash);
    color: var(--amber);
}

html[data-theme="light"] .ewpl-status--danger {
    background: var(--red-wash);
    color: var(--danger);
}

html[data-theme="light"] .dog-directory__photo,
html[data-theme="light"] .profile-dog__photo,
html[data-theme="light"] .dog-identity__photo,
html[data-theme="light"] .dog-identity__placeholder,
html[data-theme="light"] .advertising-creatives img,
html[data-theme="light"] .advertising-thumbnails img {
    border-color: var(--divider);
    background: var(--surface-soft);
}

html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus,
html[data-theme="light"] textarea:-webkit-autofill,
html[data-theme="light"] select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-main);
    box-shadow: 0 0 0 1000px var(--control-bg) inset;
    caret-color: var(--text-main);
}

@media (max-width: 900px) {
    .definition-list--facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .definition-list--facts > div:nth-child(3n) {
        border-right: 1px solid var(--divider);
    }

    .definition-list--facts > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 12.5px;
    }

    .theme-toggle {
        width: 44px;
    }

    .sport-context {
        align-items: stretch;
        flex-direction: column;
    }

    .sport-context form {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .sport-context select {
        width: 100%;
    }

    .filter-shell__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-shell__header > p {
        display: none;
    }

    .filter-shell .filters {
        display: none;
        grid-template-columns: 1fr 1fr;
    }

    .filter-shell.is-open .filters {
        display: grid;
    }

    .filter-shell__toggle {
        width: 100%;
        justify-content: space-between;
    }

    .filter-chips {
        padding-bottom: 4px;
    }

    .definition-list--facts {
        grid-template-columns: 1fr;
    }

    .definition-list--facts > div,
    .definition-list--facts > div:nth-child(2n),
    .definition-list--facts > div:nth-child(3n) {
        border-right: 0;
    }

    .dog-rating-grid {
        grid-template-columns: 1fr;
    }

    .result-table,
    .result-table--rated {
        width: 100%;
        min-width: 0;
    }

    .result-table thead {
        display: none;
    }

    .result-table tbody,
    .result-table tr {
        display: block;
    }

    .result-table tbody tr {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        padding: 8px 7px;
        gap: 3px 8px;
        border-bottom: 1px solid var(--divider);
    }

    .result-table tbody td {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .result-table .result-place {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        font-size: 13px;
        font-weight: 800;
    }

    .result-table .result-dog-cell {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        font-size: 12px;
        font-weight: 750;
    }

    .result-table .result-mobile-summary {
        display: grid;
        grid-column: 3;
        grid-row: 1 / span 3;
        align-content: center;
        justify-items: end;
        gap: 2px;
        color: var(--text-muted);
        font-size: 9.5px;
        white-space: nowrap;
    }

    .result-table .result-mobile-summary strong {
        color: var(--text-main);
        font-size: 11px;
    }

    .result-table .result-breed {
        grid-column: 2;
        grid-row: 2;
        color: var(--text-muted);
        font-size: 10px;
    }

    .result-table .event-result-details {
        grid-column: 2;
        grid-row: 3;
        color: var(--text-soft);
        font-size: 10px;
    }

    .result-table .result-value,
    .result-table .result-dvs,
    .result-table .result-rating {
        display: none;
    }

    .result-more > summary {
        font-size: 9.5px;
    }

    .guide-navigation {
        overflow-x: auto;
    }

    .guide-navigation a {
        min-width: max-content;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle__thumb,
    .theme-toggle__sun,
    .theme-toggle__moon,
    .theme-toggle__track {
        transition: none;
    }
}

/* 3.0 compact data flow and final theme refinements ------------------------ */

/* Filters are tools, not the first piece of content. Keep them closed until
   the visitor asks for them at every viewport size. */
.filter-shell {
    margin: 6px 0;
}

.filter-shell__header {
    min-height: 34px;
    padding: 3px 0;
}

.filter-shell .filters {
    display: none;
    margin: 0;
    padding: 8px 0 9px;
}

.filter-shell.is-open .filters {
    display: grid;
}

.filter-shell__toggle {
    min-height: 26px;
    padding: 4px 9px;
}

.results-controlbar {
    display: flex;
    min-height: 38px;
    padding: 4px 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--divider);
}

.view-summary {
    display: flex;
    margin: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    color: var(--text-muted);
    font-size: 10.5px;
}

.view-summary > span {
    padding: 0 9px;
    border-right: 1px solid var(--divider);
}

.view-summary > span:first-child {
    padding-left: 0;
}

.view-summary > span:last-child {
    border-right: 0;
}

.view-summary strong {
    color: var(--text-main);
    font-size: 12px;
}

.results-controlbar .result-sort {
    display: flex;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    border: 0;
    background: transparent;
}

.results-controlbar .result-sort select {
    width: 150px;
    min-height: 28px;
}

.results-page .sport-context,
.statistics-page .sport-context {
    margin-bottom: 5px;
}

.results-page .competition-results {
    gap: 6px;
}

.results-page .competition-group:first-child {
    margin-top: 0;
}

.statistics-page .statistics-summary {
    margin: 5px 0;
}

.statistics-page .statistics-summary > div {
    min-height: 38px;
    padding-block: 4px;
}

.statistics-page .statistics-sort {
    min-height: 38px;
    margin: 6px 0;
    padding: 4px 0;
}

/* Form is readable even if canvas drawing is unavailable. */
.rating-form-explainer {
    margin: 0;
    padding: 7px 9px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-muted);
    font-size: 9.5px;
    line-height: 1.45;
}

.rating-form-explainer strong {
    color: var(--text-main);
}

.rating-form {
    display: grid;
    grid-template-columns: 48px 72px;
    min-width: 124px;
    align-items: center;
    gap: 5px;
}

.rating-form__label {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 750;
}

.rating-form--up .rating-form__label {
    color: var(--green);
}

.rating-form--down .rating-form__label {
    color: var(--danger);
}

.rating-spark {
    width: 72px;
    height: 26px;
}

.rating-spark canvas {
    opacity: 1;
}

/* Guide calculations use the same surfaces as the rest of the site. */
.guide-formula-flow > div,
.rating-formula > div {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-main);
}

.guide-formula-flow code {
    border-left: 2px solid var(--chart-accent);
    background: var(--control-bg);
    color: var(--text-main);
}

.guide-formula-flow small,
.guide-example-bars__label span,
.guide-result-callout span {
    color: var(--text-muted);
}

.rating-equation {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-left: 2px solid var(--chart-accent);
    background: var(--surface-soft);
    color: var(--text-soft);
}

/* Light mode is intentionally slate and paper rather than white. */
html[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 50% -14rem, rgba(62, 86, 99, .2), transparent 44rem),
        linear-gradient(180deg, #d5dcdf, var(--page-bg) 26rem);
}

html[data-theme="light"] .page-shell,
html[data-theme="light"] .database-shell > .container {
    border-color: #aebbc1;
    background: var(--shell-bg);
    box-shadow: 0 0 34px rgba(34, 49, 58, .14);
}

html[data-theme="light"] .panel-header,
html[data-theme="light"] .competition-group__header,
html[data-theme="light"] .event-result-section__header {
    background: color-mix(in srgb, var(--surface-soft) 72%, var(--shell-bg));
}

html[data-theme="light"] th,
html[data-theme="light"] .dense-table th {
    border-color: var(--divider);
    background: var(--surface-soft);
    color: var(--text-soft);
}

html[data-theme="light"] td,
html[data-theme="light"] .dense-table td {
    border-color: color-mix(in srgb, var(--divider) 76%, transparent);
}

html[data-theme="light"] tbody tr:hover td,
html[data-theme="light"] .compact-event-list > a:hover,
html[data-theme="light"] .performance-list > a:hover,
html[data-theme="light"] .compact-ranking li:hover {
    background: var(--row-hover);
}

html[data-theme="light"] .compact-event-list > a,
html[data-theme="light"] .compact-ranking li,
html[data-theme="light"] .activity-feed > a {
    border-color: var(--divider);
    background: var(--surface-bg);
}

html[data-theme="light"] .compact-event-list > a:nth-child(even),
html[data-theme="light"] .compact-ranking li:nth-child(even),
html[data-theme="light"] .activity-feed > a:nth-child(even) {
    background: var(--row-even);
}

html[data-theme="light"] .guide-formula-flow > div,
html[data-theme="light"] .rating-formula > div,
html[data-theme="light"] .rating-equation {
    background: #d9e1e4;
}

html[data-theme="light"] .guide-formula-flow code {
    background: #eef2f3;
}

@media (max-width: 720px) {
    .results-controlbar {
        align-items: stretch;
        flex-direction: column;
        gap: 5px;
    }

    .results-controlbar .result-sort {
        justify-content: space-between;
    }

    .results-controlbar .result-sort select {
        width: min(190px, 62vw);
    }

    .view-summary > span {
        padding-inline: 6px;
    }
}

/* Compact event identity: the date and country already sit below the title. */
.event-page .page-header--compact {
    margin-bottom: 4px;
    padding-bottom: 8px;
}

.event-page .page-header--compact h1 {
    margin-bottom: 2px;
}

.event-page .event-summary {
    margin-bottom: 0;
}

.event-page .event-summary > div {
    padding: 6px 10px;
}

.event-page .event-overview {
    margin-bottom: 8px;
}

.event-page .event-overview .definition-list--facts {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.event-page .event-overview .definition-list--facts > div {
    padding: 7px 10px;
    border-bottom: 0;
}

.home-news-featured.has-transparent-image,
.news-story__image--transparent {
    background: transparent;
}

.home-news-featured.has-transparent-image > img,
.news-story__image--transparent img {
    object-fit: contain;
    background: transparent;
}

@media (max-width: 620px) {
    .event-page .event-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .event-page .event-summary > div {
        display: grid;
        gap: 2px;
        padding: 6px;
        border-right: 1px solid var(--divider);
        border-bottom: 0;
    }

    .event-page .event-summary > div:last-child {
        border-right: 0;
    }

    .event-page .event-overview .definition-list--facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CSC review rows stay compact until an administrator asks for detail. */
.connect-submission-details {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.connect-submission-details > details > summary,
.connect-submission-row > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.connect-submission-details > details > summary {
    cursor: pointer;
    padding: 9px 12px;
}

.connect-submission-details > details > summary small {
    display: block;
    color: var(--text-muted);
}

.connect-submission-row {
    padding: 10px 12px;
    border-top: 1px solid var(--divider);
}

.connect-submission-row .fact-grid {
    margin-block: 8px 0;
}

/* Self-service owner information stays open and readable instead of becoming
   another stack of cards inside My Scorebook. */
.settings-section--wide {
    max-width: none;
}

.settings-section form.personal-information-form {
    width: 100%;
    justify-items: stretch;
    gap: 16px;
}

.profile-settings-group {
    min-width: 0;
    margin: 0;
    padding: 0 0 15px;
    border: 0;
    border-bottom: 1px solid var(--divider);
}

.profile-settings-group legend {
    padding: 0 0 10px;
    color: var(--text-main);
    font-weight: 800;
}

.profile-settings-group .form-grid {
    width: 100%;
}

.profile-settings-group--security {
    width: min(100%, 460px);
}

.profile-save-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.profile-save-row .muted {
    max-width: 62ch;
}

@media (max-width: 620px) {
    .profile-settings-group .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-settings-group .field--full {
        grid-column: auto;
    }

    .profile-save-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Administration focus system: quiet by default, depth on demand. */
.is-admin-area {
    --admin-focus: var(--chart-accent);
    --admin-focus-soft: color-mix(in srgb, var(--chart-accent) 10%, transparent);
    --admin-success-soft: color-mix(in srgb, var(--green) 14%, transparent);
    background-image: none;
    font-size: 13.5px;
}

.is-admin-area .site-footer {
    margin-top: 34px;
}

.admin-navigation {
    position: relative;
    z-index: 18;
    display: grid;
    width: min(100%, var(--content));
    min-height: 48px;
    margin: 0 auto 10px;
    padding: 6px max(10px, calc((100% - var(--content)) / 2));
    grid-template-columns: minmax(0, 1fr) minmax(210px, 290px) auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--divider);
    background: color-mix(in srgb, var(--shell-bg) 94%, transparent);
}

.admin-navigation__primary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.admin-navigation a,
.admin-navigation summary {
    display: inline-flex;
    min-height: 32px;
    padding: 7px 9px;
    align-items: center;
    border: 0;
    border-radius: 3px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.admin-navigation a:hover,
.admin-navigation a.is-active,
.admin-navigation summary:hover,
.admin-navigation summary.is-active {
    background: var(--surface-soft);
    color: var(--text-main);
}

.admin-navigation a.is-active,
.admin-navigation summary.is-active {
    box-shadow: inset 0 -2px var(--admin-focus);
}

.admin-unread-count,
.message-heading-count {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--chart-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.admin-work-queue__attention {
    box-shadow: inset 2px 0 var(--chart-accent) !important;
}

/* Shared message centre: conversations first, transport stays invisible. */
.message-center-page {
    width: min(100%, 1320px);
    max-width: 1320px;
}

.message-center-heading {
    display: flex;
    min-height: 48px;
    padding: 2px 0 10px;
    align-items: end;
    justify-content: space-between;
    border-bottom: 1px solid var(--divider);
}

.message-center-heading h1 {
    display: flex;
    margin: 1px 0 0;
    align-items: center;
    font-size: 1.55rem;
}

.message-config-note {
    margin: 8px 0 0;
    padding: 7px 0;
    color: var(--text-muted);
    font-size: 11px;
}

.message-center-toolbar {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--divider);
}

.message-view-tabs {
    display: flex;
    align-self: stretch;
    gap: 16px;
}

.message-view-tabs a {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
}

.message-view-tabs a.is-active {
    box-shadow: inset 0 -2px var(--chart-accent);
    color: var(--text-main);
}

.message-search {
    display: grid;
    width: min(100%, 320px);
    grid-template-columns: 1fr auto;
}

.message-search input,
.message-search button {
    min-height: 32px;
    margin: 0;
}

.message-search input {
    min-width: 0;
    border-radius: 3px 0 0 3px;
}

.message-search button {
    border-radius: 0 3px 3px 0;
}

.message-center-layout {
    display: grid;
    min-height: 620px;
    grid-template-columns: 168px minmax(260px, 330px) minmax(0, 1fr);
    border-bottom: 1px solid var(--divider);
}

.message-sources,
.message-conversation-list,
.message-reader {
    min-width: 0;
}

.message-sources {
    padding: 10px 10px 24px 0;
    border-right: 1px solid var(--divider);
}

.message-source + .message-source {
    margin-top: 14px;
}

.message-folder {
    display: flex;
    min-height: 28px;
    padding: 5px 7px;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 10.5px;
    text-decoration: none;
}

.message-folder:hover,
.message-folder.is-active {
    background: var(--surface-soft);
    color: var(--text-main);
}

.message-folder--root {
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
}

.message-folder strong {
    color: var(--chart-accent);
    font-size: 9px;
}

.message-source__folders {
    margin: 2px 0 0 8px;
}

.message-conversation-list {
    border-right: 1px solid var(--divider);
}

.message-conversation {
    position: relative;
    display: grid;
    min-height: 60px;
    padding: 9px 10px 9px 14px;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-soft);
    text-decoration: none;
}

.message-conversation:hover,
.message-conversation.is-active {
    background: var(--row-hover);
}

.message-conversation__state {
    width: 5px;
    height: 5px;
    margin-top: 5px;
    border-radius: 50%;
}

.message-conversation.is-unread .message-conversation__state {
    background: var(--chart-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chart-accent) 14%, transparent);
}

.message-conversation__copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.message-conversation__sender,
.message-conversation__subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-conversation__sender {
    color: var(--text-main);
    font-size: 11px;
    font-weight: 720;
}

.message-conversation__subject {
    color: var(--text-muted);
    font-size: 10.5px;
}

.message-conversation.is-unread .message-conversation__sender,
.message-conversation.is-unread .message-conversation__subject {
    color: var(--text-main);
    font-weight: 800;
}

.message-conversation time {
    color: var(--text-muted);
    font-size: 9.5px;
}

.message-reader {
    padding: 24px clamp(18px, 3vw, 42px) 48px;
}

.message-reader article {
    max-width: 720px;
}

.message-reader__topline {
    display: flex;
    min-height: 28px;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.message-reader__actions {
    display: flex;
    gap: 10px;
}

.message-reader__actions form {
    margin: 0;
}

.message-reader__actions button {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 9.5px;
}

.message-reader__actions button:hover {
    color: var(--text-main);
}

.message-reader h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.message-reader__from {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    color: var(--text-muted);
    font-size: 10.5px;
}

.message-reader__from strong {
    color: var(--text-main);
}

.message-reader__from time {
    margin-left: auto;
}

.message-reader__body {
    margin-top: 28px;
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.72;
}

.message-work-link {
    margin-top: 24px;
}

.message-replies {
    margin-top: 34px;
    border-top: 1px solid var(--divider);
}

.message-reply {
    padding: 18px 0;
    border-bottom: 1px solid var(--divider);
}

.message-reply > div {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 9.5px;
}

.message-reply p {
    margin: 10px 0 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.message-reply-form {
    margin-top: 34px;
}

.message-reply-form label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

.message-reply-form textarea {
    width: 100%;
    resize: vertical;
}

.message-reply-form > div {
    display: flex;
    margin-top: 7px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.message-reply-form > div span,
.message-internal-note {
    color: var(--text-muted);
    font-size: 9.5px;
}

.message-empty {
    display: grid;
    min-height: 180px;
    padding: 30px 16px;
    place-content: center;
    gap: 5px;
    color: var(--text-muted);
    text-align: center;
}

.message-empty strong {
    color: var(--text-soft);
}

.message-mobile-back {
    display: none;
}

@media (max-width: 900px) {
    .message-center-layout {
        grid-template-columns: 145px minmax(240px, 310px) minmax(0, 1fr);
    }

    .message-reader {
        padding-inline: 18px;
    }
}

@media (max-width: 720px) {
    .message-center-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 8px 0;
    }

    .message-view-tabs {
        min-height: 30px;
    }

    .message-search {
        width: 100%;
    }

    .message-center-layout {
        display: grid;
        min-height: 500px;
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .message-reader {
        display: none;
    }

    .message-center-layout.has-reader .message-sources,
    .message-center-layout.has-reader .message-conversation-list {
        display: none;
    }

    .message-center-layout.has-reader {
        display: block;
    }

    .message-center-layout.has-reader .message-reader {
        display: block;
        min-height: 500px;
        padding: 20px 4px 42px;
    }

    .message-mobile-back {
        display: inline;
        color: var(--link-color);
        text-transform: none;
        letter-spacing: 0;
    }

    .message-reader__topline > span {
        display: none;
    }

    .message-reader__from time {
        width: 100%;
        margin-left: 0;
    }
}

.admin-navigation__search {
    display: grid;
    grid-template-columns: 1fr auto;
}

.admin-navigation__search input,
.admin-navigation__search button {
    min-height: 32px;
    margin: 0;
}

.admin-navigation__search input {
    min-width: 0;
    padding: 6px 9px;
    border-radius: 3px 0 0 3px;
}

.admin-navigation__search button {
    padding: 6px 10px;
    border-radius: 0 3px 3px 0;
}

.admin-navigation__more {
    position: relative;
}

.admin-navigation__more > summary {
    list-style: none;
}

.admin-navigation__more > summary::-webkit-details-marker {
    display: none;
}

.admin-navigation__more > summary::after {
    margin-left: 6px;
    content: "⌄";
    color: var(--text-muted);
}

.admin-navigation__more[open] > div {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    display: grid;
    min-width: 190px;
    padding: 5px;
    border: 1px solid var(--divider-strong);
    border-radius: 4px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.is-admin-area .page-shell {
    padding-top: 12px;
}

.is-admin-area .page-header {
    min-height: 0;
    margin-bottom: 10px;
    padding-bottom: 10px;
    align-items: end;
    border-bottom: 1px solid var(--divider);
}

.is-admin-area .page-header h1 {
    margin: 2px 0 0;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.is-admin-area .page-header .lede {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11.5px;
}

.is-admin-area .section {
    margin-top: 14px;
}

.is-admin-area .section-heading {
    min-height: 34px;
    margin-bottom: 0;
    padding: 5px 0;
    border-bottom: 1px solid var(--divider);
}

.is-admin-area .section-heading h2 {
    font-size: 1rem;
}

.admin-work-queue {
    display: block;
    border-top: 1px solid var(--divider);
}

.admin-work-queue .ledger-panel,
.admin-work-queue .ledger-panel--wide {
    display: grid;
    min-height: 52px;
    padding: 8px 4px;
    grid-template-columns: minmax(120px, .55fr) minmax(170px, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.admin-work-queue .ledger-panel:hover {
    background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
}

.admin-work-queue .ledger-panel h3,
.admin-work-queue .ledger-panel p,
.admin-work-queue .ledger-panel a {
    margin: 0;
}

.admin-work-queue .ledger-panel p {
    display: none;
}

.admin-work-queue .ledger-panel > a {
    justify-self: end;
}

.admin-disclosure {
    margin-top: 10px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    background: transparent;
}

.admin-disclosure > summary {
    position: relative;
    display: flex;
    min-height: 40px;
    padding: 9px 36px 9px 11px;
    align-items: center;
    color: var(--text-main);
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.admin-disclosure > summary::-webkit-details-marker {
    display: none;
}

.admin-disclosure > summary::after {
    position: absolute;
    right: 13px;
    content: "+";
    color: var(--admin-focus);
    font-size: 1rem;
    transition: transform .18s ease;
}

.admin-disclosure[open] > summary::after {
    transform: rotate(45deg);
}

.admin-disclosure__content {
    padding: 4px 11px 12px;
    border-top: 1px solid var(--divider);
}

.admin-overview-more {
    margin-top: 18px;
}

.admin-table-tools {
    display: flex;
    min-height: 42px;
    margin: 0;
    padding: 6px 0;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--divider);
}

.admin-table-tools label {
    margin: 0;
}

.admin-table-tools__search {
    flex: 1 1 240px;
}

.admin-table-tools input,
.admin-table-tools select {
    width: 100%;
    min-height: 30px;
    margin: 0;
    padding: 5px 8px;
}

.admin-table-tools__filter {
    flex: 0 1 170px;
}

.admin-table-tools__count {
    min-width: 62px;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10.5px;
    text-align: right;
}

.admin-sort-button,
.admin-server-sort {
    display: inline-flex;
    width: 100%;
    padding: 0;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    box-shadow: none;
}

.admin-sort-button:hover,
.admin-server-sort:hover {
    background: transparent;
    color: var(--link-hover);
}

.is-admin-area .table-wrap {
    border-color: var(--divider);
    border-radius: 3px;
}

.is-admin-area table th,
.is-admin-area table td {
    padding-block: 7px;
}

.is-admin-area tbody tr {
    transition: background-color .14s ease, box-shadow .14s ease;
}

.is-admin-area tbody tr:hover > * {
    background: color-mix(in srgb, var(--row-hover) 72%, transparent);
}

.is-admin-area input:focus,
.is-admin-area select:focus,
.is-admin-area textarea:focus,
.is-admin-area button:focus-visible,
.is-admin-area a:focus-visible,
.is-admin-area summary:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--admin-focus) 72%, white);
    outline-offset: 2px;
}

.is-admin-area [aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: inset 3px 0 color-mix(in srgb, var(--danger) 78%, transparent);
}

.is-admin-area form.is-working {
    opacity: .8;
    pointer-events: none;
}

.is-admin-area button.is-working::before {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: admin-spin .7s linear infinite;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

/* EWPL event work queue. */
.ewpl-flow--focus {
    grid-template-columns: repeat(3, 1fr);
}

.ewpl-event-summary {
    grid-template-columns: repeat(4, 1fr);
}

.ewpl-next-action {
    position: sticky;
    top: 58px;
    padding: 14px;
    border-color: color-mix(in srgb, var(--admin-focus) 40%, var(--divider));
    background: color-mix(in srgb, var(--surface-bg) 94%, var(--admin-focus-soft));
}

.is-admin-area .ewpl-layout {
    grid-template-columns: minmax(0, 1fr);
}

.ewpl-import-secondary {
    grid-column: 1 / -1;
}

.ewpl-import-secondary .admin-disclosure__content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ewpl-import-secondary .ewpl-panel {
    margin: 0;
}

.ewpl-run-form {
    align-items: center;
}

.ewpl-run-form > button {
    order: -1;
}

.ewpl-run-options {
    min-width: 210px;
}

.ewpl-run-options > summary {
    padding: 7px 9px;
    color: var(--link-color);
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.ewpl-run-options > div {
    display: grid;
    margin-top: 7px;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 7px;
}

.ewpl-run-options .check-line {
    grid-column: 1 / -1;
}

.ewpl-next-action h2 {
    margin: 3px 0 5px;
    font-size: 1.08rem;
}

.ewpl-next-action p {
    margin: 0 0 11px;
    color: var(--text-soft);
}

.ewpl-next-action .button,
.ewpl-next-action button {
    width: 100%;
    justify-content: center;
}

.ewpl-secondary-action {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
}

.ewpl-selected-event {
    display: grid;
    padding: 10px 3px;
    gap: 2px;
    border-bottom: 1px solid var(--divider);
}

.ewpl-selected-event > span,
.ewpl-selected-event > small {
    color: var(--text-muted);
    font-size: 10px;
}

.ewpl-all-controls .ewpl-panel {
    margin-top: 9px;
}

.ewpl-all-controls .admin-disclosure__content > .ewpl-panel:first-child {
    margin-top: 0;
}

.ewpl-event-rows td small {
    display: block;
    margin-top: 2px;
}

.ewpl-event-rows tr[data-group="attention"] > td:first-child {
    box-shadow: inset 2px 0 var(--admin-focus);
}

/* Original source is the fixed point of every EWPL decision. */
.ewpl-source-workbench {
    margin: 10px 0 12px;
    border-block: 1px solid var(--divider-strong);
    background: color-mix(in srgb, var(--surface-soft) 42%, transparent);
}

.ewpl-source-workbench > header {
    display: flex;
    min-height: 48px;
    padding: 8px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--divider);
}

.ewpl-source-workbench h2,
.ewpl-source-workbench h3 {
    margin: 1px 0 0;
}

.ewpl-source-workbench h2 {
    font-size: 1.05rem;
}

.ewpl-source-values {
    display: grid;
    margin: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ewpl-source-values > div {
    min-width: 0;
    padding: 9px 10px;
    border-right: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.ewpl-source-values > div:nth-child(4n) {
    border-right: 0;
}

.ewpl-source-values dt {
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ewpl-source-values dd {
    margin: 3px 0 0;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.ewpl-source-values dd small {
    display: block;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
}

.ewpl-value-comparison {
    padding: 10px;
}

.ewpl-value-comparison__heading {
    display: flex;
    margin-bottom: 7px;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.ewpl-value-comparison__heading h3 {
    font-size: .98rem;
}

.ewpl-value-comparison__heading > span {
    color: var(--text-muted);
    font-size: 10px;
}

.ewpl-value-comparison tr.is-changed > * {
    background: color-mix(in srgb, var(--amber-wash) 72%, transparent);
}

.ewpl-value-comparison tr.is-changed > :first-child {
    box-shadow: inset 2px 0 var(--amber);
}

.ewpl-value-comparison tr.is-changed td:last-child span {
    color: var(--amber);
    font-weight: 850;
}

.ewpl-value-comparison tr.is-same td:last-child span {
    color: var(--green);
}

.ewpl-candidates-more {
    grid-column: 1 / -1;
    border-top: 1px solid var(--divider);
}

.ewpl-candidates-more > summary {
    padding: 9px 12px;
    color: var(--link-color);
    font-weight: 750;
    cursor: pointer;
}

.ewpl-candidates--other article {
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
}

.ewpl-legacy-comparison[hidden],
.ewpl-source-legacy[hidden] {
    display: none !important;
}

/* Keep general CRUD forms readable without turning every group into a card. */
.is-admin-area .admin-form-groups {
    gap: 0;
}

.is-admin-area .admin-form-group {
    margin: 0;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.is-admin-area .admin-form-group legend {
    padding: 0 0 8px;
    color: var(--text-main);
    font-size: .96rem;
}

@media (max-width: 900px) {
    .admin-navigation {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .admin-navigation__search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .ewpl-source-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ewpl-import-secondary .admin-disclosure__content {
        grid-template-columns: 1fr;
    }

    .ewpl-source-values > div:nth-child(4n) {
        border-right: 1px solid var(--divider);
    }

    .ewpl-source-values > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 680px) {
    .admin-navigation {
        padding-inline: 8px;
    }

    .admin-work-queue .ledger-panel,
    .admin-work-queue .ledger-panel--wide {
        grid-template-columns: 1fr auto;
        gap: 3px 10px;
    }

    .admin-work-queue .ledger-panel .eyebrow {
        grid-column: 1 / -1;
    }

    .ewpl-flow--focus,
    .ewpl-event-summary {
        grid-template-columns: 1fr;
    }

    .ewpl-next-action {
        position: static;
    }

    .admin-table-tools {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .admin-table-tools__search,
    .admin-table-tools__filter {
        flex: 1 1 100%;
    }

    .ewpl-source-values {
        grid-template-columns: 1fr 1fr;
    }

    .ewpl-value-comparison table th:first-child,
    .ewpl-value-comparison table td:first-child {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-disclosure > summary::after,
    .is-admin-area tbody tr {
        transition: none;
    }

    .is-admin-area button.is-working::before {
        animation-duration: 1.8s;
    }
}

/* Mobile data edition.
   Desktop keeps the established layout; this layer only changes the public
   interface on narrow screens and consistently prioritizes primary data. */
.cs-mobile-only {
    display: none !important;
}

.eucup-event-tabs .eucup-tab-label {
    color: inherit;
    font-size: inherit;
}

@media (max-width: 680px) {
    .is-public-area {
        font-size: 12px;
        line-height: 1.42;
    }

    .is-public-area .site-header__inner {
        width: calc(100% - 12px);
        min-height: 52px;
        gap: 7px;
    }

    .is-public-area .brand__mark {
        width: 30px;
        height: 30px;
    }

    .is-public-area .sport-view {
        min-width: 0;
        flex: 1 1 176px;
        margin-left: auto;
    }

    .is-public-area .sport-view__focus {
        min-width: 0;
        flex: 1 1 auto;
    }

    .is-public-area .sport-view__focus select {
        width: 100%;
        min-height: 32px;
        font-size: 10.5px;
    }

    .is-public-area .sport-view__manage {
        width: 32px;
        min-height: 32px;
    }

    .is-public-area .theme-toggle {
        width: 40px;
        flex: 0 0 40px;
    }

    .is-public-area .nav-toggle {
        width: 40px;
        height: 38px;
        flex: 0 0 40px;
        padding: 7px;
    }

    .is-public-area .site-atmosphere {
        height: 4.75rem;
    }

    .is-public-area .site-atmosphere + .page-shell,
    .is-public-area .site-atmosphere + .database-shell {
        margin-top: -.65rem;
    }

    .is-public-area .container,
    .is-public-area .page-shell {
        width: calc(100% - 12px);
    }

    .is-public-area .database-shell > .container,
    .is-public-area .page-shell {
        min-height: calc(100vh - 120px);
        padding: 9px 10px 22px;
    }

    .is-public-area h1 {
        font-size: 20px;
    }

    .is-public-area h2 {
        font-size: 13px;
    }

    .is-public-area .dashboard-header,
    .is-public-area .page-titlebar,
    .is-public-area .page-header,
    .is-public-area .page-header--compact {
        min-height: 0;
        margin-bottom: 7px;
        padding: 4px 2px 8px;
        gap: 6px;
    }

    .is-public-area .dashboard-header h1,
    .is-public-area .page-titlebar h1,
    .is-public-area .page-header h1 {
        font-size: 20px;
        line-height: 1.15;
    }

    .is-public-area .dashboard-header p,
    .is-public-area .page-titlebar p,
    .is-public-area .page-header .lede {
        margin-top: 3px;
        font-size: 11px;
        line-height: 1.45;
    }

    .is-public-area .page-titlebar > p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .is-public-area .eyebrow,
    .is-public-area .page-titlebar > div > span {
        font-size: 9px;
    }

    .is-public-area .data-panel,
    .is-public-area .record-section {
        border-radius: 4px;
        box-shadow: none;
    }

    .is-public-area .panel-header {
        min-height: 30px;
        padding: 5px 7px;
    }

    .is-public-area .panel-header h2 {
        font-size: 11px;
    }

    .is-public-area .panel-header > span,
    .is-public-area .panel-header > a,
    .is-public-area .panel-header__meta {
        font-size: 9px;
    }

    .is-public-area .table-wrap {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .is-public-area table,
    .is-public-area .dense-table {
        font-size: 10.5px;
    }

    .is-public-area th,
    .is-public-area td,
    .is-public-area .dense-table th,
    .is-public-area .dense-table td {
        height: auto;
        padding: 5px;
        line-height: 1.32;
    }

    .is-public-area th,
    .is-public-area .dense-table th {
        font-size: 8.5px;
        letter-spacing: 0;
    }

    .is-public-area td.numeric,
    .is-public-area th.numeric {
        font-variant-numeric: tabular-nums;
    }

    .is-public-area .cs-mobile-only {
        display: inline !important;
    }

    .is-public-area .cs-desktop-label {
        display: none;
    }

    /* Home: reach the content quickly and keep the lead story compact. */
    .is-public-area .home-welcome {
        display: grid;
        gap: 8px;
    }

    .is-public-area .home-welcome > div:first-child {
        max-width: none;
    }

    .is-public-area .home-welcome__links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px 12px;
        margin-top: 7px;
    }

    .is-public-area .home-welcome__links a {
        width: max-content;
        max-width: 100%;
        overflow: hidden;
        font-size: 10.5px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .is-public-area .dashboard-search {
        width: 100%;
    }

    .is-public-area .dashboard-search > label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .is-public-area .dashboard-search input,
    .is-public-area .dashboard-search button {
        min-height: 34px;
    }

    .is-public-area .scorebook-tip {
        display: grid;
        grid-template-columns: 68px minmax(0, 1fr);
        min-height: 42px;
        margin-block: 7px 10px;
    }

    .is-public-area .scorebook-tip > span {
        padding: 7px 8px;
        font-size: 8px;
    }

    .is-public-area .scorebook-tip p {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        padding: 7px 8px;
        align-self: center;
        font-size: 10px;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .is-public-area .scorebook-tip__progress {
        grid-column: 2;
    }

    .is-public-area .home-dashboard-grid {
        gap: 12px;
    }

    .is-public-area .home-section-heading {
        padding: 2px 1px 6px;
    }

    .is-public-area .home-section-heading h2 {
        font-size: 15px;
    }

    .is-public-area .home-news-featured {
        min-height: 0;
    }

    .is-public-area .home-news-featured > img {
        max-height: 188px;
        aspect-ratio: 2 / 1;
    }

    .is-public-area .home-news-featured > div {
        padding: 10px 8px 11px;
    }

    .is-public-area .home-news-featured h3 {
        margin: 5px 0 6px;
        font-size: 17px;
        line-height: 1.17;
    }

    .is-public-area .home-news-featured p {
        display: -webkit-box;
        margin-bottom: 7px;
        overflow: hidden;
        font-size: 10.5px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .is-public-area .home-news-meta,
    .is-public-area .home-news-action {
        font-size: 9px;
    }

    .is-public-area .home-news-row {
        padding: 7px 4px;
    }

    .is-public-area .home-activity {
        margin-top: 12px;
    }

    .is-public-area .compact-event-list > a {
        min-height: 42px;
        grid-template-columns: 66px minmax(0, 1fr);
        padding: 5px 6px;
    }

    .is-public-area .compact-event-list time,
    .is-public-area .compact-event-list small {
        font-size: 9px;
    }

    .is-public-area .compact-event-list strong {
        font-size: 10.5px;
    }

    /* Event identity and navigation use one concise mobile rhythm. */
    .is-public-area .event-header-actions {
        gap: 5px;
    }

    .is-public-area .event-header-actions .button {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 10px;
    }

    .is-public-area .event-page .event-summary {
        grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
        margin-bottom: 6px;
    }

    .is-public-area .eucup-event-page .event-summary,
    .is-public-area .eucup-team-page .event-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin-bottom: 6px;
    }

    .is-public-area .event-page .event-summary > div,
    .is-public-area .eucup-event-page .event-summary > div,
    .is-public-area .eucup-team-page .event-summary > div {
        display: grid;
        justify-content: stretch;
        gap: 1px;
        min-width: 0;
        padding: 5px 4px;
        border-right: 1px solid var(--divider);
        border-bottom: 0;
        text-align: left;
    }

    .is-public-area .event-summary span {
        overflow: hidden;
        font-size: 8.5px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .is-public-area .event-summary strong {
        font-size: 14px;
    }

    .is-public-area .eucup-rule-note {
        grid-template-columns: 1fr;
        gap: 2px;
        margin: 6px 0;
        padding: 7px 8px;
        font-size: 10px;
        line-height: 1.4;
    }

    .is-public-area .eucup-event-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        min-height: 34px;
        margin: 4px 0 7px;
        overflow: visible;
    }

    .is-public-area .eucup-event-tabs a {
        min-width: 0;
        min-height: 34px;
        justify-content: center;
        gap: 4px;
        font-size: 10px;
        white-space: nowrap;
    }

    .is-public-area .eucup-event-tabs .eucup-tab-label {
        display: none;
    }

    .is-public-area .eucup-event-tabs .eucup-tab-label--mobile {
        color: inherit;
        font-size: inherit;
    }

    .is-public-area .eucup-standings-grid {
        margin: 7px 0;
    }

    .is-public-area .eucup-team-standings .panel-header > span {
        display: none;
    }

    .is-public-area .eucup-team-table {
        table-layout: fixed;
    }

    .is-public-area .eucup-team-table th:nth-child(1),
    .is-public-area .eucup-team-table td:nth-child(1) {
        width: 32px;
    }

    .is-public-area .eucup-team-table th:nth-child(3),
    .is-public-area .eucup-team-table td:nth-child(3),
    .is-public-area .eucup-team-table th:nth-child(4),
    .is-public-area .eucup-team-table td:nth-child(4) {
        display: none;
    }

    .is-public-area .eucup-team-table th:last-child,
    .is-public-area .eucup-team-table td:last-child {
        width: 88px;
        text-align: right;
        white-space: nowrap;
    }

    .is-public-area .eucup-team-name small,
    .is-public-area .eucup-individual-dog small,
    .is-public-area .record-dog small {
        display: block !important;
        margin-top: 2px;
        overflow: hidden;
        color: var(--text-muted);
        font-size: 8.5px;
        font-weight: 500;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .is-public-area .eucup-height-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .is-public-area .eucup-height-tabs a {
        min-width: 0;
        padding: 7px 5px;
        font-size: 9px;
        text-align: center;
    }

    .is-public-area .eucup-individual-class > h3 {
        padding: 7px;
        font-size: 10px;
    }

    .is-public-area .eucup-individual-table {
        table-layout: fixed;
    }

    .is-public-area .eucup-individual-table th:nth-child(1),
    .is-public-area .eucup-individual-table td:nth-child(1) {
        width: 32px;
    }

    .is-public-area .eucup-individual-table th:nth-child(n+3):nth-child(-n+6),
    .is-public-area .eucup-individual-table td:nth-child(n+3):nth-child(-n+6) {
        display: none;
    }

    .is-public-area .eucup-individual-table th:last-child,
    .is-public-area .eucup-individual-table td:last-child {
        width: 78px;
        text-align: right;
        white-space: nowrap;
    }

    .is-public-area .eucup-event-page .record-section > .discipline-tabs {
        gap: 1px;
        margin-bottom: 5px;
    }

    .is-public-area .eucup-event-page .record-section > .discipline-tabs a {
        min-width: max-content;
        padding: 6px 8px;
        font-size: 9.5px;
    }

    /* Result rows already become compact summaries on mobile. */
    .is-public-area .result-table tbody tr {
        grid-template-columns: 24px minmax(0, 1fr) minmax(92px, auto);
        padding: 6px 5px;
        gap: 2px 7px;
    }

    .is-public-area .result-table .result-place,
    .is-public-area .result-table .result-dog-cell {
        font-size: 11px;
    }

    .is-public-area .result-table .result-breed,
    .is-public-area .result-table .event-result-details {
        font-size: 9px;
    }

    .is-public-area .result-table .result-mobile-summary {
        max-width: 132px;
        font-size: 8.5px;
        text-align: right;
    }

    .is-public-area .result-table .result-mobile-summary strong {
        font-size: 10px;
    }

    .is-public-area .result-table .result-points {
        display: none;
    }

    /* Records preserve the same data while fitting the viewport. */
    .is-public-area .record-section {
        margin-top: 7px;
    }

    .is-public-area .record-section > .panel-header > span {
        max-width: 46%;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .is-public-area .record-table {
        width: 100%;
        min-width: 0;
    }

    .is-public-area .record-table--highlights th:nth-child(-n+2),
    .is-public-area .record-table--highlights td:nth-child(-n+2) {
        display: none;
    }

    .is-public-area .record-table--weight-pull {
        table-layout: fixed;
    }

    .is-public-area .record-table--weight-pull th:nth-child(1),
    .is-public-area .record-table--weight-pull td:nth-child(1) {
        width: 12%;
    }

    .is-public-area .record-table--weight-pull th:nth-child(2),
    .is-public-area .record-table--weight-pull td:nth-child(2) {
        width: 45%;
    }

    .is-public-area .record-table--weight-pull th:nth-child(3),
    .is-public-area .record-table--weight-pull td:nth-child(3) {
        width: 18%;
        text-align: right;
    }

    .is-public-area .record-table--weight-pull th:nth-child(4),
    .is-public-area .record-table--weight-pull td:nth-child(4) {
        width: 25%;
        text-align: right;
        white-space: nowrap;
    }

    .is-public-area .record-table--weight-pull .record-dog {
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .is-public-area .record-table--athletics .record-height,
    .is-public-area .record-table--athletics th:nth-child(3) {
        display: none;
    }

    .is-public-area .record-table--athletics .record-result,
    .is-public-area .record-table--athletics .record-score {
        text-align: right;
        white-space: nowrap;
    }

    .is-public-area .sport-source-switcher {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 5px 8px;
        margin: 0 0 7px;
    }

    .is-public-area .sport-source-switcher select {
        width: 100%;
        min-height: 32px;
    }
}

@media (max-width: 390px) {
    .is-public-area .site-header__inner {
        gap: 5px;
    }

    .is-public-area .sport-view__focus select {
        font-size: 10px;
    }

    .is-public-area .home-welcome__links {
        gap-inline: 8px;
    }

    .is-public-area .record-table--weight-pull th,
    .is-public-area .record-table--weight-pull td {
        padding-inline: 4px;
    }

    .is-public-area .record-table--weight-pull th:nth-child(2),
    .is-public-area .record-table--weight-pull td:nth-child(2) {
        width: 43%;
    }

    .is-public-area .record-table--weight-pull th:nth-child(4),
    .is-public-area .record-table--weight-pull td:nth-child(4) {
        width: 27%;
    }
}

/* 3.0 admin dashboard: every destination stays visible without sideways menus. */
.admin-navigation {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
    align-items: start;
    padding: 7px 0;
}

.admin-navigation__links {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    overflow: visible;
}

.admin-navigation__links a {
    flex: 0 0 auto;
}

.admin-dashboard-section {
    margin-top: 16px;
}

.admin-task-list {
    border-bottom: 1px solid var(--divider);
}

.admin-task-list a {
    display: grid;
    min-height: 45px;
    padding: 7px 4px;
    grid-template-columns: minmax(170px, 1fr) auto minmax(90px, auto);
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--divider);
    color: var(--text-soft);
    text-decoration: none;
}

.admin-task-list a:hover {
    background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
    color: var(--text-main);
}

.admin-task-list strong {
    color: var(--text-main);
    font-size: 1rem;
}

.admin-task-list small {
    justify-self: end;
    color: var(--link-color);
    font-weight: 750;
}

.admin-all-clear {
    margin: 0;
    padding: 13px 4px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-muted);
}

.admin-quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--divider);
}

.admin-quick-links a {
    display: grid;
    min-height: 58px;
    padding: 10px 12px;
    align-content: center;
    gap: 2px;
    border-top: 1px solid var(--divider);
    border-right: 1px solid var(--divider);
    color: var(--text-main);
    text-decoration: none;
}

.admin-quick-links a:nth-child(3n) {
    border-right: 0;
}

.admin-quick-links a:hover {
    background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
}

.admin-quick-links span {
    color: var(--text-muted);
    font-size: 10.5px;
}

.results-controlbar {
    justify-content: flex-end;
}

@media (max-width: 1040px) {
    .admin-navigation {
        grid-template-columns: 1fr;
    }

    .admin-navigation__search {
        grid-column: auto;
        grid-row: auto;
        width: min(100%, 430px);
    }
}

@media (max-width: 680px) {
    .admin-navigation {
        padding-inline: 8px;
    }

    .admin-navigation__links a {
        min-height: 29px;
        padding: 5px 7px;
        font-size: 10.5px;
    }

    .admin-task-list a {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 10px;
    }

    .admin-task-list small {
        display: none;
    }

    .admin-quick-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-quick-links a:nth-child(3n) {
        border-right: 1px solid var(--divider);
    }

    .admin-quick-links a:nth-child(2n) {
        border-right: 0;
    }
}
