/* Coucou Bus — page Itinéraire. Chargée seulement sur /itineraire. */
body.jbody { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.jbody .top { position: sticky; }
.jp { --walk: #8f88a0; --bike: #14b8a6; --panel: 470px; flex: 1; display: grid; grid-template-columns: var(--panel) 1fr; min-height: 0; }
.jp-panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); scrollbar-width: thin; }
.jp-map { position: relative; min-height: 320px; background: #0f0e14; }
.jp-map .map-load { position: absolute; inset: 0; display: grid; place-items: center; color: #6f6a7d; font-weight: 700; }
@media (min-width: 900px) {
  body.jbody { height: 100vh; height: 100dvh; overflow: hidden; }
  .jp-map { height: 100%; }
}

/* Bandeau de recherche : jaune bus */
.jp-search { background: var(--sun); color: #1d1a2b; padding: 22px 22px 20px; position: relative; z-index: 5; }
.jp-search h1 { font-size: 36px; margin: 0 0 16px; }
.jp-form { display: grid; gap: 12px; }
.jp-fields { position: relative; background: #fffdf8; border-radius: 20px; box-shadow: 0 14px 34px -18px rgba(29, 26, 43, 0.7), 0 0 0 1px rgba(29, 26, 43, 0.06); }
.jp-field { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 56px 0 16px; min-height: 56px; }
.jp-field + .jp-field { border-top: 1px solid #efe4cf; }
.jp-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 600 17px var(--sans); color: #1d1a2b; padding: 16px 0; }
.jp-field input::placeholder { color: #8b8597; font-weight: 500; }
.jp-field[data-end="from"] input.mine { color: #0b7a43; }
.jp-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.jp-dot.from { border: 3.5px solid #1d1a2b; background: #fff; }
.jp-dot.to { background: var(--tomato); box-shadow: 0 0 0 3.5px rgba(242, 84, 45, 0.22); }
.jp-field[data-end="from"]::after { content: ''; position: absolute; left: 22px; bottom: -11px; height: 20px; border-left: 2px dotted #b8aec4; z-index: 1; }
.jp-locate { position: absolute; right: 10px; top: 50%; translate: 0 -50%; width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; color: #4a4558; cursor: pointer; display: grid; place-items: center; }
.jp-locate svg { width: 22px; height: 22px; }
.jp-locate:hover, .jp-locate.busy { color: var(--tomato-ink); }
.jp-locate.busy svg { animation: jp-spin 1s linear infinite; }
@keyframes jp-spin { to { rotate: 360deg; } }
.jp-swap { position: absolute; right: 52px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #e6dac3; background: #fffdf8; color: #1d1a2b; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.jp-swap svg { width: 18px; height: 18px; }
.jp-swap:hover { border-color: #1d1a2b; }
.jp-field[data-end="to"] { padding-right: 96px; }

/* Suggestions */
.jp-sug { position: absolute; left: 6px; right: 6px; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fffdf8; color: #1d1a2b; border-radius: 18px;
  box-shadow: 0 22px 50px -18px rgba(29, 26, 43, 0.55), 0 0 0 1px rgba(29, 26, 43, 0.08); z-index: 40; max-height: min(420px, 60vh); overflow-y: auto; }
.jp-sug li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.jp-sug li.on, .jp-sug li:hover { background: #fff1d1; }
.jp-sug .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #f1ebf7; color: #4a4558; }
.jp-sug .ic svg { width: 19px; height: 19px; }
.jp-sug .k-shop { background: #ffe3da; color: #c2410c; } .jp-sug .k-food { background: #ffedd1; color: #b45309; } .jp-sug .k-stop, .jp-sug .k-station { background: #fff0b8; color: #1d1a2b; }
.jp-sug .k-me { background: #d9f6e6; color: #0b7a43; } .jp-sug .k-city { background: #e2ecff; color: #1d4ed8; } .jp-sug .k-leisure { background: #e1f7f3; color: #0f766e; }
.jp-sug .k-health { background: #ffe4ea; color: #be123c; } .jp-sug .k-school { background: #ece5ff; color: #6d28d9; }
.jp-sug b { display: block; font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-sug small { display: block; color: #6f6a7d; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-sug .d { color: #8b8597; font-size: 13px; font-weight: 600; white-space: nowrap; }
.jp-sug .pls { display: flex; gap: 3px; margin-top: 3px; }
.jp-sug .pls span { font: 800 11px/18px var(--sans); min-width: 22px; padding: 0 5px; border-radius: 6px; text-align: center; }
.jp-sug .empty { display: block; color: #6f6a7d; cursor: default; padding: 12px; }
.jp-sug .empty:hover { background: none; }

/* Quand ? */
.jp-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jp-when button { border: 0; background: rgba(29, 26, 43, 0.08); color: #1d1a2b; font: 700 14.5px var(--sans); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.jp-when button[aria-checked="true"] { background: #1d1a2b; color: var(--sun); }
.jp-when input { font: 700 15px var(--sans); color: #1d1a2b; background: #fffdf8; border: 0; border-radius: 12px; padding: 8px 10px; min-height: 38px; }

/* Modes */
.jp-modes { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid rgba(29, 26, 43, 0.16); background: rgba(255, 253, 248, 0.55); color: #1d1a2b;
  font: 700 14px var(--sans); padding: 7px 12px 7px 9px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.chip svg { width: 19px; height: 19px; flex: none; }
.chip svg circle[r="2"] { fill: currentColor; }
.chip[aria-pressed="true"] { background: #1d1a2b; border-color: #1d1a2b; color: #fff6e6; }
.chip:hover { border-color: #1d1a2b; }
.jp-go { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; background: var(--tomato-btn); color: #fff; font: 800 17px var(--sans);
  padding: 15px 22px; cursor: pointer; box-shadow: 0 12px 24px -14px rgba(242, 84, 45, 0.9); }
.jp-go svg { width: 22px; height: 22px; }
.jp-go:hover { background: #d9431d; }
.jp-go:disabled { opacity: 0.7; cursor: progress; }

/* Résultats */
.jp-out { padding: 18px 18px 8px; display: grid; gap: 12px; align-content: start; }
.jp-hint { color: var(--ink-2); margin: 0 0 10px; }
.jp-ex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; }
.jp-ex button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 700 14px var(--sans); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.jp-ex button:hover { border-color: var(--ink); }
.jp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.jp-head h2 { font-size: 22px; }
.jp-head p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.jp-head .live { color: var(--live); }
.jp-share { border: 0; background: none; color: var(--ink); font: 700 14px var(--sans); text-decoration: underline; text-decoration-color: var(--sun-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; padding: 0; }

.jc { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 15px 16px 14px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, translate 0.15s; }
.jc:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.jc.on { border-color: var(--ink); box-shadow: 0 16px 34px -22px rgba(29, 26, 43, 0.65); cursor: default; }
.jc:focus-visible { outline: 3px solid var(--tomato); outline-offset: 2px; }
.jc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 0; }
.jc-tags:empty { display: none; }
.tag { font: 800 12px/1 var(--sans); letter-spacing: 0.02em; padding: 6px 9px; border-radius: 999px; background: #f1ebf7; color: #4a4558; }
.tag.fast { background: var(--sun); color: #1d1a2b; }
.tag.bike { background: #ccfbf1; color: #0f766e; }
.tag.walk { background: #ece8f2; color: #4a4558; }
@media (prefers-color-scheme: dark) { .tag { background: #2e2a3a; color: #cfc7da; } .tag.bike { background: #134e4a; color: #99f6e4; } .tag.walk { background: #2e2a3a; color: #cfc7da; } .tag.fast { background: var(--sun); color: #1d1a2b; } }
.jc-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.jc-dur { font: 800 34px/1 var(--display); letter-spacing: -0.03em; }
.jc-dur small { font-size: 18px; margin-left: 3px; letter-spacing: -0.01em; }
.jc-times { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jc-times b { color: var(--ink); }

/* Frise des étapes */
.frise { display: flex; gap: 3px; height: 30px; margin: 12px 0 10px; }
.frise > span { display: flex; align-items: center; justify-content: center; min-width: 30px; border-radius: 9px; overflow: hidden; font: 800 13px/1 var(--sans); white-space: nowrap; }
.frise .w { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--walk) 45%, transparent) 0 4px, transparent 4px 8px); color: var(--ink-2); min-width: 30px; flex-grow: 0.6 !important; }
.frise .w svg, .frise .b svg { width: 17px; height: 17px; flex: none; }
.frise .w svg circle[r="2"] { fill: currentColor; }
.frise .b { background: var(--bike); color: #fff; gap: 4px; }
.frise .r { gap: 5px; padding: 0 6px; }
.frise .r svg { width: 15px; height: 15px; flex: none; opacity: 0.9; }
.jc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; font-weight: 600; }
.jc-meta b { color: var(--ink); }
.jc-meta .live { color: var(--live); display: inline-flex; align-items: center; gap: 5px; }
.jc-meta .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* Détail (feuille de route) */
.jd { margin: 14px -4px 2px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; }
.st { display: grid; grid-template-columns: 50px 22px 1fr; column-gap: 8px; }
.st .t { font: 800 14px/1 var(--sans); font-variant-numeric: tabular-nums; padding-top: 4px; text-align: right; }
.st .t small { display: block; font-weight: 700; font-size: 11px; margin-top: 3px; color: var(--muted); }
.st .rail { position: relative; display: flex; justify-content: center; }
.st .rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 6px; border-radius: 3px; background: var(--c, transparent); }
.st.walk .rail::before { width: 0; border-left: 3px dotted var(--walk); background: none; border-radius: 0; }
.st.bike .rail::before { width: 0; border-left: 4px dashed var(--bike); background: none; border-radius: 0; }
.st.pt .rail::before { display: none; }
.st.pt .rail::after { content: ''; position: relative; z-index: 1; margin-top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 4px solid var(--c, var(--ink)); box-sizing: border-box; }
.st.pt.end .rail::after { background: var(--tomato); border-color: var(--tomato); box-shadow: 0 0 0 4px rgba(242, 84, 45, 0.2); }
.st.pt.start .rail::after { border-color: var(--ink); }
.st .x { padding: 2px 0 14px; min-width: 0; }
.st.pt .x { padding-bottom: 10px; }
.st.pt .x b { font-weight: 800; font-size: 16px; }
.st .x p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.st.seg .x { padding: 4px 0 16px; }
.st .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.st .line .pill { min-width: 34px; height: 28px; font-size: 15px; border-radius: 9px; }
.st .line .hd { font-weight: 800; }
.st .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.st .chips span { font: 700 12.5px/1 var(--sans); padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-2); }
.st .chips .on { background: color-mix(in srgb, var(--live) 16%, transparent); color: var(--live); }
.st .chips .late { background: color-mix(in srgb, var(--tomato) 15%, transparent); color: var(--tomato-ink); }
.st details summary { display: inline-block; cursor: pointer; color: var(--ink-2); font-size: 14px; font-weight: 700; margin-top: 6px; list-style: none; }
.st details summary::-webkit-details-marker { display: none; }
.st details summary::after { content: ' ▾'; }
.st details[open] summary::after { content: ' ▴'; }
.st details ol { margin: 6px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.st details li { padding: 2px 0 2px 12px; position: relative; }
.st details li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.jp-more { display: flex; gap: 8px; justify-content: center; padding: 4px 0 6px; }
.jp-more button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 700 14.5px var(--sans); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.jp-more button:hover { border-color: var(--ink); }
.jp-msg { background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 18px; }
.jp-msg h2 { font-size: 21px; margin-bottom: 6px; }
.jp-msg p { margin: 0; color: var(--ink-2); }
.jp-fine { padding: 4px 18px 22px; margin: auto 0 0; }
.jp-attr { font-size: 13px; color: var(--muted); margin: 0; }

/* Chargement */
.sk { height: 132px; border-radius: 22px; background: linear-gradient(100deg, var(--card) 30%, color-mix(in srgb, var(--line) 70%, var(--card)) 50%, var(--card) 70%) 0 0 / 300% 100%; border: 1.5px solid var(--line); animation: jp-sk 1.2s ease-in-out infinite; }
@keyframes jp-sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .jp-locate.busy svg { animation: none; } }

/* Marqueurs de carte */
.mk { width: 22px; height: 22px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); }
.mk.from { background: #1d1a2b; }
.mk.to { width: 32px; height: 42px; border: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5)); }
.mk.to svg { display: block; }
.mk-lbl { font: 800 12px/1 var(--sans); color: #1d1a2b; background: #fff6e6; padding: 5px 8px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); white-space: nowrap; translate: 0 -2px; }
.mk-veh { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; font: 800 12px/1 var(--sans); border: 2.5px solid #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.5); }
.mk-veh.plan { border-color: #8f88a0; }

/* Mobile : recherche, carte, résultats, dans le flux de la page */
@media (max-width: 899px) {
  .jp { display: flex; flex-direction: column; }
  .jp-panel { display: contents; }
  .jp-search { order: 1; padding: 18px 16px 18px; }
  .jp-search h1 { font-size: 30px; margin-bottom: 14px; }
  .jp-map { order: 2; height: 44vh; min-height: 280px; display: none; }
  .jp.has-results .jp-map { display: block; }
  .jp-out { order: 3; padding: 16px 16px 6px; }
  .jp-fine { order: 4; padding: 4px 16px 24px; }
  .jp-modes { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .jp-modes::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .jc-dur { font-size: 30px; }
}
