* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: #0a0a0a;
    color: #f2f2f2;
}

a { color: #ffcc00; }

/* ---- Board (/{stop_id}) ---- */

body.board {
    background: #050505;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html.kiosk, body.kiosk {
    cursor: none;
    height: 100%;
    overflow: hidden;
}

body.kiosk table.departures tbody td {
    font-size: 2rem;
    padding: 20px 32px;
}

.board-header {
    padding: 24px 32px 16px;
    border-bottom: 3px solid #ffcc00;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-link {
    text-decoration: none;
    font-size: 0.9rem;
    color: #999;
}

.board-header h1 {
    margin: 8px 0 4px;
    font-size: 2.6rem;
    letter-spacing: 0.5px;
}

.stop-meta {
    color: #aaa;
    font-size: 1rem;
}

.clock {
    font-size: 2.4rem;
    font-variant-numeric: tabular-nums;
    color: #ffcc00;
    font-weight: bold;
}

.last-update-small {
    font-size: 0.8rem;
    color: #777;
    font-variant-numeric: tabular-nums;
}

.kiosk-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
}

.kiosk-btn:hover { background: #262626; color: #fff; }

.settings-gear {
    padding: 6px 10px;
    border-radius: 4px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.settings-gear:hover { background: #262626; color: #fff; }

.settings-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    z-index: 10;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.settings-panel[hidden] { display: none; }

.settings-panel h3 {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-panel label {
    display: block;
    padding: 4px 0;
    font-size: 0.95rem;
    color: #eee;
}

.settings-section { margin-bottom: 16px; }
.settings-section:last-child { margin-bottom: 0; }

#refresh-gtfs-btn {
    padding: 6px 14px;
    border-radius: 4px;
    border: none;
    background: #ffcc00;
    color: #111;
    font-weight: bold;
    cursor: pointer;
}

#refresh-gtfs-btn:disabled { opacity: 0.6; cursor: default; }

#refresh-gtfs-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #999;
}

.datetime-form {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 32px;
    background: #111;
    border-bottom: 1px solid #222;
    font-size: 0.95rem;
    color: #ccc;
    flex-wrap: wrap;
}

.datetime-form input {
    margin-left: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #fff;
}

.datetime-form button {
    padding: 6px 16px;
    border-radius: 4px;
    border: none;
    background: #ffcc00;
    color: #111;
    font-weight: bold;
    cursor: pointer;
}

.pole-switch {
    padding: 10px 32px;
    background: #0d0d0d;
    border-bottom: 1px solid #222;
    font-size: 0.9rem;
    color: #999;
}

.pole-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 12px;
    border-radius: 999px;
    background: #1a1a1a;
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
}

.pole-pill.active { background: #ffcc00; color: #111; font-weight: bold; }

.pole-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #262626;
    color: #999;
    font-size: 0.8rem;
    font-weight: normal;
    vertical-align: middle;
}

.datetime-form .reset-link { font-size: 0.9rem; }

.datetime-form .live-indicator {
    color: #4caf50;
    font-weight: bold;
    font-size: 0.85rem;
}

table.departures {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
}

table.departures thead th {
    text-align: left;
    padding: 12px 32px;
    font-size: 1rem;
    text-transform: uppercase;
    color: #999;
    border-bottom: 2px solid #333;
}

table.departures tbody td {
    padding: 16px 32px;
    font-size: 1.6rem;
    border-bottom: 1px solid #222;
}

table.departures tbody tr:nth-child(odd) { background: #0d0d0d; }

.col-scheduled, .col-realtime, .col-countdown { font-variant-numeric: tabular-nums; font-weight: bold; white-space: nowrap; }

.line-badge {
    display: inline-block;
    min-width: 2.4em;
    padding: 4px 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    font-size: 1.4rem;
}

.line-badge.line-bus { background: #1e6fd9; color: #fff; }
.line-badge.line-trolley { background: #2fa84f; color: #fff; }

.vehicle-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #262626;
    color: #999;
    font-size: 0.85rem;
    font-weight: normal;
    vertical-align: middle;
}

.delay-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: bold;
    vertical-align: middle;
}

.delay-badge.status-ontime { background: #1f7a34; color: #d8ffe0; }
.delay-badge.status-late { background: #8a1f1f; color: #ffd9d9; }
.delay-badge.status-early { background: #8a6d1f; color: #fff3d0; }

.no-live { color: #555; font-weight: normal; }

.countdown-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: bold;
}

.countdown-badge.status-ontime { background: #1f7a34; color: #d8ffe0; }
.countdown-badge.status-late { background: #8a1f1f; color: #ffd9d9; }
.countdown-badge.status-early { background: #8a6d1f; color: #fff3d0; }
.countdown-badge.status-planned { background: #333; color: #ccc; }

/* Column visibility toggles, driven by assets/columns.js (localStorage) */
body.hide-col-line .col-line,
body.hide-col-headsign .col-headsign,
body.hide-col-scheduled .col-scheduled,
body.hide-col-countdown .col-countdown {
    display: none;
}

/* Live-time display mode: separate column, an inline badge on the scheduled time, or both */
.scheduled-badge { margin-left: 8px; }
body.realtime-mode-column .scheduled-badge { display: none; }
body.realtime-mode-badge .col-realtime { display: none; }

.empty { text-align: center; color: #888; padding: 40px; font-size: 1.4rem; }

.load-more-row {
    text-align: center;
    padding: 10px;
    background: #0d0d0d;
}

.show-more-btn {
    padding: 6px 20px;
    border-radius: 999px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #ccc;
    font-size: 0.9rem;
    cursor: pointer;
}

.show-more-btn:hover { background: #262626; color: #fff; }

/* ---- Home (/) ---- */

body.home {
    background: #f4f4f4;
    color: #1a1a1a;
}

.home-header {
    padding: 24px 32px;
    background: #111;
    color: #fff;
}

.home-header h1 { margin: 0 0 12px; font-size: 1.8rem; }

#stop-search {
    width: 100%;
    max-width: 480px;
    padding: 10px 14px;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
}

#map {
    height: 420px;
    width: 100%;
}

table.stop-list {
    width: 100%;
    border-collapse: collapse;
    max-width: 900px;
    margin: 24px auto;
}

table.stop-list th {
    text-align: left;
    padding: 10px 16px;
    border-bottom: 2px solid #ccc;
}

table.stop-list td {
    padding: 10px 16px;
    border-bottom: 1px solid #ddd;
}

table.stop-list a.show-btn {
    display: inline-block;
    padding: 4px 12px;
    background: #1e6fd9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.loading { text-align: center; color: #888; padding: 24px; }
