:root {
  --fond: oklch(0.975 0.005 85);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.955 0.006 85);
  --trait: oklch(0.9 0.006 85);
  --encre: oklch(0.22 0.012 75);
  --encre-2: oklch(0.46 0.010 75);
  --encre-3: oklch(0.6 0.008 75);
  --accent: oklch(0.5 0.11 172);
  --accent-fort: oklch(0.42 0.12 172);
  --accent-doux: oklch(0.94 0.035 172);
  --sur-accent: oklch(0.99 0.005 172);
  --fait: oklch(0.52 0.13 150);
  --fait-doux: oklch(0.94 0.045 150);
  --en-cours: oklch(0.62 0.14 75);
  --en-cours-doux: oklch(0.95 0.055 80);
  --retard: oklch(0.54 0.17 25);
  --retard-doux: oklch(0.95 0.035 25);
  --police: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 18px;
  --e: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: oklch(0.17 0.008 75);
    --surface: oklch(0.215 0.009 75);
    --surface-2: oklch(0.26 0.010 75);
    --trait: oklch(0.32 0.010 75);
    --encre: oklch(0.95 0.006 85);
    --encre-2: oklch(0.76 0.008 85);
    --encre-3: oklch(0.62 0.008 85);
    --accent: oklch(0.74 0.10 172);
    --accent-fort: oklch(0.82 0.11 172);
    --accent-doux: oklch(0.3 0.045 172);
    --sur-accent: oklch(0.17 0.02 172);
    --fait: oklch(0.74 0.13 150);
    --fait-doux: oklch(0.3 0.05 150);
    --en-cours: oklch(0.8 0.12 75);
    --en-cours-doux: oklch(0.31 0.055 75);
    --retard: oklch(0.72 0.15 25);
    --retard-doux: oklch(0.3 0.05 25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--encre); font: 15px/1.45 var(--police); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font: 600 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px;
  border: 1px solid var(--trait); background: var(--surface-2); color: var(--encre-2);
}
.meta { color: var(--encre-3); font-size: 13px; font-weight: 400; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------ porte */
.porte { max-width: 340px; margin: 18vh auto 0; padding: 0 16px; display: grid; gap: 10px; }
.porte h1 { font: 600 2rem/1.1 var(--serif); margin: 0 0 10px; }
.porte input { width: 100%; padding: 12px 48px 12px 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); }
.mdp { position: relative; }
.oeil {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; color: var(--encre-2);
  display: grid; place-items: center;
}
.oeil svg { width: 20px; height: 20px; }
.erreur { color: var(--retard); min-height: 1.2em; margin: 0; font-size: 14px; }
.plein { background: var(--accent); color: var(--sur-accent); border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; }
.plein:hover { background: var(--accent-fort); }

/* ------------------------------------------------ cadre */
.app { display: grid; grid-template-columns: 196px 1fr; height: 100vh; }
.rail { border-right: 1px solid var(--trait); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.rail-groupe { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--encre-3); margin: 14px 10px 4px; text-transform: uppercase; }
.cat {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  border: 0; background: none; padding: 8px 10px; border-radius: 9px; text-align: left; font-size: 14px;
}
.cat:hover { background: var(--surface-2); }
.cat .n { font-variant-numeric: tabular-nums; color: var(--encre-3); font-size: 13px; }
.cat.active { background: var(--accent-doux); color: var(--accent-fort); font-weight: 600; }
.cat.active .n { color: var(--accent-fort); }
.rail-tel { margin-top: auto; border: 1px solid var(--trait); background: var(--surface); border-radius: 10px; padding: 10px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.rail-tel kbd { margin-left: auto; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--encre-3); flex: none; }
.point.on { background: var(--fait); box-shadow: 0 0 0 3px var(--fait-doux); }

/* ------------------------------------------------ bento */
.bento {
  display: grid; gap: var(--e); padding: var(--e); height: 100vh; min-height: 0;
  grid-template-columns: 1.15fr 1.15fr 1fr;
  grid-template-rows: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1fr) auto;
  grid-template-areas:
    "num    script images"
    "asso   script images"
    "web    argent note"
    "rep    rep    rep";
}
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r); padding: 18px 20px; min-height: 0; overflow: auto; }
.tuile h2 { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--encre-3); margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; }
.tuile h2 .meta { text-transform: none; letter-spacing: 0; font-size: 12px; }
.t-num { grid-area: num; display: flex; flex-direction: column; container-type: inline-size; }
.t-script { grid-area: script; }
.t-images { grid-area: images; }
.t-asso { grid-area: asso; }
.t-web { grid-area: web; }
.t-argent { grid-area: argent; }
.t-note { grid-area: note; display: flex; flex-direction: column; }
.t-rep { grid-area: rep; padding: 12px; overflow: visible; }

/* numéro */
.num-haut { display: flex; justify-content: space-between; align-items: center; }
.nav-fleches button { border: 1px solid var(--trait); background: var(--surface); width: 34px; height: 30px; border-radius: 8px; }
.nav-fleches button:hover { background: var(--surface-2); }
.nom { font: 600 clamp(22px, 2.1vw, 34px)/1.12 var(--serif); margin: 8px 0 2px; overflow-wrap: anywhere; }
.lieu { margin: 0; color: var(--encre-2); }
.numero {
  display: inline-block; margin: 14px 0 2px; font: 600 min(64px, 11.2cqi)/1 var(--mono); white-space: nowrap;
  letter-spacing: -.02em; color: var(--encre); text-decoration: none; font-variant-numeric: tabular-nums;
}
.numero:hover { color: var(--accent-fort); }
.interlocuteur { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.interlocuteur b { font-size: 16px; }
.interlocuteur:empty { display: none; }
.suivi { margin: auto 0 0; padding-top: 10px; font-size: 13px; color: var(--encre-2); }
.suivi .etiquette { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); margin-right: 6px; }
.alerte { color: var(--retard); background: var(--retard-doux); padding: 8px 10px; border-radius: 10px; font-size: 14px; margin: 10px 0 0; }

/* script */
.script { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.script li { font-size: 15px; line-height: 1.42; }
.script li.moi { padding: 10px 12px; border-radius: 12px; background: var(--accent-doux); }
.script li.eux { color: var(--encre-3); font-size: 14px; padding-left: 12px; }
.script mark { background: none; color: var(--accent-fort); font-weight: 600; }
.objections { margin-top: 14px; border-top: 1px solid var(--trait); padding-top: 10px; }
.objections summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.objection { margin-top: 10px; }
.objection b { display: block; font-size: 14px; }
.objection p { margin: 2px 0 0; color: var(--encre-2); font-size: 14px; }

/* images */
.images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.images button { padding: 0; border: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; aspect-ratio: 1; position: relative; }
.images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.images button.logo img { object-fit: contain; padding: 8px; background: #fff; }
.images .vide { grid-column: 1 / -1; color: var(--encre-3); font-size: 14px; }

/* texte */
.resume { font-size: 16px; margin: 0 0 8px; }
.angle { font-size: 15px; margin: 0 0 10px; }
.reseaux { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reseaux li { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.reseaux a { color: var(--accent-fort); font-weight: 600; text-decoration: none; }
.reseaux a:hover { text-decoration: underline; }
.etat-actif { color: var(--fait); }
.etat-endormi { color: var(--en-cours); }
.etat-doute { color: var(--retard); }
.argent { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.argent dt { color: var(--encre-3); }
.argent dd { margin: 0; font-weight: 600; }
.t-note textarea { flex: 1; width: 100%; min-height: 60px; resize: none; border: 1px solid var(--trait); border-radius: 10px; padding: 10px; background: var(--surface-2); }

/* réponses */
.reponses { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.rep {
  border: 1px solid var(--trait); background: var(--surface-2); border-radius: 14px; padding: 14px 10px;
  font-size: 16px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 76px; justify-content: center;
}
.rep:hover { filter: brightness(.97); }
.rep kbd { font-size: 12px; }
.rep.oui { background: var(--fait-doux); color: var(--fait); border-color: color-mix(in oklch, var(--fait) 35%, transparent); }
.rep.plus-tard { background: var(--en-cours-doux); color: color-mix(in oklch, var(--en-cours) 70%, var(--encre)); border-color: color-mix(in oklch, var(--en-cours) 35%, transparent); }
.rep.non { background: var(--retard-doux); color: var(--retard); border-color: color-mix(in oklch, var(--retard) 30%, transparent); }
.rep.fait { outline: 3px solid currentColor; outline-offset: -3px; }
.choix { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px; }
.choix .titre { font-weight: 600; margin-right: 6px; }
.choix button { border: 1px solid var(--trait); background: var(--surface); border-radius: 12px; padding: 14px 18px; font-size: 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.choix button:hover { background: var(--surface-2); }
.choix input { padding: 13px 12px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); font-size: 16px; min-width: 280px; }
.choix .annuler { margin-left: auto; font-weight: 400; }

/* panneau */
.panneau {
  position: fixed; left: 196px; top: 0; bottom: 0; width: 420px; background: var(--surface);
  border-right: 1px solid var(--trait); box-shadow: 0 8px 32px oklch(0 0 0 / .14); z-index: 5; display: flex; flex-direction: column;
}
.panneau-haut { display: flex; gap: 8px; align-items: center; padding: 16px; border-bottom: 1px solid var(--trait); }
.panneau-haut h2 { margin: 0 auto 0 0; font: 600 20px/1.2 var(--serif); }
.panneau-haut .plein { padding: 8px 12px; font-size: 14px; }
#panneau-fermer { border: 0; background: none; font-size: 24px; width: 36px; height: 36px; border-radius: 8px; }
.liste { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.liste button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; display: grid; gap: 1px; }
.liste button:hover { background: var(--surface-2); }
.liste .l1 { font-weight: 600; font-size: 14px; }
.liste .l2 { font-size: 13px; color: var(--encre-3); }

/* dialogues */
dialog { border: 1px solid var(--trait); border-radius: 18px; background: var(--surface); color: var(--encre); padding: 22px; }
dialog::backdrop { background: oklch(0 0 0 / .45); }
.dlg-tel { width: 340px; text-align: center; }
.dlg-tel h2 { margin: 0 0 12px; font: 600 22px/1.2 var(--serif); }
#qr svg { width: 260px; height: 260px; border-radius: 10px; }
.dlg-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.dlg-actions button:not(.plein) { border: 1px solid var(--trait); background: var(--surface); border-radius: 10px; padding: 10px 14px; }
.dlg-image { padding: 10px; max-width: 90vw; }
.dlg-image img { max-width: 86vw; max-height: 82vh; display: block; border-radius: 10px; }
.dlg-image p { margin: 8px 4px 0; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--trait); }
  .rail-groupe { display: none; }
  .cat { width: auto; gap: 8px; }
  .rail-tel { margin-top: 0; }
  .bento { height: auto; grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "num" "rep" "script" "asso" "web" "argent" "images" "note"; }
  .reponses { grid-template-columns: repeat(2, 1fr); }
  .panneau { left: 0; width: 100%; }
}
