:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #eef2f6;
    color: #172033;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    min-height: 100%;
    background: #eef2f6;
}

body {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100svh;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    background: #eef2f6;
}

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

[hidden] {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 1120px;
    flex: 1 0 auto;
    margin: 0 auto;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
}

.list {
    padding: clamp(16px, 3vw, 32px);
    border: 1px solid #d8e0e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgb(23 32 51 / 9%);
}

.site-header {
    margin-bottom: clamp(18px, 3vw, 28px);
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    background: #f6f8fb;
}

.site-brand {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.site-header h1 {
    max-width: 100%;
    margin: 0;
    color: #164fa8;
    font-size: 1.75rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.route-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.route-card {
    --route-color: #1557b7;
    --route-dark: #0e408b;
    --route-border: #bbcee7;
    display: grid;
    grid-template-rows: auto auto auto;
    min-width: 0;
    min-height: 104px;
    align-items: center;
    gap: 14px;
    padding: clamp(16px, 2.5vw, 22px);
    overflow: hidden;
    border: 1px solid var(--route-border);
    border-radius: 8px;
    background: #fff;
    text-align: center;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.route-card--blue {
    --route-color: #1557b7;
    --route-dark: #0e408b;
    --route-border: #bbcee7;
}

.route-card--green {
    --route-color: #087454;
    --route-dark: #05553d;
    --route-border: #b8dbcf;
}

.route-card--amber {
    --route-color: #a84d09;
    --route-dark: #7b3504;
    --route-border: #e8c7a8;
}

.route-heading {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
}

.route-heading h2 {
    max-width: 100%;
    margin: 0;
    color: #27364b;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.redirect-btn {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--route-color);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    justify-self: center;
    letter-spacing: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color .18s ease, transform .18s ease;
}

.redirect-btn[aria-disabled="true"] {
    cursor: wait;
    opacity: .62;
}

.redirect-btn:active {
    transform: translateY(1px);
}

.button-arrow {
    flex: 0 0 auto;
    font-size: 1.15rem;
    line-height: 1;
}

:focus-visible {
    outline: 3px solid #0f62d6;
    outline-offset: 3px;
}

.status {
    min-height: 48px;
    margin: 16px 0 0;
    padding: 11px 14px;
    border: 1px solid #b9d1ef;
    border-radius: 6px;
    background: #eef6ff;
    color: #164e8d;
    font-size: .9rem;
    line-height: 1.5;
    text-align: center;
}

.status-error {
    border-color: #efb8b3;
    background: #fff1f0;
    color: #a52a22;
}

.route-unavailable-status {
    margin: 0;
    color: #a52a22;
    font-size: .9rem;
    line-height: 1.5;
    text-align: center;
}

footer {
    display: flex;
    width: 100%;
    max-width: 1120px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    padding-top: 16px;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    border-top: 1px solid #d2dbe5;
    color: #53647a;
}

.runtime-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #16805d;
    box-shadow: 0 0 0 4px rgb(22 128 93 / 12%);
}

footer p {
    max-width: 100%;
    margin: 0;
    font-size: .85rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
    .route-card:hover {
        border-color: var(--route-color);
        box-shadow: 0 8px 22px rgb(23 32 51 / 8%);
        transform: translateY(-1px);
    }

    .redirect-btn:not([aria-disabled="true"]):hover {
        background: var(--route-dark);
    }
}

@media (max-width: 479px) {
    .container {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: 12px;
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .list {
        padding: 12px;
    }

    .site-header {
        padding: 16px 12px;
    }

    .site-header h1 {
        font-size: 1.625rem;
    }

    .route-card {
        min-height: 100px;
        padding: 16px 12px;
    }
}

@media (min-width: 720px) {
    .site-header h1 {
        font-size: 2rem;
    }

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

    .route-card {
        min-height: 132px;
    }
}

@media (min-width: 960px) {
    .site-header h1 {
        font-size: 2.25rem;
    }

    .route-list {
        max-width: 520px;
        margin-right: auto;
        margin-left: auto;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    .container {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: 10px;
    }

    .list {
        padding: 16px;
    }

    .site-header {
        margin-bottom: 16px;
        padding: 14px 18px;
    }

    .route-card {
        min-height: 0;
        padding: 14px;
    }

    footer {
        padding-top: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

@media (forced-colors: active) {
    .route-card,
    .list,
    .site-header,
    .status {
        border: 1px solid CanvasText;
    }

    .redirect-btn {
        border: 1px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
