:root {
    --ink: #07111f;
    --muted: #7d828c;
    --soft: #eef2f5;
    --surface: rgba(255, 255, 255, 0.88);
    --stroke: rgba(7, 17, 31, 0.08);
    --blue: #079bf2;
    --blue-dark: #0078d8;
    --green: #4fd06b;
    --green-dark: #28b957;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
    color: var(--ink);
    background: #fff;
}

button,
a {
    font: inherit;
}

.open-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(15, 118, 110, 0.16), transparent 44%),
        radial-gradient(circle at 90% 85%, rgba(2, 132, 199, 0.14), transparent 38%),
        linear-gradient(180deg, #f5f7fb, #e6edf8);
}

.open-page.is-stop-page {
    display: block;
    padding: 0;
    background: #fff;
}

.stop-view {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.stop-hero {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.02)),
        #edf2f4;
}

.hero-topbar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 72px 1fr 72px;
    align-items: center;
    min-height: 92px;
    padding: max(18px, env(safe-area-inset-top)) 16px 10px;
}

.hero-topbar h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 600;
    text-align: center;
}

.back-button {
    width: 52px;
    height: 52px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 30px rgba(7, 17, 31, 0.08);
    text-decoration: none;
}

.back-button span {
    width: 16px;
    height: 16px;
    border-left: 5px solid var(--ink);
    border-bottom: 5px solid var(--ink);
    transform: rotate(45deg) translate(2px, -2px);
    border-radius: 2px;
}

.map-abstract {
    position: absolute;
    inset: 0;
    opacity: 0.96;
}

.road,
.park,
.water,
.stop-pin {
    position: absolute;
    display: block;
}

.road {
    height: 28px;
    border: 5px solid #d4d9dc;
    background: #f8faf9;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.road-a {
    width: 150%;
    left: -24%;
    top: 48%;
    transform: rotate(8deg);
}

.road-b {
    width: 120%;
    left: 12%;
    top: 23%;
    transform: rotate(72deg);
}

.road-c {
    width: 90%;
    left: -26%;
    top: 74%;
    transform: rotate(37deg);
}

.road-d {
    width: 84%;
    right: -36%;
    top: 62%;
    transform: rotate(118deg);
}

.park-a {
    right: -20px;
    bottom: 18px;
    width: 140px;
    height: 70px;
    border-radius: 60% 0 0 20%;
    background: #bdf39a;
    transform: rotate(-12deg);
}

.water {
    right: -42px;
    top: 112px;
    width: 92px;
    height: 132px;
    background: #82d8f7;
}

.stop-pin {
    left: 50%;
    top: 48%;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 6px solid #fff;
    border-radius: 50% 50% 50% 10%;
    background: #2384f4;
    color: #fff;
    font-size: 25px;
    transform: translate(-50%, -50%) rotate(-45deg);
    box-shadow: 0 12px 24px rgba(35, 132, 244, 0.28);
}

.stop-pin::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 4px;
    transform: rotate(45deg);
}

.stop-summary {
    position: relative;
    z-index: 3;
    margin: -70px 14px 0;
    padding: 14px;
    border: 1px solid rgba(7, 17, 31, 0.08);
    border-radius: 20px;
    background: rgba(247, 248, 247, 0.84);
    box-shadow: 0 16px 44px rgba(7, 17, 31, 0.12);
    backdrop-filter: blur(14px);
}

.stop-heading-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
}

.stop-code {
    display: inline-grid;
    min-width: 80px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #0797ff;
    color: #fff;
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 19px;
    line-height: 1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stop-road {
    color: #85878c;
    font-size: 15px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-count {
    margin: 16px 0 12px;
    color: #8c8d93;
    font-size: 12px;
    font-weight: 400;
}

.arrival-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.arrival-strip::-webkit-scrollbar {
    display: none;
}

.arrival-pill {
    flex: 0 0 68px;
    display: grid;
    gap: 6px;
    text-align: center;
}

.arrival-pill strong {
    display: grid;
    place-items: center;
    min-height: 28px;
    border-radius: 7px;
    background: var(--green);
    color: #06120b;
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.arrival-pill span {
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
}

.services-section {
    padding: 22px 14px 0;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.services-section h2,
.download-section h2 {
    margin: 0;
    color: #8c8d93;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
}

.refresh-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 0 14px;
    background: #fff;
    color: #4d5562;
    font-weight: 700;
    transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.refresh-button::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.refresh-button.is-live-state {
    border-color: rgba(13, 143, 46, 0.28);
    background: rgba(79, 208, 107, 0.14);
    color: #0d8f2e;
    box-shadow: 0 8px 18px rgba(13, 143, 46, 0.1);
}

.refresh-button.is-live-state::before {
    background: #0d8f2e;
    box-shadow: 0 0 0 4px rgba(13, 143, 46, 0.16);
}

.refresh-button.is-track-state {
    border-color: rgba(7, 17, 31, 0.1);
    background: #fff;
    color: #4d5562;
}

.refresh-button.is-refreshing {
    border-color: rgba(7, 120, 216, 0.22);
    background: rgba(7, 155, 242, 0.08);
    color: #0078d8;
}

.refresh-button.is-refreshing::before {
    background: #0078d8;
    box-shadow: 0 0 0 4px rgba(7, 155, 242, 0.14);
}

.refresh-button:disabled {
    opacity: 0.68;
}

.arrival-status {
    margin: 8px 0 16px;
    color: #9a9ca3;
    font-size: 12px;
}

.service-grid {
    display: grid;
    gap: 10px;
}

.service-row {
    display: grid;
    grid-template-columns: 58px repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-height: 62px;
}

.service-number-card,
.arrival-time-card {
    min-width: 0;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(7, 17, 31, 0.08);
}

.service-number-card {
    display: grid;
    place-items: center;
    padding: 8px 6px;
    background: linear-gradient(135deg, #63da73, #37c761);
    color: #06120b;
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.arrival-time-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3px;
    padding: 8px 7px;
    background: linear-gradient(135deg, #14c1d7, #058ff5);
    color: #fff;
}

.arrival-time-card span {
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 17px;
    line-height: 1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.arrival-time-card.is-empty {
    visibility: hidden;
}

.vehicle-badge {
    min-width: 34px;
    height: 24px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.58);
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.vehicle-badge.load-seats {
    color: #0d8f2e;
}

.vehicle-badge.load-standing {
    color: #d66603;
}

.vehicle-badge.load-limited {
    color: #ff2d2d;
}

.vehicle-badge.load-unknown {
    color: #6b7280;
}

.download-section {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: center;
    margin: 26px 14px max(22px, env(safe-area-inset-bottom));
    padding: 14px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: #f7f9fb;
}

.download-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.download-section h2 {
    color: var(--ink);
    font-size: 20px;
}

.download-section p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.store-badge-link {
    grid-column: 1 / -1;
    display: inline-flex;
    width: 156px;
    max-width: 100%;
}

.store-badge-link img {
    width: 100%;
    height: auto;
}

.empty-pill,
.empty-services {
    color: var(--muted);
    font-size: 15px;
}

.empty-pill {
    padding: 10px 12px;
    border-radius: 999px;
    background: #fff;
}

.empty-services {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    border-radius: 12px;
    background: #f7f9fb;
}

.skeleton-chip,
.skeleton-row span {
    position: relative;
    overflow: hidden;
    background: #e8edf1;
}

.skeleton-chip {
    flex: 0 0 78px;
    height: 57px;
    border-radius: 9px;
}

.skeleton-row span {
    border-radius: 10px;
    min-height: 62px;
}

.skeleton-chip::after,
.skeleton-row span::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
    animation: shimmer 1.2s infinite;
}

.card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.12);
    text-align: center;
    backdrop-filter: blur(6px);
}

.app-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
}

.error-illustration {
    width: min(100%, 420px);
    height: auto;
    margin: 0 auto 8px;
}

.eyebrow {
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.card h1 {
    margin: 0;
    font-size: clamp(24px, 4.7vw, 32px);
    line-height: 1.1;
    font-weight: 700;
}

.description {
    margin: 12px auto 0;
    max-width: 36ch;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #0f766e;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.btn-primary:hover {
    background: #115e59;
}

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid rgba(17, 24, 39, 0.1);
}

.footnote {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--muted);
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (min-width: 760px) {
    .open-page.is-stop-page {
        display: grid;
        place-items: center;
        min-height: 100vh;
        padding: 32px;
        background:
            radial-gradient(circle at 12% 12%, rgba(64, 156, 255, 0.13), transparent 34%),
            radial-gradient(circle at 86% 78%, rgba(79, 208, 107, 0.11), transparent 32%),
            #eef2f5;
    }

    .stop-view {
        width: min(100%, 1040px);
        height: min(880px, calc(100vh - 64px));
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(300px, 0.92fr) minmax(340px, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        column-gap: 28px;
        row-gap: 20px;
        padding: 24px;
        border: 1px solid rgba(7, 17, 31, 0.08);
        border-radius: 28px;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 22px 80px rgba(7, 17, 31, 0.14);
        overflow: hidden;
        backdrop-filter: blur(10px);
    }

    .stop-hero {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        height: 100%;
        border-radius: 22px;
    }

    .hero-topbar {
        grid-template-columns: 58px 1fr 58px;
        min-height: 82px;
        padding: 18px 18px 10px;
    }

    .back-button {
        width: 48px;
        height: 48px;
    }

    .stop-summary {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        margin: 96px 28px 0;
    }

    .services-section {
        grid-column: 2;
        grid-row: 1;
        min-height: 0;
        padding: 8px 0 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 4px;
        scrollbar-gutter: stable;
    }

    .download-section {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        align-self: end;
    }

    .service-row {
        grid-template-columns: 72px repeat(3, minmax(0, 1fr));
        gap: 10px;
        min-height: 72px;
    }

    .service-number-card {
        font-size: 28px;
    }

    .arrival-time-card {
        padding: 10px 9px;
    }

    .arrival-time-card span {
        font-size: 19px;
    }

    .vehicle-badge {
        min-width: 40px;
        height: 28px;
        padding: 0 8px;
        font-size: 16px;
    }

    .skeleton-row span {
        min-height: 72px;
    }
}

@media (max-width: 380px) {
    .hero-topbar {
        grid-template-columns: 60px 1fr 60px;
        padding-inline: 14px;
    }

    .hero-topbar h1 {
        font-size: 18px;
    }

    .stop-code {
        min-width: 72px;
        font-size: 17px;
    }

    .stop-road {
        font-size: 14px;
    }

    .service-row {
        grid-template-columns: 52px repeat(3, minmax(0, 1fr));
        gap: 5px;
        min-height: 58px;
    }

    .service-number-card,
    .arrival-time-card {
        border-radius: 9px;
    }

    .service-number-card {
        font-size: 22px;
    }

    .arrival-time-card span {
        font-size: 16px;
    }

    .arrival-time-card {
        padding: 7px 6px;
    }

    .vehicle-badge {
        min-width: 31px;
        height: 22px;
        padding: 0 5px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .card {
        border-radius: 18px;
        padding: 24px 18px;
    }
}
