:root {
    --nav-bg: #00406e;
    --nav-text: #ffffff;
    --nav-active-bg: #007ec1;
    --nav-active-text: #ffffff;
    --table-header-bg: #00406e;
    --table-header-text: #ffffff;
    --heading-color: #00406e;
    --table-text: #17222b;
    --table-bg: #ffffff;
    --page-bg: #eaf0f3;
    --info-table-bg: #ffffff;
    --info-table-text: #17222b;
    --classification-color: #00406e;
    --button-bg: var(--nav-active-bg);
    --button-text: var(--nav-active-text);
    --ink: #17222b;
    --charcoal: #3e3d40;
    --muted: #667580;
    --line: #dce4e9;
    --line-strong: #c8d4dc;
    --surface: #ffffff;
    --surface-soft: #f3f7f9;
    --surface-blue: #eaf5fb;
    --success: #1a7f5a;
    --shadow: 0 16px 40px rgba(0, 64, 110, 0.10);
    --shadow-soft: 0 10px 26px rgba(0, 64, 110, 0.06);
    --radius: 14px;
    --sidebar: 252px;
    --header-height: 72px;
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    overscroll-behavior-y: none;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    overscroll-behavior-y: none;
    color: var(--ink);
    background: var(--page-bg);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

a { color: var(--heading-color); }
a:hover { color: var(--nav-active-bg); }

img,
svg { display: block; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: #fff;
    background: var(--nav-bg);
    border-radius: 8px;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}

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

:focus-visible {
    outline: 3px solid rgba(0, 126, 193, 0.42);
    outline-offset: 2px;
}

.app { min-height: 100vh; }

/* ===== Application sidebar ===== */
.site-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    color: var(--nav-text);
    background: var(--nav-bg);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 188px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.site-logo {
    width: 155px;
    max-width: 100%;
    height: auto;
    padding: 0;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.sidebar-label {
    margin: 24px 12px 9px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.site-nav ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link,
.nav-link:link,
.nav-link:visited {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.nav-link:active { transform: translateY(1px); }

.nav-link.active,
.nav-link.active:link,
.nav-link.active:visited {
    color: var(--nav-active-text);
    background: var(--nav-active-bg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: block;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 10px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.classification {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.environment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #78d4b0;
    box-shadow: 0 0 0 4px rgba(120, 212, 176, 0.14);
}

.version {
    margin: 8px 0 0 17px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
}

/* ===== Top bar and page content ===== */
.site-shell {
    min-height: 100vh;
    margin-left: var(--sidebar);
    padding-top: var(--header-height);
}

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar);
    z-index: 30;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 12px 34px;
    color: var(--info-table-text);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 3px 14px rgba(30, 48, 60, 0.04);
    backdrop-filter: blur(12px);
}

.header-context { min-width: 0; }

.header-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-title {
    margin: 1px 0 0;
    overflow: hidden;
    color: var(--heading-color);
    font-size: 18px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-meta {
    display: grid;
    justify-items: end;
    gap: 3px;
    padding-left: 22px;
    border-left: 1px solid var(--line);
}

.site-meta-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.site-meta-icon {
    width: 20px;
    height: 20px;
    color: var(--heading-color);
}

.site-meta-copy {
    display: grid;
    gap: 1px;
}

.site-meta-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

.site-meta-date {
    color: var(--heading-color);
    font-size: 15px;
    font-weight: 760;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.site-meta-generated {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

#main-content {
    width: min(1420px, 100%);
    min-height: calc(100vh - 240px);
    margin: 0 auto;
    padding: 34px;
}

.page-heading { margin: 0 0 26px; }

h1,
h2,
h3,
.page-title {
    color: var(--heading-color);
}

.page-title,
h1 {
    margin: 0;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-align: left;
}

h2 {
    margin: 28px 0 14px;
    color: var(--charcoal);
    font-size: 18px;
    line-height: 1.3;
    text-align: left;
}

h3 {
    margin: 20px 0 10px;
    font-size: 15px;
    text-align: left;
}

/* ===== Searchable data panels ===== */
.list-block {
    margin-bottom: 24px;
    padding: 12px 0 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.list-count {
    min-height: 18px;
    margin: 0 0 8px !important;
    padding: 0 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-color: var(--line-strong) transparent;
}

table.list {
    width: 100%;
    min-width: 1140px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

td.list-filter-cell {
    padding: 10px 8px;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

td.list-filter-cell:first-child { padding-left: 16px; }
td.list-filter-cell:last-child { padding-right: 16px; }

input.list-search,
select.list-filter {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.list-search { min-width: 150px; }
input.list-search::placeholder { color: #89959d; }

input.list-search:hover,
select.list-filter:hover { border-color: #aabac5; }

input.list-search:focus,
select.list-filter:focus {
    border-color: var(--nav-active-bg);
    box-shadow: 0 0 0 3px rgba(0, 126, 193, 0.12);
    outline: 0;
}

th.list {
    height: 44px;
    padding: 12px 16px;
    color: #60717c;
    background: var(--surface-soft);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

th.list.sortable-col:hover { color: var(--heading-color); background: #eaf1f5; }

th.list-share-heading {
    line-height: 1.2;
    white-space: nowrap;
}

button.sort-button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    color: inherit;
    cursor: pointer;
    text-align: inherit;
    user-select: none;
    white-space: nowrap;
}

th.list.sortable-col .sort-button::after {
    content: "\2195";
    flex: 0 0 auto;
    opacity: 0.45;
}

th.list.sort-asc .sort-button::after { content: "\2191"; opacity: 1; }
th.list.sort-desc .sort-button::after { content: "\2193"; opacity: 1; }

td.list {
    height: 52px;
    padding: 12px 16px;
    overflow-wrap: break-word;
    color: var(--table-text);
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    text-align: left;
    vertical-align: middle;
}

table.list tr:last-child td.list { border-bottom: 0; }
table.list tr:not(.list-filter-row):not(.list-header-row):hover td.list { background: #f8fbfc; }

td.list a {
    color: var(--heading-color);
    font-weight: 720;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

th.list-num,
td.list-num { text-align: right; }

/* ===== Detail cards ===== */
table.card {
    width: 100%;
    min-width: 720px;
    margin: 0 auto 22px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    table-layout: auto;
}

th.card {
    height: 62px;
    padding: 16px 20px;
    color: var(--charcoal);
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    font-weight: 760;
    line-height: 1.3;
    text-align: left;
}

th.card_subheader {
    height: 42px;
    padding: 11px 16px;
    color: #60717c;
    background: var(--surface-soft);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

td.card {
    min-height: 48px;
    padding: 12px 16px;
    overflow-wrap: break-word;
    color: var(--table-text);
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    text-align: left;
    vertical-align: top;
}

table.card tr:last-child td.card { border-bottom: 0; }
table.card td.card:first-child { color: var(--muted); font-weight: 650; }
table.card td.card a { color: var(--heading-color); font-weight: 700; }

td.card-num,
th.card_subheader-num { text-align: right; }

.share-cell { min-width: 112px; }

.share-bar {
    width: 100%;
    min-width: 96px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.share-bar-track {
    position: relative;
    width: 46px;
    height: 5px;
    flex: 0 0 46px;
    overflow: hidden;
    background: #dce5ea;
    border-radius: 999px;
}

.share-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    background: var(--nav-active-bg);
    border-radius: inherit;
}

.share-bar-value {
    color: var(--table-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.detail-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    align-items: start;
    gap: 20px;
}

.detail-info,
.detail-map { min-width: 0; }

.detail-info table.card { min-width: 0; }

.detail-map > a,
.map-scroll {
    display: block;
    padding: 20px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

a.map-button:link,
a.map-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    color: var(--button-text);
    background: var(--button-bg);
    border: 1px solid var(--button-bg);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

a.map-button:hover,
a.map-button:focus {
    color: var(--nav-active-text);
    background: var(--nav-bg);
    border-color: var(--nav-bg);
}

/* ===== Locations and globe ===== */
.location-map-section { margin-bottom: 30px; }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 14px;
}

.section-heading h2 { margin: 0; color: var(--charcoal); font-size: 17px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.map-tools { margin-bottom: 14px; padding: 12px 14px; }
.map-tools .list-count { padding: 0 2px; }

.map-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 0.8fr));
    gap: 8px;
}

.location-directory-heading { margin-top: 0; }

/* ===== Hub, system information, static pages ===== */
.hub { max-width: 1040px; }
.hub-section { margin: 0 0 30px; }

.hub-heading {
    margin: 0 0 14px;
    color: var(--charcoal);
    font-size: 17px;
}

.hub-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hub-link,
.hub-link:visited {
    display: block;
    height: 100%;
    min-height: 104px;
    padding: 18px;
    color: var(--heading-color);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(0, 64, 110, 0.05);
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-link:hover,
.hub-link:focus {
    color: var(--heading-color);
    border-color: #a9cfe4;
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.hub-link-label { display: block; font-weight: 760; }
.hub-link-desc { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.static-page {
    max-width: 900px;
    padding: 24px 26px;
    color: var(--table-text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    line-height: 1.65;
}

.static-page > :first-child { margin-top: 0; }
.static-page > :last-child { margin-bottom: 0; }
.static-page h2,
.static-page h3 { color: var(--charcoal); text-align: left; }

.sysinfo { margin: 0 0 26px; }
.sysinfo-row { display: grid; grid-template-columns: 200px 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sysinfo-row dt { color: var(--muted); font-weight: 650; }
.sysinfo-row dd { margin: 0; font-weight: 650; }
.sysinfo-list { margin: 8px 0 24px; padding-left: 20px; }
.sysinfo-list li { margin: 5px 0; }

/* ===== Footer ===== */
.site-footer {
    width: min(1420px, calc(100% - 68px));
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin: 20px auto 0;
    padding: 24px 0 30px;
    color: var(--muted);
    border-top: 1px solid var(--line-strong);
    font-size: 12px;
}

.footer-section h2 {
    margin: 0 0 8px;
    color: var(--charcoal);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-section p,
.distribution-note { margin: 4px 0; }
.footer-section ul { margin: 4px 0; padding-left: 18px; }
.distribution-note { align-self: end; }

/* ===== Responsive layout ===== */
@media (max-width: 1120px) {
    .site-sidebar { width: 220px; }
    .site-shell { margin-left: 220px; }
    .site-header { left: 220px; padding-inline: 26px; }
    #main-content { padding: 28px 26px; }
    .site-footer { width: calc(100% - 52px); }
    .map-filter-bar { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .map-filter-bar .map-search { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .detail-cols { grid-template-columns: 1fr; }
    .detail-map { max-width: 620px; }
}

@media (max-width: 820px) {
    .app { padding-top: 64px; }

    .site-sidebar {
        position: relative;
        z-index: 20;
        width: 100%;
        padding: 14px 16px;
    }

    .brand {
        min-height: 0;
        justify-content: flex-start;
        padding: 0 0 14px;
        border: 0;
    }

    .site-logo { width: 86px; padding: 0; }
    .sidebar-label { display: none; }

    .site-nav ul {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(118px, 1fr);
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .nav-link,
    .nav-link:link,
    .nav-link:visited {
        justify-content: center;
        gap: 8px;
        padding-inline: 10px;
        background: rgba(255, 255, 255, 0.07);
    }

    .sidebar-footer {
        display: flex;
        align-items: center;
        gap: 18px;
        margin-top: 12px;
        padding: 12px 2px 0;
    }

    .version { margin: 0; }
    .site-shell { margin-left: 0; padding-top: 0; }

    .site-header {
        left: 0;
        min-height: 64px;
        padding: 10px 16px;
    }

    #main-content { min-height: 0; padding: 24px 16px; }
    .site-footer { width: calc(100% - 32px); }
    table.list { min-width: 760px; }
    table.card { min-width: 680px; }
    .detail-info table.card { min-width: 0; }
}

@media (max-width: 620px) {
    .site-nav ul { grid-auto-columns: minmax(82px, 1fr); }

    .nav-link,
    .nav-link:link,
    .nav-link:visited {
        gap: 5px;
        padding-inline: 5px;
        font-size: 11px;
    }

    .nav-icon { width: 16px; height: 16px; }

    .site-header { align-items: flex-start; gap: 14px; }
    .header-kicker { display: none; }
    .header-title { font-size: 16px; }

    .site-meta { padding-left: 14px; }
    .site-meta-generated { display: none; }

    .page-heading { margin-bottom: 20px; }
    .page-title { font-size: 27px; }
    .section-heading { display: block; }
    .map-filter-bar { grid-template-columns: 1fr; }
    .map-filter-bar .map-search { grid-column: auto; }
    .static-page { padding: 20px 18px; }
    .sysinfo-row { grid-template-columns: 1fr; gap: 2px; }
}

@media print {
    .app { padding-top: 0; }
    .site-sidebar { display: none; }
    .site-shell { margin-left: 0; padding-top: 0; }
    .site-header { position: static; }
    #main-content,
    .site-footer { width: 100%; padding-inline: 0; }
    .list-block,
    table.card,
    .static-page,
    .map-scroll { box-shadow: none; }
}
