/*
 * Style specyficzne dla /autobusy/. Tokeny, reset i nagłówek/stopka strony
 * są wspólne dla wszystkich podstron — patrz ../../assets/theme.css.
 * Kolory linii autobusowych (LINES w skrypcie) są celowo pozostawione
 * jako osobne wartości — kodują tożsamość konkretnej linii, nie markę strony.
 */

button, input, select {
    font: inherit;
}

body.page-autobusy {
    background: radial-gradient(circle at top left, #fbf4e6 0, #f7ecd8 42%, #f3e5cd 100%);
}

.hidden {
    display: none !important;
}

/* Mini pages (single stop / single line / single trip, no picker UI) — shared
   .mini-back / .mini-link styling lives in ../../assets/theme.css */

.page-mini #closeLine {
    display: none;
}

/* Status row + shared panel surface */

.today {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
}

.panel {
    background: var(--surface);
    border: 1px solid rgba(152, 175, 199, .35);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 34px rgba(16, 42, 67, .08);
}

/* Mode / day switcher */

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mode-tabs,
.day-select {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow);
    overflow: auto;
}

.mode-tabs button,
.day-select button {
    border: 0;
    background: transparent;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.mode-tabs button.active {
    background: var(--text);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(16, 42, 67, .18);
}

.day-select button.active {
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(8, 127, 91, .16);
}

.direction-tabs button.active {
    box-shadow: 0 8px 18px rgba(16, 42, 67, .18);
}

/* Prototype disclaimer */

/* Stop picker + departures */

.picker {
    padding: 18px;
    margin-bottom: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.picker-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 800;
    margin: 0 0 10px;
}

.picker input,
.picker select,
.line-search input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 13px;
    background: var(--surface);
    outline: none;
}

.picker input:focus,
.picker select:focus,
.line-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.helper {
    font-size: 12px;
    color: var(--muted);
    margin-top: 9px;
}

.stop-head {
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.stop-head h2 {
    margin: 0 0 4px;
    font-size: 25px;
    letter-spacing: -.02em;
}

.stop-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.depart-list {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.departure-card {
    position: relative;
    border: 1px solid var(--border);
    border-left: 6px solid var(--line-color, var(--accent));
    border-radius: var(--radius-lg);
    padding: 15px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    box-shadow: 0 8px 24px rgba(16, 42, 67, .05);
}

.dep-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.badge {
    min-width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 18px;
    background: var(--badge, var(--accent));
    box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .12), 0 8px 18px rgba(16, 42, 67, .18);
}

.dep-copy {
    min-width: 0;
    flex: 1;
}

.dep-line {
    font-weight: 850;
    font-size: 17px;
}

.dep-dir {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
    line-height: 1.45;
}

.next-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--teal);
    background: var(--teal-soft);
    padding: 5px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.times {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 13px;
}

.time {
    font-weight: 800;
    background: #edf4fb;
    border: 1px solid #dde7f2;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.time.past {
    opacity: .42;
}

.time.next {
    background: #dff7e5;
    color: #1b5e20;
    border-color: #8ce99a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 233, 154, .28);
}

.dep-source {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
    flex-wrap: wrap;
}

.dep-source a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 750;
}

.dep-source .source-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}

.empty {
    padding: 25px;
    text-align: center;
    color: var(--muted);
}

/* Quick "next departure" summary */

.stop-quick {
    margin: 0 14px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--text), var(--accent));
    color: #fff;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(36, 25, 10, .16);
}

.stop-quick-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr);
    gap: 14px;
    padding: 16px 18px;
}

.stop-quick-label {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .75;
    font-weight: 800;
}

.stop-quick-time {
    font-size: clamp(30px, 6vw, 46px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.03em;
    margin: 6px 0;
}

.stop-quick-sub {
    font-size: 14px;
    opacity: .92;
    line-height: 1.45;
}

.stop-quick-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .16);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.countdown strong {
    font-size: 15px;
}

.stop-quick-line {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 10px 12px;
    border-radius: var(--radius);
}

.stop-quick-line .mini-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .12);
}

.stop-quick-line b {
    display: block;
    font-size: 14px;
}

.stop-quick-line span {
    display: block;
    font-size: 12px;
    opacity: .82;
    line-height: 1.35;
}

.stop-quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 18px;
}

.quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border);
}

.quick-pill .dotline {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.quick-pill small {
    color: var(--muted);
    font-weight: 700;
}

/* Line list + detail */

.line-search {
    margin-bottom: 14px;
}

.line-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.line-card {
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--line-color, var(--border));
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    padding: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: .15s;
}

.line-card:after {
    content: "";
    position: absolute;
    right: -16px;
    top: -16px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--line-color, var(--border)) 13%, white);
    opacity: .9;
}

.line-card > * {
    position: relative;
    z-index: 1;
}

.line-card:hover {
    transform: translateY(-1px);
    border-color: var(--gold);
}

.line-top {
    display: flex;
    gap: 9px;
    align-items: flex-start;
}

.line-card .badge {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.line-copy {
    min-width: 0;
    flex: 1;
}

.line-name {
    font-size: 14px;
    font-weight: 850;
    margin: 0 0 2px;
}

.route {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
}

.status {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
}

.status.off {
    background: var(--surface-soft);
    color: #868e96;
}

.line-mini {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

/* Stop tiles (compact, same pattern as line tiles) */

.stop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.stop-card {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 9px 11px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    line-height: 1.35;
    cursor: pointer;
    transition: .15s;
}

.stop-card:hover {
    border-color: var(--gold);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.detail {
    margin-top: 18px;
    overflow: hidden;
}

.detail-head {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.detail-head h2 {
    margin: 1px 0 4px;
    letter-spacing: -.02em;
}

.detail-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.close {
    margin-left: auto;
    border: 0;
    background: var(--surface-soft);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
}

.direction-tabs {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 14px 14px 0;
}

.direction-tabs button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.direction-tabs button.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.stop-table {
    padding: 14px;
}

.stop-row {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-soft);
    align-items: start;
}

.stop-row:last-child {
    border-bottom: 0;
}

.stop-name {
    font-weight: 750;
    font-size: 13px;
}

.stop-times {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stop-times .time {
    font-size: 12px;
    padding: 5px 7px;
}

.source-note {
    margin-top: 28px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* Trip (single-course) view */

.trip-picker {
    padding: 18px;
    margin-bottom: 16px;
}

.trip-picker .line-grid {
    margin-bottom: 4px;
}

.trip-direction-title {
    margin-top: 14px;
}

.trip-picker .direction-tabs {
    padding: 0;
}

.line-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.trip-focus {
    margin-bottom: 16px;
    overflow: hidden;
    border-top: 5px solid var(--trip-accent, var(--accent));
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.trip-focus-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.trip-focus-copy {
    min-width: 0;
    flex: 1;
}

.trip-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dff7e5;
    color: #1b5e20;
    letter-spacing: normal;
    font-size: 10px;
    font-weight: 800;
}

.trip-focus-label {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 6px;
}

.trip-focus-time {
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.trip-focus-route {
    font-size: 15px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.4;
}

.trip-focus-pills {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.trip-focus-body {
    padding: 10px 18px 18px;
}

.trip-timeline {
    display: grid;
    gap: 0;
}

.trip-stop {
    display: grid;
    grid-template-columns: 76px 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 48px;
    padding: 9px 0;
}

.trip-stop-time {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    line-height: 1.2;
    padding-top: 2px;
}

.trip-stop.past {
    opacity: .45;
}

.trip-stop.next .trip-stop-time {
    color: #1b5e20;
}

.trip-stop.next .trip-stop-name {
    font-weight: 800;
}

.trip-stop.next .trip-stop-sub {
    color: #1b5e20;
    font-weight: 700;
}

.trip-stop.next .trip-track:after {
    background: #dff7e5;
    border-color: #8ce99a;
    box-shadow: 0 0 0 3px rgba(140, 233, 154, .28);
}

.trip-track {
    position: relative;
    height: 100%;
}

.trip-track:before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: -18px;
    width: 3px;
    background: var(--border);
}

.trip-stop:last-child .trip-track:before {
    bottom: 50%;
}

.trip-track:after {
    content: "";
    position: absolute;
    left: 1px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--trip-color, var(--accent));
}

.trip-stop-name {
    font-size: 14px;
    line-height: 1.35;
    padding-top: 1px;
}

.trip-stop-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.trip-list {
    display: grid;
    gap: 12px;
}

.trip-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--trip-color, var(--accent));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: .15s;
}

.trip-card.active {
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(156, 51, 25, .12);
}

.trip-card.past {
    opacity: .55;
}

.trip-card.active.past {
    opacity: 1;
}

.trip-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
}

.trip-summary:hover {
    background: var(--surface-soft);
}

.trip-main {
    min-width: 0;
    flex: 1;
}

.trip-time {
    font-size: 20px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.trip-route {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.35;
}

.trip-meta {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 7px;
}

.trip-pill {
    font-size: 11px;
    font-weight: 750;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 4px 7px;
    border-radius: 999px;
}

.trip-toggle {
    border: 0;
    background: var(--text);
    color: #fff;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.trip-card.active .trip-toggle {
    background: var(--trip-color, var(--accent));
}

.trip-empty {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

@media (max-width: 760px) {
    .trip-summary,
    .trip-focus-head {
        align-items: flex-start;
    }

    .trip-time {
        font-size: 18px;
    }

    .trip-stop {
        grid-template-columns: 64px 18px minmax(0, 1fr);
    }

    .trip-stop-time {
        font-size: 14px;
    }

    .stop-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .topbar {
        align-items: stretch;
    }

    .mode-tabs,
    .day-select {
        width: 100%;
    }

    .mode-tabs button,
    .day-select button {
        flex: 1;
    }

    .dep-top {
        align-items: center;
    }

    .next-label {
        display: none;
    }

    .stop-quick-body {
        grid-template-columns: 1fr;
    }

    .stop-quick-right {
        align-items: flex-start;
    }

    .countdown {
        align-self: stretch;
        justify-content: center;
    }

    .line-card:after {
        display: none;
    }
}

@media (max-width: 560px) {
    .dep-source .source-actions {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .picker,
    .stop-head {
        padding: 14px;
    }

    .depart-list {
        padding: 10px;
    }

    .departure-card {
        padding: 12px;
    }
}
