:root {
    --bg: #eef2f7;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #1e3a8a;
    --primary-light: #e0e7ff;
    --border: #dbe2ea;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

[hidden] {
    display: none !important;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 14px 30px;
}

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

.title {
    margin: 0;
    font-size: 1.5rem;
}

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

/* Boutons */
.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-light {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.icon-btn {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 4px 8px;
    cursor: pointer;
}

/* Cartes */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.stop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.stop-name {
    margin: 0;
    font-size: 1.25rem;
}

.stop-tools {
    display: flex;
    flex-shrink: 0;
}

/* Prochains passages */
.departures {
    list-style: none;
    margin: 0;
    padding: 0;
}

.departure {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}

.departure:first-child {
    border-top: none;
}

/* Destination sur une ligne, horaires en dessous */
.info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.headsign {
    font-weight: 600;
}

.times {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-variant-numeric: tabular-nums;
}

.time {
    color: var(--muted);
}

.time.first {
    color: var(--text);
    font-weight: 800;
}

/* Pastille de ligne, aux couleurs de la CTS */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.badge.tram {
    border-radius: 50%;
    width: 30px;
    min-width: 30px;
    height: 30px;
}

/* Recherche */
.search-head {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
}

.results {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding: 10px 6px;
    border: none;
    border-top: 1px solid var(--border);
    background: none;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
}

.result:hover {
    background: var(--primary-light);
}

.result-name {
    font-weight: 700;
}

.result-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.result-lines .badge {
    min-width: 26px;
    height: 22px;
    font-size: 0.8rem;
}

.result-lines .badge.tram {
    width: 24px;
    min-width: 24px;
    height: 24px;
}

.empty-title {
    margin: 0 0 6px;
    font-weight: 700;
}

.footer {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 20px;
}

/* Bandeau « Installer l'appli » (téléphone) */
.install-banner {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.install-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
}

.install-text span {
    color: var(--muted);
}

.install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-close {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 6px;
    cursor: pointer;
}

/* Recherche de trajet */
.journey-toggle {
    width: 100%;
    text-align: left;
}

.journey-panel {
    margin-top: 12px;
}

.journey-field {
    position: relative;
}

.journey-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.journey-field .search-input {
    width: 100%;
    box-sizing: border-box;
}

.journey-suggest {
    margin-top: 4px;
}

.journey-swap {
    display: flex;
    justify-content: center;
    margin: 6px 0;
}

.journey-go {
    width: 100%;
    border-radius: 10px;
    height: auto;
    margin-top: 10px;
}

.journey-results {
    margin-top: 14px;
}

.journeys {
    list-style: none;
    margin: 0;
    padding: 0;
}

.journey-item {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.journey-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.journey-time {
    font-size: 1.1rem;
    font-weight: 800;
}

.journey-leg {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
}

.journey-leg .info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.journey-change {
    margin: 4px 0 4px 44px;
    font-size: 0.85rem;
    color: var(--muted);
}

.journey-walk {
    margin: 6px 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.journey-map {
    position: relative;
    height: 320px;
    margin-top: 14px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    z-index: 0;
}

.journey-item {
    cursor: pointer;
}

.journey-item.selected {
    background: var(--primary-light);
    border-radius: 10px;
    padding-left: 10px;
    padding-right: 10px;
}

/* « Y aller » : carte en plein écran */
body.nav-open {
    overflow: hidden;
}

.journey-map.is-full {
    position: fixed;
    inset: 0;
    z-index: 1000;
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
}

.journey-nav {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    pointer-events: none;
}

.journey-step {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
}

.journey-step-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.journey-step-detail {
    margin-top: 4px;
    color: var(--muted);
}

.journey-nav-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.journey-nav-top .journey-step {
    flex: 1;
    min-width: 0;
}

/* en bas, au-dessus de la barre de debug de Symfony (visible seulement en développement) */
.journey-nav-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding-bottom: 60px;
    pointer-events: auto;
}

.journey-nav-buttons .btn {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.journey-close {
    flex: none;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
