/* Coffre — charte Anthracite Studio */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Sometype Mono";
  src: url("fonts/sometype-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --font-body: "Figtree", system-ui, sans-serif;
  --font-title: "Instrument Serif", Georgia, serif;
  --font-mono: "Sometype Mono", ui-monospace, monospace;

  --primary: #0004EB;
  --primary-hover: #1F24FF;
  --lightprimary: #838DFF;
  --bg: #04040E;
  --panel: #090918;
  --panel-2: #0E0E22;
  --field: #12122A;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, .58);
  --faint: rgba(255, 255, 255, .36);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --danger: #FF6B6B;
  --warn: #FFB547;
  --ok: #4ADE80;
  --radius: 10px;
  --ease: cubic-bezier(.25, 1, .5, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--lightprimary); outline-offset: 2px; }

.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons et champs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; font-weight: 550; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, .05); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { color: var(--danger); border-color: rgba(255, 107, 107, .35); }
.btn--danger:hover { background: rgba(255, 107, 107, .08); }
.btn--block { width: 100%; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--fg); }
.icon-btn.is-on { color: var(--lightprimary); }
.icon-btn.is-on svg path { fill: currentColor; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--lightprimary); box-shadow: 0 0 0 3px rgba(131, 141, 255, .18); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input-row { display: flex; gap: 6px; align-items: center; }
.input-row .input { flex: 1; min-width: 0; }
.input--mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 2px; background: var(--line-strong); transition: background .25s var(--ease); }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--lightprimary); }
.meter[data-level="4"] i { background: var(--ok); }
.meter-label { font-size: 12px; color: var(--muted); min-height: 18px; }

.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0; }

/* ---------- Écrans verrouillé / création ---------- */

.gate {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(0, 4, 235, .28), transparent 70%),
    var(--bg);
}
.gate__card { width: min(100%, 400px); display: grid; gap: 18px; }
.gate__logo { width: 48px; height: 48px; border-radius: 4px; }
.gate__title { font: 400 44px/1 var(--font-title); margin: 6px 0 0; letter-spacing: -.01em; }
.gate__text { margin: 0; color: var(--muted); }
.gate__form { display: grid; gap: 14px; margin-top: 8px; }
.gate__or {
  display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px;
  text-transform: uppercase; letter-spacing: .12em; font-family: var(--font-mono);
}
.gate__or::before, .gate__or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.btn--touch { height: 52px; font-size: 16px; }
.btn--touch .ic { width: 22px; height: 22px; }
.gate__foot { font-size: 12px; color: var(--faint); margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.gate__foot .ic { width: 14px; height: 14px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Application ---------- */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) minmax(400px, 42%);
  height: 100dvh;
}

/* Navigation */
.nav {
  display: flex; flex-direction: column; gap: 4px; min-height: 0;
  padding: 20px 14px calc(14px + env(safe-area-inset-bottom));
  background: var(--panel); border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand img { width: 28px; height: 28px; border-radius: 3px; }
.brand b { font: 400 26px/1 var(--font-title); letter-spacing: -.01em; }
.nav .btn--primary { margin: 0 0 14px; }
.nav__title {
  margin: 18px 8px 6px; font: 500 11px/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.nav__item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); text-align: left; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav__item:hover { background: rgba(255, 255, 255, .05); color: var(--fg); }
.nav__item.is-active { background: rgba(0, 4, 235, .22); color: var(--fg); }
.nav__item.is-active .ic { color: var(--lightprimary); }
.nav__item span:not(.ic) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__item em { font-style: normal; font-size: 12px; color: var(--faint); font-family: var(--font-mono); }
.nav__item--warn em { color: var(--warn); }
.nav__spacer { flex: 1; min-height: 16px; }
.save-state { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; color: var(--faint); }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state[data-state="saving"] i { background: var(--warn); }
.save-state[data-state="error"] { color: var(--danger); }
.save-state[data-state="error"] i { background: var(--danger); }

/* Arbre des dossiers */
.tree-row { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--depth, 0) * 14px); }
.tree-row .nav__item { flex: 1; min-width: 0; padding-left: 6px; }
.tree-caret {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 30px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--faint);
}
button.tree-caret:hover { color: var(--fg); background: rgba(255, 255, 255, .05); }
.tree-caret .ic { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.tree-caret.is-open .ic { transform: rotate(90deg); }

/* Liste en arbre (comme Keeper) */
.list__items.is-tree { padding: 6px 10px 24px; }
.list__items.is-tree .item {
  padding-left: calc(6px + var(--depth, 0) * 22px);
  border-radius: 8px; min-height: 58px;
}
.list__items.is-tree .item + .item { margin-top: 1px; }
.item .tree-caret { pointer-events: auto; }
.item--folder .item__title { font-weight: 600; }
.list__tools { display: flex; gap: 6px; }
.btn--ghost { border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--fg); }
.section-title { margin: 22px 2px 8px; font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.card--list { padding: 4px; }
.card--list .item { border-radius: 10px; }

/* Sélection multiple */
.check-box {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); color: transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.check-box .ic { width: 14px; height: 14px; }
.check-box svg { stroke-width: 2.4; }
.check-box.is-on, .check-box.is-some { background: var(--primary); border-color: var(--primary); color: #fff; }
.item.is-checked { background: rgba(0, 4, 235, .14); }
.list { position: relative; }
.bulk {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 10px calc(10px + env(safe-area-inset-bottom)); padding: 10px 10px 10px 16px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--panel-2); box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
  animation: toast .25s var(--ease);
}
.bulk__count { flex: 1; min-width: 140px; font-weight: 600; font-size: 14px; }
.bulk__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Liste */
.list {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--bg);
}
.list__head { display: grid; gap: 14px; padding: 20px 16px 12px; border-bottom: 1px solid var(--line); }
.list__top { display: flex; align-items: center; gap: 8px; }
.list__title { font: 400 30px/1 var(--font-title); margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: -8px; font-size: 13px; color: var(--faint); }
.list__crumb:empty { display: none; }
.list__crumb button { padding: 0; border: 0; background: none; color: var(--muted); }
.list__crumb button:hover { color: var(--fg); text-decoration: underline; }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 40px; }
.list__items { flex: 1; overflow-y: auto; padding: 8px; }
.list__count { padding: 6px 10px; font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border: 0; border-radius: 10px; background: transparent; text-align: left;
  transition: background .15s var(--ease);
}
.item:hover { background: rgba(255, 255, 255, .04); }
.item.is-active { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.item__body { flex: 1; min-width: 0; }
.item__title, .item__sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__title { font-weight: 600; }
.item__sub { font-size: 13px; color: var(--muted); }
.item__flags { display: flex; gap: 4px; color: var(--faint); }
.item__flags .ic { width: 15px; height: 15px; }
.item__flags .is-warn { color: var(--warn); }
.item__flags .is-fav { color: var(--lightprimary); }
.item__flags .is-fav svg path { fill: currentColor; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  font: 600 16px/1 var(--font-body); color: #fff; text-transform: uppercase;
}
.avatar--folder { background: var(--panel-2); color: var(--lightprimary); box-shadow: inset 0 0 0 1px var(--line-strong); }
.item--folder .item__flags .ic { width: 16px; height: 16px; }
.avatar--lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.avatar .ic { width: 20px; height: 20px; }
.avatar--lg .ic { width: 26px; height: 26px; }

.empty { display: grid; place-items: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--faint); }
.empty h3 { margin: 0; font: 400 26px/1.1 var(--font-title); color: var(--fg); }
.empty p { margin: 0; max-width: 320px; }

/* Détail */
.detail { min-height: 0; overflow-y: auto; background: var(--bg); }
.detail__inner { max-width: 760px; padding: 28px 40px 60px; }
.detail__bar { display: flex; align-items: center; gap: 4px; margin-bottom: 22px; }
.detail__bar .grow { flex: 1; }
.detail__head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.detail__head h2 { margin: 0; font: 400 40px/1.05 var(--font-title); letter-spacing: -.01em; overflow-wrap: anywhere; }
.detail__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 6px; background: rgba(255, 255, 255, .06);
  font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tag .ic { width: 13px; height: 13px; }
.tag--link { border: 0; cursor: pointer; text-transform: none; letter-spacing: .02em; font-size: 12px; }
.tag--link:hover { color: var(--fg); background: rgba(255, 255, 255, .1); }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--radius); background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .22);
  color: var(--warn); font-size: 14px;
}
.alert ul { margin: 0; padding: 0; list-style: none; }

.card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.card + .card { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 68px; }
.row + .row { border-top: 1px solid var(--line); }
.row__body { flex: 1; min-width: 0; }
.row__label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.row__value { display: block; overflow-wrap: anywhere; }
.row__value--secret { font-family: var(--font-mono); font-weight: 500; letter-spacing: .04em; }
.row__value a { color: var(--lightprimary); text-decoration: none; }
.row__value a:hover { text-decoration: underline; }
.row__actions { display: flex; gap: 2px; }
.row--notes .row__value { white-space: pre-wrap; }

.totp { display: flex; align-items: center; gap: 12px; }
.totp__code { font: 500 24px/1 var(--font-mono); letter-spacing: .14em; color: var(--lightprimary); }
.totp__ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.totp__ring circle { fill: none; stroke-width: 3; }
.totp__ring .bg { stroke: var(--line-strong); }
.totp__ring .fg { stroke: var(--lightprimary); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.totp.is-ending .totp__code, .totp.is-ending .fg { color: var(--warn); stroke: var(--warn); }

.history { margin-top: 16px; }
.history summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; }
.history .row { min-height: 56px; }

.detail__foot { margin-top: 20px; font-size: 12px; color: var(--faint); }

/* Formulaire d'édition */
.form { display: grid; gap: 18px; }
.form__actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.form__actions .grow { flex: 1; }
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-pick button {
  display: grid; justify-items: center; gap: 8px; padding: 14px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 550;
}
.type-pick button.is-active { border-color: var(--lightprimary); color: var(--fg); background: rgba(0, 4, 235, .16); }
.type-pick .ic { width: 22px; height: 22px; }

/* Dialogues */
dialog {
  width: min(calc(100% - 32px), 480px); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--panel); color: var(--fg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
dialog::backdrop { background: rgba(4, 4, 14, .72); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog__head { display: flex; align-items: center; gap: 8px; padding: 18px 18px 0 22px; }
.dialog__head h3 { flex: 1; margin: 0; font: 400 28px/1.1 var(--font-title); }
.dialog__body { display: grid; gap: 16px; padding: 18px 22px 22px; }
.dialog__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dialog__section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog__section h4 { margin: 0; font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.dialog__section p { margin: 0; font-size: 14px; color: var(--muted); }
.dialog__buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.gen-output {
  display: flex; align-items: center; gap: 6px; padding: 14px 14px 14px 16px;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
}
.gen-output output { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 500 18px/1.4 var(--font-mono); }
.gen-output output .d { color: var(--lightprimary); }
.gen-output output .s { color: var(--warn); }
.range { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.range input { grid-column: 1 / -1; accent-color: var(--primary); width: 100%; }
.range b { font: 500 14px/1 var(--font-mono); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Notifications */
#toasts {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100;
  display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-radius: 999px; background: #fff; color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4); white-space: nowrap;
  animation: toast .3s var(--ease);
}
.toast .ic { width: 16px; height: 16px; color: var(--primary); }
.toast.is-error .ic { color: #D33; }
@keyframes toast { from { opacity: 0; transform: translateY(10px); } }
.toast { pointer-events: auto; }
.toast__action {
  margin-left: 6px; padding: 4px 10px; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px;
}

/* Corbeille */
.alert--trash { align-items: center; flex-wrap: wrap; background: rgba(255, 255, 255, .04); border-color: var(--line-strong); color: var(--muted); }
.alert--trash .grow { flex: 1; min-width: 180px; }
.alert__actions { display: flex; gap: 6px; }

/* Valeurs multi-lignes (clés SSH…) */
.row--top { align-items: flex-start; }
.row__value--block {
  margin: 2px 0 0; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  font: 500 12.5px/1.5 var(--font-mono);
}
.textarea--field { min-height: 44px; resize: vertical; font-size: 13.5px; line-height: 1.5; }
.is-masked:not(:focus) { -webkit-text-security: disc; }
.input-row--top { align-items: flex-start; }

/* Champs personnalisés */
.custom-fields { display: grid; gap: 10px; }
.custom-field { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.custom-field__label { min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.custom-fields__add { justify-self: start; }
.detail__keys { margin-top: 4px; }
.versions { max-height: 46vh; overflow-y: auto; }

.scrim { display: none; }

/* Panneau de droite seulement quand une entrée ou un dossier est ouvert */
@media (min-width: 861px) {
  .app[data-detail="none"] { grid-template-columns: 248px minmax(0, 1fr); }
  .app[data-detail="none"] .detail { display: none; }
  .app[data-detail="none"] .list { border-right: 0; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .app[data-detail="none"] { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 860px) { .desktop-only { display: none !important; } }
.mobile-only { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .app { grid-template-columns: 210px minmax(0, 1fr) minmax(320px, 40%); }
  .detail__inner { padding: 24px 28px 48px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .mobile-only { display: inline-flex !important; }
  .nav {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(84vw, 300px);
    padding-top: calc(20px + env(safe-area-inset-top));
    transform: translateX(-102%); transition: transform .3s var(--ease);
  }
  .app[data-nav="open"] .nav { transform: none; }
  .app[data-nav="open"] .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(4, 4, 14, .6); }
  .list { border-right: 0; }
  .list__head { padding: calc(14px + env(safe-area-inset-top)) 16px 12px; }
  .list__items { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .detail { display: none; }
  .app[data-pane="detail"] .list { display: none; }
  .app[data-pane="detail"] .detail { display: block; }
  .detail__inner { padding: calc(12px + env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom)); }
  .detail__head h2 { font-size: 32px; }
  .row { padding: 12px 14px; }
  .input, .select, .textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .checks { grid-template-columns: 1fr; }
}
