/* RATP · VESI : feuille de style, version 5.1 (mobile d'abord, disposition PC à partir de 900 px) */

:root {
	--bg: #eef3f9;
	--bg-2: #f6f8fc;
	--surface: #ffffff;
	--surface-2: #f3f6fa;
	--text: #0e1d3f;
	--muted: #5f6c82;
	--line: #e3e9f1;
	--blue: #2f7fe0;
	--blue-dark: #1f63c4;
	--blue-soft: #e8f1fd;
	--green: #148a4b;
	--green-dark: #0f7a41;
	--green-soft: #e4f5ea;
	--warn: #e07a12;
	--warn-soft: #fdeedb;
	--danger: #c0392b;
	--danger-soft: #fdecec;
	--radius: 22px;
	--shadow: 0 6px 24px rgba(16, 40, 80, 0.07);
	--tabbar: 78px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%) fixed;
	color: var(--text);
	font: 16px/1.4 system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
	-webkit-tap-highlight-color: transparent;
}

[hidden] {
	display: none !important;
}

button,
input {
	font: inherit;
	color: inherit;
}

/* Graisses modérées : rendu trop épais des polices système sur mobile en 700/800. */
b,
strong {
	font-weight: 600;
}

button {
	cursor: pointer;
}

h1,
h2,
h3,
p {
	margin: 0;
}

svg {
	flex: none;
	fill: currentColor;
}

svg .stroke {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pill svg,
.field-icon svg,
.field-button svg,
.round-button svg {
	width: 22px;
	height: 22px;
}

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

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.small-text {
	margin-top: 10px;
	font-size: 0.82rem;
}

/* ================================================================== */
/* Bandeau de version                                                 */
/* ================================================================== */

.version-banner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 8px 12px;
	background: var(--text);
	color: #fff;
	font-size: 0.9rem;
}

.version-banner button {
	padding: 4px 12px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--text);
	font-weight: 600;
}

/* ================================================================== */
/* Barre supérieure                                                   */
/* ================================================================== */

.topbar {
	position: relative;
	padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
}

.brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-bottom: 14px;
}

.brand img {
	border-radius: 16px;
	box-shadow: 0 6px 16px rgba(31, 95, 192, 0.25);
}

.brand h1 {
	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.15;
}

.brand p {
	color: var(--muted);
	font-size: 1.05rem;
}

.controls {
	display: grid;
	gap: 10px;
}

.quick {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.pill {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 54px;
	border: 0;
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow);
	font-size: 1.02rem;
	font-weight: 600;
	transition: transform 0.1s ease, background 0.15s ease;
}

.pill svg {
	color: var(--green);
}

.pill:active {
	transform: scale(0.97);
	background: var(--green-soft);
}

.search-field {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 8px;
	min-width: 0;
	height: 54px;
	padding: 0 6px 0 14px;
	border: 1px solid transparent;
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.search-field:focus-within {
	border-color: var(--green);
}

.search-field input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	outline: none;
}

.field-icon {
	display: flex;
	color: var(--muted);
}

.field-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 12px;
	background: var(--green-soft);
	color: var(--green);
}

.origin-box {
	position: relative;
}

.origin-box .search-field {
	border-color: var(--green);
}

.origin-box .field-icon {
	color: var(--green);
}

.suggestions {
	position: relative;
	z-index: 1500;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--shadow);
}

.suggestions:empty {
	display: none;
}

.suggestion {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 11px 14px;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
	cursor: pointer;
}

.suggestion.active,
.suggestion:hover {
	background: var(--blue-soft);
}

.suggestion small {
	display: block;
	color: var(--muted);
	font-size: 0.8rem;
}

.suggestion-empty {
	padding: 11px 14px;
	background: var(--surface);
	color: var(--muted);
	font-size: 0.9rem;
}

/* ================================================================== */
/* Panneau et éléments communs                                        */
/* ================================================================== */

.panel {
	padding: 0 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom));
}

.card {
	margin-bottom: 14px;
	padding: 18px;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.card h3 {
	font-size: 1.05rem;
	font-weight: 600;
}

.card-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.section-title {
	margin: 22px 4px 10px;
	font-size: 1.2rem;
	font-weight: 600;
}

.section-head {
	margin: 24px 4px 12px;
}

.section-head h3,
.section-head h2 {
	font-size: 1.45rem;
	font-weight: 600;
	line-height: 1.2;
}

.section-head p {
	color: var(--muted);
	font-size: 1rem;
}

.page-head {
	margin-top: 8px;
}

.link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--green);
	font-size: 0.9rem;
	font-weight: 600;
}

.primary-button {
	flex: none;
	height: 50px;
	padding: 0 18px;
	border: 0;
	border-radius: 14px;
	background: var(--green);
	color: #fff;
	font-weight: 600;
}

.primary-button.small {
	height: 38px;
	padding: 0 14px;
	font-size: 0.9rem;
}

.primary-button:active {
	background: var(--green-dark);
}

.hint {
	margin-top: 10px;
	color: var(--muted);
	font-size: 0.78rem;
}

.field-error {
	margin-top: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--danger-soft);
	color: var(--danger);
	font-size: 0.86rem;
	font-weight: 600;
}

.soft-pill {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
}

.pill-green {
	background: var(--green-soft);
	color: var(--green);
}

.pill-orange {
	background: var(--warn-soft);
	color: var(--warn);
	padding: 3px 10px;
	font-size: 0.82rem;
}

.live-dot {
	display: inline-block;
	flex: none;
	width: 10px;
	height: 10px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--green);
	vertical-align: 1px;
}

/* Accueil */

/* Accueil */

.status {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	padding: 12px 14px;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.status small {
	display: block;
	color: var(--muted);
	font-size: 0.82rem;
}

.dot {
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.dot-pending {
	background: var(--blue);
	animation: pulse 1.4s infinite;
}

.dot-ok {
	background: var(--green);
	box-shadow: 0 0 0 5px var(--green-soft);
}

.dot-error {
	background: var(--danger);
}

@keyframes pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(47, 128, 237, 0.45);
	}
	100% {
		box-shadow: 0 0 0 12px rgba(47, 128, 237, 0);
	}
}

.home-setup h3 {
	margin-bottom: 4px;
}

.home-setup p {
	margin-bottom: 12px;
	font-size: 0.88rem;
}

.home-row {
	display: flex;
	gap: 8px;
}

.home-setup .search-field {
	height: 48px;
	border-color: var(--line);
	box-shadow: none;
	background: var(--surface-2);
}

.home-setup .link-button {
	margin-top: 10px;
}

.card-map {
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

#homeMap {
	height: 48vh;
	min-height: 260px;
	background: #dfe8f1;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	max-width: 100%;
	padding: 8px 12px;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
	font-size: 0.88rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.desktop-hint {
	display: none;
}

.desktop-hint {
	display: none;
}

/* Mobile : les commandes disparaissent sur l'écran résultat et les pages. */
body.show-results .controls,
body.show-page .controls {
	display: none;
}

body.show-results .brand,
body.show-page .brand {
	margin-bottom: 4px;
}

/* Bandeau « trajet en cours » sur l'accueil */
.trip-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	border: 0;
	text-align: left;
	box-shadow: inset 0 0 0 2px var(--green), var(--shadow);
}

.trip-banner > span:nth-child(2) {
	flex: 1;
	min-width: 0;
}

.trip-banner small {
	display: block;
	color: var(--muted);
	font-size: 0.86rem;
}

/* ================================================================== */
/* Résultat                                                           */
/* ================================================================== */

.result-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 0 16px;
}

.result-title {
	flex: 1;
	min-width: 0;
	text-align: center;
}

.result-title h2 {
	overflow: hidden;
	font-size: 1.5rem;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.result-title p {
	color: var(--muted);
	font-size: 1rem;
}

.round-button {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border: 0;
	border-radius: 50%;
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--text);
}

.round-button svg {
	width: 26px;
	height: 26px;
}

.round-button.spinning svg {
	animation: spin 0.8s linear infinite;
}

.loading {
	display: flex;
	align-items: center;
	gap: 12px;
}

.spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--line);
	border-top-color: var(--green);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.error {
	background: var(--danger-soft);
	color: var(--danger);
	font-weight: 600;
}

/* Carte « trajet recommandé » */

.hero {
	padding: 20px 22px 22px;
}

.hero-none {
	box-shadow: inset 0 0 0 2px var(--warn), var(--shadow);
}

.hero-none p {
	margin-top: 10px;
}

.hero-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 18px;
}

/* 3 correspondances ou plus : lignes sur leur propre rangée, alignées à gauche. */
.hero-top.many .hero-lines {
	flex-basis: 100%;
	margin-left: 0;
}

.hero-count {
	margin-left: auto;
	color: var(--muted);
	font-size: 0.9rem;
}

.badge-ok,
.badge-warn {
	display: inline-flex;
	align-items: center;
	flex: none;
	gap: 5px;
	padding: 5px 9px 5px 5px;
	border-radius: 999px;
	background: var(--green-soft);
	color: var(--green);
	font-size: 0.88rem;
	white-space: nowrap;
	font-weight: 600;
}

.badge-ok svg {
	width: 20px;
	height: 20px;
	color: var(--green);
}

.badge-ok svg .tick {
	fill: none;
	stroke: #fff;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.badge-warn {
	padding: 6px 14px;
	background: var(--warn-soft);
	color: var(--warn);
}

.badge-live {
	padding-left: 16px;
}

.hero-lines,
.alt-lines {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.hero-top .hero-lines {
	flex-wrap: nowrap;
	gap: 2px;
	margin-left: auto;
}

.hero-lines .line-code {
	min-width: 29px;
	height: 29px;
	padding: 0 4px;
	border-radius: 6px;
	font-size: 1rem;
}

.hero-lines .mode-tag {
	min-width: 30px;
	height: 30px;
	font-size: 0.6rem;
}

.hero-lines .line-code.round {
	border-radius: 50%;
}

.chain-sep {
	display: inline-flex;
	color: var(--muted);
}

.chain-sep svg {
	width: 15px;
	height: 15px;
}

.chain-sep svg .stroke {
	stroke-width: 1.6;
}

.hero-times {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.leave,
.arrive {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.leave {
	padding-right: 16px;
	border-right: 1px solid var(--line);
}

.arrive {
	padding-left: clamp(14px, 6vw, 32px);
}

.leave small,
.arrive small {
	color: var(--muted);
	font-size: 1.1rem;
}

.leave strong,
.arrive strong {
	font-size: clamp(2rem, 9.5vw, 2.4rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.leave strong {
	color: var(--green);
}

.leave strong.trip-stop {
	overflow: hidden;
	font-size: 1.6rem;
	line-height: 1.25;
	white-space: normal;
}

.leave span,
.arrive span {
	color: var(--muted);
	font-size: 0.95rem;
}

/* Départ immédiat : « Partez maintenant » sur toute la largeur, arrivée dessous. */
.hero-times.now {
	grid-template-columns: 1fr;
}

.hero-times.now .leave {
	padding-right: 0;
	border-right: 0;
}

.hero-times.now .leave small {
	display: none;
}

.hero-times.now .leave strong {
	font-size: clamp(1.5rem, 7.3vw, 2.2rem);
	white-space: normal;
}

.hero-times.now .leave strong::before {
	content: "Partez ";
}

.hero-times.now .arrive {
	display: grid;
	grid-template-columns: auto auto 1fr;
	align-items: baseline;
	gap: 10px;
	margin-top: 12px;
	padding: 12px 0 0;
	border-top: 1px solid var(--line);
}

.hero-times.now .arrive strong {
	font-size: 1.6rem;
}

.hero-times.now .arrive span {
	justify-self: end;
}

.hero-station-block {
	display: grid;
	gap: 10px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.hero-station {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 1.2rem;
}

.hero-walk {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	color: var(--muted);
	font-size: 1.1rem;
}

.walk-icon {
	display: inline-flex;
	justify-content: center;
	width: 44px;
	color: #44516a;
}

.walk-icon svg {
	width: 30px;
	height: 30px;
}

.hero-walk .soft-pill {
	margin-left: auto;
	margin-right: auto;
	padding: 7px 22px;
	font-size: 1rem;
}

.cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	position: relative;
	width: 100%;
	height: 56px;
	margin-top: 18px;
	padding: 0 44px;
	white-space: nowrap;
	border: 0;
	border-radius: 16px;
	background: var(--green);
	color: #fff;
	font-size: 1.1rem;
	font-weight: 600;
}

.cta svg {
	position: absolute;
	right: 16px;
	width: 22px;
	height: 22px;
}

.cta:active {
	background: var(--green-dark);
}

.cta-secondary {
	background: var(--surface-2);
	color: var(--text);
}

.board-button {
	display: block;
	margin: 12px auto 0;
}

/* Pictogrammes de lignes */

.line-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	vertical-align: middle;
}

.mode-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 4px;
	border: 2px solid var(--text);
	border-radius: 7px;
	background: #fff;
	color: var(--text);
	font-size: 0.64rem;
	font-weight: 800;
}

.line-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border-radius: 7px;
	font-size: 0.95rem;
	font-weight: 800;
}

.line-code.round {
	border-radius: 50%;
}

.line-badge.big .line-code {
	min-width: 44px;
	height: 44px;
	border-radius: 9px;
	font-size: 1.35rem;
}

.line-badge.big .line-code.round {
	border-radius: 50%;
}

.line-badge.big .mode-tag {
	height: 36px;
	min-width: 36px;
	font-size: 0.72rem;
}

.walk-only {
	font-weight: 600;
}

/* Prochains passages */

.departures-card {
	padding: 18px 0 8px;
	overflow: hidden;
}

.dep-head {
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0 22px 4px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
	color: #44516a;
	font-size: 1.15rem;
}

.dep-head b {
	color: var(--text);
}

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

.dep {
	display: grid;
	grid-template-columns: minmax(62px, auto) auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	margin: 0 22px;
	padding: 13px 0;
	border-bottom: 1px solid var(--line);
	font-size: 1.15rem;
}

.dep-time {
	display: flex;
	flex-direction: column;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.dep-dir {
	overflow: hidden;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.dep-in {
	min-width: 58px;
	font-weight: 700;
	text-align: right;
}

.flag {
	justify-self: center;
	overflow: hidden;
	max-width: 100%;
	padding: 4px 12px;
	text-overflow: ellipsis;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 600;
	white-space: nowrap;
}

.flag-take {
	padding: 6px 18px;
	background: var(--green);
	color: #fff;
	font-size: 1rem;
}

.flag-tight {
	background: var(--surface-2);
	color: var(--muted);
}

.flag-missed {
	background: var(--danger-soft);
	color: var(--danger);
}

.dep.recommended {
	margin: 0 12px 0 10px;
	padding-right: 10px;
	padding-left: 18px;
	border-bottom-color: transparent;
	border-left: 5px solid var(--green);
	border-radius: 6px 12px 12px 6px;
	background: var(--green-soft);
}

.dep.recommended .dep-in {
	color: var(--green);
}

.dep.tight .dep-time,
.dep.missed .dep-time {
	color: var(--muted);
}

.dep.missed .dep-time > span:first-child {
	text-decoration: line-through;
}

.dep.missed .dep-in {
	color: var(--muted);
	font-weight: 600;
}

.dep.missed {
	opacity: 0.75;
}

.dep-foot {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 22px;
	padding: 14px 0 6px;
	color: #44516a;
	font-size: 1rem;
}

.dep-empty {
	margin: 12px 22px;
}

.info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--surface-2);
	color: #44516a;
}

.info-icon svg {
	width: 24px;
	height: 24px;
}

/* Trajet en cours */

.trip-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 12px;
	align-items: baseline;
}

.trip-row small {
	grid-column: 1 / -1;
	color: var(--muted);
	font-size: 0.95rem;
}

.trip-row b {
	font-size: 1.2rem;
}

.trip-row span {
	color: var(--green);
	font-weight: 600;
}

.stops {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.stop {
	display: grid;
	grid-template-columns: 22px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 7px 0;
	color: var(--muted);
}

.stop-dot {
	justify-self: center;
	width: 12px;
	height: 12px;
	border: 3px solid var(--line-color, var(--text));
	border-radius: 50%;
	background: #fff;
}

.stop-next {
	color: var(--text);
	font-weight: 600;
}

.stop-next .stop-dot {
	background: var(--line-color, var(--text));
}

.stop-last {
	color: var(--text);
	font-weight: 600;
}

.stop-last .stop-dot {
	width: 16px;
	height: 16px;
	border-radius: 4px;
}

.stop-time {
	font-variant-numeric: tabular-nums;
}

.connection {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

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

.connection-head .flag,
.connection-head .soft-pill {
	justify-self: auto;
	font-size: 0.82rem;
}

.connection-line {
	display: flex;
	align-items: center;
	gap: 10px;
}

.connection-time {
	margin-left: auto;
	font-weight: 700;
}

.replan {
	box-shadow: inset 0 0 0 2px var(--warn), var(--shadow);
}

.replan p {
	margin: 10px 0;
}

.replan-lines {
	margin-bottom: 8px;
}

/* Favoris et réglages */

.fav-list {
	padding: 6px 0;
}

.fav {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 12px 18px;
	border: 0;
	border-bottom: 1px solid var(--line);
	background: none;
	text-align: left;
}

.fav:last-child {
	border-bottom: 0;
}

.fav-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: var(--green-soft);
	color: var(--green);
}

.fav-icon svg {
	width: 24px;
	height: 24px;
}

.fav-icon-soft {
	background: var(--surface-2);
}

.fav-text {
	flex: 1;
	min-width: 0;
}

.fav-text b,
.fav-text small {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.fav-text small {
	color: var(--muted);
	font-size: 0.86rem;
}

.fav-go {
	color: var(--muted);
	font-size: 1.6rem;
	line-height: 1;
}

.fav-empty {
	padding: 10px 18px;
}

.settings {
	padding: 4px 18px;
}

.settings .small-text {
	margin: 0 0 12px;
}

.setting {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
}

.setting:last-of-type {
	border-bottom: 0;
}

.setting > div {
	min-width: 0;
}

.setting small {
	display: block;
	overflow: hidden;
	color: var(--muted);
	font-size: 0.86rem;
	text-overflow: ellipsis;
}

.setting-actions {
	display: flex;
	flex: none;
	gap: 14px;
}

/* ================================================================== */
/* Barre de navigation                                                */
/* ================================================================== */

.tabbar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1800;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(10px);
}

.tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 6px 0;
	border: 0;
	background: none;
	color: var(--muted);
	font-size: 0.95rem;
	font-weight: 600;
}

.tab svg {
	width: 30px;
	height: 30px;
}

.tab.active {
	color: var(--green);
	font-weight: 600;
}

/* Carte repliable et détail */

details > summary {
	cursor: pointer;
	list-style: none;
}

details > summary::-webkit-details-marker {
	display: none;
}

.map-details,
.steps-details {
	padding: 0;
	overflow: hidden;
}

.map-details > summary,
.steps-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	font-weight: 600;
}

.map-details > summary::after,
.steps-details > summary::after {
	content: "";
	width: 9px;
	height: 9px;
	margin-left: 4px;
	border-right: 2px solid var(--green);
	border-bottom: 2px solid var(--green);
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.map-details[open] > summary::after,
.steps-details[open] > summary::after {
	transform: rotate(-135deg);
}

.map-details > summary > span:first-child {
	flex: 1;
}

#mapSummary {
	font-size: 0.85rem;
	font-weight: 500;
}

#miniMap {
	height: 240px;
	background: #dfe8f1;
}

.steps-details .timeline {
	padding: 0 16px 8px;
}

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

.step {
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 8px;
	padding: 9px 0;
	border-top: 1px solid var(--line);
	font-size: 0.9rem;
}

.step-icon {
	display: flex;
	justify-content: center;
}

.step-transit > div {
	padding-left: 10px;
	border-left: 4px solid var(--line-color, var(--line));
}

.step-dir {
	font-weight: 600;
}

.tag {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 6px;
	background: var(--surface-2);
	font-size: 0.74rem;
	font-weight: 600;
}

.tag-delay,
.tag-medium,
.tag-low {
	background: var(--warn-soft);
	color: var(--warn);
}

.tag-high {
	background: var(--danger-soft);
	color: var(--danger);
}

/* Alternatives */

.alt {
	padding: 12px 16px;
}

.alt > summary {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 10px;
	align-items: center;
}

.alt-arrival {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	grid-row: span 2;
}

.alt-arrival strong {
	font-size: 1.25rem;
}

.alt-arrival small {
	color: var(--muted);
	font-size: 0.78rem;
}

.alt-meta {
	color: var(--muted);
	font-size: 0.85rem;
}

.alt-meta b {
	color: var(--text);
}

.alt .timeline {
	margin-top: 10px;
}

/* Infos trafic */

#trafficCard h3 {
	margin-bottom: 10px;
}

.traffic-ok {
	display: flex;
	align-items: center;
	gap: 12px;
}

.traffic-ok b {
	display: block;
	color: var(--green);
}

.traffic-ok small {
	color: var(--muted);
}

.check {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--green);
	color: #fff;
	font-weight: 800;
}

.disruptions {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.disruption {
	padding: 10px 12px;
	border-left: 4px solid var(--warn);
	border-radius: 0 12px 12px 0;
	background: var(--warn-soft);
	font-size: 0.9rem;
}

.disruption.level-high {
	border-left-color: var(--danger);
	background: var(--danger-soft);
}

.disruption summary {
	margin-top: 4px;
	color: var(--blue);
}

.disruption p {
	margin-top: 6px;
}

.updated-at {
	margin-top: 14px;
	color: var(--muted);
	font-size: 0.78rem;
	text-align: center;
}

/* Marqueurs de carte */

.stop-marker,
.walk-label,
.dest-marker {
	background: none;
	border: 0;
}

.stop-marker .line-badge {
	padding: 3px;
	border-radius: 9px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	transform: translate(-50%, -50%);
}

.walk-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: max-content;
	padding: 4px 10px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	font-size: 0.85rem;
	line-height: 1.2;
	transform: translate(-50%, -130%);
}

.walk-label span {
	color: var(--muted);
	font-size: 0.75rem;
}

.dest-marker {
	font-size: 1.6rem;
	transform: translate(-30%, -90%);
}

/* La grande carte n'existe que sur PC. */
.big-map {
	display: none;
}

/* ================================================================== */
/* PC : barre de recherche en haut, panneau à gauche, grande carte    */
/* ================================================================== */

@media (min-width: 900px) {
	body {
		display: flex;
		flex-direction: column;
		height: 100vh;
		overflow: hidden;
	}

	.topbar {
		z-index: 2000;
		display: flex;
		align-items: center;
		gap: 20px;
		padding: 10px 20px;
		background: var(--surface);
		box-shadow: 0 1px 0 var(--line);
	}

	.brand {
		flex: none;
		justify-content: flex-start;
		margin: 0;
	}

	.brand h1 {
		font-size: 1.15rem;
	}

	.controls,
	body.show-results .controls {
		display: flex;
		flex: 1;
		align-items: flex-start;
		gap: 10px;
		min-width: 0;
	}

	.origin-box,
	.destination-box {
		position: relative;
		flex: 1 1 260px;
		min-width: 0;
		max-width: 380px;
	}

	.suggestions {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
	}

	.search-field,
	.pill {
		height: 44px;
		box-shadow: none;
		background: var(--surface-2);
	}

	.search-field {
		border-color: var(--line);
	}

	.quick {
		display: flex;
		flex: none;
		order: 3;
	}

	.pill {
		padding: 0 14px;
		border: 1px solid var(--line);
		font-size: 0.95rem;
	}

	.pill:hover {
		background: var(--blue-soft);
	}

	.app {
		display: grid;
		flex: 1;
		grid-template-columns: 430px 1fr;
		min-height: 0;
	}

	.panel {
		padding: 16px;
		overflow-y: auto;
		border-right: 1px solid var(--line);
		background: var(--bg);
	}

	.big-map {
		display: block;
		min-height: 0;
	}

	#bigMap {
		width: 100%;
		height: 100%;
		background: #dfe8f1;
	}

	/* Sur PC, la grande carte remplace la carte d'accueil et la carte réduite. */
	.card-map,
	.map-details,
	.back-button {
		display: none !important;
	}

	.desktop-hint {
		display: block;
		padding: 28px 20px;
		border: 2px dashed var(--line);
		border-radius: var(--radius);
		color: var(--muted);
		text-align: center;
	}

	.result-title {
		text-align: left;
	}

	.brand img {
		width: 42px;
		height: 42px;
		border-radius: 11px;
	}

	.brand h1 {
		font-size: 1.25rem;
	}

	.brand p {
		font-size: 0.85rem;
	}

	.leave strong,
	.arrive strong {
		font-size: 2.5rem;
	}

	.hero-times.now .leave strong {
		font-size: 1.9rem;
	}

	.panel {
		padding-bottom: calc(var(--tabbar) + 16px);
	}

	/* Barre de navigation sous le panneau de gauche */
	.tabbar {
		right: auto;
		width: 430px;
		border-right: 1px solid var(--line);
	}

	body.show-results .brand,
	body.show-page .brand {
		margin-bottom: 0;
	}
}

/* PC à fenêtre étroite : libellés des boutons masqués pour éviter le débordement. */
@media (min-width: 900px) and (max-width: 1180px) {
	.brand p {
		display: none;
	}

	.pill span {
		display: none;
	}

	.pill {
		width: 44px;
		padding: 0;
	}
}
