@font-face { font-family: "Inter"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
html, body { margin: 0; height: 100%; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); }
#map { position: absolute; inset: 0; }
.maplibregl-popup-content { font-size: 14.5px; }
.popup-title { font-weight: 600; margin-bottom: 4px; }
.popup-note { color: #666; font-style: italic; }
.relation-tip { pointer-events: none; }
.map-legend { position: absolute; right: 10px; bottom: 36px; z-index: 2; list-style: none; margin: 0; padding: 8px 12px; display: grid; gap: 4px; background: rgba(255, 255, 255, 0.92); border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); font-size: 13px; color: var(--ink); pointer-events: none; }
.map-legend:empty { display: none; }
.map-legend li { display: flex; align-items: center; gap: 8px; }
.legend-mark { width: 28px; flex: none; display: flex; align-items: center; justify-content: center; }
.legend-bar { width: 28px; border-radius: 3px; background: #555; }
.loading[hidden] { display: none; }
.spinner { flex: none; width: 18px; height: 18px; box-sizing: border-box; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.searching { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-weight: 600; color: var(--accent); }
.journey.skeleton { display: grid; gap: 10px; padding: 16px; margin-bottom: 10px; animation: pulse 1.2s ease-in-out infinite alternate; }
.journey.skeleton span { height: 12px; border-radius: 6px; background: var(--accent-soft); }
.journey.skeleton span:first-child { width: 55%; height: 18px; }
.journey.skeleton span:last-child { width: 35%; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .spinner, .primary.busy::before, .journey.skeleton { animation-duration: 3s; } }
.legend-dot { box-sizing: border-box; border-radius: 50%; }
.legend-dot.is-start, .legend-dot.is-end { width: 18px; height: 18px; border: 3px solid #fff; box-shadow: 0 0 0 1px #0003; }
.legend-dot.is-start, .legend-dot.is-end { background: #111; }
.legend-dot.is-change { width: 14px; height: 14px; background: #fff; border: 3px solid #111; }
.legend-dot.is-stop { width: 8px; height: 8px; background: #fff; border: 1.5px solid #111; }
.popup-relations { border-bottom: 1px solid #ddd; margin-bottom: 8px; padding-bottom: 8px; }
.popup-relations ul { list-style: none; margin: 0; padding: 0; max-height: 160px; overflow-y: auto; }
.popup-relations button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 1px solid transparent; border-radius: 4px; padding: 3px 5px; cursor: pointer; }
.popup-relations button:hover { background: #f2f2f2; }
.popup-relations button.active { border-color: #333; font-weight: 600; }
.popup-relations small { display: block; font-weight: normal; color: #666; }
.popup-line + .popup-line { border-top: 1px solid #ddd; margin-top: 8px; padding-top: 8px; }
#journeys:not(:empty) { margin-top: 20px; }
.journey-list { list-style: none; margin: 0 0 8px; padding: 0; }
.journeys-day { margin: 0 0 8px; font-weight: 600; }
.journey { border: 1.5px solid var(--line); border-radius: 16px; margin: 8px 0; background: #fff; transition: border-color 0.15s; }
.journey:hover { border-color: #c9c5b8; }
.journey.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.journey.recommended { position: relative; margin-top: 22px; border: 2px solid var(--accent); background: #f4f8f3; box-shadow: 0 6px 18px rgba(36, 92, 52, 0.16); }
.journey.recommended.selected { box-shadow: 0 6px 18px rgba(36, 92, 52, 0.16); }
.journey.recommended .journey-head { padding: 22px 18px 16px; gap: 10px; }
.journey.recommended .journey-lead { position: absolute; top: 0; left: 16px; transform: translateY(-50%); }
.journey.recommended .journey-times { font-family: var(--title); font-size: 22px; }
.journey-lead { display: flex; }
.other-journeys .journey { border-radius: 12px; margin: 6px 0; }
.other-journeys .journey-head { gap: 5px; padding: 8px 12px; }
.other-journeys .journey-times { font-size: 15px; }
.other-journeys .journey-meta { font-size: 13px; }
.other-journeys .pill { font-size: 11px; padding: 4px 6px; }
.other-journeys .badge { font-size: 12px; padding-top: 3px; padding-bottom: 3px; }
.other-journeys { margin-top: 18px; }
.other-journeys > summary { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--accent); border-radius: 999px; background: #fff; cursor: pointer; font-family: var(--title); font-size: 16px; font-weight: 700; color: var(--accent); list-style: none; transition: background 0.15s; }
.other-journeys > summary:hover { background: var(--accent-soft); }
.other-journeys > summary::-webkit-details-marker { display: none; }
.other-journeys > summary::after { content: ""; width: 8px; height: 8px; margin-top: -4px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s, margin 0.15s; }
.other-journeys[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.other-journeys[open] > summary { margin-bottom: 8px; }
.other-journeys .when-open, .other-journeys[open] .when-closed { display: none; }
.other-journeys[open] .when-open { display: inline; }
.journey-head { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px 14px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.journey-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.journey-times { font-weight: 700; font-size: 17.5px; font-variant-numeric: tabular-nums; }
.journey-meta { color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.journey-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.journey-modes .sep { color: #a0a3ad; font-size: 14.5px; }
.journey-badges { display: contents; }
.journey-modes .badge:first-of-type { margin-left: 6px; }
.pill { --c: #6b6b73; display: inline-block; font-size: 12.5px; font-weight: 700; line-height: 1; padding: 5px 8px; border-radius: 5px; color: #fff; background: var(--c); }
.pill.bike { background: #fff; color: #4a4a52; border: 1px dashed #9a9aa2; padding: 3px 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; line-height: 1.2; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.badge.free, .badge.reserved, .badge.recommended { padding-left: 7px; }
.badge.free::before, .badge.reserved::before, .badge.recommended::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor; mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; }
.badge.free { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.7 5.3a1 1 0 0 1 0 1.4l-4 4a1 1 0 0 1-1.4 0l-2-2a1 1 0 1 1 1.4-1.4L7 8.6l3.3-3.3a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E"); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #c4d8c7; }
.badge.reserved { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 0a1 1 0 0 1 1 1v1h4V1a1 1 0 1 1 2 0v1h1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h1V1a1 1 0 0 1 1-1ZM2 7v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7Z'/%3E%3C/svg%3E"); background: #f3eef7; color: #5a2a7a; box-shadow: inset 0 0 0 1px #ddd0e8; }
.badge.recommended { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 .8l2.2 4.6 5 .7-3.6 3.5.9 5L8 12.2l-4.5 2.4.9-5L.8 6.1l5-.7Z'/%3E%3C/svg%3E"); background: var(--accent); color: #fff; font-size: 13.5px; padding: 5px 12px 5px 9px; }
.badge.best { background: var(--accent-soft); color: var(--accent); }
.legs { list-style: none; margin: 0; padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.leg { --c: #999; position: relative; padding-left: 22px; font-size: 14.5px; }
.leg::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; background: var(--c); }
.stop { position: relative; display: flex; gap: 8px; padding: 6px 0; font-weight: 600; }
.stop::before { content: ""; position: absolute; left: -21px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--c); box-sizing: border-box; }
.stop time { font-variant-numeric: tabular-nums; min-width: 40px; }
.leg-ride { display: block; padding: 2px 0 2px 48px; color: #444; }
.leg-train { display: block; font-weight: 600; color: #1d1d1f; }
.leg-rule { font-size: 13.5px; margin-top: 2px; }
.leg-later { font-size: 13px; margin-top: 4px; color: var(--muted); }
.leg-later summary { cursor: pointer; }
.leg-later ul { margin: 4px 0 0; padding-left: 16px; }
.leg-later li { margin: 2px 0; }
.leg-later time { font-variant-numeric: tabular-nums; font-weight: 600; color: #1d1d1f; }
.leg-later .missed { color: #b42318; }
.stop time.was, .leg-later time.was { min-width: 0; color: var(--muted); font-weight: 400; text-decoration: line-through; }
.leg-later time.was { margin-right: 4px; }
.stop time.late, .leg-later time.late { color: #b42318; }
.rt { display: block; font-size: 13.5px; margin-top: 2px; color: #8a4b00; }
.rt.alert { color: #b42318; font-weight: 600; }
.leg.transfer .rt { margin-top: 0; }
.badge.late { background: #fff4e0; color: #8a4b00; }
.leg.bike, .leg.transfer { padding-top: 4px; padding-bottom: 4px; }
.leg.bike::before { top: 2px; bottom: 2px; width: 0; border-left: 3px dotted #9a9aa2; background: none; }
.leg.transfer::before { display: none; }
.leg.bike .leg-ride, .leg.transfer .leg-ride { font-size: 13.5px; color: var(--muted); font-style: italic; }

:root {
  --accent: #245c34; --accent-dark: #17402a; --accent-soft: #e3ece4; --ink: #1c211d; --paper: #fbfaf6; --field: #d9d6cb;
  --line: #e7e4da; --muted: #5d635e; --soft: #f1efe8; --title: "Space Grotesk", Inter, system-ui, sans-serif;
}
.panel {
  position: absolute; top: 12px; left: 12px; width: 400px; max-height: calc(100% - 24px); display: flex; flex-direction: column;
  z-index: 3; background: var(--paper); border-radius: 20px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16); box-sizing: border-box; font-size: 15.5px; line-height: 1.4; overflow: hidden;
}
.sheet-handle { display: none; }
.sheet-peek { display: none; align-items: center; gap: 10px; flex: none; min-height: 48px; margin: 12px 16px 14px; padding: 0 16px; font: inherit; font-weight: 600; color: var(--muted); text-align: left; background: #fff; border: 1.5px solid var(--field); border-radius: 14px; cursor: pointer; box-sizing: border-box; }
.sheet-peek span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head { padding: 18px 20px 0; flex: none; }
.panel h1 { font-family: var(--title); font-size: 24px; margin: 0; letter-spacing: -0.01em; color: var(--ink); }
.tagline { margin: 1px 0 10px; font-size: 14.5px; color: var(--muted); }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.share { flex: none; white-space: nowrap; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); background: none; border: 1.5px solid var(--field); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.share:hover { border-color: var(--accent); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #eeece4; border-radius: 999px; }
.tabs button { min-height: 40px; font: inherit; font-weight: 500; font-size: 14.5px; padding: 8px 4px; border: 0; border-radius: 999px; background: none; color: #4a514b; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.tabs button:not([aria-selected="true"]):hover { background: #e2dfd4; color: var(--ink); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-body { overflow: auto; flex: 1; min-height: 0; }
.pane { padding: 20px; }
.source { margin: 0; padding: 0 20px 16px; font-size: 12px; color: #888; }
.source a { color: inherit; font-weight: 600; }
.note.alert { color: #8a4b00; background: #fff4e0; padding: 8px 10px; border-radius: 8px; }
.map-key { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
#journeys:not(:empty) + .map-key { display: none; }
.map-key ul { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 14.5px; }
.map-key li { display: flex; align-items: center; gap: 7px; }
.loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); font: 14.5px Inter, system-ui, sans-serif; color: var(--muted); }
@media (min-width: 601px) { .loading { left: calc(50% + 186px); } }
.note { font-size: 13.5px; color: var(--muted); margin: 4px 0; }
.group-title { font-size: 13.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 6px; }

/* Itinéraire */
.question { font-family: var(--title); font-size: 26px; font-weight: 700; line-height: 1.15; margin: 0 0 4px; letter-spacing: -0.01em; }
.planner { display: flex; flex-direction: column; gap: 14px; }
.region { font: inherit; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; min-width: 0; }
.region:focus { outline: 2px solid #245c3433; border-color: var(--accent); }
.stations { position: relative; display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; background: #fff; border: 1.5px solid var(--field); border-radius: 14px; padding: 11px 56px 11px 16px; cursor: text; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #245c3422; }
.field > span { font-size: 13px; color: var(--muted); }
.field input { font: inherit; min-width: 0; font-size: 18px; font-weight: 600; border: 0; padding: 0; border-radius: 0; background: none; outline: none; }
.field input::placeholder { font-weight: 400; color: #9a9d96; }
.swap { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 1.5px solid var(--field); border-radius: 50%; background: var(--paper); font-size: 18px; cursor: pointer; color: var(--accent); }
.swap:hover { background: var(--accent-soft); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; border: 2px solid var(--accent); box-sizing: border-box; }
.dot.to { background: var(--accent); }
.when { display: flex; flex-wrap: wrap; gap: 8px; }
.when-pill { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; cursor: pointer; box-sizing: border-box; }
.when-pill:hover { background: #d5e3d7; }
.when-pill:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.when-pill input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; font-size: 16px; cursor: pointer; }
.when-pill input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.advanced { font-size: 14.5px; }
.advanced summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px dashed #c9c5b8; border-radius: 999px; color: #4a514b; font-size: 15px; box-sizing: border-box; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "+"; margin-right: 6px; }
.advanced[open] summary::before { content: "−"; }
.advanced summary:hover { border-color: var(--accent); color: var(--accent); }
.advanced-body { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; padding: 14px; background: var(--soft); border-radius: 14px; }
.advanced fieldset { border: 0; padding: 0; margin: 0; }
.advanced legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1.5px solid var(--field); border-radius: 999px; background: #fff; cursor: pointer; font-size: 14px; box-sizing: border-box; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid #245c3466; outline-offset: 1px; }
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.switch input { appearance: none; flex: none; width: 32px; height: 18px; margin: 1px 0 0; border-radius: 9px; background: #c9c5b8; position: relative; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { outline: 2px solid #245c3466; outline-offset: 2px; }
.switch small { display: block; color: #777; font-size: 13.5px; }
.primary { font: inherit; font-size: 17px; font-weight: 600; min-height: 52px; padding: 14px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; cursor: pointer; }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.primary:disabled { opacity: 0.5; cursor: default; }
.primary.busy { opacity: 1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.primary.busy::before { content: ""; width: 18px; height: 18px; border: 2.5px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* Lignes */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 20px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 100%; min-height: 60px; padding: 10px 14px; border: 1.5px solid var(--field); border-radius: 14px; background: #fff; font-weight: 700; font-size: 15px; box-sizing: border-box; transition: border-color 0.15s, background 0.15s; }
.choice small { font-weight: 400; font-size: 13px; color: var(--muted); }
.choice input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice input:focus-visible + span { outline: 2px solid #245c3466; outline-offset: 2px; }
.legend-group { margin-bottom: 16px; }
.legend-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.type-chip { position: relative; cursor: pointer; }
.type-chip input { position: absolute; opacity: 0; pointer-events: none; }
.type-chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border: 1.5px dashed #c9c5b8; border-radius: 999px; background: #fff; color: var(--muted); font-size: 14.5px; font-weight: 600; box-sizing: border-box; transition: background 0.15s, border-color 0.15s; }
.type-chip span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); box-sizing: border-box; }
.type-chip input:checked + span { border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--ink); }
.type-chip input:checked + span::before { background: var(--c); }
.type-chip input:focus-visible + span { outline: 2px solid #245c3466; outline-offset: 1px; }
.legend-group .region-item { flex-basis: 100%; }
.legend-group .region { width: 100%; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--field); border-radius: 12px; background: #fff; font: inherit; font-size: 14.5px; color: var(--ink); }
.traffic { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); margin: 4px 0 12px; }
.bars { display: flex; flex-direction: column; gap: 3px; flex: none; }
.swatch { display: inline-block; width: 22px; height: 6px; border-radius: 3px; flex: none; }
.bar { display: inline-block; width: 20px; background: #555; border-radius: 3px; flex: none; }
.bar.major { height: 6px; }
.bar.medium { height: 3px; }
.bar.minor { height: 1.5px; }

/* Règles vélo */

/* Fiche de la ligne cliquée, hors de la carte pour ne pas cacher la relation */
.line-card {
  position: absolute; top: 12px; right: 50px; width: min(340px, calc(100% - 484px)); min-width: 200px; max-height: calc(100% - 56px); z-index: 3; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 20px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16); box-sizing: border-box; font-size: 14.5px; line-height: 1.4;
}
.line-card[hidden] { display: none; }
.line-card-body { overflow: auto; padding: 16px; min-height: 0; }
.line-card-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%; z-index: 1; }
.line-card-close:hover { background: var(--soft); color: #111; }
.line-card .popup-title { padding-right: 32px; margin-bottom: 8px; font-family: var(--title); font-size: 17px; font-weight: 700; }
.line-card .popup-relations { border-bottom-color: var(--line); margin-bottom: 14px; padding-bottom: 12px; }
.line-card .popup-relations button { padding: 7px 10px; border-radius: 10px; }
.line-card .popup-relations button:hover { background: var(--soft); }
.line-card .popup-relations button.active { border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.line-card .popup-relations small { color: var(--muted); }
.line-card .popup-line + .popup-line { border-top-color: var(--line); margin-top: 14px; padding-top: 14px; }
.line-card .answer { gap: 10px; padding: 14px; border-radius: 14px; }
.line-card .answer-head strong { font-size: 18px; }
.line-card .tile { padding: 8px 10px; font-size: 14px; }
.answer-banned { margin: 0; font-size: 14px; line-height: 1.45; color: #5a2a22; }
.answer-banned strong { color: #7a2418; }

@media (max-width: 600px) {
  .map-legend { top: 8px; left: 8px; right: auto; bottom: auto; padding: 6px 10px; font-size: 12.5px; }
  .line-card { top: 8px; left: 8px; right: 8px; width: auto; min-width: 0; max-height: 38%; }
  .panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 85%; border-radius: 20px 20px 0 0; }
  .panel[data-sheet="half"] { max-height: 50%; }
  .panel[data-sheet="collapsed"] .panel-body { display: none; }
  .panel[data-sheet="collapsed"] .sheet-peek { display: flex; }
  .sheet-handle { display: block; flex: none; width: 100%; height: 18px; border: 0; background: none; cursor: pointer; position: relative; }
  .sheet-handle::after { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #c9c5b8; }
  .panel-head { padding: 0 16px; }
  .pane { padding: 16px; }
  .question { font-size: 22px; }
  .tagline { display: none; }
  .panel-title { margin-bottom: 4px; }
  .legend-group .region { font-size: 16px; }
}

/* Page info */
body.info-page { height: auto; background: var(--paper); }
.info { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; font-size: 16px; line-height: 1.55; }
.info h1, .info h2, .info h3, .info h4 { font-family: var(--title); letter-spacing: -0.01em; }
.info h1 { font-size: 34px; line-height: 1.15; margin: 12px 0 14px; }
.info h2 { font-size: 24px; margin: 40px 0 10px; }
.info section { scroll-margin-top: 16px; }
.info a { color: var(--accent); }
.info-lead { font-size: 18px; color: #3a403b; }
.info-back { font-size: 15px; font-weight: 600; }
.info-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.info-toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; font-size: 14.5px; font-weight: 600; border: 1.5px solid var(--field); border-radius: 999px; background: #fff; text-decoration: none; box-sizing: border-box; }
.info-toc a:hover { border-color: var(--accent); background: var(--accent-soft); }
.info-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.info-summary > div { background: #fff; border: 1.5px solid #e2dfd4; border-radius: 14px; padding: 12px 16px; }
.info-summary h3 { font-size: 16px; margin: 0 0 6px; }
.info-summary ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
.info-rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.info-rule { scroll-margin-top: 16px; font-size: 15px; }
.info-rule h4 { font-size: 17px; margin: 0 0 8px; }
.info-rules h3.group-title { margin: 28px 0 10px; }
.info-link { margin: 0; padding: 0 20px 6px; font-size: 13px; }
.info-link a { color: var(--accent); font-weight: 600; }
.note a { color: var(--accent); font-weight: 600; }

/* Rules tab: train type, then variant or region, then the answer card. */
.rule-types { margin: 14px 0 12px; }
.rule-types .chip span { min-height: 40px; font-size: 15px; }
.segmented { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; margin-bottom: 14px; background: #eeece4; border-radius: 12px; }
.segmented[hidden] { display: none; }
.segmented .chip span { display: flex; justify-content: center; width: 100%; min-height: 40px; padding: 0 8px; border: 0; border-radius: 9px; background: none; color: var(--muted); text-align: center; }
.segmented .chip input:checked + span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.rule-region { width: 100%; min-height: 44px; margin-bottom: 14px; border: 1.5px solid var(--field); border-radius: 12px; color: var(--ink); }
.answer { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: #fff; border: 1.5px solid #e2dfd4; border-radius: 18px; }
.answer-head { display: flex; flex-direction: column; gap: 4px; }
.answer-head span { font-size: 13.5px; color: var(--muted); }
.answer-head strong { font-family: var(--title); font-size: 22px; line-height: 1.2; }
.answer-yes { color: var(--accent); }
.answer-partial { color: #8a4b00; }
.answer-no { color: #9b1c1c; }
.answer-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { padding: 10px 12px; background: #f6f4ee; border-radius: 12px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.tile.wide { grid-column: span 2; }
.tile span { display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.answer-warning { margin: 0; font-size: 14.5px; line-height: 1.5; color: #3a403b; }
.answer-map { align-self: flex-start; min-height: 44px; padding: 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--accent); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.answer-map:hover { color: var(--accent-dark); }
.answer .note { margin: 0; }
.answer-notes summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
.answer-notes ul { margin: 8px 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.answer-notes .popup-note { font-size: 13.5px; }
.banned { display: flex; flex-direction: column; gap: 4px; margin: 16px 0 0; padding: 14px 16px; background: #f8e9e6; border-radius: 14px; font-size: 14.5px; line-height: 1.45; color: #5a2a22; }
.banned strong { display: flex; align-items: center; gap: 7px; font-size: 15px; color: #7a2418; }
.banned strong::before { content: ""; flex: none; width: 17px; height: 17px; background: currentColor; mask: var(--no-entry) center / contain no-repeat; -webkit-mask: var(--no-entry) center / contain no-repeat; }
.banned { --no-entry: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M3.4 12.6 12.6 3.4'/%3E%3C/svg%3E"); }
.book { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.book-link { display: block; text-align: center; padding: 10px 14px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.book-link:hover { background: var(--accent-dark); }
.book-note { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
