/* Nora — interface artisan. Bleu de travail + gilet haute visibilité pour ce qui demande une action. */
:root {
  --encre: #14213d;
  --encre-2: #4a5878;
  --encre-3: #8a95ad;
  --bleu: #2347d1;
  --bleu-fonce: #1a36a8;
  --bleu-pale: #e8eefc;
  --craie: #f3f5f9;
  --blanc: #ffffff;
  --trait: #e2e7f0;
  --gilet: #ffb020;
  --gilet-pale: #fff4dc;
  --gilet-encre: #7a4b00;
  --vert: #138a45;
  --vert-pale: #e3f5ea;
  --rouge: #c8312b;
  --rouge-pale: #fbe9e8;
  --ombre: 0 1px 2px rgba(20, 33, 61, .06), 0 6px 18px -10px rgba(20, 33, 61, .18);
  --r-s: 10px; --r-m: 14px; --r-l: 20px;
  --tab-h: 64px;
  --font-titre: "Bricolage Grotesque", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--craie); color: var(--encre); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--bleu) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
h1, h2, h3 { font-family: var(--font-titre); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 19px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--encre-2); }
.faint { color: var(--encre-3); font-size: 13px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r-m); font-weight: 650; font-size: 15px; transition: background .15s, transform .08s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--bleu); color: #fff; }
.btn.primary:hover { background: var(--bleu-fonce); }
.btn.ok { background: var(--vert); color: #fff; }
.btn.no { background: var(--rouge-pale); color: var(--rouge); }
.btn.soft { background: var(--bleu-pale); color: var(--bleu); }
.btn.ghost { background: var(--blanc); color: var(--encre); box-shadow: inset 0 0 0 1px var(--trait); }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 16px; border-radius: 16px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.link { color: var(--bleu); font-weight: 600; }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--encre-2); }
.iconbtn:hover { background: var(--craie); }

/* ---------- champs ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.input, .field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-m); border: 1.5px solid var(--trait); background: var(--blanc); font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 4px var(--bleu-pale); }
.hint { font-size: 12.5px; color: var(--encre-3); margin-top: 5px; }
.err { color: var(--rouge); font-size: 13.5px; font-weight: 600; min-height: 18px; margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--blanc); box-shadow: inset 0 0 0 1.5px var(--trait); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--bleu); color: #fff; box-shadow: none; }
.seg { display: flex; background: var(--craie); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--encre-2); }
.seg button[aria-pressed="true"] { background: var(--blanc); color: var(--encre); box-shadow: var(--ombre); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cfd6e4; transition: .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--vert); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- écrans d'accueil (connexion, inscription) ---------- */
.gate { min-height: 100%; display: flex; flex-direction: column; padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; }
.gate .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; font-family: var(--font-titre); font-weight: 800; font-size: 22px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--bleu); color: #fff; display: grid; place-items: center; font-family: var(--font-titre); font-weight: 800; font-size: 21px; position: relative; }
.logo svg { width: 62%; height: 62%; display: block; }
.gate .brand svg.mot { height: 28px; width: auto; color: var(--encre); display: block; }
.gate h1 { margin-bottom: 8px; }
.gate .lead { color: var(--encre-2); margin-bottom: 26px; font-size: 15.5px; }
.gate .foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: 12px; color: var(--encre-3); }
.code-input { letter-spacing: .5em; font-size: 26px !important; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.devcode { display: block; width: 100%; text-align: left; background: var(--gilet-pale); color: var(--gilet-encre); padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--trait); }
.steps i.on { background: var(--bleu); }
.pick { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border-radius: var(--r-l); background: var(--blanc); box-shadow: inset 0 0 0 1.5px var(--trait); margin-bottom: 10px; }
.pick[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--bleu); background: var(--bleu-pale); }
.pick .t { flex: 1; min-width: 0; }
.pick b { display: block; font-size: 16px; }
.pick small { display: block; color: var(--encre-2); font-size: 13px; margin-top: 2px; }
.pick .num { font-family: var(--font-titre); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pick .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--trait); flex: none; }
.pick[aria-checked="true"] .dot { box-shadow: inset 0 0 0 7px var(--bleu); }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0 calc(6px + env(safe-area-inset-bottom)); background: var(--blanc); border-top: 1px solid var(--trait); margin-top: 18px; display: grid; gap: 10px; }
.code-box { background: var(--encre); color: #fff; border-radius: var(--r-l); padding: 18px; text-align: center; }
.code-box .c { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; margin: 6px 0 12px; word-break: break-all; }
.preview-sms { background: var(--blanc); border-radius: var(--r-l); padding: 14px; box-shadow: var(--ombre); }
.preview-sms .bubble { background: #e9edf4; border-radius: 18px 18px 18px 6px; padding: 10px 13px; font-size: 14.5px; }

/* ---------- structure de l'appli ---------- */
.app { display: flex; min-height: 100%; }
.side { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--craie) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; min-height: 56px; }
.top h1 { font-size: 24px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back { margin-left: -10px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--encre-2); background: var(--blanc); padding: 6px 10px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--trait); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--encre-3); }
.live.on i { background: var(--vert); box-shadow: 0 0 0 3px var(--vert-pale); }
.live.off i { background: var(--rouge); }
.content { padding: 4px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); max-width: 760px; width: 100%; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--blanc) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--trait); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--encre-3); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; border-radius: 12px; }
.tabs a svg.i { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--bleu); }
.badge-n { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--gilet); color: var(--encre); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* conversation ouverte sur téléphone : la barre d'onglets laisse la place à la zone de réponse */
.app.focus .tabs { display: none; }
.app.focus .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

/* ---------- blocs ---------- */
.section { margin: 20px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section h2 { font-size: 17px; }
.panel { background: var(--blanc); border-radius: var(--r-l); box-shadow: var(--ombre); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; width: 100%; text-align: left; min-height: 60px; }
.panel .row + .row { border-top: 1px solid var(--trait); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--encre-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { color: var(--encre-3); font-size: 12.5px; flex: none; align-self: flex-start; margin-top: 2px; }
.row.unread .t::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bleu); margin-left: 8px; vertical-align: middle; }
.row .chev { color: var(--encre-3); }
.av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--bleu); background: var(--bleu-pale); position: relative; font-size: 16px; }
.av .ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--blanc); box-shadow: 0 0 0 2px var(--blanc); }
.av .ch svg { width: 12px; height: 12px; }
.ch.sms { color: var(--vert); } .ch.instagram { color: #c13584; } .ch.formulaire { color: var(--bleu); } .ch.simu { color: var(--encre-3); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--craie); color: var(--encre-2); }
.tag.ok { background: var(--vert-pale); color: var(--vert); }
.tag.no { background: var(--rouge-pale); color: var(--rouge); }
.tag.new { background: var(--gilet); color: var(--encre); }
.tag.wait { background: var(--gilet-pale); color: var(--gilet-encre); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--blanc); border-radius: var(--r-m); padding: 14px; box-shadow: var(--ombre); }
.stat b { display: block; font-family: var(--font-titre); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--encre-2); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick button { background: var(--blanc); border-radius: var(--r-m); box-shadow: var(--ombre); padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; text-align: center; }
.quick button .q { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bleu-pale); color: var(--bleu); }
.empty { text-align: center; padding: 40px 20px; color: var(--encre-2); }
.empty .e { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--blanc); box-shadow: var(--ombre); color: var(--bleu); }
.empty h3 { margin-bottom: 4px; color: var(--encre); }
.empty .btn { margin-top: 16px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; min-height: 34px; font-size: 13.5px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--encre-3); }
.search input { padding-left: 42px; min-height: 44px; border-radius: 12px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-m); background: var(--bleu-pale); color: var(--encre); margin-bottom: 12px; font-size: 14px; }
.banner b { display: block; }
.banner.warn { background: var(--gilet-pale); color: var(--gilet-encre); }

/* ---------- bon d'intervention (demande à traiter) : l'élément signature ---------- */
.ticket { position: relative; background: var(--blanc); border-radius: var(--r-l); box-shadow: var(--ombre); padding: 16px 16px 14px 22px; margin-bottom: 12px; overflow: hidden; }
.ticket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--gilet); }
.ticket.done::before { background: var(--trait); }
.ticket.ok::before { background: var(--vert); }
.ticket.no::before { background: var(--rouge); opacity: .5; }
.ticket .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--encre-2); font-weight: 600; }
.ticket .hd .grow { flex: 1; }
.ticket .who { font-family: var(--font-titre); font-size: 20px; font-weight: 700; line-height: 1.2; }
.ticket .need { font-size: 15.5px; margin: 4px 0 10px; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.ticket dt { color: var(--encre-3); }
.ticket dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ticket .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ticket .acts .btn { min-height: 50px; }
.ticket .acts .wide { grid-column: 1 / -1; }
.urg { color: var(--rouge); font-weight: 700; }

/* ---------- conversation ---------- */
.thread { display: flex; flex-direction: column; min-height: 100%; }
.msgs { flex: 1; padding: 8px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.m { max-width: 80%; padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; }
.m.in { align-self: flex-start; background: var(--blanc); box-shadow: var(--ombre); border-bottom-left-radius: 6px; }
.m.bot { align-self: flex-end; background: #dde4f2; border-bottom-right-radius: 6px; }
.m.me { align-self: flex-end; background: var(--bleu); color: #fff; border-bottom-right-radius: 6px; }
.m .by { display: block; font-size: 11px; font-weight: 700; opacity: .65; margin-bottom: 2px; }
.day { align-self: center; font-size: 12px; color: var(--encre-3); font-weight: 600; margin: 10px 0 4px; }
.composer { position: sticky; bottom: 0; background: color-mix(in srgb, var(--blanc) 96%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--trait); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.composer .qa { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.composer .qa button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 99px; background: var(--craie); font-size: 13px; font-weight: 650; color: var(--encre-2); }
.composer .qa svg.i { width: 16px; height: 16px; }
.composer .line { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 14px; border-radius: 22px; border: 1.5px solid var(--trait); background: var(--blanc); font-size: 16px; line-height: 1.3; }
.composer textarea:focus { outline: none; border-color: var(--bleu); }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--bleu); color: #fff; display: grid; place-items: center; flex: none; }
.send[disabled] { background: var(--trait); }
.takeover { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--gilet-pale); color: var(--gilet-encre); font-size: 13.5px; font-weight: 600; }
.takeover.bot { background: var(--bleu-pale); color: var(--bleu-fonce); }
.takeover .grow { flex: 1; }

/* ---------- feuille (modale du bas) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 33, 61, .38); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--craie); border-radius: 24px 24px 0 0; max-height: 92%; overflow-y: auto; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #c9d1e0; margin: 4px auto 14px; }
.sheet h2 { margin-bottom: 4px; }
.sheet .sub { color: var(--encre-2); margin-bottom: 16px; font-size: 14px; }

/* ---------- alerte nouvelle demande ---------- */
.incoming { position: fixed; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top)); z-index: 60; background: var(--encre); color: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 18px 40px -12px rgba(20, 33, 61, .55); transform: translateY(-140%); transition: transform .35s cubic-bezier(.2, .9, .25, 1.15); max-width: 520px; margin: 0 auto; }
.incoming.on { transform: none; }
.incoming .hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--gilet); margin-bottom: 6px; }
.incoming .hd i { width: 8px; height: 8px; border-radius: 50%; background: var(--gilet); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 176, 32, .25); } }
.incoming .who { font-family: var(--font-titre); font-size: 19px; font-weight: 700; }
.incoming .need { color: #c9d2e6; font-size: 14px; margin: 2px 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.incoming .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.incoming .btn.no { background: rgba(255, 255, 255, .12); color: #fff; }
.incoming .more { display: block; width: 100%; text-align: center; color: #c9d2e6; font-size: 13px; font-weight: 600; margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--encre); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; opacity: 0; transition: .2s; z-index: 70; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--trait); border-top-color: var(--bleu); animation: sp .8s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- ordinateur : barre latérale + liste/fil côte à côte ---------- */
@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; width: 240px; flex: none; background: var(--encre); color: #fff; padding: 20px 12px; position: sticky; top: 0; height: 100vh; }
  .side .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-titre); font-weight: 800; font-size: 20px; padding: 0 8px 22px; }
  .side .logo::after { border-color: var(--encre); }
  .side a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #b9c3db; text-decoration: none; font-weight: 600; font-size: 14.5px; position: relative; }
  .side a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; }
  .side a .badge-n { position: static; margin-left: auto; }
  .side .grow { flex: 1; }
  .side .acct { font-size: 12.5px; color: #8e9ab8; padding: 10px 12px; overflow: hidden; text-overflow: ellipsis; }
  .tabs { display: none; }
  .content { padding-bottom: 40px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .split { display: grid; grid-template-columns: 360px 1fr; height: 100vh; }
  .split > .list { border-right: 1px solid var(--trait); overflow-y: auto; height: 100vh; }
  .split > .pane { overflow-y: auto; height: 100vh; background: #eef1f6; }
  .split .top { background: color-mix(in srgb, var(--craie) 92%, transparent); }
  .split .content { padding: 4px 12px 24px; }
  .toast { bottom: 28px; }
  .sheet { left: 50%; right: auto; width: 520px; bottom: auto; top: 50%; border-radius: 24px; transform: translate(-50%, -45%) scale(.98); opacity: 0; pointer-events: none; transition: .2s; max-height: 86vh; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
  .incoming { left: auto; right: 24px; top: 24px; width: 400px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* =====================================================================
   Thème « logiciel pro » : blanc, filets fins, listes denses, trois volets
   ===================================================================== */
:root {
  --craie: #f6f7f9; --blanc: #fff; --trait: #e6e8ec; --encre: #1b1f29; --encre-2: #5b6474; --encre-3: #8b93a1;
  --bleu: #1d4e89; --bleu-fonce: #163d6c; --bleu-pale: #eaf0f7;
  --ombre: 0 1px 2px rgba(16, 24, 40, .05);
  --r-s: 8px; --r-m: 10px; --r-l: 12px;
  --font-titre: var(--font);
}
html, body { background: var(--blanc); font-size: 14.5px; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 16px; font-weight: 700; }
.top { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--trait); min-height: 58px; }
.top .tt { flex: 1; min-width: 0; }
.top .tt h1 { font-size: 19px; }
.top .tt .sub { font-size: 12.5px; color: var(--encre-3); }
.content { padding-top: 12px; }
.btn { border-radius: 9px; min-height: 42px; font-weight: 600; font-size: 14.5px; }
.btn.big { min-height: 48px; border-radius: 10px; }
.btn.sm { min-height: 34px; border-radius: 8px; }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--trait); }
.chip { min-height: 32px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--trait); }
.chip[aria-pressed="true"] { background: var(--encre); }
.panel { border: 1px solid var(--trait); box-shadow: none; border-radius: var(--r-l); }
.row { min-height: 56px; padding: 11px 14px; }
.row .t { font-weight: 600; }
.row .line1 { display: flex; align-items: baseline; gap: 8px; }
.row .line1 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .line1 .when { margin: 0; }
.row.unread .t { font-weight: 800; }
.row.unread .s { color: var(--encre); font-weight: 500; }
.av { width: 38px; height: 38px; font-size: 15px; background: #e8ecf4; color: #3d4a63; }
.stat, .quick button { border: 1px solid var(--trait); box-shadow: none; border-radius: var(--r-l); }
.stat b { font-size: 24px; }
.banner { border-radius: var(--r-m); }
.ticket { border: 1px solid var(--trait); box-shadow: none; border-radius: var(--r-l); }
.ticket .who { font-size: 18px; }
.section h2 { font-size: 14px; color: var(--encre-2); font-weight: 700; }
.sheet { background: var(--blanc); }
.tabs { background: rgba(255, 255, 255, .97); }
.tabs a { font-size: 11px; }
.tabs a svg.i { width: 23px; height: 23px; }
.m.in { box-shadow: none; border: 1px solid var(--trait); }
.m.bot { background: #eef1f6; }
.composer { background: var(--blanc); }
.takeover { font-size: 13px; padding: 9px 14px; }

/* demandes épinglées en haut de la boîte */
.pinned { border: 1px solid #f3d9a4; background: #fffaf0; border-radius: var(--r-l); margin-bottom: 12px; overflow: hidden; }
.pin-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; font-weight: 700; font-size: 13.5px; color: var(--gilet-encre); }
.pin { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-top: 1px solid #f6e6c4; }
.pin:first-of-type { border-top: 0; }
.pin .t { font-weight: 700; font-size: 14.5px; }
.pin .s { font-size: 13px; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin .btn.sm { width: 38px; padding: 0; }

/* panneau client */
.info { padding: 22px 18px; }
.info .who { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--trait); }
.info .av.big { width: 64px; height: 64px; font-size: 24px; margin: 0 auto 10px; }
.info .who .s { color: var(--encre-2); font-size: 13.5px; margin-top: 2px; }
.info .acts3 { display: flex; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.info .acts3 button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--trait); font-size: 12.5px; font-weight: 600; color: var(--encre-2); }
.info .acts3 button:hover { background: var(--craie); }
.info .blk { padding: 14px 0; border-bottom: 1px solid var(--trait); }
.info .lbl { font-size: 12px; font-weight: 700; color: var(--encre-3); margin-bottom: 8px; }
.info .mini { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 0; }
.info .mini .t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .mini .s { font-size: 12px; color: var(--encre-3); }

@media (min-width: 900px) {
  .side { background: var(--craie); color: var(--encre); border-right: 1px solid var(--trait); width: 236px; padding: 14px 10px; }
  .side .brand { font-size: 15px; font-weight: 700; padding: 4px 8px 14px; gap: 10px; }
  .side .brand .logo { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
  .side .brand .logo::after { border-color: var(--craie); }
  .side .brand .sub { font-size: 12px; color: var(--encre-3); font-weight: 500; }
  .side .newmsg { margin: 0 4px 14px; width: auto; min-height: 38px; }
  .side a { color: var(--encre-2); padding: 9px 10px; font-size: 14px; border-radius: 8px; }
  .side a:hover { background: #eceef2; color: var(--encre); }
  .side a[aria-current="page"] { background: var(--blanc); color: var(--bleu); box-shadow: 0 0 0 1px var(--trait); }
  .side .acct { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--trait); margin-top: 8px; color: var(--encre); }
  .side .acct .av { width: 32px; height: 32px; font-size: 13px; }
  .side .acct .t { font-weight: 600; font-size: 13.5px; }
  .side .acct .s { font-size: 12px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; }
  .split { grid-template-columns: 340px 1fr; }
  .split:has(> .info) { grid-template-columns: 340px 1fr 300px; }
  .split > .pane { background: var(--craie); }
  .split > .info { border-left: 1px solid var(--trait); overflow-y: auto; height: 100vh; background: var(--blanc); }
  .split > .list .panel { border: 0; border-radius: 0; }
  .split > .list .content { padding: 10px 0 24px; }
  .split > .list .filters { padding: 2px 12px 10px; margin: 0; }
  .split > .list .pinned { margin: 0 12px 12px; }
  .split > .list .banner { margin: 0 12px 12px; }
  .split > .list .row { border-radius: 0; }
  .split .thread .top .back { display: none; }
  .main > div > .top { padding-left: 24px; padding-right: 24px; }
  .content { max-width: 880px; padding-left: 24px; padding-right: 24px; }
  .gate { padding-top: 60px; }
}

/* saisie de ville avec propositions */
.suggest-wrap { position: relative; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--r-m); box-shadow: 0 12px 28px -12px rgba(16,24,40,.25); max-height: 300px; overflow-y: auto; }
.suggest li { display: grid; gap: 1px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.suggest li b { font-size: 15.5px; font-weight: 600; }
.suggest li span { font-size: 13px; color: var(--gris); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--craie); }

/* ---------- page Résultats ---------- */
.res { display: grid; gap: 14px; }
.res-hero { background: var(--encre); color: #fff; border-radius: var(--r-l); padding: 22px 20px 20px; }
.res-kicker { font-size: 14px; opacity: .75; }
.res-big { font-family: var(--font-titre); font-size: 64px; font-weight: 800; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.res-big-l { font-size: 17px; font-weight: 600; margin-top: 4px; }
.res-phrase { margin: 12px 0 0; font-size: 15px; line-height: 1.5; opacity: .9; }
.res-evo { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: rgba(255,255,255,.12); }
.res-evo.up { color: #7ee2a8; } .res-evo.down { color: #ffc9c5; }
.res-card { background: var(--blanc); border-radius: var(--r-l); padding: 18px 16px; box-shadow: var(--ombre); }
.res-card h3 { margin: 0 0 12px; font-size: 16px; }
.res-money { font-family: var(--font-titre); font-size: 40px; font-weight: 800; color: var(--vert); line-height: 1.05; font-variant-numeric: tabular-nums; }
.res-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.res-mini div { background: var(--craie); border-radius: var(--r-m); padding: 10px; }
.res-mini b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.res-mini span { font-size: 12.5px; color: var(--encre-2); }
.res-list { list-style: none; margin: 0; padding: 0; }
.res-list li { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--trait); }
.res-list li:first-child { border-top: 0; padding-top: 2px; }
.res-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--bleu-pale); color: var(--bleu); display: grid; place-items: center; }
.res-ic svg { width: 19px; height: 19px; }
.res-list b { display: block; font-size: 15px; }
.res-list li > div > span { display: block; font-size: 13px; color: var(--encre-2); line-height: 1.4; margin-top: 2px; }
.res-temps { margin-top: 12px; background: var(--vert-pale); border-radius: var(--r-m); padding: 12px 14px; }
.res-temps b { font-size: 22px; color: var(--vert); margin-right: 6px; }
.res-temps span { font-size: 14px; font-weight: 600; }
.res-temps small { display: block; color: var(--encre-2); font-size: 12px; margin-top: 4px; }
.res-bar { margin: 4px 0 12px; }
.res-bar-t { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.res-bar-f { height: 10px; border-radius: 5px; background: var(--craie); overflow: hidden; }
.res-bar-f i { display: block; height: 100%; border-radius: 5px; background: var(--bleu); }
.res-fil { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--trait); }
.res-fil li { position: relative; padding: 0 0 14px 4px; }
.res-fil li::before { content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bleu); border: 2px solid var(--blanc); }
.res-fil li.hors::before { background: var(--gilet); }
.res-fil time { font-size: 12.5px; color: var(--encre-3); }
.res-fil em { font-style: normal; color: var(--gilet-encre); background: var(--gilet-pale); border-radius: 99px; padding: 1px 8px; margin-left: 6px; font-size: 11.5px; font-weight: 600; }
.res-fil p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; }
.res-total .res-mini { margin-top: 0; }
@media (min-width: 900px) { .res { grid-template-columns: 1fr 1fr; } .res-hero { grid-column: 1 / -1; } .res-total { grid-column: 1 / -1; } .res-total .res-mini { grid-template-columns: repeat(6, 1fr); } }
