:root {
  --bg: #f4f7f9; --card: #fff; --ink: #14212b; --muted: #5b6b77; --line: #dbe3e8;
  --brand: #0b5d7a; --brand-ink: #fff; --ok: #1b7f3b; --warn: #a15c00; --bad: #b3261e;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Gurmukhi", "Noto Sans SC", "Noto Sans Arabic", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", "Noto Sans Gujarati", "Noto Sans Tamil", "Noto Sans Thai", "Noto Nastaliq Urdu", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--brand); color: var(--brand-ink); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--brand); font-size: 24px; font-weight: 700; }
h1 { font-size: 1.2rem; margin: 0; }
.tagline { margin: 0; font-size: .85rem; opacity: .9; }
.lang select { font-size: 1rem; padding: 6px 8px; border-radius: 8px; border: 0; max-width: 46vw; }
main { max-width: 720px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 14px; }
.planner { position: relative; display: grid; gap: 10px; }
.field { display: grid; gap: 4px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.field input { font-size: 1.05rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: #fff; color: var(--ink); }
.field input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row .small { flex: 1 1 130px; }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 1000; inset-inline: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 300px; overflow: auto; }
.ac-list li { padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: #e8f2f6; }
.ac-list small { color: var(--muted); margin-inline-start: 6px; }
.row.between { justify-content: space-between; align-items: center; }
.link { justify-self: start; background: none; border: 0; color: var(--brand); font-size: .9rem; padding: 2px 0; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .9rem; cursor: pointer; }
.chip:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.modes input, .access input { position: absolute; opacity: 0; pointer-events: none; }
.primary { font-size: 1.05rem; font-weight: 600; padding: 12px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer; }
.primary:disabled { opacity: .6; }
.status { margin: 12px 4px; color: var(--muted); min-height: 1.2em; }
.status.error { color: var(--bad); font-weight: 600; }
.rt { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.rt.ok { background: #e3f4e8; color: var(--ok); }
.rt.unavailable { background: #fff1db; color: var(--warn); }
.rt.scheduled { background: #eef2f5; color: var(--muted); }
.results { display: grid; gap: 10px; }
.opt { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 2px solid transparent; }
.opt.open { border-color: var(--brand); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e8f2f6; color: var(--brand); }
.times { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.times .big { font-size: 1.35rem; font-weight: 700; }
.times .dur { color: var(--muted); }
.summary { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.badge { display: inline-block; min-width: 2.2em; text-align: center; padding: 2px 7px; border-radius: 6px; font-weight: 700; font-size: .85rem; background: #555; color: #fff; }
.delay { font-size: .8rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.delay.late { background: #fde4e2; color: var(--bad); }
.delay.early, .delay.ontime { background: #e3f4e8; color: var(--ok); }
.delay.cancel { background: var(--bad); color: #fff; }
.legs { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.legs li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.legs .t { font-weight: 700; }
.legs .sub { color: var(--muted); font-size: .85rem; }
.opt { padding: 0; overflow: hidden; }
.opt-head { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 12px 14px; font: inherit; color: inherit; cursor: pointer; }
.opt-body { padding: 0 14px 10px; }
.chg { margin-top: 6px; background: none; border: 1px solid var(--brand); color: var(--brand); border-radius: 999px; padding: 4px 10px; font-size: .82rem; cursor: pointer; }
.alt-panel { grid-column: 1 / -1; background: #eef6f9; border-radius: 10px; padding: 10px; }
.alt-panel h3 { margin: 0 0 2px; font-size: .95rem; }
.alt-panel .sub { display: block; margin-bottom: 6px; }
.alt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.alt-row:first-of-type { border-top: 0; }
.alt-row button, .alt-cancel { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.alt-cancel { background: none; color: var(--brand); padding: 6px 0; }
.line-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.line-chip { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.line-chip .x { color: var(--muted); font-size: 1rem; }
.more { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .92rem; }
.more[open] summary { margin-bottom: 8px; }
.more > .field, .more > .row { margin-top: 8px; }
.vias { display: grid; gap: 6px; }
.via-row { display: grid; grid-template-columns: 22px 1fr 74px 30px; gap: 6px; align-items: center; }
.via-row .num { font-weight: 700; color: var(--muted); text-align: center; }
.via-row input { font-size: 1rem; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: #fff; color: var(--ink); }
.via-row .via-lines { grid-column: 2 / 4; font-size: .85rem; padding: 6px 10px; }
.via-row .del { background: none; border: 0; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
.opt-check { font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; color: var(--ink) !important; font-weight: 500 !important; }
.opt-check input, .field .opt-check input { width: auto; padding: 0; margin: 0; }
.via-head { font-size: .72rem; color: var(--muted); font-weight: 600; margin-bottom: -2px; }
.first-name { font-size: .85rem; color: var(--muted); }
.notice { margin: 0 14px 8px; padding: 6px 10px; border-radius: 8px; background: #e3f4e8; color: var(--ok); font-size: .85rem; font-weight: 600; }
.notice.err { background: #fde4e2; color: var(--bad); }
.tip { margin: 0 4px 8px; font-size: .82rem; color: var(--muted); }
.status button { margin-inline-start: 8px; background: none; border: 1px solid var(--bad); color: var(--bad); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.chg { font-weight: 600; }
.walkchip { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.map-legend { font-size: .78rem; color: var(--muted); margin: 6px 4px 0; }
.lg-ride, .lg-walk { display: inline-block; width: 26px; height: 0; vertical-align: middle; border-top: 5px solid #0b5d7a; }
.lg-walk { border-top: 4px dotted #5b6b77; }
.access .chip { font-size: .85rem; padding: 6px 10px; }
.bikechip { font-size: .8rem; color: var(--ok); white-space: nowrap; }
.lg-bike { display: inline-block; width: 26px; height: 0; vertical-align: middle; border-top: 4px dashed #1b7f3b; }
.accbox { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #eaf1fb; color: #123a6b; font-size: .85rem; }
.accbox.warn { background: #fff1db; color: var(--warn); }
.accbox a { color: inherit; font-weight: 700; }
.legwarn { color: var(--bad); font-weight: 700; font-size: .8rem; }
.legacc { color: #123a6b; font-size: .8rem; }
.hint { margin: 0; font-size: .8rem; color: var(--muted); }
.tag.custom { background: var(--brand); color: #fff; }
.alerts { margin-top: 14px; }
.alerts h2 { font-size: 1rem; margin: 0 0 8px; }
.alert { background: #fff6e5; border-inline-start: 4px solid var(--warn); padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; font-size: .9rem; }
.map { height: 340px; border-radius: var(--radius); margin-top: 14px; overflow: hidden; }
.foot { max-width: 720px; margin: 20px auto 30px; padding: 0 16px; color: var(--muted); font-size: .8rem; }
.foot .small { font-size: .75rem; }
.foot a { color: var(--brand); }
/* Mention TransLink : visible en permanence (barre fixe en bas de l'écran) */
.legend { position: fixed; z-index: 2000; inset-inline: 0; bottom: 0; background: #14212b; color: #fff; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); font-size: .72rem; line-height: 1.3; text-align: center; }
.legend p { margin: 0 auto; max-width: 720px; }
.legend-tr:empty { display: none; }
[dir="rtl"] .legs li { grid-template-columns: 1fr 52px; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f171d; --card: #182630; --ink: #e6eef3; --muted: #9db0bd; --line: #2b3d4a; }
  .field input, .ac-list, .chip { background: #0f1c25; color: var(--ink); }
  .ac-list li[aria-selected="true"], .ac-list li:hover, .tag { background: #1f3a48; color: #cfe8f2; }
  .alt-panel { background: #12303d; }
  .via-row input { background: #0f1c25; color: var(--ink); }
}

/* v0.7.3 : avis complets et navigateur d'avis */
.alert .afull summary { cursor: pointer; color: var(--accent, #0b5cad); margin-top: 4px; }
.alert .afull p, .alert .afull-txt { white-space: pre-line; margin: 4px 0 0; }
.alert .tag.soon { background: #e8eefc; }
.afilter { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.afilter input { flex: 1 1 12rem; min-width: 0; }
#af-more { width: 100%; margin-top: 4px; }

.access .chip { position: relative; }
.access input[type="radio"] { width: 1px; height: 1px; padding: 0; margin: 0; border: 0; }
.access .chip:has(input:focus-visible) { outline: 2px solid currentColor; outline-offset: 2px; }

/* v0.7.4 : lieux favoris (sur l'appareil) */
.ac { position: relative; }
.ac input[type="search"]#from, .ac input[type="search"]#to { padding-inline-end: 44px; }
.fav-star { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; color: #b8860b; border-radius: 8px; }
.fav-star:hover, .fav-star:focus-visible { background: #fff6e0; }
.fav-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fav-chip { border: 1px solid #d0d7de; background: #fff; border-radius: 999px; padding: 6px 10px; font-size: .85rem; cursor: pointer; min-height: 34px; color: inherit; }
.fav-chip.unset { border-style: dashed; color: #667; }
.fav-chip.manage { background: transparent; border-color: transparent; text-decoration: underline; }
.fav-dialog { border: 0; border-radius: 14px; padding: 0; width: min(94vw, 460px); max-height: 90vh; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.fav-dialog::backdrop { background: rgba(0,0,0,.35); }
.fav-form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fav-form h2 { margin: 0 0 4px; font-size: 1.15rem; }
.fav-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.fav-form input, .fav-form select { font: inherit; padding: 10px; border: 1px solid #c8ccd2; border-radius: 10px; width: 100%; box-sizing: border-box; }
.fav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fav-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px; border: 1px solid #e3e6ea; border-radius: 10px; }
.fav-list small { display: block; color: #667; font-weight: 400; overflow-wrap: anywhere; }
.fav-actions { display: flex; gap: 4px; flex-shrink: 0; }
.fav-actions button { min-width: 38px; min-height: 38px; border: 1px solid #d0d7de; background: #fff; border-radius: 8px; cursor: pointer; }

/* v0.7.5 : 25 langues — texte officiel TransLink (souvent en anglais) gardé dans sa langue */
.alert .orig { color: var(--muted); }
[dir="rtl"] .alert [lang="en"] { unicode-bidi: isolate; }
:lang(ur) { line-height: 1.8; }
