/* Mise en page : une colonne de lecture large, cartes avec panneau de détails à droite, sections par ville. */
:root {
  --papier: #f6f6f2;
  --surface: #ffffff;
  --surface-2: #eef0ea;
  --encre: #1c2230;
  --encre-2: #4a5263;
  --encre-3: #737b8c;
  --trait: #dcdfd6;
  --ai: #2b4a8b;          /* indigo, couleur principale */
  --ai-pale: #e3e9f6;
  --shu: #d0422a;         /* vermillon des torii, pour les accents */
  --shu-pale: #fbe6e1;
  --sakura: #e9a5b6;
  --ok: #2f7d4f;
  --ok-pale: #e0f1e6;
  --attention: #a86a00;
  --attention-pale: #fbefd5;
  --vol-aller: #2b4a8b;
  --vol-retour: #d0422a;
  --train: #1f7a5a;
  --ombre: 0 1px 2px rgb(20 30 50 / 6%), 0 6px 24px rgb(20 30 50 / 6%);
  --rayon: 10px;
  --f-titre: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Inter', system-ui, sans-serif;
  --f-texte: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-data: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #12151c; --surface: #1a1f29; --surface-2: #222835; --encre: #e8eaef; --encre-2: #b7bdca; --encre-3: #8a92a3;
    --trait: #2e3545; --ai: #8fa9e8; --ai-pale: #243256; --shu: #f07a62; --shu-pale: #3d231f; --sakura: #e9a5b6;
    --ok: #6cc592; --ok-pale: #1c3427; --attention: #e6b04f; --attention-pale: #3a2f17;
    --vol-aller: #8fa9e8; --vol-retour: #f07a62; --train: #5fc79d; --ombre: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #12151c; --surface: #1a1f29; --surface-2: #222835; --encre: #e8eaef; --encre-2: #b7bdca; --encre-3: #8a92a3;
  --trait: #2e3545; --ai: #8fa9e8; --ai-pale: #243256; --shu: #f07a62; --shu-pale: #3d231f; --sakura: #e9a5b6;
  --ok: #6cc592; --ok-pale: #1c3427; --attention: #e6b04f; --attention-pale: #3a2f17;
  --vol-aller: #8fa9e8; --vol-retour: #f07a62; --train: #5fc79d; --ombre: 0 1px 2px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 15px/1.55 var(--f-texte); }
img { max-width: 100%; display: block; }
a { color: var(--ai); }
h1, h2, h3, h4 { font-family: var(--f-titre); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 900; }
h2 { font-size: 1.45rem; font-weight: 900; }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-size: 0.98rem; font-weight: 700; }
p { margin: 0; }
.num, .data { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* En-tête */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.entete { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--trait); }
.entete-in { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.marque { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--encre); }
.marque strong { display: block; font-family: var(--f-titre); font-weight: 900; font-size: 1.15rem; }
.marque small { display: block; color: var(--encre-3); font-size: 0.78rem; }
.marque-sceau { width: 36px; height: 36px; border-radius: 50%; background: var(--shu); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; }
.onglet { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--encre-2); font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; }
.onglet:hover { background: var(--surface-2); }
.onglet[aria-current="page"] { background: var(--ai); color: var(--surface); }
.onglet-off { color: var(--encre-3); cursor: default; }
.onglet-off em { font-style: normal; font-size: 0.75rem; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }

.page { max-width: 1280px; margin: 0 auto; padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 36px; }
.chargement { color: var(--encre-3); padding: 40px 0; }
.pied { max-width: 1280px; margin: 0 auto; padding-block: 0 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); color: var(--encre-3); font-size: 0.82rem; }

section { display: grid; gap: 14px; min-width: 0; }
.sec-tete { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.sec-tete p { color: var(--encre-3); font-size: 0.88rem; }
.surtitre { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--shu); }

/* Intro */
.intro { display: grid; gap: 6px; }
.intro p { color: var(--encre-2); max-width: 70ch; }

/* Sélecteur de vol */
.choix-vols { display: grid; gap: 10px; }
.vols-onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.vol-onglet { text-align: left; border: 1px solid var(--trait); background: var(--surface); border-radius: var(--rayon); padding: 10px 12px; cursor: pointer; color: var(--encre);
  display: grid; gap: 2px; font: inherit; transition: border-color .15s, box-shadow .15s; }
.vol-onglet:hover { border-color: var(--ai); }
.vol-onglet[aria-selected="true"] { border-color: var(--ai); box-shadow: inset 0 0 0 1px var(--ai); background: var(--ai-pale); }
.vol-onglet b { font-size: 0.92rem; }
.vol-onglet .prix { font-family: var(--f-data); font-weight: 500; font-size: 1.02rem; }
.vol-onglet small { color: var(--encre-3); font-size: 0.78rem; }
.vol-onglet .delta { font-family: var(--f-data); font-size: 0.75rem; }
.delta.moins { color: var(--ok); } .delta.plus { color: var(--shu); }

.reglages { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 0.88rem; color: var(--encre-2); }
.reglage { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.segment { display: inline-flex; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.segment button { border: 0; background: transparent; padding: 5px 10px; font: inherit; font-size: 0.84rem; color: var(--encre-2); cursor: pointer; }
.segment button + button { border-left: 1px solid var(--trait); }
.segment button[aria-pressed="true"] { background: var(--ai); color: var(--surface); }

/* Chiffres clés */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.chiffre { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; display: grid; gap: 2px; }
.chiffre span { color: var(--encre-3); font-size: 0.78rem; }
.chiffre b { font-family: var(--f-data); font-weight: 500; font-size: 1.18rem; }
.chiffre small { color: var(--encre-3); font-size: 0.76rem; }

/* Vol détaillé */
.vol-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.trajet { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.trajet-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trajet-tete .data { color: var(--encre-3); font-size: 0.84rem; }
.segments { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.seg { display: grid; grid-template-columns: 64px 1fr; gap: 2px 12px; position: relative; padding-bottom: 10px; }
.seg .h { font-family: var(--f-data); font-weight: 500; }
.seg .d { color: var(--encre-3); font-size: 0.75rem; display: block; font-family: var(--f-data); }
.seg .vol-no { font-family: var(--f-data); font-size: 0.8rem; color: var(--encre-2); }
.escale { margin-left: 76px; padding: 4px 10px; border-left: 2px dashed var(--trait); color: var(--encre-3); font-size: 0.8rem; margin-bottom: 10px; }
.bagages { font-size: 0.84rem; color: var(--encre-2); display: flex; gap: 8px; align-items: flex-start; }
.remarques { margin: 0; padding-left: 18px; color: var(--encre-2); font-size: 0.86rem; display: grid; gap: 2px; }

/* Étiquettes */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.tag-releve { background: var(--ok-pale); color: var(--ok); }
.tag-estime { background: var(--attention-pale); color: var(--attention); }
.tag-offre { background: var(--ai-pale); color: var(--ai); }
.tag-saisi { background: var(--surface-2); color: var(--encre-2); }
.tag-promo { background: var(--shu-pale); color: var(--shu); }
.tag-idee { background: var(--surface-2); color: var(--encre-2); }
.tag-prevue { background: var(--ai-pale); color: var(--ai); }
.tag-reservee { background: var(--ok-pale); color: var(--ok); }
.tag-repos { background: var(--ok-pale); color: var(--ok); }
.tag-enfants { background: var(--shu-pale); color: var(--shu); }
.tag-transfert, .tag-arrivee, .tag-depart, .tag-voyage { background: var(--ai-pale); color: var(--ai); }

/* Carte + panneau */
.carte-bloc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: stretch; }
.carte { height: 520px; border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--trait); background: var(--surface-2); min-width: 0; }
.carte.petite { height: 420px; }
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 10px; align-content: start; max-height: 520px; overflow: auto; min-width: 0; }
.carte-bloc.petit .panneau { max-height: 420px; }
.panneau .vide { color: var(--encre-3); font-size: 0.88rem; }
.panneau h3 { font-size: 1.02rem; }
.panneau .type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-3); font-weight: 700; }
.panneau dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.86rem; }
.panneau dt { color: var(--encre-3); }
.panneau dd { margin: 0; font-size: 0.84rem; }
.panneau p { font-size: 0.88rem; color: var(--encre-2); }
.panneau img { border-radius: 8px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.panneau .credit { font-size: 0.7rem; color: var(--encre-3); }
.panneau .epingle { font-size: 0.74rem; color: var(--ai); }
.zoom-carte { display: flex; gap: 6px; flex-wrap: wrap; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--encre-2); }
.legende i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.legende i.pt { border-top-style: dashed; }
.legende i.rond { width: 10px; height: 10px; border: 0; border-radius: 50%; }
@media (max-width: 860px) {
  .carte-bloc { grid-template-columns: 1fr; }
  .carte { height: 420px; }
  .panneau { max-height: none; }
}

/* Marqueurs */
.pin-wrap { background: none !important; border: 0 !important; }
.pin { transform: translate(-50%, -50%); display: inline-grid; place-items: center; white-space: nowrap; cursor: pointer; }
.pin-hotel { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; color: #fff; font: 700 0.8rem/1 var(--f-texte); border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 35%); }
.pin-aero { width: 22px; height: 22px; border-radius: 6px; background: #fff; color: #1c2230; font: 600 0.62rem/1 var(--f-data); border: 1.5px solid #1c2230; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); }
.pin-aero.large { width: auto; padding: 0 4px; }
.pin-lieu { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 35%); }
.pin-lieu.famille { border-radius: 3px; transform: translate(-50%, -50%) rotate(45deg); }
.pin-label { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); font: 600 0.7rem/1 var(--f-texte); color: #1c2230; background: rgb(255 255 255 / 88%); padding: 2px 4px; border-radius: 4px; pointer-events: none; }
.pin-zone { font: 700 0.72rem/1 var(--f-titre); color: #1c2230; background: rgb(255 255 255 / 80%); padding: 2px 6px; border-radius: 6px; border-left: 3px solid; }

/* Frise des étapes */
.frise { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.etape-f { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px; display: grid; gap: 4px; align-content: start; border-top: 4px solid var(--c, var(--ai)); }
.etape-f .dates { font-family: var(--f-data); font-size: 0.78rem; color: var(--encre-3); }
.etape-f h3 { font-size: 1.05rem; }
.etape-f p { font-size: 0.82rem; color: var(--encre-2); }
.etape-f a { font-size: 0.8rem; }
.etape-f.voyage { border-top-color: var(--encre-3); background: var(--surface-2); }

/* Budget */
.table-wrap { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--encre-3); font-weight: 700; background: var(--surface-2); }
td.m, th.m { text-align: right; font-family: var(--f-data); white-space: nowrap; }
tr.groupe td { background: var(--surface-2); font-weight: 700; font-size: 0.8rem; color: var(--encre-2); }
tr.total td { font-weight: 700; font-size: 0.95rem; border-bottom: 0; }
tr.sel td { background: var(--ai-pale); }
td .src { display: block; color: var(--encre-3); font-size: 0.76rem; }
td .src a { color: inherit; }
.note-budget { font-size: 0.84rem; color: var(--encre-2); display: grid; gap: 4px; }

/* Villes */
.ville { border-top: 2px solid var(--c); padding-top: 18px; gap: 18px; }
.ville-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: end; }
.ville-tete .dates { font-family: var(--f-data); color: var(--encre-3); font-size: 0.86rem; }
.hotel-carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; }
.hotel-carte h3 { font-size: 1.05rem; }
.hotel-carte p { font-size: 0.86rem; color: var(--encre-2); }
.hotel-prix { display: grid; gap: 6px; justify-items: end; align-content: start; }
.hotel-prix b { font-family: var(--f-data); font-weight: 500; font-size: 1.15rem; }
.hotel-prix s { color: var(--encre-3); font-family: var(--f-data); font-size: 0.8rem; }
@media (max-width: 640px) { .hotel-carte, .ville-tete { grid-template-columns: 1fr; } .hotel-prix { justify-items: start; } }

.quartiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.quartier { background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--qc); border-radius: var(--rayon); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.quartier-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.etoiles { color: var(--shu); letter-spacing: 2px; font-size: 0.9rem; white-space: nowrap; }
.etoiles .off { color: var(--trait); }
.quartier p { font-size: 0.86rem; color: var(--encre-2); }
.quartier ul { margin: 0; padding-left: 18px; font-size: 0.84rem; color: var(--encre-2); }
.quartier .famille { font-size: 0.84rem; font-weight: 600; color: var(--encre); }

.jours { display: grid; gap: 12px; }
.jour { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); display: grid; grid-template-columns: 150px minmax(0, 1fr) 220px; overflow: hidden; }
.jour-date { padding: 14px; background: var(--surface-2); display: grid; gap: 4px; align-content: start; }
.jour-date .jds { font-family: var(--f-titre); font-weight: 900; font-size: 1.05rem; }
.jour-date .jn { font-family: var(--f-data); font-size: 0.76rem; color: var(--encre-3); }
.jour-corps { padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.jour-photo { position: relative; min-height: 160px; background: var(--surface-2); }
.jour-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jour-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.66rem; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 60%)); padding: 14px 8px 4px; }
@media (max-width: 900px) { .jour { grid-template-columns: 120px minmax(0, 1fr); } .jour-photo { grid-column: 1 / -1; min-height: 180px; } }
@media (max-width: 560px) { .jour { grid-template-columns: 1fr; } .jour-date { grid-auto-flow: column; justify-content: start; gap: 10px; align-items: baseline; } }

.creneau { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 4px 12px; }
.creneau .moment { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--encre-3); font-weight: 700; padding-top: 2px; }
.creneau-corps { display: grid; gap: 6px; min-width: 0; }
.option h4 { font-size: 0.95rem; }
.option p { font-size: 0.86rem; color: var(--encre-2); }
.option .ligne-prix { font-size: 0.82rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.option .ligne-prix .data { font-size: 0.82rem; }
@media (max-width: 560px) { .creneau { grid-template-columns: 1fr; } }

.ajouts { display: grid; gap: 6px; }
.ajout { border: 1px dashed var(--trait); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; font-size: 0.86rem; }
.ajout-tete { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; justify-content: space-between; }
.ajout-tete b { font-size: 0.9rem; }
.ajout .meta { color: var(--encre-3); font-size: 0.76rem; }
.ajout .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lien-mini { background: none; border: 0; padding: 0; font: inherit; font-size: 0.78rem; color: var(--ai); cursor: pointer; text-decoration: underline; }
.lien-mini.danger { color: var(--shu); }

.btn { font: inherit; font-size: 0.86rem; font-weight: 600; border: 1px solid var(--trait); background: var(--surface); color: var(--encre); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: var(--ai); }
.btn-plein { background: var(--ai); border-color: var(--ai); color: var(--surface); }
.btn-petit { font-size: 0.8rem; padding: 4px 10px; }
.btn-ajout { justify-self: start; border-style: dashed; color: var(--ai); }

.idees { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.vide-bloc { color: var(--encre-3); font-size: 0.88rem; border: 1px dashed var(--trait); border-radius: var(--rayon); padding: 14px; }
.alerte { background: var(--attention-pale); color: var(--attention); border-radius: 8px; padding: 8px 12px; font-size: 0.86rem; }

/* Dialogue */
.dlg { border: 1px solid var(--trait); border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 32px)); background: var(--surface); color: var(--encre); box-shadow: var(--ombre); }
.dlg::backdrop { background: rgb(10 15 25 / 45%); }
.dlg form { padding: 20px; display: grid; gap: 14px; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.champ { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--encre-2); }
.champ.large, .aide.large { grid-column: 1 / -1; }
.champ input, .champ select, .champ textarea { font: inherit; font-size: 0.92rem; font-weight: 400; color: var(--encre); background: var(--papier); border: 1px solid var(--trait); border-radius: 8px; padding: 7px 9px; width: 100%; }
.aide { font-size: 0.78rem; color: var(--encre-3); }
.erreur { color: var(--shu); font-size: 0.86rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 560px) { .champs { grid-template-columns: 1fr; } }

/* Comparaison */
.barres { display: grid; gap: 10px; }
.barre-ligne { display: grid; grid-template-columns: 200px minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: 0.86rem; }
.barre { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.barre span { height: 100%; }
.barre-ligne .m { font-family: var(--f-data); text-align: right; font-size: 0.82rem; }
@media (max-width: 640px) { .barre-ligne { grid-template-columns: 1fr; } .barre-ligne .m { text-align: left; } }
.c-vols { background: var(--ai); } .c-heb { background: var(--shu); } .c-trains { background: var(--train); } .c-visites { background: var(--sakura); } .c-autres { background: var(--encre-3); } .c-ajouts { background: var(--attention); }
.legende-barres { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--encre-2); }
.legende-barres i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 640px) { .entete { position: static; } .onglet { padding: 6px 10px; } }
