  /* Appli téléphone une colonne : onglets Jour / Virements / Stats, panneaux qui montent du bas */
  :root {
    --bg: #f3f4f7; --surface: #ffffff; --surface-2: #eceef3; --line: #dadde5;
    --fg: #151821; --muted: #626a7a; --faint: #a3a9b5;
    --accent: #2f5bd8; --accent-fg: #ffffff;
    --net: #157a45; --charge: #b35c00; --danger: #c22a2a;
    --viz-1: #2a78d6; --viz-2: #eb6834; /* graphiques : paire validée daltonisme */
    --fab: #f2a614; --fab-fg: #1d1400;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color-scheme: light;
  }
  /* Sombre : réglage du téléphone (Automatique) ou choix forcé dans Réglages → Apparence */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0f1116; --surface: #191c24; --surface-2: #222632; --line: #2c3140;
      --fg: #f1f2f5; --muted: #9aa2b1; --faint: #5d6474;
      --accent: #4a78f0; --accent-fg: #ffffff;
      --net: #3ccf7d; --charge: #f2a43a; --danger: #ff6b6b;
      --viz-1: #3987e5; --viz-2: #d95926;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
      --bg: #0f1116; --surface: #191c24; --surface-2: #222632; --line: #2c3140;
      --fg: #f1f2f5; --muted: #9aa2b1; --faint: #5d6474;
      --accent: #4a78f0; --accent-fg: #ffffff;
      --net: #3ccf7d; --charge: #f2a43a; --danger: #ff6b6b;
      --viz-1: #3987e5; --viz-2: #d95926;
      color-scheme: dark;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; }
  body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
  [hidden] { display: none !important; }
  .wrap { max-width: 520px; margin: 0 auto; padding-inline: 16px;
    padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)); }
  button { font: inherit; color: inherit; cursor: pointer; }
  button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
  .resahead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
  .item.resa small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
  .item.resa.soon { box-shadow: inset 3px 0 0 var(--accent); }
  .rcard { border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; background: var(--bg); }
  .rrow { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
  .rrow:first-child { border-top: 0; } .rrow span { color: var(--muted); font-size: 13.5px; } .rrow b { font-weight: 700; overflow-wrap: anywhere; } .rrow a { color: var(--accent); }
  .hleft { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .drawer { position: fixed; inset: 0; z-index: 20; }
  .dshade { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; }
  .dpanel { position: absolute; top: 0; left: 0; bottom: 0; width: min(84vw, 340px); background: var(--surface); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; overflow-y: auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%); transition: transform .22s ease-out; }
  .drawer.open .dshade { opacity: 1; } .drawer.open .dpanel { transform: none; }
  .dhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .dhead b { font-size: 19px; font-weight: 800; }
  .dgrp { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 16px 4px 6px; }
  .dlink { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; color: var(--fg); font: inherit; font-size: 16px; font-weight: 600; text-align: left; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
  .dlink:active { background: var(--bg); }
  .dlink .sic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; }
  .dlink .dl { flex: 1; min-width: 0; } .dlink .dl small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  .dlink .chev { color: var(--muted); font-size: 22px; line-height: 1; }
  .dlink.soon { background: color-mix(in srgb, var(--charge) 13%, transparent); } .dlink.over { background: color-mix(in srgb, var(--danger) 13%, transparent); }
  .dbadge { font-size: 12.5px; font-weight: 700; color: var(--charge); white-space: nowrap; } .dlink.over .dbadge { color: var(--danger); }
  .dfoot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
  .dfoot a { color: var(--accent); }
  @media (prefers-reduced-motion: reduce) { .dshade, .dpanel { transition: none; } }
  header h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
  .sub { color: var(--muted); font-size: 13px; }
  .icon-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; font-size: 19px;
    display: inline-grid; place-items: center; position: relative; padding: 0; }
  .hbtns { display: flex; gap: 8px; }
  .tgrid { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .trow { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
  .trow input { margin: 0 !important; min-width: 0; flex: 1; font-size: 19px !important; padding: 11px 8px !important; }
  .trow .now { flex: none; width: 50px; height: 50px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); border-radius: 12px; }
  .trow .now:active { transform: scale(.94); }
  .hmrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .hmrow input { margin: 0 !important; flex: 1; min-width: 0; text-align: center; font-size: 22px !important; font-weight: 700; }
  .hmrow span { font-weight: 700; color: var(--muted, #888); }
  .pair-lbl .hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }
  .calc .neg { color: #d33; font-weight: 600; }
  .tile.running { border-color: var(--accent); }
  .tile.running .v { color: var(--accent); font-size: 15px; }
  .icon-btn.spin svg { animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .icon-btn.due::after { content: ""; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--fab); box-shadow: 0 0 0 2px var(--surface); }

  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
  .tab { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-weight: 700; font-size: 14.5px; color: var(--muted); }
  .tab[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

  .banner { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.45; }
  .banner b { display: block; margin-bottom: 2px; }
  .banner.warn { border-color: var(--charge); }
  .banner .row { margin-top: 10px; }
  .entpill { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 7px 14px 7px 11px; margin: 0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    color: var(--charge); background: color-mix(in srgb, var(--charge) 15%, transparent); }
  #ent:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
  .entpill.over { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
  .entpill svg { width: 17px; height: 17px; }
  .icon-btn.due.alert::after { background: var(--danger); }
  .ent { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; font: inherit; font-size: 14px; cursor: pointer; }
  .ent .ei { color: var(--muted); display: flex; flex: none; }
  .ent .et { flex: 1; min-width: 0; } .ent .et b { font-weight: 700; } .ent .et small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
  .ent .bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 7px; overflow: hidden; } .ent .bar i { display: block; height: 100%; background: var(--net); }
  .ent.soon { border-color: var(--charge); } .ent.soon .ei { color: var(--charge); } .ent.soon .bar i { background: var(--charge); }
  .ent.over { border-color: var(--danger); } .ent.over .ei { color: var(--danger); } .ent.over .bar i { background: var(--danger); }
  .ent .chev { color: var(--muted); font-size: 22px; line-height: 1; }
  .slim { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);
    margin: -4px 0 12px; padding: 0 2px; }
  .slim button { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 13.5px; padding: 6px 0; }

  .daynav { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; margin-bottom: 12px; }
  .daynav .d { text-align: center; font-weight: 700; font-size: 16px; text-transform: capitalize; }
  .daynav .d small { display: block; font-weight: 500; color: var(--accent); font-size: 12.5px; text-transform: none; }
  .daynav .d small button { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 2px 6px; }

  .summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sum { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
  .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
  .net { font-size: 27px; font-weight: 800; margin: 3px 0 6px; color: var(--net); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .net.neg { color: var(--danger); }
  .det { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .det span:nth-child(even) { text-align: right; color: var(--fg); }

  h2 { font-size: 16px; font-weight: 700; margin: 22px 0 10px; }
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px 13px; text-align: center; min-height: 76px; }
  .tile:active { transform: scale(.97); background: var(--surface-2); }
  .tile .t { font-size: 12.5px; color: var(--muted); }
  .tile .v { font-size: 17px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
  .tile.charge .v { color: var(--charge); }
  .tile.empty .v { color: var(--faint); font-weight: 500; }
  .tile.total { background: var(--surface-2); cursor: default; }
  .tile.total .v { color: var(--net); }
  .tile.ratio { min-height: 0; padding: 10px 6px; }
  .section-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin: 12px 0 6px; }

  .list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .item { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border: 0; border-top: 1px solid var(--line); font-size: 14px; width: 100%; background: none; text-align: left; }
  .item:first-child { border-top: 0; }
  .item div { min-width: 0; }
  .item small { color: var(--muted); display: block; font-size: 12.5px; margin-top: 1px; }
  /* Voitures enregistrées : cadre plus marqué et nom en gras pour bien les repérer */
  .list.cars { border: 2px solid var(--muted); }
  /* Page Véhicule : onglets + blocs sur fond pour séparer les rubriques */
  .vtabs { position: sticky; top: -1px; z-index: 2; margin: 2px 0 14px; box-shadow: 0 6px 10px -8px rgba(0,0,0,.18); }
  .vtabs button { position: relative; font-size: 13.5px; padding: 10px 2px; }
  .vtabs button .vdot { position: absolute; top: 6px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--charge); }
  .vtabs button .vdot.over { background: var(--danger); }
  .cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .cgrp { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 14px; text-align: left; color: var(--fg); }
  .cgrp[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
  .cdet .chip { font-size: 14px; padding: 7px 13px; color: var(--fg); }
  .cdet .chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
  .rdet { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
  .vblock { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
  .vblock > h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .vblock > h4 .vic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
  .vblock .cur:last-child { margin-bottom: 0; }
  .vblock .list { margin-bottom: 10px; }
  .list.cars .item { padding: 13px 14px; }
  .list.cars .car-name { font-weight: 700; font-size: 15.5px; color: var(--fg); }
  .item b { color: var(--charge); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .item.empty { color: var(--muted); }

  .fab { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); max-width: 488px; margin: 0 auto;
    background: var(--fab); color: var(--fab-fg); border: 0; border-radius: 16px; padding: 16px; font-size: 16px; font-weight: 800; z-index: 5;
    box-shadow: 0 6px 20px rgba(0,0,0,.18); }

  .wk-list { display: grid; gap: 8px; }
  .wk { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 4px 10px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 14px; text-align: left; width: 100%; }
  .wk.current { border-color: var(--accent); }
  .wk-main { display: grid; gap: 3px; min-width: 0; }
  .wk .name { font-weight: 700; font-size: 15px; }
  .wk .per { color: var(--muted); font-size: 12.5px; }
  .wk-breakdown { color: var(--muted); font-size: 12px; line-height: 1.35; }
  .wk-side { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
  .wk-amount-label { color: var(--muted); font-size: 11px; }
  .wk .amt { font-weight: 800; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
  .wk .amt.neg { color: var(--danger); }
  .wk-state { font-size: 11.5px; font-weight: 700; }
  .wk-state.ok { color: var(--net); }
  .wk-state.wait { color: var(--charge); }
  .wk-state.empty { color: var(--muted); }
  .wk-chevron { color: var(--muted); font-size: 20px; }
  .wk-year, .wk-month { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
  .wk-year > summary, .wk-month > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; cursor: pointer; list-style: none; }
  .wk-year > summary::-webkit-details-marker, .wk-month > summary::-webkit-details-marker { display: none; }
  .wk-year > summary::after, .wk-month > summary::after { content: "›"; color: var(--muted); font-size: 20px; transition: transform .15s; }
  .wk-year[open] > summary::after, .wk-month[open] > summary::after { transform: rotate(90deg); }
  .wk-year > summary { font-weight: 800; }
  .wk-month > summary { font-weight: 700; border-top: 1px solid var(--line); }
  .wk-group-total { max-width: 72%; color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; }
  .wk-months { display: grid; }
  .wk-month-list { display: grid; gap: 8px; padding: 0 10px 10px; }
  .wk-month-list .wk { background: var(--bg); }
  .wk { position: relative; overflow: hidden; padding-left: 18px; }
  .wk-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
  .wk-bar.cur { background: var(--accent); }
  .wk-bar.ok { background: var(--net); }
  .wk-bar.wait { background: var(--charge); }
  .wk-bar.empty { background: var(--muted); }
  .wk.empty { border-style: dashed; }
  .wk-state { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; margin-top: 2px; }
  .wk-state.cur { color: var(--accent); }
  .wk-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
  .wk-chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
  .wk-chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .transfer-calc { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
  .transfer-calc .calc-lines { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
  .transfer-calc .calc-lines span { color: var(--muted); }
  .transfer-calc .calc-lines b { font-variant-numeric: tabular-nums; text-align: right; }
  .transfer-calc .transfer-result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; }
  .transfer-calc .transfer-result strong { color: var(--net); font-size: 22px; font-variant-numeric: tabular-nums; text-align: right; }
  .transfer-calc .transfer-result strong.neg { color: var(--danger); }
  .transfer-calc .transfer-formula { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 4px; }
  .transfer-platforms { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
  .transfer-platforms > b { display: block; margin-bottom: 6px; font-size: 13px; }
  .transfer-platform { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
  .transfer-platform span:first-child { font-weight: 600; }
  .transfer-platform span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
  .transfer-kpis .kpi:last-child .v { color: var(--net); }
  .transfer-kpis .kpi:last-child .v.neg { color: var(--danger); }
  .pill { display: inline-block; float: right; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); margin-top: 3px; }
  .pill.ok { color: var(--net); border-color: var(--net); }
  .pill.wait { color: var(--charge); border-color: var(--charge); }
  .pill.bad { color: var(--danger); border-color: var(--danger); }

  .sum.clickable { cursor: pointer; }
  .sum .more { float: right; color: var(--accent); font-weight: 700; text-transform: none; letter-spacing: 0; }
  .wkpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wkpis .kpi { background: var(--bg); padding: 10px 12px; }
  .wkpis .kpi .lbl { font-size: 12px; color: var(--muted); }
  .wkpis .kpi .v { font-size: 18px; }
  .wkpis .kpi.main .v { font-size: 26px; }
  .wkpis .kpi .v.neg { color: var(--danger); }
  .wkpis small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
  .wkpis .evo.up { color: var(--net); } .wkpis .evo.down { color: var(--danger); }
  table.clk tbody tr, .sheet tr[data-date] { cursor: pointer; }
  .sheet tr.off td { color: var(--faint); }
  h2 .hint { font-size: 12px; font-weight: 500; color: var(--faint); }
  #stats { position: relative; }
  .seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin: 4px 0 6px; }
  .seg.seg3 { grid-template-columns: repeat(3, 1fr); }
  .nightrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
  .nightrow label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
  .nightrow input { font-size: 17px; font-weight: 700; }
  .seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 2px; border-radius: 9px; }
  .seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
  .cur-range { color: var(--muted); font-size: 12.5px; margin: 0 2px 12px; }
  .kpis .kpi small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
  .kpi.wide { grid-column: 1 / -1; }
  .vz-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 6px; margin-top: 12px; }
  .vz-t { font-weight: 700; font-size: 15px; }
  .vz-s { color: var(--muted); font-size: 12px; margin-top: 1px; }
  .vz-leg { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
  .vz-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
  .vz { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; touch-action: pan-y; }
  .vz-grid { stroke: var(--line); stroke-width: 1; }
  .vz-y { fill: var(--muted); font-size: 10px; text-anchor: end; }
  .vz-x { fill: var(--muted); font-size: 10px; text-anchor: middle; }
  .vz-val { fill: var(--fg); font-size: 10.5px; font-weight: 700; text-anchor: middle; }
  .vz-dot { stroke: var(--surface); stroke-width: 2; }
  .vz-hit { cursor: pointer; }
  .vz-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 9px; max-width: 260px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
  .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; min-width: 0; }
  .kpi .v { font-size: 20px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
  .kpi.main { grid-column: 1 / -1; }
  .kpi.main .v { font-size: 28px; color: var(--net); }
  .tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
  th, td { padding: 9px 8px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
  th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
  th:first-child, td:first-child { text-align: left; }
  td.n { font-weight: 700; color: var(--net); }
  td.n.neg { color: var(--danger); }
  tr.tot td { font-weight: 800; background: var(--surface-2); }
  .rowline { padding: 10px 14px; border-top: 1px solid var(--line); }
  .rowline:first-child { border-top: 0; }
  .rowline .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
  .rowline .top b { font-variant-numeric: tabular-nums; }
  .rowline small { color: var(--muted); }
  .bar { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
  .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
  .bar.ch i { background: var(--charge); }

  /* Ordinateur / tablette en largeur : tableau de bord sur deux colonnes, fenêtres centrées */
  @media (min-width: 900px) {
    .wrap { max-width: 1120px; padding-inline: 32px; }
    .tabs { max-width: 480px; }
    #p-jour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-content: start;
      grid-template-areas: "nav rh" "goals tiles" "ent tiles" "sum tiles" "dh tiles" "deps tiles"; grid-template-rows: auto auto auto auto auto 1fr; }
    #p-jour > .daynav { grid-area: nav; align-self: end; }
    #p-jour > #goals { grid-area: goals; }
    #p-jour > #ent { grid-area: ent; }
    #p-jour > .summary { grid-area: sum; margin-top: 0; }
    #p-jour > h2:nth-of-type(1) { grid-area: rh; }
    #p-jour > #tiles { grid-area: tiles; }
    #p-jour > h2:nth-of-type(2) { grid-area: dh; }
    #p-jour > #deps { grid-area: deps; align-self: start; }
    #p-vir .wk-list { max-width: 680px; }
    .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kpis .kpi.main { grid-column: span 2; }
    .kpis .kpi.wide { grid-column: span 2; }
    .vz-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
    .vz-wrap .vz-card { margin-top: 0; }
    .seg { max-width: 520px; }
    /* Fenêtres de détail (mois, semaine…) : plus larges, remontées en haut et presque toute la hauteur de l'écran.
       Sélecteur #sheet : sinon la règle de base .sheet (écrite plus bas) l'écrase et la fenêtre reste collée en bas. */
    #sheet { top: 3vh; bottom: auto; left: 50%; right: auto; width: 720px; max-width: calc(100vw - 48px); margin: 0;
      border-radius: 20px; padding-bottom: 20px; max-height: 94vh; transform: translate(-50%, 12px); opacity: 0;
      transition: transform .18s ease, opacity .18s ease; }
    #sheet.open { transform: translate(-50%, 0); opacity: 1; }
    .fab { left: auto; right: 32px; max-width: 340px; margin: 0; }
  }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10; }
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); z-index: 11; max-width: 520px; margin: 0 auto;
    border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%); transition: transform .2s ease; max-height: 92vh; overflow-y: auto; visibility: hidden; }
  .sheet.open { transform: none; visibility: visible; }
  .sheet h3 { margin: 0 0 3px; font-size: 19px; padding-right: 48px; }
  .sheet-bar { position: sticky; top: -18px; z-index: 2; height: 0; display: flex; justify-content: flex-end; }
  .sheet-x { width: 40px; height: 40px; margin-top: -6px; margin-right: -4px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--fg); font-size: 18px; font-weight: 700; line-height: 1; display: grid; place-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  .sheet .cur { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; line-height: 1.4; }
  .sheet input, .sheet select { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px;
    padding: 14px; font: inherit; font-size: 22px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
  .sheet .import-option { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 12px; color: var(--fg); font-size: 14px; line-height: 1.4; }
  .sheet .import-option input { width: 20px; height: 20px; flex: none; padding: 0; margin: 0; accent-color: var(--accent); }
  .sheet select, .sheet input.small { font-size: 16px; }
  .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; font-size: 15px; font-weight: 600; }
  .row { display: flex; gap: 8px; }
  .btn { flex: 1; border: 0; border-radius: 12px; padding: 15px; font-size: 16px; font-weight: 700; }
  .btn.primary { background: var(--accent); color: var(--accent-fg); }
  .btn.ghost { background: var(--surface-2); border: 1px solid var(--line); }
  .btn.danger { background: var(--danger); color: #fff; }
  .btn.small { padding: 10px 12px; font-size: 14.5px; }
  .pair { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pair small { color: var(--muted); font-size: 12px; }
  .pair input { font-size: 17px; padding: 12px 10px; margin-bottom: 6px; }
  .linkbtn { display: block; width: 100%; margin: -2px 0 10px; padding: 9px 10px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; text-align: left; }
  .pair-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 6px 0 5px; }
  .calc { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
  .calc span:nth-child(even) { text-align: right; }
  .calc .big { font-weight: 800; font-size: 17px; color: var(--net); }
  .plat-recu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .plat-chk { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; cursor: pointer; }
  .plat-chk input { width: 22px; height: 22px; flex: none; accent-color: var(--net); }
  .plat-chk span { flex: 1; text-align: left; }
  .plat-chk b { font-variant-numeric: tabular-nums; }
  .toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border: 1px solid var(--line);
    border-radius: 12px; padding: 13px 14px; margin-bottom: 12px; font-weight: 600; width: 100%; }
  .toggle .sw { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
  .toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
  .toggle[aria-pressed="true"] .sw { background: var(--net); }
  .toggle[aria-pressed="true"] .sw::after { left: 21px; }
  .stack { display: grid; gap: 8px; }
  .seg.two { grid-template-columns: repeat(2, 1fr); }
  .seg.three { grid-template-columns: repeat(3, 1fr); }
  .radio-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 15px; font-weight: 600; color: var(--fg); }
  .radio-row .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
  .radio-row[aria-checked="true"] { border-color: var(--accent); }
  .radio-row[aria-checked="true"] .dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
  .stbox { margin-top: 12px; }
  .xbtn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; flex: none; }
  .xbtn.danger, .chip.danger { color: var(--danger); border-color: var(--danger); }
  .seg.mini { margin: 0; align-self: stretch; }
  .seg.mini button { padding: 8px 10px; white-space: nowrap; }
  .setgrp { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 18px 4px 8px; }
  .setgrp:first-of-type { margin-top: 6px; }
  .setmenu { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
  .setlink { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; padding: 14px; color: var(--fg); min-height: 66px; }
  .setlink:first-child { border-top: 0; }
  .setlink:active { background: var(--surface-2); }
  .setlink .stx { flex: 1; min-width: 0; display: grid; gap: 3px; }
  .setlink b { font-size: 16px; font-weight: 700; }
  .setlink small { color: var(--muted); font-size: 13px; line-height: 1.35; }
  .setlink .sic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #fff; }
  .ic-car { background: #2f5bd8; } .ic-doc { background: #7a4fd1; } .ic-receipt { background: #c46a00; }
  .ic-tool { background: #4b5563; } .ic-check { background: #4b5563; } .ic-sheet { background: #188038; } .ic-bank { background: #0b7f8a; } .ic-building { background: #8a5a12; } .ic-gear { background: #3d4456; } .ic-grid { background: #0f766e; }
  .ic-user { background: #157a45; } .ic-moon { background: #3d4456; } .ic-save { background: #0b7f8a; } .ic-info { background: #6b7280; }
  .setlink .chev { color: var(--faint); font-size: 24px; line-height: 1; }
  .backlink { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 15px; padding: 4px 0 10px; margin-top: -6px; }
  .plist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
  .plist .toggle { margin: 0; padding: 10px 12px; }
  .toggle > span:first-child { text-align: left; }
  .toggle .tsub { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 2px; }
  .addrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
  .addrow input { margin: 0; }
  .fl { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
  .note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 10px 0 0; }

  h1 .pro { font-size: 12px; font-weight: 800; color: var(--accent-fg); background: var(--accent); border-radius: 6px; padding: 2px 6px; vertical-align: 4px; }
  .auth { position: fixed; inset: 0; z-index: 15; background: var(--bg); overflow-y: auto; }
  .auth[hidden] { display: none; }
  .auth .box { max-width: 400px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top, 0px)) 20px 40px; }
  .auth h2 { font-size: 26px; margin: 0 0 4px; text-transform: none; letter-spacing: 0; color: var(--fg); }
  .auth p { color: var(--muted); margin: 0 0 22px; line-height: 1.45; }
  .auth label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
  .auth input { width: 100%; box-sizing: border-box; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; font-size: 16px; margin-bottom: 14px; }
  .auth .btn { width: 100%; margin-top: 4px; }
  .auth .alt { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
  .auth .alt button { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
  .auth .pk-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 6px; }
  .auth .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
  .auth .or::before, .auth .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .auth .pitch { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
  .auth .pitch h1 { font-size: 17px; margin: 0 0 10px; line-height: 1.3; }
  .auth .pitch ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .auth .pitch li { margin-bottom: 5px; } .auth .pitch b { color: var(--fg); font-weight: 600; }
  .auth .legal, .legal-links { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted); }
  .auth .legal a, .legal-links a { color: var(--muted); }
  .auth .msg { border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; line-height: 1.4; background: var(--surface-2); }
  .auth .msg.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
  .auth .msg[hidden] { display: none; }
  .toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -160%);
    background: var(--net); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 20;
    transition: transform .2s; max-width: calc(100% - 32px); }
  .toast.show { transform: translate(-50%, 0); }
  .toast.err { background: var(--danger); }
  @media (prefers-reduced-motion: reduce) { .sheet, .toast, .toggle .sw, .toggle .sw::after { transition: none; } }

  /* Annonce de l'équipe (écrite depuis l'admin) */
  .annonce { position: relative; padding-right: 44px; white-space: pre-line; }
  .annonce-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 16px; border-radius: 8px; }
  /* Message à l'équipe */
  .sheet textarea { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; line-height: 1.4; margin: 8px 0 12px; resize: vertical; }

  /* Objectifs de la semaine et du mois, alerte de seuil (onglet Jour) */
  #goals { display: grid; gap: 8px; margin-top: 10px; }
  #goals:empty { display: none; }
  .goals { display: grid; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--fg); font: inherit; }
  .goals-add { width: 100%; background: none; border: 1px dashed var(--line); border-radius: 14px; padding: 11px 14px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; }
  .goal-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
  .goal-h b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .goal-h b small { color: var(--muted); font-weight: 500; font-size: 13px; }
  .goal-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 5px; }
  .goal-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
  .goal.ok .goal-bar i { background: var(--net); }
  .goal.warn .goal-bar i { background: var(--charge); }
  .goal.bad .goal-bar i { background: var(--danger); }
  .goal-f { font-size: 12.5px; color: var(--muted); }
  .goal.ok .goal-f { color: var(--net); font-weight: 600; }
  .sheet .goal { margin: 12px 0; }
  /* Onglet Jour (1.70) : objectifs en une ligne au-dessus de la saisie */
  .goals.compact { gap: 8px; padding: 10px 14px; margin-bottom: 4px; }
  .goals.compact .goal-h { font-size: 12.5px; }
  .goals.compact .goal-h b { font-size: 14px; }
  .goals.compact .goal-bar { height: 6px; margin: 5px 0 0; }
  #ent:not(:empty) { margin-top: 8px; }
  /* Net du jour sous la saisie, puis semaine et mois en cartes compactes */
  .daynet { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
  .daynet span { font-weight: 700; font-size: 15px; }
  .daynet small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
  .daynet b { font-size: 22px; font-weight: 800; color: var(--net); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .daynet b.neg { color: var(--danger); }
  .summary.compact { margin-top: 10px; }
  .summary.compact .sum { padding: 10px 14px; }
  .summary.compact .lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  .summary.compact .more { float: none; white-space: nowrap; }
  .summary.compact .net { font-size: 20px; margin: 2px 0 0; }
  .seuil-al { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--charge); border-radius: 14px; padding: 10px 14px; color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; }
  .seuil-al.over { border-color: var(--danger); color: var(--danger); }
  .ic-target { background: #2f5bd8; } .ic-bell { background: #c2410c; } .ic-globe { background: #0f766e; }
  .ms2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ms2 > div { min-width: 0; } .ms2 small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin: 10px 0 4px; } .ms2 input { width: 100%; }

  /* Réservations : fil de cartes (pastille du client, état, trajet, prix, actions) */
  .rday { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 2px 8px; }
  .rday b { font-size: 15px; } .rday span { color: var(--muted); font-size: 13px; white-space: nowrap; }
  .rpost { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
  .rpost.off { opacity: .6; }
  .rpost header, .rhead { display: flex; align-items: center; gap: 12px; }
  .rhead { margin: 4px 0 12px; }
  .ravatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: hsl(var(--h) 70% 90%); color: hsl(var(--h) 55% 32%); }
  .rwho { flex: 1; min-width: 0; } .rwho b { display: block; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rwho small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rbadge { flex: none; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: var(--line); color: var(--muted); }
  .rbadge.ok { background: color-mix(in srgb, var(--net) 16%, transparent); color: var(--net); }
  .rbadge.wait { background: color-mix(in srgb, var(--charge) 18%, transparent); color: var(--charge); }
  .rbadge.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
  .rroute { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: grid; gap: 12px; }
  .rstop { display: flex; gap: 10px; align-items: flex-start; } .rstop svg { flex: none; margin-top: 2px; }
  .rstop.dep svg, .rline.dep svg { color: var(--net); } .rstop.arr svg { color: var(--danger); }
  .rstop b { display: block; font-size: 14.5px; } .rstop span { display: block; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
  .rline { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 15px; } .rline svg { flex: none; margin-top: 1px; } .rline span { overflow-wrap: anywhere; }
  .rnote { margin-top: 8px; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
  .rprice { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14.5px; }
  .rpost.big .rprice { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
  .rprice b { color: var(--fg); font-size: 18px; font-variant-numeric: tabular-nums; }
  .ractions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; } .ractions .btn { margin: 0; width: 100%; }
  .btn.primary.go { background: var(--net); border-color: var(--net); color: #fff; }
  .rempty { border: 1px dashed var(--line); border-radius: 16px; padding: 18px 16px; color: var(--muted); font-size: 14.5px; text-align: center; margin-top: 12px; } .rempty b { display: block; color: var(--fg); margin-bottom: 4px; }
  #resaTotals .kpi .v small { display: inline; font-size: 13px; font-weight: 600; color: var(--muted); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ravatar { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 70% 80%); } }
  :root[data-theme="dark"] .ravatar { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 70% 80%); }
