:root {
    --ink: #172133;
    --muted: #657086;
    --line: #dce3ec;
    --surface: #ffffff;
    --surface-soft: #f4f7fa;
    --brand: #075985;
    --brand-dark: #0c3f5d;
    --accent: #f0b429;
    --danger: #b42318;
    --radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--ink);
    background: #eef3f7;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--brand);
    text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -5rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: white;
}

.skip-link:focus {
    top: 1rem;
}

.shell {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: white;
    background: linear-gradient(110deg, var(--brand-dark), var(--brand));
}

.header-content {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: rgba(255, 255, 255, 0.72);
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 650;
}

.main-content {
    flex: 1;
    padding-block: clamp(2rem, 5vw, 4.5rem);
}

.site-footer {
    padding: 1.4rem 0;
    color: #cbd5e1;
    background: #111827;
}

.site-footer .shell {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.hero {
    min-height: 520px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
}

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

h1 {
    max-width: 18ch;
    margin-bottom: 1rem;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

h2 {
    letter-spacing: -0.025em;
}

.lead {
    max-width: 60ch;
    margin-bottom: 2rem;
    color: var(--muted);
    font-size: 1.18rem;
}

.eyebrow {
    margin-bottom: 0.6rem;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.trust-card,
.panel,
.metric {
    border: 1px solid rgba(18, 64, 91, 0.1);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(40, 68, 84, 0.08);
}

.trust-card,
.panel {
    padding: clamp(1.4rem, 4vw, 2.4rem);
}

.trust-card {
    border-top: 5px solid var(--accent);
}

.trust-card ul {
    margin: 0;
    padding-left: 1.2rem;
}

.trust-card li + li {
    margin-top: 0.7rem;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border: 1px solid var(--brand);
    border-radius: 10px;
    color: white;
    background: var(--brand);
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--brand-dark);
}

.button-small {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    border-color: white;
    background: transparent;
}

.button-secondary {
    color: var(--brand);
    background: transparent;
}

.button-block {
    width: 100%;
}

.auth-layout {
    min-height: 560px;
    display: grid;
    place-items: center;
}

.auth-card,
.narrow {
    width: min(100%, 520px);
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field + .field {
    margin-top: 1rem;
}

label {
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.75rem;
    border: 1px solid #b7c2d0;
    border-radius: 9px;
    color: var(--ink);
    background: white;
    font: inherit;
}

form .button {
    margin-top: 1.2rem;
}

.validation {
    color: var(--danger);
    font-size: 0.9rem;
}

.validation:empty {
    display: none;
}

.form-note,
.request-id {
    margin-top: 1.4rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.steps {
    display: grid;
    gap: 1rem;
    padding-left: 1.4rem;
}

code {
    overflow-wrap: anywhere;
}

.shared-key,
.uri {
    display: block;
    margin-top: 0.6rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--surface-soft);
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.recovery-codes code {
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    text-align: center;
}

.page-heading,
.results-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.page-heading {
    margin-bottom: 2rem;
}

.page-heading h1 {
    margin-bottom: 0.3rem;
    font-size: clamp(2rem, 5vw, 3.6rem);
}

.filter-panel {
    margin-bottom: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 1rem;
}

.filter-action .button {
    margin: 0;
}

.results-heading {
    margin-bottom: 1rem;
}

.results-heading h2 {
    margin: 0;
}

.results-heading span {
    color: var(--muted);
}

.results-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.export-button {
    min-height: 40px;
    padding: 0.5rem 0.85rem;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.table-scroll:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.routes-table {
    min-width: 960px;
    table-layout: fixed;
    white-space: normal;
}

.route-code-column {
    width: 11%;
}

.route-date-column {
    width: 10%;
}

.route-time-column {
    width: 7%;
}

.route-loader-column {
    width: 25%;
}

.route-town-column {
    width: 15%;
}

.route-container-column {
    width: 12%;
}

.route-photo-column {
    width: 8%;
}

.route-status-column {
    width: 12%;
}

.routes-table td:nth-child(4),
.routes-table td:nth-child(5),
.routes-table td:nth-child(6) {
    overflow-wrap: anywhere;
}

.routes-table .status {
    max-width: 100%;
}

.empty-value {
    color: var(--muted);
}

.photo-availability {
    font-weight: 750;
    white-space: nowrap;
}

.table-scroll-hint {
    display: none;
    margin: -0.25rem 0 0.65rem;
    color: var(--muted);
    font-size: 0.85rem;
}

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

th {
    color: #415066;
    background: var(--surface-soft);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

td small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.status {
    display: inline-flex;
    max-width: 26ch;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    white-space: normal;
    font-size: 0.82rem;
    font-weight: 750;
}

.status-large {
    padding: 0.55rem 0.85rem;
}

.empty-state {
    padding: 2.4rem;
    border: 1px dashed #aeb9c8;
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.pagination {
    justify-content: center;
    margin-top: 1.3rem;
    color: var(--muted);
}

.pagination a {
    color: var(--brand);
}

.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--brand);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric {
    min-height: 120px;
    padding: 1.1rem;
}

.metric span,
.metric strong {
    display: block;
}

.metric span {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.metric strong {
    overflow-wrap: anywhere;
}

.route-photos {
    margin-top: 2rem;
}

.photo-notice {
    margin-bottom: 0;
    color: var(--muted);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.photo-card {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.photo-card a {
    display: grid;
    height: 240px;
    place-items: center;
    background: white;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.photo-card figcaption {
    padding: 0.75rem 0.9rem;
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 850px) {
    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .route-results-scroll {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .routes-table {
        min-width: 0;
    }

    .routes-table thead,
    .routes-table colgroup {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .routes-table,
    .routes-table tbody,
    .routes-table tr,
    .routes-table td {
        display: block;
        width: 100%;
    }

    .routes-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .routes-table tr {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 8px 24px rgba(40, 68, 84, 0.06);
    }

    .routes-table td {
        display: grid;
        grid-template-columns: minmax(7rem, 0.42fr) minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.7rem 0.85rem;
        white-space: normal;
    }

    .routes-table td::before {
        content: attr(data-label);
        color: #415066;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .routes-table td > small {
        grid-column: 2;
        margin-top: -0.55rem;
    }

    .routes-table td:last-child {
        border-bottom: 0;
    }
}

@media (min-width: 851px) and (max-width: 992px) {
    .table-scroll-hint {
        display: block;
    }
}

@media (max-width: 600px) {
    .header-content,
    .site-footer .shell,
    .page-heading,
    .results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-actions {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .header-content {
        padding-block: 1rem;
    }

    .header-content nav {
        width: 100%;
        overflow-x: auto;
    }

    .filter-grid,
    .detail-grid,
    .recovery-codes {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.35rem;
    }
}
