/* ══════════════════════════════════════════════════════════════════════════
   Coffre Hymo — même graphite et même rouge que le portail, mais une pièce
   plus nue : pas d'aurore, pas de mouvement continu, pas de police externe
   (la CSP l'interdit, et c'est voulu). Ce qui est chiffré s'affiche en mono ;
   le rouge ne dit qu'une chose : ceci est déverrouillé, ou ceci a échoué.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --void: #07080D;
  --deep: #0B0D14;
  --raise: #11141E;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --glass-3: rgba(255, 255, 255, 0.10);
  --edge: rgba(255, 255, 255, 0.09);
  --edge-2: rgba(255, 255, 255, 0.16);
  --hair: rgba(255, 255, 255, 0.05);
  --sheen: rgba(255, 255, 255, 0.14);
  --ink: #F4F5FA;
  --ink-2: #B9BECF;
  --ink-3: #7C8298;
  --ink-4: #565C71;
  --red: hsl(348, 84%, 60%);
  --red-hi: hsl(348, 92%, 68%);
  --red-veil: hsla(348, 84%, 60%, 0.12);
  --red-line: hsla(348, 84%, 60%, 0.32);
  --sunk-1: rgba(0, 0, 0, 0.22);
  --sunk-2: rgba(0, 0, 0, 0.32);
  --sunk-3: rgba(0, 0, 0, 0.44);
  --pane: rgba(11, 13, 20, 0.88);
  --scrim: rgba(4, 5, 9, 0.66);
  --code-ink: #C9D2EA;
  --lift-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  --lift-2: 0 2px 6px rgba(0, 0, 0, 0.45), 0 28px 60px -22px rgba(0, 0, 0, 0.85);
  --inner: inset 0 1px 0 var(--sheen), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --mid: 300ms;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Mode clair : verre opaque, bordures d'encre, ombres bleutées. */
:root[data-theme="light"] {
  --void: #EEF0F6;
  --deep: #F5F6FA;
  --raise: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-2: rgba(255, 255, 255, 0.88);
  --glass-3: rgba(255, 255, 255, 0.97);
  --edge: rgba(19, 22, 34, 0.10);
  --edge-2: rgba(19, 22, 34, 0.19);
  --hair: rgba(19, 22, 34, 0.06);
  --sheen: rgba(255, 255, 255, 0.95);
  --ink: #13161F;
  --ink-2: #464C60;
  --ink-3: #6B7288;
  --ink-4: #8C93A8;
  --red: hsl(348, 72%, 46%);
  --red-hi: hsl(348, 78%, 40%);
  --red-veil: hsla(348, 72%, 46%, 0.10);
  --red-line: hsla(348, 72%, 46%, 0.32);
  --sunk-1: rgba(19, 22, 34, 0.04);
  --sunk-2: rgba(19, 22, 34, 0.065);
  --sunk-3: rgba(19, 22, 34, 0.09);
  --pane: rgba(245, 246, 250, 0.9);
  --scrim: rgba(19, 22, 34, 0.42);
  --code-ink: #1E2333;
  --lift-1: 0 1px 2px rgba(19, 22, 34, 0.06), 0 8px 24px -12px rgba(19, 22, 34, 0.18);
  --lift-2: 0 2px 6px rgba(19, 22, 34, 0.07), 0 28px 60px -22px rgba(19, 22, 34, 0.26);
  --inner: inset 0 1px 0 var(--sheen), inset 0 -1px 0 rgba(19, 22, 34, 0.035);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--void);
  background-image: radial-gradient(1200px 600px at 50% -200px, var(--raise), transparent 70%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--red-line); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--red-veil); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Vocabulaire ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge);
  color: var(--ink); font-weight: 600; font-size: 13px; letter-spacing: -0.01em;
  cursor: pointer; box-shadow: var(--inner);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--glass-3); border-color: var(--edge-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--void); border-color: transparent; box-shadow: none; }
.btn-primary:hover { background: var(--ink); opacity: 0.9; }
.btn-red { background: var(--red); color: #fff; border-color: transparent; box-shadow: none; }
.btn-red:hover { background: var(--red-hi); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--glass-2); color: var(--ink); }
.btn-small { padding: 5px 11px; font-size: 12px; }
.btn-icon { padding: 5px 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  background: var(--sunk-2); border: 1px solid var(--edge);
  color: var(--ink); outline: none;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.input:focus { border-color: var(--edge-2); background: var(--sunk-3); }
.input::placeholder { color: var(--ink-4); }
textarea.input { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.hint { color: var(--ink-3); font-size: 12px; margin: 0; }
.hint code { background: var(--sunk-2); padding: 1px 5px; border-radius: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--glass);
  font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill.mono { font-size: 11px; }
.pill-red { border-color: var(--red-line); background: var(--red-veil); color: var(--red); }

.card {
  background: var(--glass); border: 1px solid var(--edge); border-radius: 16px;
  box-shadow: var(--inner), var(--lift-1); padding: 22px;
}
.card h2 { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.error { color: var(--red); font-size: 12.5px; margin: 0; min-height: 1.2em; }
.error:empty { display: none; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ── Écran d'authentification ────────────────────────────────────────────── */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--glass); border: 1px solid var(--edge); border-radius: 22px;
  box-shadow: var(--inner), var(--lift-2); padding: 34px 32px 30px;
  animation: rise var(--mid) var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: var(--void);
}
/* Un <svg> sans width ni height retombe sur 300 × 150 — la taille par défaut
   d'un élément remplacé. Toutes les icônes de l'interface sont produites par
   icon(), qui n'en pose aucune : sans ce défaut, la moindre icône occupe un
   quart de l'écran. Les règles plus spécifiques ci-dessous le surchargent.
   flex: none — sinon l'icône se fait écraser dans une rangée flex. */
svg { width: 16px; height: 16px; flex: none; }

/* Un bouton qui doit se lire comme un lien, au fil d'une phrase : c'est bien
   un <button> (il déclenche une action, il ne mène nulle part), mais lui
   donner l'aspect d'un bouton casserait la ligne de texte. */
.btn-link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--red); text-decoration: underline; text-underline-offset: 2px;
}
.btn-link:hover { color: var(--red-hi); }

/* Un message d'erreur dans un formulaire doit se voir sans être cherché. */
.dlg .error:not(:empty) {
  background: var(--red-veil); border: 1px solid var(--red-line);
  border-radius: 12px; padding: 10px 14px; line-height: 1.5;
}

/* Bandeau d'avertissement au-dessus d'un item : un accès retiré dont le
   secret n'a pas encore été tourné. Il doit se voir sans crier. */
.banner {
  border-radius: 14px; padding: 12px 16px; margin: 12px 0; font-size: 13px;
  line-height: 1.55; border: 1px solid var(--edge);
}
/* Choix de type : des tuiles plutôt qu'un <select>. La liste déroulante
   native est dessinée par le système — fond clair, surlignage bleu — et
   aucune feuille de style ne la rattrape. Deux options qui méritent une
   phrase d'explication chacune n'ont de toute façon rien à faire dans un
   menu déroulant. */
.with-action { display: flex; gap: 8px; align-items: stretch; }
.with-action .input { flex: 1; min-width: 0; }
.with-action .btn { flex: none; }

.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.choice legend {
  padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
}
.tile {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--edge); background: var(--sunk-1);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.tile:hover { border-color: var(--edge-2); background: var(--sunk-2); }
.tile input { margin: 3px 0 0; accent-color: var(--red); flex: none; }
.tile-body { display: grid; gap: 4px; }
.tile-name { font-weight: 700; font-size: 14px; }
.tile-desc { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.tile:has(input:checked) { border-color: var(--red-line); background: var(--red-veil); }
.tile:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }

/* Un <select> reste utilisé ailleurs (choix d'un porteur) : au moins lui
   donner le fond du thème, même si la liste déroulée échappe au CSS. */
select.input { appearance: none; background-image: none; }

.banner.warn { background: var(--red-veil); border-color: var(--red-line); color: var(--ink); }

.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; }
.brand-sub { color: var(--ink-3); font-size: 11.5px; margin-top: -2px; }
.auth h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.auth p.lead { margin: 0 0 20px; color: var(--ink-2); font-size: 13.5px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .btn-primary { justify-content: center; padding: 11px; margin-top: 4px; }

.passkey-wait {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px 0 6px; text-align: center; color: var(--ink-2);
}
.passkey-wait .orb {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--edge-2); display: grid; place-items: center;
  background: var(--sunk-2);
  animation: pulse 1.6s var(--ease) infinite;
}
.passkey-wait .orb svg { width: 28px; height: 28px; color: var(--ink); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--red-veil); } 50% { box-shadow: 0 0 0 14px transparent; } }

.recovery-code {
  font-family: var(--mono); font-size: 20px; letter-spacing: 0.08em; text-align: center;
  padding: 18px 12px; border-radius: 12px; border: 1px dashed var(--red-line);
  background: var(--red-veil); color: var(--ink); user-select: all;
  font-variant-numeric: tabular-nums;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--red); }

/* ── Coque de l'application ──────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; border-bottom: 1px solid var(--edge);
  background: var(--pane); backdrop-filter: saturate(180%) blur(18px);
}
.topbar .brand { margin: 0; }
.topbar nav { display: flex; gap: 4px; margin-left: 8px; }
.topbar nav button {
  padding: 6px 13px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--ink-3); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.topbar nav button:hover { color: var(--ink); background: var(--glass-2); }
.topbar nav button[aria-current="page"] { color: var(--ink); background: var(--glass-2); border-color: var(--edge); }
.topbar .spacer { flex: 1; }
.who { color: var(--ink-3); font-size: 12.5px; }
.who b { color: var(--ink-2); font-weight: 600; }

main { flex: 1; width: 100%; max-width: 1340px; margin: 0 auto; padding: 22px 22px 60px; }

/* ── Vue items : liste | détail ──────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .side.has-selection { display: none; } }

/* ── Téléphone ─────────────────────────────────────────────────────────────
   Le coffre se consulte en mobilité — c'est même souvent là qu'on a besoin
   d'un mot de passe. Les marges de bureau et les rangées d'actions côte à
   côte y coûtent la moitié de l'écran. */
@media (max-width: 560px) {
  main { padding: 14px 12px 48px; }
  .card { padding: 16px; border-radius: 14px; }
  .detail h1 { font-size: 20px; }

  /* Chaque action prend sa ligne plutôt que de déborder : sur un écran
     étroit, quatre boutons côte à côte deviennent illisibles bien avant
     d'être inatteignables. */
  .detail-head, .detail-head .row { width: 100%; }
  .detail-head .row .btn, .lockbar .btn { flex: 1 1 auto; justify-content: center; }
  .lockbar { padding: 10px 12px; gap: 8px; }
  .lockbar .spacer { display: none; }

  /* Une empreinte, un DSN, un jeton : des chaînes sans espace qui poussent la
     page si on ne leur dit pas de se couper. */
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .kv dd, .mono, .crumb { overflow-wrap: anywhere; }

  dialog .dlg { padding: 18px 16px; }
  dialog .actions { flex-wrap: wrap; }
  dialog .actions .btn { flex: 1 1 auto; }

  /* Le tableau des valeurs défile déjà dans son cadre ; ne pas lui laisser
     imposer une colonne de 60 caractères. */
  .vals .v { max-width: 46ch; }
  .tile { padding: 12px 14px; }
}

.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; }
.side .input { padding: 8px 12px; }
.item-list { display: flex; flex-direction: column; gap: 2px; }
.folder {
  margin: 10px 0 3px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4);
}
.folder:first-child { margin-top: 2px; }
.item-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 11px; border: 1px solid transparent; background: transparent;
  cursor: pointer; transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.item-row:hover { background: var(--glass); }
.item-row[aria-current="true"] { background: var(--glass-2); border-color: var(--edge); }
.item-row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .envs { display: flex; gap: 4px; }
.item-row .envs span {
  font-family: var(--mono); font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--sunk-2); color: var(--ink-3);
}
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }

/* Détail */
.detail { display: flex; flex-direction: column; gap: 18px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumb { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.detail h1 { margin: 2px 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -0.035em; }
.detail .meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; }
.detail .meta a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--edge-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--edge); padding-bottom: 0; flex-wrap: wrap; }
.tabs button {
  padding: 8px 14px; border: none; background: transparent; color: var(--ink-3);
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button.add { font-family: var(--sans); color: var(--ink-4); }

/* Barre d'état : verrouillé / déverrouillé. C'est ici que le rouge parle. */
.lockbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--glass);
}
.lockbar.open { border-color: var(--red-line); background: var(--red-veil); }
.lockbar .state { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; }
.lockbar .state svg { width: 16px; height: 16px; }
.lockbar.open .state { color: var(--red); }
.lockbar .ttl { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lockbar.open .ttl { color: var(--red); }
.lockbar .spacer { flex: 1; }

/* Table de valeurs */
.vals { width: 100%; border-collapse: collapse; }
.vals th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4); padding: 6px 10px; border-bottom: 1px solid var(--edge);
}
.vals td { padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.vals tr:last-child td { border-bottom: none; }
.vals .k { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.vals .v { font-family: var(--mono); font-size: 12.5px; color: var(--code-ink); word-break: break-all; max-width: 60ch; }
.vals .v.masked { color: var(--ink-4); letter-spacing: 0.12em; user-select: none; }
.vals .v.multi { white-space: pre-wrap; max-height: 8.5em; overflow: auto; }
.vals .ver { font-family: var(--mono); font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.vals .acts { text-align: right; white-space: nowrap; }
.vals .acts .btn { opacity: 0.55; }
.vals tr:hover .acts .btn { opacity: 1; }
.vals input.input { padding: 6px 9px; }
.vals tr.new .k input { border-color: var(--red-line); }
/* Champ canonique d'un identifiant pas encore renseigné : présent dans la
   liste pour être proposé, mais visiblement en attente. */
.vals tr.vide .v { color: var(--ink-4); }
.vals tr.vide .k { opacity: 0.75; }
.vals .k .muted.mono { font-size: 11px; margin-left: 6px; }
/* La ligne ouverte se distingue du reste du tableau : l'édition porte sur
   elle seule, et rien n'est enregistré ailleurs. */
.vals tr.editing td, .vals tr.new td { background: var(--glass-2); }
.vals tr.editing .ver, .vals tr.new .ver { color: var(--ink-3); }
.table-wrap { overflow-x: auto; border: 1px solid var(--edge); border-radius: 12px; background: var(--glass); }

.editbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Journal ─────────────────────────────────────────────────────────────── */
.audit { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.audit th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); padding: 8px 10px; border-bottom: 1px solid var(--edge); white-space: nowrap; }
.audit td { padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.audit .at { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit .action { font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.audit tr.ko .action { color: var(--red); }
.audit .detail-cell { color: var(--ink-2); }
.audit .where { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* ── Compte ──────────────────────────────────────────────────────────────── */
/* minmax(340px, …) impose une piste de 340 px même quand le conteneur est plus
   étroit : sur un téléphone, la grille dépassait et c'est toute la page qui
   défilait horizontalement. `min(340px, 100%)` garde deux colonnes dès qu'il y
   a la place et n'en impose jamais plus que la largeur disponible. */
.grid2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 18px; align-items: start;
}
.authn { display: flex; flex-direction: column; gap: 8px; }
.authn-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--sunk-1); border: 1px solid var(--hair); }
.authn-row .lbl { flex: 1; font-weight: 600; }
.authn-row .dates { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }

/* ── Modales ─────────────────────────────────────────────────────────────── */
dialog {
  border: 1px solid var(--edge); border-radius: 18px; padding: 0;
  background: var(--raise); color: var(--ink); box-shadow: var(--inner), var(--lift-2);
  width: min(560px, calc(100vw - 32px));
}
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(6px); }
dialog .dlg { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; }
dialog h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }

.history { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; background: var(--sunk-1); }
.history-row .v { font-family: var(--mono); font-weight: 600; min-width: 3ch; }
.history-row .d { flex: 1; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-row.current { border: 1px solid var(--edge); }
.history-val { font-family: var(--mono); font-size: 12.5px; color: var(--code-ink); background: var(--sunk-2); padding: 10px 12px; border-radius: 9px; white-space: pre-wrap; word-break: break-all; }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  padding: 10px 14px; border-radius: 11px; font-size: 13px; font-weight: 500;
  background: var(--raise); border: 1px solid var(--edge-2); box-shadow: var(--lift-2);
  animation: rise var(--fast) var(--ease) both;
}
.toast.ko { border-color: var(--red-line); color: var(--red); }

/* Thème */
.theme-btn { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; padding: 0; }
.theme-btn svg { width: 15px; height: 15px; }
:root[data-theme="light"] .only-dark { display: none; }
:root:not([data-theme="light"]) .only-light { display: none; }

/* Utilitaires — la CSP interdit les attributs style, tout passe par ici. */
.f1 { flex: 1; } .f2 { flex: 2; }
.w-auto { width: auto; }
.mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

/* Barre de recherche : l'input prend la place, le bouton garde la sienne. */
.side .row .input { flex: 1; width: auto; min-width: 0; }
