:root {
    --blue: #01A2FC;
    --blue-soft: #E8F6FF;
    --blue-soft-hover: #D9F1FF;
    --ink: #16212B;
    --muted: #66727D;
    --line: #E5EDF2;
    --surface: #FFFFFF;
    --surface-soft: #F8FBFD;
    --max-width: 1180px;
    --radius-sm: 10px;
    --radius: 16px;
    --shadow-soft: 0 10px 30px rgba(22, 33, 43, 0.055);
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 220ms ease, color 220ms ease;
}

a {
    color: var(--blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--transition), background-color var(--transition), opacity var(--transition);
}

a:hover {
    text-decoration-thickness: 1px;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}

.shell {
    width: min(calc(100% - 2.5rem), var(--max-width));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    transform: translateY(-180%);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--blue);
    color: #FFFFFF;
    text-decoration: none;
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    transition: background-color 220ms ease, border-color 220ms ease;
}

.navbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-placeholder {
    display: inline-grid;
    place-items: center;
    width: 80px;
    height: 42px;
    border: 1px solid rgba(1, 162, 252, 0.42);
    border-radius: var(--radius-sm);
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    transition: background-color var(--transition), border-color var(--transition);
}

.brand:hover .logo-placeholder {
    border-color: rgba(1, 162, 252, 0.62);
    background: var(--blue-soft-hover);
}

.nav-links {
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    list-style: none;
}

.nav-links li {
    flex: 0 0 auto;
}

.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.55rem 0.72rem;
    border-radius: var(--radius-sm);
    color: #34414C;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-links a:hover {
    background: var(--surface-soft);
    color: var(--blue);
}

.nav-links a[aria-current="page"] {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 650;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.compact-heading {
    margin-bottom: 1.45rem;
}

.compact-heading h1 {
    margin-bottom: 0.4rem;
}

.directory-list,
.timeline-list {
    width: 100%;
    border-top: 1px solid var(--line);
}

.directory-row,
.timeline-row {
    padding: 1.25rem 0.15rem;
    border-bottom: 1px solid var(--line);
}

.directory-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.directory-main,
.timeline-main {
    min-width: 0;
}

.directory-row h2,
.timeline-row h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 650;
}

.meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    color: var(--muted);
    font-size: 0.91rem;
}

.meta-line span:not(:last-child)::after {
    content: "";
}


.directory-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    font-size: 0.9rem;
}

.directory-links a {
    text-decoration-color: rgba(1, 162, 252, 0.28);
}

.timeline-row {
    display: grid;
    grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
}

.timeline-date {
    color: var(--muted);
    font-size: 0.91rem;
    font-variant-numeric: tabular-nums;
}

.timeline-main p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
}

.timeline-separator {
    padding-inline: 0.2rem;
    color: #AAB3BB;
}

.main-content {
    flex: 1;
}

.page-shell {
    padding-block: clamp(4rem, 8vw, 7rem);
}

.page-heading {
    max-width: 760px;
    margin-bottom: 2rem;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 900px;
    margin-bottom: 0.75rem;
    color: var(--ink);
    font-size: clamp(2.25rem, 6vw, 4.25rem);
    font-weight: 650;
    line-height: 1.04;
    letter-spacing: -0.04em;
}

h2 {
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.page-description,
.prose > p {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.04rem;
}

.empty-state {
    max-width: 720px;
    min-height: 150px;
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.contact-card {
    max-width: 540px;
    margin-top: 2.5rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.contact-card h2 {
    margin-bottom: 0.85rem;
}

.contact-card p {
    margin-bottom: 0.35rem;
}

.contact-card p:last-child {
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid rgba(1, 162, 252, 0.12);
    background: var(--blue-soft);
    color: #375063;
}

.footer-inner {
    min-height: 104px;
    padding-block: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-left,
.footer-copy,
.footer-nav,
.footer-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.footer-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-copy {
    gap: 0.7rem 1rem;
}

.footer-contact {
    justify-content: flex-end;
    gap: 0.45rem 1rem;
    text-align: right;
}

.footer-copy strong {
    color: var(--ink);
    font-weight: 650;
}

.footer-copy span {
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-nav {
    gap: 0.45rem 1rem;
}

.footer-nav a,
.footer-contact a {
    color: #375063;
    font-size: 0.92rem;
    text-decoration-color: rgba(55, 80, 99, 0.3);
}

.footer-nav a:hover,
.footer-contact a:hover {
    color: var(--blue);
}

.contact-label {
    color: var(--ink);
    font-weight: 650;
}

.back-to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(1, 162, 252, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: var(--blue);
    box-shadow: 0 8px 24px rgba(22, 33, 43, 0.09);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity var(--transition), transform var(--transition), background-color var(--transition);
}

.back-to-top:hover {
    background: var(--blue-soft);
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

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

@media (max-width: 900px) {
    .shell {
        width: min(calc(100% - 1.5rem), var(--max-width));
    }

    .navbar {
        min-height: 68px;
        gap: 1rem;
    }

    .nav-links {
        overflow-x: auto;
        justify-content: flex-start;
        padding-block: 0.35rem;
        scrollbar-width: thin;
        scrollbar-color: rgba(1, 162, 252, 0.2) transparent;
    }

    .nav-links a {
        padding-inline: 0.62rem;
    }

    .footer-inner,
    .footer-left,
    .footer-copy,
    .footer-nav,
    .footer-contact {
        align-items: flex-start;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-contact {
        justify-content: flex-start;
        text-align: left;
        gap: 0.5rem 0.9rem;
    }
}

@media (max-width: 560px) {
    .navbar {
        align-items: stretch;
        flex-direction: column;
        padding-block: 0.75rem;
    }

    .brand {
        align-self: flex-start;
    }

    .nav-links {
        width: 100%;
    }

    .page-shell {
        padding-block: 3.25rem;
    }

    .empty-state {
        min-height: 120px;
        padding: 1.2rem;
    }

    .footer-contact {
        flex-direction: column;
    }
}


@media (max-width: 640px) {
    .directory-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }

    .directory-links {
        justify-content: flex-start;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Detail pages and linked directory objects */
.main-content {
    flex: 1;
    /* The shared .shell class owns the width. Keeping width unset prevents
       directory/detail content from escaping the header/footer alignment. */
}

.object-link,
.subtle-link {
    color: inherit;
    text-decoration: none;
}

.object-link {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

.object-link:hover,
.subtle-link:hover {
    color: var(--blue);
}

.directory-row h2 .object-link:hover,
.timeline-row h2 .object-link:hover {
    text-decoration: underline;
    text-decoration-color: rgba(1, 162, 252, 0.34);
}

.detail-page {
    max-width: 920px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 1.8rem;
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
}

.back-link:hover {
    color: var(--blue);
}

.detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.detail-header h1 {
    margin-bottom: 0.7rem;
}

.detail-meta {
    font-size: 0.96rem;
}

.detail-section {
    padding-top: 2.1rem;
}

.detail-section > h2,
.section-heading-row h2 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.section-heading-row {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}

.section-count {
    color: #98A2AA;
    font-size: 0.84rem;
}

.notes-copy {
    max-width: 760px;
    color: #42515D;
}

.notes-copy p:last-child {
    margin-bottom: 0;
}

.compact-empty {
    min-height: 110px;
}

.soft-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(1, 162, 252, 0.2);
    border-radius: var(--radius-sm);
    background: var(--blue-soft);
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.soft-action:hover {
    background: var(--blue-soft-hover);
    border-color: rgba(1, 162, 252, 0.32);
}

/* Social and website links */
.social-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 34px;
    padding: 0.35rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #566571;
    text-decoration: none;
    font-size: 0.84rem;
}

.social-link:hover {
    border-color: rgba(1, 162, 252, 0.12);
    background: var(--surface-soft);
    color: var(--blue);
}

.social-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-icon-fill {
    fill: currentColor;
    stroke: none;
}

.social-icon-dot {
    fill: currentColor;
    stroke: none;
}

/* Navigation illustrations */
.trophy-icon {
    color: #C99612;
    stroke: #C99612;
}

.trophy-icon .trophy-cup {
    fill: #F6D66A;
    stroke: #C99612;
}

.map-icon {
    overflow: visible;
    stroke-width: 1.25;
}

.map-icon .map-panel {
    stroke: rgba(40, 75, 92, 0.42);
}

.map-icon .map-panel-a {
    fill: #BFE8FF;
}

.map-icon .map-panel-b {
    fill: #DDF4D2;
}

.map-icon .map-panel-c {
    fill: #FFE7AD;
}

.map-icon .map-route {
    fill: none;
    stroke: #1688C9;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.map-icon .map-dot {
    fill: #F06B61;
    stroke: #FFFFFF;
    stroke-width: 0.8;
}

@media (max-width: 700px) {
    .detail-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* Search and directory controls */
.directory-heading {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.directory-heading > div {
    min-width: 0;
}

.search-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.search-form input[type="search"] {
    width: min(280px, 55vw);
    min-height: 42px;
    padding: 0.58rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.search-form input[type="search"]:focus {
    border-color: rgba(1, 162, 252, 0.42);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(1, 162, 252, 0.08);
}

.search-form button,
.search-clear {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.9rem;
}

.search-form button {
    border: 1px solid rgba(1, 162, 252, 0.22);
    background: var(--blue-soft);
    color: var(--blue);
    cursor: pointer;
}

.search-form button:hover {
    background: var(--blue-soft-hover);
}

.search-clear {
    color: var(--muted);
    text-decoration: none;
}

.search-clear:hover {
    color: var(--blue);
}

.recent-section {
    margin-top: clamp(3.5rem, 7vw, 6rem);
}

.recent-heading {
    margin-bottom: 0.8rem;
}

/* Swim completion leaderboards */
.swim-detail-page {
    max-width: none;
}

.sex-completion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.completion-panel,
.unclassified-completions {
    min-width: 0;
}

.completion-panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.completion-panel-heading h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.completion-panel-heading span {
    color: var(--muted);
    font-size: 0.82rem;
}

.completion-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.completion-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    font-size: 0.91rem;
    font-variant-numeric: tabular-nums;
}

.completion-table th,
.completion-table td {
    padding: 0.72rem 0.8rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.completion-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 600;
}

.completion-table tbody tr:last-child td {
    border-bottom: 0;
}

.completion-table tbody tr:hover {
    background: rgba(232, 246, 255, 0.35);
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sort-button:hover {
    color: var(--blue);
}

.sort-indicator {
    width: 0.9rem;
    color: #9AA5AD;
    font-size: 0.8rem;
    text-align: center;
}

.finisher-name {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
}

.medal-badge {
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 1.65rem;
    display: none;
    place-items: center;
    border-radius: 50%;
    color: #544412;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1;
}

.completion-table[data-sort-key="time"] .medal-badge {
    display: inline-grid;
}

.completion-table[data-sort-key="time"] .medal-1 {
    background: #F2D268;
    color: #5B4910;
}

.completion-table[data-sort-key="time"] .medal-2 {
    background: #DCE1E5;
    color: #46515A;
}

.completion-table[data-sort-key="time"] .medal-3 {
    background: #D9A477;
    color: #5C3821;
}

.time-cell {
    white-space: nowrap;
}

.table-muted,
.completion-empty {
    color: var(--muted);
}

.completion-empty {
    margin: 0;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    font-size: 0.91rem;
}

.unclassified-completions {
    margin-top: 2rem;
    max-width: calc(50% - 0.75rem);
}

@media (max-width: 800px) {
    .directory-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .search-form {
        width: 100%;
        justify-content: flex-start;
    }

    .search-form input[type="search"] {
        width: min(100%, 360px);
    }

    .sex-completion-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .unclassified-completions {
        max-width: none;
    }
}

@media (max-width: 500px) {
    .search-form input[type="search"] {
        flex: 1 1 100%;
        width: 100%;
    }
}


/* Completion metadata and record summaries */
.completion-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
}

.completion-meta-line > *:not(:last-child)::after {
    content: "";
}

.completion-notes {
    margin-top: 0.3rem !important;
}

.source-link {
    white-space: nowrap;
    color: var(--blue);
    text-decoration-color: rgba(1, 162, 252, 0.28);
}

.records-page {
    max-width: none;
}

.record-sex-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
}

.record-sex-column > h2 {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

.record-card-list {
    border-top: 1px solid var(--line);
}

.record-card {
    padding: 1.2rem 0.1rem 1.3rem;
    border-bottom: 1px solid var(--line);
}

.record-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.record-water-type {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.record-distance {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.record-holder + .record-holder {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(229, 237, 242, 0.75);
}

.record-swim {
    display: inline-block;
    margin-bottom: 0.18rem;
    font-weight: 650;
}

.record-holder-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.7rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.record-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.91rem;
}

@media (max-width: 760px) {
    .record-sex-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* Interactive GPX route map */
.route-map-section {
    margin-top: 1.6rem;
}

.interactive-route-map {
    position: relative;
    width: 100%;
    height: 30rem;
    margin-top: 0.85rem;
    overflow: hidden;
    background: #eef6fa;
    border: 1px solid rgba(1, 162, 252, 0.16);
    border-radius: 18px;
}

.route-map-status {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
    color: var(--muted);
    background: var(--surface, #ffffff);
    text-align: center;
}

.route-map-status.is-error {
    color: var(--muted);
}

.route-map-unavailable {
    margin: 0.8rem 0 0;
    padding: 0.9rem 1rem;
    color: var(--muted);
    background: var(--surface, #f7fbfd);
    border: 1px solid rgba(1, 162, 252, 0.12);
    border-radius: 12px;
}

@media (max-width: 760px) {
    .interactive-route-map {
        height: 22rem;
        border-radius: 14px;
    }
}

.social-icon-wikipedia {
    fill: currentColor;
    stroke: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 700;
}

/* Theme toggle */
.theme-toggle-item {
    display: flex;
    align-items: center;
}

.theme-toggle {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-soft);
    color: #526675;
    cursor: pointer;
    overflow: hidden;
    transition:
        color 220ms ease,
        background-color 220ms ease,
        border-color 220ms ease,
        transform 220ms ease;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: rgba(1, 162, 252, 0.08);
    transform: scale(0.75);
    opacity: 0;
    transition: transform 280ms ease, opacity 280ms ease, background-color 280ms ease;
}

.theme-toggle:hover {
    border-color: rgba(1, 162, 252, 0.34);
    background: var(--blue-soft);
    color: var(--blue);
}

.theme-toggle:hover::before {
    transform: scale(1);
    opacity: 1;
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.theme-icon-stage {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    display: block;
}

.theme-icon {
    position: absolute;
    inset: 0;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform-origin: 50% 50%;
    transition:
        opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon-sun {
    opacity: 0;
    transform: rotate(-100deg) scale(0.58);
}

html[data-theme="dark"] .theme-toggle {
    color: #F2C766;
    background: #14232D;
    border-color: #2B414E;
}

html[data-theme="dark"] .theme-toggle::before {
    background: rgba(242, 199, 102, 0.08);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 0;
    transform: rotate(100deg) scale(0.58);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle.is-switching .theme-icon-stage {
    animation: theme-icon-pop 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes theme-icon-pop {
    0% { transform: scale(1); }
    46% { transform: scale(0.78); }
    100% { transform: scale(1); }
}

/* Dark mode keeps the same restrained visual language and blue accent. */
html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --blue-soft: #0D3449;
    --blue-soft-hover: #10445F;
    --ink: #EAF3F8;
    --muted: #9AAEBA;
    --line: #263A47;
    --surface: #0E1820;
    --surface-soft: #14232D;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .site-header {
    background: rgba(14, 24, 32, 0.97);
}

html[data-theme="dark"] .nav-links a {
    color: #C5D4DC;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a[aria-current="page"] {
    color: var(--blue);
}

html[data-theme="dark"] .timeline-separator,
html[data-theme="dark"] .section-count,
html[data-theme="dark"] .sort-indicator {
    color: #78909D;
}

html[data-theme="dark"] .site-footer {
    color: #B7CBD6;
    background: #102B3B;
}

html[data-theme="dark"] .footer-nav a,
html[data-theme="dark"] .footer-contact a {
    color: #B7CBD6;
    text-decoration-color: rgba(183, 203, 214, 0.35);
}

html[data-theme="dark"] .back-to-top {
    background: rgba(20, 35, 45, 0.97);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .notes-copy,
html[data-theme="dark"] .social-link {
    color: #B3C5CF;
}

html[data-theme="dark"] .completion-table tbody tr:hover {
    background: rgba(1, 162, 252, 0.06);
}

html[data-theme="dark"] .record-holder + .record-holder {
    border-top-color: rgba(38, 58, 71, 0.8);
}

html[data-theme="dark"] .map-icon .map-panel {
    stroke: rgba(191, 221, 236, 0.45);
}

html[data-theme="dark"] .map-icon .map-panel-a {
    fill: #174C68;
}

html[data-theme="dark"] .map-icon .map-panel-b {
    fill: #284D3A;
}

html[data-theme="dark"] .map-icon .map-panel-c {
    fill: #654D25;
}

html[data-theme="dark"] .map-icon .map-route {
    stroke: #61C2F7;
}

html[data-theme="dark"] .map-icon .map-dot {
    stroke: #0E1820;
}

html[data-theme="dark"] .interactive-route-map {
    background: #122531;
    border-color: rgba(1, 162, 252, 0.24);
}

html[data-theme="dark"] .route-map-status {
    background: #122531;
}

@media (prefers-reduced-motion: reduce) {
    .theme-icon,
    .theme-toggle,
    .theme-toggle::before {
        transition: none;
    }

    .theme-toggle.is-switching .theme-icon-stage {
        animation: none;
    }
}

/* 2026-08 map + records refinement */
.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--accent, #01A2FC);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Records showcase */
.records-showcase {
    display: grid;
    gap: 1.4rem;
}

.records-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 3rem);
    overflow: hidden;
    padding: clamp(1.4rem, 4vw, 3.2rem);
    border: 1px solid rgba(1, 162, 252, 0.14);
    border-radius: 30px;
    background:
        radial-gradient(circle at 13% 8%, rgba(1, 162, 252, 0.1), transparent 32%),
        linear-gradient(145deg, rgba(255,255,255,0.96), rgba(239,249,255,0.86));
}

.records-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -62% 38%;
    height: 250px;
    border-radius: 50%;
    background: rgba(1, 162, 252, 0.06);
    pointer-events: none;
}

.records-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.records-hero-copy h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.records-hero-copy .page-description {
    max-width: 590px;
    margin-top: 1rem;
    font-size: clamp(1rem, 1.6vw, 1.16rem);
}

.records-hero-art {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    justify-self: end;
    overflow: visible;
}

.records-sun {
    fill: rgba(255, 202, 82, 0.24);
}

.records-wave {
    stroke: none;
}

.records-wave.wave-back {
    fill: rgba(111, 208, 255, 0.52);
}

.records-wave.wave-front {
    fill: url(#records-water);
    opacity: 0.88;
}

.records-trophy-cup {
    fill: url(#records-gold);
    stroke: #cc9418;
    stroke-width: 3;
}

.records-trophy-line,
.records-butterfly {
    fill: none;
    stroke: #b67f0c;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.records-butterfly {
    stroke-width: 3.3;
}

.records-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.7rem;
    color: rgba(1, 162, 252, 0.48);
}

.records-divider span {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(1, 162, 252, 0.2));
}

.records-divider span:last-child {
    background: linear-gradient(90deg, rgba(1, 162, 252, 0.2), transparent);
}

.records-divider svg {
    width: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.record-showcase-grid {
    gap: clamp(1rem, 3vw, 1.7rem);
}

.record-board {
    padding: clamp(1rem, 2.4vw, 1.4rem);
    border: 1px solid rgba(24, 52, 68, 0.09);
    border-radius: 24px;
    background: rgba(255,255,255,0.72);
}

.record-board-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding: 0.2rem 0.2rem 0.85rem;
    border-bottom: 1px solid rgba(24, 52, 68, 0.08);
}

.record-board-heading h2 {
    margin: 0.08rem 0 0;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.record-board-kicker {
    color: var(--muted, #647783);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.record-board-medal {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    fill: rgba(245, 189, 54, 0.18);
    stroke: #d49d1d;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.record-showcase-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid rgba(24, 52, 68, 0.075);
    border-radius: 18px;
    background: rgba(255,255,255,0.7);
    box-shadow: none;
    transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .record-showcase-card:hover {
        transform: translateY(-2px);
        border-color: rgba(1, 162, 252, 0.22);
        background: rgba(255,255,255,0.92);
    }
}

.record-type-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(1, 162, 252, 0.08);
    color: #01A2FC;
}

.record-type-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.record-card-main {
    min-width: 0;
}

.record-showcase-card .record-card-heading {
    align-items: baseline;
    gap: 0.7rem;
}

.record-showcase-card .record-distance {
    font-size: 1rem;
    white-space: normal;
    text-align: right;
}

/* MapLibre maps */
.maplibre-map {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(24, 52, 68, 0.12);
    border-radius: 22px;
    background: #eaf4f9;
}

.interactive-route-map {
    width: 100%;
    min-height: 480px;
}

.map-page {
    display: grid;
    gap: 1rem;
}

.map-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.25rem;
}

.map-page-heading h1 {
    margin: 0;
}

.map-page-heading .page-description {
    max-width: 700px;
    margin-top: 0.55rem;
}

.overview-map {
    width: 100%;
    min-height: 650px;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem 1rem;
    padding-bottom: 0.2rem;
    color: var(--muted, #647783);
    font-size: 0.88rem;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.legend-dot {
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid rgba(255,255,255,0.95);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(24,52,68,0.12);
}

.legend-dot.is-completed { background: #2f9d67; }
.legend-dot.is-open { background: #d95a5a; }

.map-page-note {
    margin: 0;
    color: var(--muted, #647783);
    font-size: 0.83rem;
}

.route-map-status {
    position: absolute;
    z-index: 2;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(24,52,68,0.09);
    border-radius: 999px;
    background: rgba(255,255,255,0.94);
    color: #536a76;
    font-size: 0.88rem;
    box-shadow: 0 8px 26px rgba(31,68,86,0.08);
}

.route-map-status.is-error {
    color: #9d3e3e;
}

.route-map-status.is-warning {
    color: #75590b;
}

html[data-theme="dark"] .route-map-status.is-warning {
    color: #f0cf70;
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(15, 43, 58, 0.14) !important;
}

.maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
}

.maplibregl-ctrl-attrib {
    font-size: 10px;
}


@media (max-width: 760px) {
    .records-hero {
        grid-template-columns: 1fr;
        padding-bottom: 0;
    }

    .records-hero-art {
        max-width: 330px;
        justify-self: center;
        margin-top: -0.4rem;
    }

    .map-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-legend {
        justify-content: flex-start;
    }

    .interactive-route-map {
        min-height: 410px;
    }

    .overview-map {
        min-height: 520px;
    }
}

@media (max-width: 480px) {
    .record-showcase-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 0.7rem;
    }

    .record-type-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .record-type-icon svg {
        width: 29px;
        height: 29px;
    }

    .record-showcase-card .record-card-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .record-showcase-card .record-distance {
        text-align: left;
    }

    .interactive-route-map,
    .overview-map {
        min-height: 400px;
        border-radius: 17px;
    }
}

html[data-theme="dark"] .records-hero {
    border-color: rgba(92, 190, 246, 0.14);
    background:
        radial-gradient(circle at 13% 8%, rgba(1,162,252,0.12), transparent 32%),
        linear-gradient(145deg, rgba(28,43,51,0.96), rgba(22,35,42,0.92));
}

html[data-theme="dark"] .records-hero::after {
    background: rgba(1,162,252,0.05);
}

html[data-theme="dark"] .record-board,
html[data-theme="dark"] .record-showcase-card {
    border-color: rgba(210, 232, 243, 0.09);
    background: rgba(30, 45, 53, 0.74);
}

@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .record-showcase-card:hover {
        border-color: rgba(1,162,252,0.25);
        background: rgba(35, 52, 61, 0.94);
    }
}

html[data-theme="dark"] .record-board-heading {
    border-bottom-color: rgba(210,232,243,0.08);
}

html[data-theme="dark"] .record-type-icon {
    background: rgba(1,162,252,0.12);
}

html[data-theme="dark"] .maplibre-map {
    border-color: rgba(210,232,243,0.12);
    background: #18252c;
}

html[data-theme="dark"] .route-map-status {
    border-color: rgba(210,232,243,0.1);
    background: rgba(27,42,50,0.95);
    color: #c3d2da;
}

html[data-theme="dark"] .legend-dot {
    border-color: rgba(26, 39, 46, 0.95);
    box-shadow: 0 0 0 1px rgba(220,235,242,0.14);
}

/* 2026-08 brand, gender and map marker refinement */
.brand {
    gap: 0.55rem;
}

.brand-logo {
    display: block;
    width: 156px;
    height: 58px;
    object-fit: contain;
    transition: transform var(--transition), opacity var(--transition);
}


@media (hover: hover) and (pointer: fine) {
    .brand:hover .brand-logo {
        transform: translateY(-1px);
    }
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.footer-logo {
    display: block;
    width: 126px;
    height: 48px;
    object-fit: contain;
}

.gender-icon {
    display: inline-grid;
    place-items: center;
    width: 1.08rem;
    height: 1.08rem;
    flex: 0 0 1.08rem;
    vertical-align: -0.14em;
}

.gender-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gender-icon-male {
    color: #01A2FC;
}

.gender-icon-female {
    color: #F05A9D;
}

.gender-label,
.person-with-gender {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.completion-panel-heading h3,
.record-board-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.records-intro {
    max-width: 590px;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.16rem);
}


.record-board-heading {
    justify-content: flex-start;
}

.record-card-list {
    display: grid;
    gap: 0.9rem;
    border-top: 0;
}

.record-card {
    border-bottom: 0;
}

.record-type-icon {
    background: rgba(1, 162, 252, 0.065);
}

.record-type-icon svg {
    stroke-width: 2.15;
}

.route-endpoint-marker {
    width: 16px;
    height: 16px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(22, 42, 52, 0.34);
}

.route-endpoint-marker.is-start {
    background: #2DBE60;
}

.route-endpoint-marker.is-finish {
    background: #E44D4D;
}

.route-endpoint-marker.is-overview-endpoint {
    cursor: pointer;
}

.route-endpoint-marker.is-overview-endpoint:focus-visible {
    outline: 2px solid #01A2FC;
    outline-offset: 3px;
}

.route-endpoint-marker.is-map-hidden {
    display: none !important;
}

html[data-theme="dark"] .route-endpoint-marker {
    border-color: #f3f8fb;
}

.route-status-marker {
    width: 21px;
    height: 21px;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(22, 42, 52, 0.34);
    cursor: pointer;
}

.route-status-marker.is-split {
    background: linear-gradient(90deg, #d95a5a 0 50%, #2f9d67 50% 100%);
}

.route-status-marker:focus-visible {
    outline: 2px solid #01A2FC;
    outline-offset: 3px;
}

.route-status-marker.is-map-hidden {
    display: none !important;
}

html[data-theme="dark"] .route-status-marker {
    border-color: #f3f8fb;
}


@media (max-width: 560px) {
    .brand-logo {
        width: 138px;
        height: 52px;
    }

}

.country-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.country-flag {
    display: inline-block;
    flex: 0 0 auto;
    margin-inline-end: 0.62rem;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.05em;
    line-height: 1;
    transform: translateY(-0.02em);
}

.country-name {
    display: inline-block;
}

.country-link {
    color: inherit;
    text-decoration: none;
}

.country-link:hover .country-name {
    color: #017fc4;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.social-icon-openwaterpedia {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* 2026-09 country pages, person statistics and multi-source links */
.source-links {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.table-source-links {
    min-width: max-content;
}

.person-stat-grid,
.country-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.country-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.2rem 0 2rem;
}

.person-stat-card,
.country-stat-grid article {
    min-width: 0;
    padding: 1rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface, #fff);
}

.person-stat-card strong,
.country-stat-grid strong {
    display: block;
    margin-bottom: 0.24rem;
    font-size: 1.05rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.person-stat-card > span,
.country-stat-grid article > span {
    color: var(--muted, #64727c);
    font-size: 0.88rem;
}

.person-stat-card .subtle-link {
    display: inline-block;
    margin-top: 0.2rem;
}

.person-stat-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.person-stat-detail {
    display: grid;
    gap: 0.22rem;
    padding: 0.9rem 1.05rem;
    border-radius: 12px;
    background: rgba(1, 162, 252, 0.055);
}

.person-stat-detail > span {
    color: var(--muted, #64727c);
    font-size: 0.84rem;
}

.water-stat-list {
    margin-top: 0.85rem;
    border-top: 1px solid var(--line);
}

.water-stat-row {
    display: grid;
    grid-template-columns: minmax(6rem, .65fr) minmax(8rem, .9fr) minmax(10rem, 1.4fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--line);
}

.water-stat-row strong {
    text-align: right;
}

.country-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.country-hero-flag {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 2rem;
    line-height: 1;
}

html[data-theme="dark"] .country-link:hover .country-name {
    color: #67c8ff;
}

html[data-theme="dark"] .person-stat-card,
html[data-theme="dark"] .country-stat-grid article {
    background: var(--surface, #10202a);
}

html[data-theme="dark"] .person-stat-detail {
    background: rgba(1, 162, 252, 0.11);
}

@media (max-width: 820px) {
    .person-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .country-stat-grid,
    .person-stat-detail-grid {
        grid-template-columns: 1fr;
    }

    .water-stat-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .water-stat-row strong {
        text-align: left;
    }
}

/* Route chooser for overlapping GPX tracks */
.route-choice-menu {
    min-width: 190px;
    color: var(--ink);
}

.route-choice-title {
    display: block;
    margin: 0 1.7rem 0.55rem 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.route-choice-list {
    display: grid;
    gap: 0.28rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.route-choice-link {
    display: block;
    padding: 0.48rem 0.55rem;
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.25;
    text-decoration: none;
}

.route-choice-link:hover,
.route-choice-link:focus-visible {
    background: var(--blue-soft);
    color: var(--blue);
    outline: none;
}

.maplibregl-popup-content {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 32px rgba(20, 45, 62, 0.13);
}

.maplibregl-popup-close-button {
    color: var(--muted);
    font-size: 1.2rem;
}

.maplibregl-popup-close-button:hover {
    background: transparent;
    color: var(--ink);
}

html[data-theme="dark"] .maplibregl-popup-content {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
}


/* 2026-09 Hall of Fame */
.about-copy {
    max-width: 760px;
}

.about-copy p {
    margin: 0 0 1.15rem;
}

.hall-heading {
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1.45rem;
}

.hall-sort {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.38rem;
}

.hall-sort a {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.hall-sort a:hover,
.hall-sort a[aria-current="page"] {
    border-color: rgba(1, 162, 252, 0.34);
    background: rgba(1, 162, 252, 0.09);
    color: var(--blue);
}

.hall-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.hall-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
}

.hall-table th,
.hall-table td {
    padding: 0.85rem 0.9rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.hall-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
}

.hall-table tbody tr:last-child td {
    border-bottom: 0;
}

.hall-table tbody tr:hover {
    background: rgba(1, 162, 252, 0.04);
}

.hall-rank-col {
    width: 4.5rem;
}

.hall-rank span {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.hall-table tbody tr:nth-child(1) .hall-rank span {
    background: #f2d268;
    color: #5b4910;
}

.hall-table tbody tr:nth-child(2) .hall-rank span {
    background: #dce1e5;
    color: #46515a;
}

.hall-table tbody tr:nth-child(3) .hall-rank span {
    background: #d9a477;
    color: #5c3821;
}

.hall-person {
    display: inline-flex;
    align-items: center;
}

.hall-sex {
    display: inline-flex;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.hall-number {
    white-space: nowrap;
}

html[data-theme="dark"] .hall-sort a {
    background: var(--surface);
}

html[data-theme="dark"] .hall-sort a:hover,
html[data-theme="dark"] .hall-sort a[aria-current="page"] {
    background: rgba(1, 162, 252, 0.13);
}

html[data-theme="dark"] .hall-table tbody tr:hover {
    background: rgba(1, 162, 252, 0.07);
}

@media (max-width: 800px) {
    .hall-sort {
        justify-content: flex-start;
    }
}
