/* ============================================================
   Relevés km v2 : styles (iPhone d'abord, clair et sombre)
   ============================================================ */

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif;

  --bg: #EDEFF2;            /* asphalte clair */
  --behind: #CDD2D9;        /* derrière l'écran quand une feuille est ouverte */
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --fill: rgba(112, 122, 138, .13);
  --fill-2: rgba(112, 122, 138, .22);
  --ink: #0F1722;
  --ink-2: #4B5668;
  --ink-3: #8992A1;
  --line: rgba(15, 23, 34, .09);
  --line-2: rgba(15, 23, 34, .16);

  --signal: #FFC21A;        /* jaune signalisation : l'action principale, l'étape en cours */
  --signal-press: #EDAF00;
  --signal-glow: rgba(255, 194, 26, .32);
  --on-signal: #1B1400;

  --cab: #0E1828;           /* tableau de bord */
  --cab-2: #172338;
  --cab-ink: #EFF3F9;
  --cab-ink-2: rgba(239, 243, 249, .6);
  --cab-ink-3: rgba(239, 243, 249, .34);
  --cab-line: rgba(255, 255, 255, .08);

  --eu: #1F49B6;
  --good: #11804A;  --good-bg: rgba(17, 128, 74, .11);
  --warn: #9A5B00;  --warn-bg: rgba(255, 170, 0, .17);
  --bad: #C9343A;   --bad-bg: rgba(217, 58, 63, .11);
  --info: #2A5BC8;  --info-bg: rgba(42, 91, 200, .1);
  --switch-on: #2FB45A;
  --bar: #5A6A80;

  --shadow: 0 1px 2px rgba(15, 23, 34, .05), 0 6px 18px -6px rgba(15, 23, 34, .08);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-roll: cubic-bezier(.18, .74, .22, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --dock-h: 84px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06090E;
    --behind: #000;
    --surface: #131A23;
    --surface-2: #1A222D;
    --fill: rgba(130, 145, 170, .16);
    --fill-2: rgba(130, 145, 170, .26);
    --ink: #EEF2F7;
    --ink-2: #A9B3C1;
    --ink-3: #6E7988;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .15);
    --signal-glow: rgba(255, 194, 26, .22);
    --cab: #101927;
    --cab-2: #18243A;
    --cab-line: rgba(255, 255, 255, .07);
    --good: #45CF86;  --good-bg: rgba(69, 207, 134, .13);
    --warn: #F5B544;  --warn-bg: rgba(245, 181, 68, .14);
    --bad: #FF6B6F;   --bad-bg: rgba(255, 107, 111, .13);
    --info: #7AA2FF;  --info-bg: rgba(122, 162, 255, .13);
    --switch-on: #35C760;
    --bar: #8D9DB4;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  height: 100%;
}
html.is-locked { background: var(--behind); }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
html.is-locked body { background: var(--behind); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
.muted { color: var(--ink-2); }

.ico {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 10px; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  transform-origin: 50% 0;
  transition: transform .5s var(--ease), border-radius .5s var(--ease), opacity .5s var(--ease);
}
html.is-locked .app {
  transform: scale(.935) translateY(calc(var(--safe-t) * .5 + 6px));
  border-radius: 16px;
  overflow: hidden;
  opacity: .78;
}

.view { padding: calc(var(--safe-t) + 12px) var(--gutter) calc(var(--safe-b) + 24px); max-width: 560px; margin: 0 auto; }

/* ---------- Typo ---------- */
.large-title { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.title-1 { font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 18px 0 8px; }
.lead { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; max-width: 34ch; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.sec-title { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.sec-aside { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.field-label { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 4px 8px; }
.field-note { font-size: 13px; color: var(--ink-2); margin: 8px 4px 0; }
.form-error { color: var(--bad); font-size: 15px; margin: 12px 4px 0; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px; border-radius: 16px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .15s ease, background-color .15s ease, opacity .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-signal { background: var(--signal); color: var(--on-signal); }
.btn-signal:active { background: var(--signal-press); }
.btn-signal .ico { stroke-width: 2.2; }
.btn[disabled] { background: var(--fill-2); color: var(--ink-3); transform: none; cursor: default; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-plain { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-sm { height: 44px; width: auto; padding: 0 18px; border-radius: 12px; font-size: 16px; }
.btn.is-busy { opacity: .7; pointer-events: none; }

.text-btn { font-size: 17px; color: var(--ink); padding: 8px 2px; min-height: 44px; }
.text-btn:active { opacity: .45; }
.text-btn-strong { font-weight: 600; }

.input {
  display: block; width: 100%; height: 52px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 17px; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--fill); }
.input-plate { font-family: var(--font-num); font-weight: 700; font-size: 24px; letter-spacing: .06em; text-transform: uppercase; }

.switch {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: var(--fill-2); position: relative; cursor: pointer;
  transition: background-color .25s ease;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .28s var(--ease);
}
.switch:checked { background: var(--switch-on); }
.switch:checked::after { transform: translateX(20px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; color: var(--ink);
}
.chip:active { background: var(--fill); }

/* ---------- Plaque d'immatriculation ---------- */
.plate {
  display: inline-flex; align-items: stretch; height: 30px; flex: none;
  border-radius: 5px; overflow: hidden; background: #FCFCFA; color: #121212;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.plate-eu, .plate-dep { background: var(--eu); width: 17px; flex: none; }
.plate-eu { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 0 2px; }
.plate-eu svg { width: 12px; height: 12px; }
.plate-eu b { color: #fff; font: 700 9px/1 var(--font); }
.plate-dep { width: 13px; }
.plate-txt {
  display: flex; align-items: center; padding: 0 8px;
  font-family: var(--font-num); font-weight: 700; font-size: 22px; letter-spacing: .05em; line-height: 1;
  padding-top: 1px;
}
.plate.is-sm { height: 24px; border-radius: 4px; }
.plate.is-sm .plate-eu { width: 13px; padding: 2px 0 1px; }
.plate.is-sm .plate-eu svg { width: 9px; height: 9px; }
.plate.is-sm .plate-eu b { font-size: 7px; }
.plate.is-sm .plate-dep { width: 10px; }
.plate.is-sm .plate-txt { font-size: 17px; padding: 0 6px; }
.plate.is-empty .plate-txt { color: #9AA0A8; }

/* ---------- Compteur à tambours ---------- */
.odo { display: inline-flex; align-items: center; font-family: var(--font-num); font-weight: 600; }
.odo-lg { --h: 58px; --w: min(37px, 9.4vw); --gap: 3px; font-size: 48px; }
.odo-entry { --h: 54px; --w: min(34px, 8.6vw); --gap: 3px; font-size: 44px; }
.odo-sm { --h: 34px; --w: 22px; --gap: 2px; font-size: 27px; }
.drum {
  position: relative; width: var(--w); height: var(--h); overflow: hidden; border-radius: 7px;
  margin-left: var(--gap);
  background: linear-gradient(#04080F, #1B2638 46%, #1B2638 54%, #04080F);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 3px 6px rgba(0, 0, 0, .55);
}
.drum:first-child { margin-left: 0; }
.drum.grp { margin-left: calc(var(--gap) + 7px); }
.drum::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .5), transparent 32%, transparent 68%, rgba(0, 0, 0, .5));
}
.strip {
  display: flex; flex-direction: column;
  transform: translateY(calc(var(--d, 0) * var(--h) * -1));
  transition: transform .95s var(--ease-roll);
  transition-delay: var(--delay, 0s);
}
.strip span { display: block; height: var(--h); line-height: var(--h); text-align: center; color: #F3F6FA; }
.drum.is-auto .strip span { color: rgba(243, 246, 250, .36); }
.drum.is-slot .strip { opacity: 0; }
.drum.is-slot::before {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 10px; height: 3px; border-radius: 2px;
  background: rgba(243, 246, 250, .22); z-index: 1;
}
.drum.is-next::before { background: var(--signal); animation: caret 1.1s steps(1) infinite; }
.drum.is-err .strip span { color: #FF8A8D; }
.drum.is-warn .strip span { color: #FFC857; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Connexion ---------- */
.view-center, .view-login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.view-center { align-items: center; text-align: center; }
.login { width: 100%; max-width: 420px; margin: 0 auto; padding-bottom: 6vh; }
.app-mark { width: 80px; height: 80px; border-radius: 19px; box-shadow: 0 10px 28px -10px rgba(14, 24, 40, .55); display: block; }
.login-form { margin-top: 8px; }
.login-form .btn { margin-top: 16px; }
.login-foot { font-size: 14px; color: var(--ink-3); margin: 20px 4px 0; }

/* ---------- Accueil ---------- */
.view-home { padding-bottom: calc(var(--dock-h) + var(--safe-b) + 28px); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; }
.top-txt { min-width: 0; }
.top-date { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.large-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center;
  font-weight: 600; font-size: 16px; letter-spacing: .02em; margin-bottom: 2px;
}
.avatar:active { transform: scale(.94); }
.avatar-dot { position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2.5px var(--bg); }

.status-bar {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: -6px 0 14px; padding: 10px 14px; border-radius: 14px;
  background: var(--warn-bg); color: var(--warn); font-size: 15px; font-weight: 500; text-align: left;
}
.status-bar.is-sync { background: var(--fill); color: var(--ink-2); }
.status-bar.is-sync .ico { animation: spin 1s linear infinite; }

/* Le tableau de bord */
.cluster {
  position: relative; border-radius: 26px; padding: 14px 16px 16px; color: var(--cab-ink);
  background: var(--cab);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px var(--cab-line), 0 14px 30px -18px rgba(8, 14, 24, .7);
}
.cluster-vehicle {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: -4px 0 2px;
  text-align: left; color: var(--cab-ink);
}
.cluster-vehicle:active { opacity: .7; }
.cluster-model { flex: 1; min-width: 0; font-size: 15px; color: var(--cab-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico-chev { width: 18px; height: 18px; color: var(--cab-ink-3); stroke-width: 2.2; }
.cluster-odo { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0 12px; }
.odo-unit { font-family: var(--font-num); font-weight: 600; font-size: 22px; color: var(--cab-ink-2); padding-bottom: 4px; }
.cluster-last { margin: 0; font-size: 14px; color: var(--cab-ink-2); }
.cluster-last b { color: var(--cab-ink); font-weight: 600; }
.cluster-revert {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; height: 36px; padding: 0 14px;
  border-radius: 18px; background: rgba(255, 255, 255, .08); color: var(--cab-ink); font-size: 15px;
}
.cluster-revert .ico { width: 18px; height: 18px; }
.cluster.is-empty .cluster-odo { opacity: .5; }

/* La journée */
.day, .week, .todo { margin-top: 26px; }
.route {
  list-style: none; margin: 0; padding: 30px 6px 16px;
  display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
}
.rt { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rt + .rt::before {
  content: ""; position: absolute; top: 15px; right: calc(50% + 16px); width: calc(100% - 32px); height: 3px;
  border-radius: 2px; background: var(--fill-2);
}
.rt.is-done + .rt.is-done::before { background: var(--ink); }
.rt + .rt.is-missing::before, .rt.is-missing + .rt::before { background: repeating-linear-gradient(90deg, var(--bad) 0 5px, transparent 5px 9px); opacity: .7; }
.rt-km {
  position: absolute; top: -22px; right: 50%; width: 100%; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rt-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--ink-3);
  box-shadow: inset 0 0 0 2px var(--fill-2);
}
.rt-dot .ico { width: 17px; height: 17px; stroke-width: 2; }
.rt.is-done .rt-dot { background: var(--ink); color: var(--bg); box-shadow: none; }
.rt.is-next .rt-dot { background: var(--signal); color: var(--on-signal); box-shadow: 0 0 0 6px var(--signal-glow); animation: halo 2.6s ease-in-out infinite; }
.rt.is-missing .rt-dot { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.rt.is-estimated .rt-dot { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.rt-name { margin-top: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.15; color: var(--ink); }
.rt-time { margin-top: 2px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rt:not(.is-done):not(.is-estimated) .rt-name { color: var(--ink-2); font-weight: 500; }
.rt.is-next .rt-name { color: var(--ink); font-weight: 600; }
@keyframes halo { 50% { box-shadow: 0 0 0 10px transparent; } }
.day-note { margin: 10px 4px 0; font-size: 15px; color: var(--ink-2); }
.day-note b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* À traiter */
.todo { display: grid; gap: 10px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); text-align: left;
}
.todo-item:active { background: var(--surface-2); }
.todo-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.todo-ico.is-warn { background: var(--warn-bg); color: var(--warn); }
.todo-ico.is-info { background: var(--info-bg); color: var(--info); }
.todo-ico.is-bad { background: var(--bad-bg); color: var(--bad); }
.todo-txt { flex: 1; min-width: 0; }
.todo-txt b { display: block; font-size: 16px; }
.todo-txt span { display: block; font-size: 14px; color: var(--ink-2); margin-top: 1px; }
.todo-item .ico-chev { color: var(--ink-3); }

/* La semaine */
.week-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 14px 14px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 132px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; position: relative; }
.bar-val { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-bottom: 4px; white-space: nowrap; visibility: hidden; }
.bar.is-today .bar-val, .bar.is-shown .bar-val { visibility: visible; }
.bar-col { width: 100%; max-width: 30px; border-radius: 4px 4px 2px 2px; background: var(--bar); min-height: 3px; transition: height .6s var(--ease); }
.bar.is-zero .bar-col { background: var(--fill-2); }
.bar.is-future .bar-col { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); min-height: 3px; height: 3px !important; }
.bar.is-today .bar-col { background: var(--ink); }
.bar-day { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.bar.is-today .bar-day { color: var(--ink); font-weight: 700; }
.week-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.week-stats div { min-width: 0; }
.week-stats dt { font-size: 13px; color: var(--ink-2); }
.week-stats dd { margin: 2px 0 0; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.week-stats dd small { font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* Historique */
.history { margin-top: 28px; }
.day-group { margin-bottom: 18px; }
.day-group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 6px 8px; font-size: 15px; }
.day-group-head b { color: var(--ink); }
.day-group-head span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.list { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; text-align: left; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.row:active { background: var(--surface-2); }
.row-ico {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--fill); color: var(--ink);
}
.row-ico .ico { width: 19px; height: 19px; }
.row-ico.is-est { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink-2); }
.row-txt { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row-end { text-align: right; flex: none; }
.row-km { display: block; font-family: var(--font-num); font-weight: 600; font-size: 21px; line-height: 1.1; letter-spacing: .01em; }
.row-delta { display: block; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row-delta.is-warn { color: var(--warn); }
.row-delta.is-bad { color: var(--bad); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--ink-2); }
.tag.is-warn { background: var(--warn-bg); color: var(--warn); }
.tag.is-info { background: var(--info-bg); color: var(--info); }
.tag.is-bad { background: var(--bad-bg); color: var(--bad); }
.tag.is-wait { background: var(--fill); color: var(--ink-2); }
.tag .ico { width: 12px; height: 12px; margin-right: 3px; stroke-width: 2.4; }

.more-btn { height: 48px; font-size: 16px; font-weight: 500; margin-top: 4px; }
.empty { text-align: center; padding: 30px 24px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); }
.empty .ico { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 6px; }
.empty p { margin: 4px 0; }
.foot { text-align: center; font-size: 13px; color: var(--ink-3); margin: 26px 0 0; }

/* Chargement */
.skel { color: transparent !important; background: var(--fill); border-radius: 8px; animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .5; } }

/* Tirer pour actualiser */
.ptr {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 6px); z-index: 5; width: 36px; height: 36px; margin-left: -18px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center;
  color: var(--ink-2); opacity: 0; transform: translateY(-50px); pointer-events: none;
}
.ptr .ico { width: 20px; height: 20px; }
.ptr.is-loading .ico { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Barre d'action ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 10px; padding: 12px var(--gutter) max(12px, var(--safe-b));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  transition: transform .45s var(--ease), opacity .3s ease;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .dock {
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    -webkit-backdrop-filter: saturate(170%) blur(20px); backdrop-filter: saturate(170%) blur(20px);
    border-top: .5px solid var(--line);
  }
}
html.is-locked .dock { transform: translateY(110%); opacity: 0; }
.dock-main { height: 58px; border-radius: 18px; font-size: 18px; box-shadow: 0 8px 20px -10px rgba(160, 110, 0, .6); }
.dock-main .ico { width: 22px; height: 22px; }
.dock-fuel {
  width: 58px; height: 58px; flex: none; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--ink);
}
.dock-fuel:active { transform: scale(.95); }
.dock > * { max-width: 100%; }
@media (min-width: 600px) { .dock { justify-content: center; } .dock-main { max-width: 470px; } }

/* ---------- Feuilles ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 14, .36); opacity: 0; transition: opacity .45s var(--ease); }
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 600px;
  max-height: calc(100% - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 16px 16px 0 0;
  padding-bottom: var(--safe-b);
  transform: translateY(100%);
  transition: transform .5s var(--ease);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
  will-change: transform;
}
.sheet.is-open .sheet-panel { transform: translateY(var(--drag, 0px)); }
.sheet.is-dragging .sheet-panel { transition: none; }
.sheet-tall { height: calc(100% - var(--safe-t) - 12px); }
.sheet-grab { flex: none; height: 18px; display: grid; place-items: center; touch-action: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); }
.sheet-head {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 0 var(--gutter) 6px; touch-action: none;
}
.sheet-head > :first-child { justify-self: start; }
.sheet-head > :last-child { justify-self: end; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px var(--gutter) 16px; }
.sheet-foot { flex: none; padding: 6px var(--gutter) 10px; }

.time-pill {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px;
  border-radius: 16px; background: var(--fill); font-size: 15px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow: hidden;
}
.time-pill .ico { width: 16px; height: 16px; stroke-width: 2; }
.time-pill.is-past { background: var(--warn-bg); color: var(--warn); }
.time-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; border: 0; -webkit-appearance: none; }
.time-pill.is-locked-time { pointer-events: none; opacity: .7; }

/* Sélecteur d'étape */
.steps { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); margin: 4px 0 0; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; min-width: 0; }
.step + .step::before { content: ""; position: absolute; top: 25px; right: calc(50% + 23px); width: calc(100% - 46px); height: 2px; background: var(--fill-2); border-radius: 1px; }
.step-dot {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2);
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.step-dot .ico { width: 20px; height: 20px; }
.step-name { font-size: 12.5px; line-height: 1.15; text-align: center; color: var(--ink-2); }
.step-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 14px; }
.step.is-done .step-dot { background: var(--ink); color: var(--bg); box-shadow: none; }
.step[aria-checked="true"] .step-dot { background: var(--signal); color: var(--on-signal); box-shadow: 0 0 0 5px var(--signal-glow); transform: scale(1.06); }
.step[aria-checked="true"] .step-name { color: var(--ink); font-weight: 600; }
.step:active .step-dot { transform: scale(.94); }
.events { display: flex; gap: 8px; justify-content: center; margin: 10px 0 2px; }
.event {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 11px; border-radius: 19px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; font-weight: 500;
}
.event .ico { width: 18px; height: 18px; }
.event[aria-checked="true"] { background: var(--signal); color: var(--on-signal); box-shadow: none; }

/* Alertes dans la feuille */
.notice { margin: 12px 0 0; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--warn-bg); }
.notice.is-info { background: var(--info-bg); }
.notice-head { display: flex; gap: 9px; align-items: flex-start; }
.notice-head .ico { color: var(--warn); margin-top: 1px; width: 20px; height: 20px; }
.notice.is-info .notice-head .ico { color: var(--info); }
.notice-head b { display: block; font-size: 15px; line-height: 1.25; }
.notice-head span { display: block; font-size: 13px; line-height: 1.3; color: var(--ink-2); margin-top: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 9px; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg button { height: 32px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Saisie du compteur : toujours visible au-dessus du clavier */
.releve-body { padding-bottom: 8px; }
.releve-foot { padding-top: 0; }
.entry { margin-top: 0; text-align: center; }
.entry-field { display: block; width: 100%; }
.entry-km {
  display: flex; align-items: flex-end; justify-content: center; gap: 8px;
  padding: 14px 10px 14px; border-radius: 22px; background: var(--cab);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px var(--cab-line);
  transition: box-shadow .2s ease;
}
.entry-unit { font-family: var(--font-num); font-weight: 600; font-size: 21px; color: var(--cab-ink-2); padding-bottom: 4px; }
.has-fuel .entry-km.is-active { box-shadow: inset 0 0 0 2px var(--signal); }
.entry-hint { margin: 8px 8px 10px; min-height: 20px; font-size: 14.5px; line-height: 1.35; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.entry-hint b { color: var(--ink); }
.entry-hint.is-warn { color: var(--warn); }
.entry-hint.is-bad { color: var(--bad); }

.fuel { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 0 0 10px; }
.fuel-field {
  text-align: left; padding: 8px 12px 9px; border-radius: 16px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); min-height: 60px; min-width: 0;
}
.fuel-field.is-active { box-shadow: inset 0 0 0 2px var(--signal); }
.fuel-label { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.fuel-value { display: block; margin-top: 1px; font-family: var(--font-num); font-weight: 600; font-size: 25px; line-height: 1.1; white-space: nowrap; }
.fuel-value.is-empty { color: var(--ink-3); font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 29px; }
.fuel-full { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px; cursor: pointer; }
.fuel-note { grid-column: 1 / -1; margin: 0 4px; font-size: 13px; color: var(--ink-2); min-height: 17px; }
.is-fuel .key { height: clamp(40px, 5.5vh, 50px); }
.is-fuel .entry-km { padding-top: 10px; padding-bottom: 10px; }
@media (max-height: 700px) {
  .step { gap: 4px; padding: 2px 0; }
  .step-dot { width: 36px; height: 36px; }
  .step-dot .ico { width: 18px; height: 18px; }
  .step + .step::before { top: 19px; right: calc(50% + 20px); width: calc(100% - 40px); }
  .step-name { font-size: 11.5px; }
  .step-time { font-size: 11px; min-height: 0; }
  .step-time:empty { display: none; }
  .events { margin-top: 4px; }
  .event { height: 32px; font-size: 14px; }
  .notice { margin-top: 8px; padding: 8px 8px 8px 10px; }
  .notice-head span { display: none; }
  .seg { margin-top: 7px; }
  .odo-entry { --h: 46px; font-size: 38px; }
  .entry-km { padding: 8px 10px; }
  .entry-hint { margin: 6px 4px 8px; font-size: 13.5px; }
  .keypad { gap: 6px; margin-bottom: 8px; }
  .key { height: 40px; font-size: 24px; }
  .is-fuel .key { height: 37px; }
  .releve-foot .btn { height: 50px; }
  .fuel-field { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
  .fuel-value { font-size: 22px; }
}
@media (min-height: 800px) {
  .odo-entry { --h: 62px; --w: min(39px, 9.6vw); font-size: 52px; }
  .key { height: 58px; font-size: 28px; }
  .is-fuel .key { height: 50px; }
  .step-dot { width: 48px; height: 48px; }
  .step + .step::before { top: 27px; right: calc(50% + 25px); width: calc(100% - 50px); }
  .events { margin-top: 14px; }
}
.other { margin-top: 14px; }

/* Clavier */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px; }
.key {
  height: clamp(44px, 6.4vh, 56px); border-radius: 13px; background: var(--surface);
  box-shadow: 0 1px 0 var(--line-2); font-size: 26px; font-weight: 500; color: var(--ink);
  display: grid; place-items: center; transition: background-color .08s ease;
}
.key:active, .key.is-press { background: var(--fill-2); }
.key-fn { background: transparent; box-shadow: none; }
.key-fn .ico { width: 26px; height: 26px; stroke-width: 1.7; }
.key[disabled] { opacity: 0; pointer-events: none; }
.is-typing .keypad, .is-typing .entry, .is-typing .fuel { display: none; }

/* Liste de véhicules */
.search { position: relative; margin-bottom: 12px; }
.search .ico { position: absolute; left: 12px; top: 50%; margin-top: -10px; width: 20px; height: 20px; color: var(--ink-3); }
.search-input {
  width: 100%; height: 44px; padding: 0 12px 0 40px; border-radius: 12px; border: 0;
  background: var(--fill); font-size: 17px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--ink-3); }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 16px; background: var(--surface); margin-bottom: 18px; box-shadow: var(--shadow);
}
.toggle-row b { display: block; font-size: 16px; }
.toggle-row .muted { display: block; font-size: 13px; }
.list-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 6px 8px; }
.veh-group { margin-bottom: 18px; }
.veh { min-height: 66px; }
.veh .row-sub { gap: 4px 8px; }
.veh-check { color: var(--ink); width: 22px; height: 22px; stroke-width: 2.4; }
.veh.is-current { background: var(--surface-2); }
.veh-add { text-align: center; margin: 6px 0 10px; }
.veh-add-form { text-align: left; margin-top: 8px; }
.veh-add-row { display: flex; gap: 10px; }
.veh-add-row .input { flex: 1; }
.veh-add-row .btn { height: 52px; }

/* Détail */
.detail-top { text-align: center; padding: 6px 0 18px; }
.detail-top .row-ico { width: 54px; height: 54px; margin: 0 auto 10px; }
.detail-top .row-ico .ico { width: 26px; height: 26px; }
.detail-km { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin-top: 4px; }
.detail-km .odo-unit { color: var(--ink-2); font-size: 18px; padding-bottom: 2px; }
.detail-when { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }
.kv { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 16px; position: relative; font-size: 16px; }
.kv-row + .kv-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.kv-row span { color: var(--ink-2); flex: none; }
.kv-row b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.actions { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; text-align: left; font-size: 17px; position: relative; }
.action + .action::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.action:active { background: var(--surface-2); }
.action .ico { color: var(--ink-2); }
.action.is-danger, .action.is-danger .ico { color: var(--bad); }
.detail-note { font-size: 13px; color: var(--ink-2); margin: 0 6px 12px; }

/* Compte */
.account-top { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.account-top .avatar { width: 58px; height: 58px; font-size: 21px; box-shadow: none; background: var(--cab); color: var(--cab-ink); }
.account-top b { display: block; font-size: 20px; }
.account-top span { color: var(--ink-2); font-size: 15px; }

/* ---------- Alerte ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 14, .42); opacity: 0; transition: opacity .25s ease; }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal-box {
  position: relative; width: min(300px, 100%); border-radius: 16px; overflow: hidden; text-align: center;
  background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  opacity: 0; transform: scale(1.1); transition: transform .3s var(--ease), opacity .2s ease;
}
.modal.is-open .modal-box { opacity: 1; transform: none; }
.modal-content { padding: 20px 18px 16px; }
.modal-box h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal-box p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.modal-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); }
.modal-btns.is-stacked { grid-auto-flow: row; }
.modal-btn { min-height: 46px; font-size: 17px; color: var(--ink); padding: 0 10px; }
.modal-btn + .modal-btn { border-left: 1px solid var(--line); }
.modal-btns.is-stacked .modal-btn + .modal-btn { border-left: 0; border-top: 1px solid var(--line); }
.modal-btn.is-main { font-weight: 600; }
.modal-btn.is-danger { color: var(--bad); }
.modal-btn:active { background: var(--fill); }

/* ---------- Notification ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; top: calc(var(--safe-t) + 8px);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 24px);
  padding: 9px 10px 9px 9px; border-radius: 24px;
  background: #0E1828; color: #F2F5FA; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45);
  transform: translate(-50%, calc(-100% - var(--safe-t) - 20px)); transition: transform .55s var(--ease);
}
.toast.is-shown { transform: translate(-50%, 0); }
.toast-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--signal); color: var(--on-signal); display: grid; place-items: center; flex: none; }
.toast-ico .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.toast.is-bad .toast-ico { background: #FF6B6F; color: #2A0002; }
.toast-txt { min-width: 0; padding-right: 6px; }
.toast-txt b { display: block; font-size: 15px; line-height: 1.2; }
.toast-txt span { display: block; font-size: 13px; color: rgba(242, 245, 250, .68); font-variant-numeric: tabular-nums; }
.toast-action { height: 32px; padding: 0 12px; border-radius: 16px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 600; flex: none; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ============================================================
   v2.1 : entretien, suggestions, chiffres
   ============================================================ */

/* Ligne d'entretien dans le tableau de bord */
.cluster-maint {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px 12px; min-height: 44px;
  border-radius: 14px; background: rgba(255, 255, 255, .06); color: var(--cab-ink); font-size: 14.5px; text-align: left;
}
.cluster-maint .ico { width: 18px; height: 18px; color: var(--cab-ink-2); flex: none; }
.cluster-maint span { flex: 1; min-width: 0; }
.cluster-maint.is-warn { background: rgba(255, 194, 26, .16); }
.cluster-maint.is-warn .ico:first-child { color: var(--signal); }
.cluster-maint.is-bad { background: rgba(255, 107, 111, .18); }
.cluster-maint.is-bad .ico:first-child { color: #FF8A8D; }
.cluster-maint:active { opacity: .75; }

.sec-link { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 500; color: var(--ink-2); min-height: 32px; }
.sec-link .ico { width: 16px; height: 16px; stroke-width: 2.2; }
.sec-link:active { opacity: .5; }

/* Chiffre incertain près d'un passage (252 999 > 253 000) : les deux possibilités, l'une au-dessus de l'autre */
.drum.is-roll .strip { opacity: 0; }
.drum.is-roll { box-shadow: inset 0 0 0 1.5px rgba(255, 194, 26, .6), inset 0 3px 6px rgba(0, 0, 0, .55); }
.roll { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.roll b { font-weight: 600; font-size: .5em; line-height: 1; color: rgba(243, 246, 250, .78); }
.roll b + b { border-top: 1px solid rgba(255, 194, 26, .55); padding-top: 2px; }

/* Proposition du compteur probable */
.guess {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: -2px 0 10px; padding: 9px 12px;
  border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--signal); text-align: left;
}
.guess .ico { color: var(--warn); flex: none; width: 20px; height: 20px; }
.guess-txt { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.3; }
.guess-txt b { display: block; font-family: var(--font-num); font-weight: 600; font-size: 21px; color: var(--ink); letter-spacing: .02em; line-height: 1.1; }
.guess-go { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--signal); color: var(--on-signal); font-size: 15px; font-weight: 600; display: grid; place-items: center; }
.guess:active { transform: scale(.99); }

/* Étapes compactes quand un autre type de relevé est choisi */
.steps.is-compact .step-name, .steps.is-compact .step-time { display: none; }
.steps.is-compact .step-dot { width: 34px; height: 34px; }
.steps.is-compact .step-dot .ico { width: 17px; height: 17px; }
.steps.is-compact .step + .step::before { top: 21px; right: calc(50% + 19px); width: calc(100% - 38px); }

/* Choix de l'intervention */
.maint { margin-top: 12px; }
.maint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mtile {
  display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 7px 10px; border-radius: 14px; text-align: left;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14.5px; font-weight: 500; line-height: 1.2; min-width: 0;
}
.mtile .ico { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.mtile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mtile[aria-checked="true"] { background: var(--signal); color: var(--on-signal); box-shadow: none; font-weight: 600; }
.mtile[aria-checked="true"] .ico { color: var(--on-signal); }
.mtile-all { grid-column: 1 / -1; justify-content: center; color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.mtile:active { transform: scale(.98); }
@media (max-height: 899px) { .maint-grid .mtile.is-q5, .maint-grid .mtile.is-q6 { display: none; } }

.fuel.is-maint { grid-template-columns: 1fr; }
.fuel.is-maint #field-litres, .fuel.is-maint .fuel-full { display: none; }

.interv-group { margin-bottom: 16px; }
.interv { min-height: 58px; }
.interv .row-ico { width: 36px; height: 36px; }
.interv-meta { font-size: 13px; color: var(--ink-3); }

/* Entretien du véhicule */
.maint-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px 16px; }
.maint-head b { display: block; font-size: 17px; }
.maint-head span { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left; position: relative; min-height: 62px; }
.mrow + .mrow::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--line); }
.mrow:active { background: var(--surface-2); }
.mrow .row-ico { width: 36px; height: 36px; }
.mrow-txt { flex: 1; min-width: 0; }
.mrow-title { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 600; }
.mrow-title em { font-style: normal; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mrow-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.wear { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 7px; overflow: hidden; }
.wear i { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.is-soon .wear i { background: var(--warn); }
.is-late .wear i { background: var(--bad); }
.is-soon .mrow-title em { color: var(--warn); }
.is-late .mrow-title em { color: var(--bad); }
.is-ok .mrow-title em { color: var(--good); }
.maint-note { font-size: 13px; color: var(--ink-2); margin: -6px 6px 16px; }
.hist-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; position: relative; font-size: 15px; }
.hist-row + .hist-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.hist-row b { font-weight: 600; display: block; }
.hist-row span { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hist-row .hist-end { text-align: right; flex: none; }

/* Mes chiffres */
.big-stat { padding: 6px 4px 14px; }
.big-stat .val { font-family: var(--font-num); font-weight: 600; font-size: 52px; line-height: 1; letter-spacing: .01em; }
.big-stat .val small { font-size: 24px; color: var(--ink-2); margin-left: 4px; }
.big-stat p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.is-up { color: var(--good); }
.delta.is-down { color: var(--bad); }
.delta.is-flat { color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.tile { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile dt { font-size: 13px; color: var(--ink-2); }
.tile dd { margin: 3px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile dd small { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tile .sub { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.habits { margin-bottom: 16px; }
.habit { display: flex; align-items: center; gap: 12px; padding: 11px 14px; position: relative; }
.habit + .habit::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--line); }
.habit .row-ico { width: 36px; height: 36px; }
.habit-txt { flex: 1; min-width: 0; }
.habit-txt b { display: block; font-size: 15.5px; }
.habit-txt span { font-size: 13.5px; color: var(--ink-2); }
.habit-val { font-family: var(--font-num); font-weight: 600; font-size: 21px; white-space: nowrap; }
.seg-big { margin: 0 0 16px; }
.seg-big button { height: 34px; font-size: 15px; }

.week-more { display: flex; align-items: center; gap: 10px; width: calc(100% + 28px); margin: 12px -14px -14px; padding: 12px 14px; min-height: 48px;
  border-top: 1px solid var(--line); font-size: 15.5px; font-weight: 500; color: var(--ink); text-align: left; border-radius: 0 0 22px 22px; }
.week-more span { flex: 1; }
.week-more .ico { width: 20px; height: 20px; color: var(--ink-2); }
.week-more .ico-chev { width: 18px; height: 18px; color: var(--ink-3); }
.week-more:active { background: var(--surface-2); }

.maint-grid { margin-bottom: 8px; }
.mtile-all { min-height: 40px; }
.maint-extra { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.maint-cost { min-height: 56px; padding: 6px 12px; }
.maint-cost .fuel-value { font-size: 21px; }
.maint-cost .fuel-value.is-empty { font-size: 15px; line-height: 25px; }
.maint-extra .input { height: 56px; font-size: 16px; }
.maint-cost.is-active { box-shadow: inset 0 0 0 2px var(--signal); }

.fuel-note.is-warn { color: var(--warn); font-weight: 500; }
.habit-val { text-align: right; }
.tag { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   v2.3 : démarrer, semaine type, échéances, notifications
   ============================================================ */

/* Démarrer : le compteur n'a pas bougé depuis le retour maison */
.start { text-align: center; padding: 4px 0 6px; }
.start-veh { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-size: 15px; color: var(--ink-2); }
.start-odo { display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.start-odo .odo-unit { color: var(--ink-2); font-size: 20px; padding-bottom: 4px; }
.start-q { margin: 18px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.start-note { margin: 6px auto 0; max-width: 30em; font-size: 14.5px; color: var(--ink-2); line-height: 1.4; }
.start-note b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.start-foot { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: calc(10px + var(--safe-b)); }
.start-foot .btn { height: 58px; font-size: 18px; }
.start-other { align-self: center; font-size: 16px; color: var(--ink-2); }

/* Entretien : rythme du véhicule, jours de roulage */
.maint-head .maint-rythme { display: block; font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.mrow-meta { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }

/* Ma semaine type */
.week-type { margin-bottom: 8px; }
.wt-row { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px; padding: 9px 14px; position: relative; min-height: 50px; }
.wt-row + .wt-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.wt-day { font-size: 15px; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.wt-main { min-width: 0; }
.wt-bar { display: block; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.wt-bar i { display: block; height: 100%; border-radius: 4px; background: var(--bar); }
.wt-sub { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-km { font-family: var(--font-num); font-weight: 600; font-size: 20px; text-align: right; min-width: 64px; white-space: nowrap; }
.wt-km small { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.wt-row.is-rest .wt-day, .wt-row.is-rest .wt-km { color: var(--ink-3); }
.wt-row.is-today .wt-day::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); margin-left: 4px; vertical-align: 2px; }
.wt-row.is-today .wt-bar i { background: var(--signal); }

/* Notifications */
.notif-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 8px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; min-height: 58px; position: relative; }
.pref + .pref::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.pref b { display: block; font-size: 16px; font-weight: 500; }
.pref.is-main b { font-weight: 600; }
.pref small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 1px; line-height: 1.3; }
.pref .switch[disabled] { opacity: .5; }
.notif-msg { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.notif-msg .ico { flex: none; width: 20px; height: 20px; color: var(--info); margin-top: 1px; }
.notif-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 6px 18px; font-size: 13px; color: var(--ink-2); }
.notif-err { margin: 0 6px 12px; font-size: 14px; }
.text-btn-sm { font-size: 15px; font-weight: 600; min-height: 36px; padding: 6px 2px; flex: none; }
#notif-zone + .actions { margin-top: 18px; }
#notif-zone .notif-card:last-child { margin-bottom: 18px; }
.tile.is-wide { grid-column: 1 / -1; }

/* ============================================================
   v2.4 : missions (tournées STTI et courses), CMR
   ============================================================ */
.missions { margin-top: 26px; }
.mcards { display: grid; gap: 10px; }
.mcard {
  display: block; width: 100%; text-align: left; padding: 13px 14px 4px; border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; position: relative;
  -webkit-user-select: none; user-select: none; transition: background-color .15s ease;
}
.mcard:active { background: var(--surface-2); }
.mcard.is-current { box-shadow: inset 0 0 0 2px var(--signal), var(--shadow); }
.mcard.is-cancel { opacity: .55; }
.mcard-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.mtype {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; flex: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em; background: var(--fill); color: var(--ink);
}
.mtype.is-stti { background: var(--cab); color: var(--cab-ink); }
.mcard-no { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmr-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--ink-2); flex: none;
}
.cmr-pill .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.cmr-pill.is-ok { background: var(--good-bg); color: var(--good); }
.cmr-pill.is-warn { background: var(--warn-bg); color: var(--warn); }
.cmr-pill.is-bad { background: var(--bad-bg); color: var(--bad); }
.cmr-pill.is-inline { margin-left: 0; height: 20px; font-size: 11.5px; }

.mroute { display: block; margin: 11px 0 0; }
.mstop { display: flex; gap: 11px; align-items: flex-start; position: relative; padding-bottom: 9px; }
.mstop:last-child { padding-bottom: 2px; }
.mstop > i {
  flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; position: relative; z-index: 1;
  background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--ink);
}
.mstop.is-end > i { background: var(--ink); }
.mroute.has-end .mstop:first-child::after {
  content: ""; position: absolute; left: 4.5px; top: 17px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--line-2);
}
.mstop > span { min-width: 0; flex: 1; }
.mstop b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstop small { display: block; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 1px; }
.mcard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 6px 0 6px; border-top: 1px solid var(--line); min-height: 50px;
}
.mstate { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 0; }
.mstate b { color: var(--ink); font-weight: 600; }
.mcard.is-current .mstate { color: var(--ink); }
.mcard-foot .btn-sm { height: 38px; padding: 0 14px 0 11px; font-size: 15px; gap: 6px; flex: none; border-radius: 12px; }
.mcard-foot .btn-sm .ico { width: 18px; height: 18px; stroke-width: 2.1; }
.mempty {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-size: 15px;
}
.mempty .ico { color: var(--ink-3); }
.m-sub { margin-top: 18px; }
.mrow-l .row-title, .mchoix-row .row-title {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25;
}
.m-ico.is-stti { background: var(--cab); color: var(--cab-ink); }
.row.is-cancel { opacity: .55; }
.tag.is-mission { font-variant-numeric: tabular-nums; }
.tag.is-ok { background: var(--good-bg); color: var(--good); }
.tag.is-cur { background: var(--signal); color: var(--on-signal); }

/* Parcours de la journée : mission en cours */
.rt.is-current .rt-dot { background: var(--signal); color: var(--on-signal); box-shadow: 0 0 0 5px var(--signal-glow); }
.rt.is-current .rt-name, .rt.is-current .rt-time { color: var(--ink); font-weight: 600; }
.rt.is-done + .rt.is-current::before { background: var(--ink); }
.rt { cursor: pointer; }

/* Saisie : mission du relevé */
.mpick {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 12px 0 0; padding: 7px 12px; min-height: 50px;
  border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--signal); text-align: left;
}
.mpick.is-empty { box-shadow: inset 0 0 0 1px var(--line-2); }
.mpick .ico { color: var(--ink-2); width: 20px; height: 20px; flex: none; }
.mpick-txt { flex: 1; min-width: 0; }
.mpick-txt small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.2; }
.mpick-txt b { display: block; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpick.is-empty b { color: var(--ink-2); font-weight: 500; }
.mpick-go { flex: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.mpick:active { background: var(--surface-2); }
@media (max-height: 700px) { .mpick { margin-top: 8px; min-height: 42px; padding: 4px 10px; } .mpick-txt small { display: none; } }
.mchoix-row { min-height: 62px; }

/* Fiche d'une mission */
.mhead { padding: 2px 2px 14px; }
.mhead-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mhead-tags .cmr-pill { margin-left: 0; }
.mhead-title { margin: 10px 0 3px; font-size: 25px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.mhead-sub { margin: 0; font-size: 15px; color: var(--ink-2); }
.mbanner { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 500; line-height: 1.35; }
.mbanner.is-bad { background: var(--bad-bg); color: var(--bad); }
.mstatus {
  display: flex; align-items: center; min-height: 48px; padding: 12px 14px; border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow); font-size: 15px; color: var(--ink-2); margin-bottom: 12px;
}
.mstatus b { color: var(--ink); font-weight: 600; }
.mstatus.is-current { box-shadow: inset 0 0 0 2px var(--signal), var(--shadow); color: var(--ink); }
.mstatus.is-done { color: var(--ink); }
.mactions { display: grid; gap: 8px; margin-bottom: 16px; }
.mlieux { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 14px 13px; margin-bottom: 16px; }
.mlieu { display: flex; gap: 12px; position: relative; }
.mlieu + .mlieu { margin-top: 14px; }
.mlieu:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 19px; bottom: -11px; width: 2px; border-radius: 1px; background: var(--line-2); }
.mlieu-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; box-shadow: inset 0 0 0 3px var(--ink); background: var(--surface); }
.mlieu.is-end .mlieu-dot { background: var(--ink); }
.mlieu-txt { min-width: 0; flex: 1; }
.mlieu-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.mlieu-txt b { display: block; font-size: 16.5px; margin-top: 3px; line-height: 1.25; }
.mlieu-txt span:not(.mlieu-lbl) { display: block; font-size: 14.5px; color: var(--ink-2); line-height: 1.38; }
.mlieu-txt i { font-style: normal; color: var(--ink-3); }
.kv-row b small { font-weight: 400; color: var(--ink-2); font-size: 13.5px; }
.minstr { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.minstr summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 50px;
  padding: 0 16px; font-size: 16px; font-weight: 600;
}
.minstr summary::-webkit-details-marker { display: none; }
.minstr summary .ico { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s ease; }
.minstr[open] summary .ico { transform: rotate(90deg); }
.minstr p { margin: 0; padding: 0 16px 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.mprix { font-family: var(--font-num); font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.txt-warn { color: var(--warn); font-weight: 600; }
.mcmr { margin-bottom: 6px; }
.mcmr .cmr-pill { margin-left: 0; }
.massign { margin: 0 0 18px; }
.chip.is-on { background: var(--ink); color: var(--bg); box-shadow: none; }
.mtype-seg { margin: 0 0 18px; }
.mtype-seg button { height: 36px; font-size: 14px; }
a.action { color: var(--ink); text-decoration: none; }
.link-btn { font: inherit; font-weight: 500; color: var(--info); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; padding: 2px 0; }

/* v2.4 : finitions */
.nw { white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .mtype.is-stti, .m-ico.is-stti { background: var(--ink); color: var(--surface); }
}
.row-km small { margin-left: 3px; font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
