/* =========================================================================
   Coffre — feuille de style
   Thème sombre "aurore dorée", cartes de verre, responsive.
   ========================================================================= */

:root {
  --bg:        #0e1116;
  --bg-2:      #131822;
  --panel:     rgba(255, 255, 255, 0.04);
  --panel-2:   rgba(255, 255, 255, 0.06);
  --border:    rgba(255, 255, 255, 0.10);
  --border-2:  rgba(255, 255, 255, 0.16);
  --text:      #eef2f7;
  --muted:     #97a3b6;
  --gold:      #e7c26a;
  --gold-2:    #f0d489;
  --gold-deep: #b8933f;
  --accent:    #6ea8fe;
  --ok:        #4ec98a;
  --warn:      #f0b849;
  --danger:    #ef6a6a;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Surfaces solides (remplacent le verre : plus net, plus rapide) */
  --surface:   #161b23;
  --surface-2: #1c222c;
  --surface-3: #222937;

  /* Échelle z-index sémantique (fini les valeurs au hasard) */
  --z-sticky: 20;
  --z-sidebar: 25;
  --z-fab: 30;
  --z-menu: 40;
  --z-modal: 60;
  --z-toast: 90;
  --z-viewer: 120;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
}
/* Lueur "aurore dorée" en couche fixe légère (sans coût de repaint au scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 82% -8%, rgba(231, 194, 106, 0.14), transparent 60%),
    radial-gradient(820px 560px at 6% 108%, rgba(110, 168, 254, 0.10), transparent 60%);
}

body { -webkit-tap-highlight-color: transparent; }

a { color: var(--gold-2); }
code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.only-mobile { display: none; }

/* ------------------------------ Écrans ---------------------------------- */
.screen { min-height: 100dvh; }
.center { display: grid; place-items: center; padding: 24px; }

/* Surface solide élevée (ex-"verre") : net, contrasté, sans coût de flou */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card { border-radius: var(--radius); }

.auth-card {
  width: min(440px, 100%);
  padding: 32px 30px;
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-card h1 { margin: 6px 0 4px; font-size: 1.5rem; letter-spacing: 0.2px; }
.auth-card p { margin: 0 0 18px; }
.auth-card label {
  display: block;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 2px 6px;
}

.logo-lock {
  font-size: 42px;
  filter: drop-shadow(0 6px 16px rgba(231, 194, 106, 0.35));
}

.steps { text-align: left; color: var(--muted); line-height: 1.7; }

/* ------------------------------ Champs ---------------------------------- */
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(231, 194, 106, 0.18);
}
textarea { resize: vertical; min-height: 74px; }

.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { padding-right: 44px; }
.pw-field .reveal {
  position: absolute; right: 6px;
  background: transparent; border: none;
}

/* ------------------------------ Boutons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.10); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  color: #241c05;
  background: var(--gold);
  border: none;
  box-shadow: 0 6px 18px rgba(231, 194, 106, 0.22);
}
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: #fff; background: #c0453f; border: none; }
.btn.danger:hover { background: #d1544f; }
.btn.block { width: 100%; margin-top: 20px; }
.btn.round { width: 56px; height: 56px; border-radius: 50%; font-size: 1.6rem; padding: 0; }

/* Séparateur « ou » entre « Se connecter » et « Créer un coffre » */
.auth-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 0;
  color: var(--muted); font-size: 0.85rem;
}
.auth-sep::before, .auth-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--panel-2); }

/* ------------------------------ Force pw -------------------------------- */
.strength { margin-top: 8px; text-align: left; }
.strength-bar {
  height: 7px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.strength-bar span {
  display: block; height: 100%; width: 0%;
  border-radius: 99px;
  transition: width 0.25s, background 0.25s;
}
.strength small { display: block; margin-top: 5px; color: var(--muted); font-size: 0.78rem; }

/* ------------------------------ Avertissements -------------------------- */
.warn, .error {
  text-align: left;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}
.warn {
  margin-top: 18px; padding: 12px 14px;
  background: rgba(240, 184, 73, 0.10);
  border: 1px solid rgba(240, 184, 73, 0.30);
  color: #f4d79a;
  line-height: 1.5;
}
.error { color: var(--danger); min-height: 1.1em; margin: 12px 0 0; font-weight: 600; }

.danger-zone { margin-top: 22px; text-align: left; }
.danger-zone summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.danger-zone p { font-size: 0.82rem; margin: 10px 0; }

.shake { animation: shake 0.4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* =============================== APP ==================================== */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: var(--z-sticky);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.2px; }
.brand-mark { font-size: 1.25rem; }
.brand-name { color: var(--gold-2); }

.search { position: relative; flex: 1; max-width: 560px; }
.search input { padding-left: 40px; }
.search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: 0.6; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 46px;
  min-width: 250px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  z-index: var(--z-menu);
}
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text); font-size: 0.92rem; font-family: inherit; cursor: pointer;
}
.menu button:hover { background: var(--panel-2); }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100dvh - 63px); }

.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.cat-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 10px 12px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--text); font-size: 0.92rem; font-family: inherit; cursor: pointer;
}
.cat-item:hover { background: var(--panel); }
.cat-item.active {
  background: rgba(231, 194, 106, 0.12);
  border-color: rgba(231, 194, 106, 0.28);
  color: var(--gold-2);
}
.cat-item .count {
  margin-left: auto; font-size: 0.76rem; color: var(--muted);
  background: var(--panel-2); padding: 1px 8px; border-radius: 99px;
}
.cat-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

.list-pane { padding: 20px 22px; overflow-y: auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.list-head h2 { margin: 0; font-size: 1.2rem; }

.entries {
  display: flex; flex-direction: column;
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.entries:empty { display: none; }

.entry {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.entry:last-child { border-bottom: none; }
.entry:hover { background: var(--surface-2); }
.entry-ico {
  flex: none;
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.05rem; color: #241c05;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
}
.entry-main { min-width: 0; flex: 1; }
.entry-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-sub { font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-badges { display: flex; gap: 6px; align-items: center; }
.badge {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 99px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.totp { color: var(--ok); border-color: rgba(78, 201, 138, 0.35); }
.entry .fav { color: var(--gold); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-ico { font-size: 52px; margin-bottom: 10px; }

.fab { position: fixed; right: 20px; bottom: 22px; z-index: var(--z-fab); }

/* ------------------------------ Détail / formulaire --------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 2px 6px; }
.row { display: flex; gap: 8px; }
.row .grow { flex: 1; }

.copy-field { position: relative; display: flex; gap: 8px; }
.copy-field input { flex: 1; }
.inline-actions { display: flex; gap: 6px; }

.pw-strength-inline { font-size: 0.76rem; color: var(--muted); margin-top: 6px; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .spacer { flex: 1; }

/* ------------------------------ TOTP ------------------------------------ */
.totp-box {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: rgba(78, 201, 138, 0.08);
  border: 1px solid rgba(78, 201, 138, 0.3);
  border-radius: 12px;
}
.totp-code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.7rem; font-weight: 700; letter-spacing: 3px; color: var(--ok);
}
.totp-code .space { display: inline-block; width: 10px; }
.totp-ring { --p: 0; flex: none; width: 34px; height: 34px; }

/* ------------------------------ Générateur ------------------------------ */
.gen-output {
  display: flex; align-items: center; gap: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  margin-bottom: 8px;
}
.gen-value {
  flex: 1; min-width: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.1rem; word-break: break-all; line-height: 1.5;
}
.gen-controls { display: grid; gap: 14px; margin-top: 14px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--gold); }
.slider-row .len { width: 42px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; font-size: 0.9rem;
}
.check input { width: auto; }
.seg { display: flex; gap: 6px; background: var(--panel); padding: 4px; border-radius: 10px; border: 1px solid var(--border); }
.seg button { flex: 1; padding: 8px; background: transparent; border: none; border-radius: 7px; color: var(--muted); font-family: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); }

/* ------------------------------ Modale ---------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(6, 8, 12, 0.66);
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%);
  max-height: 88dvh;
  display: flex; flex-direction: column;
  padding: 0;
  animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 18px 20px 22px; overflow-y: auto; }

/* ------------------------------ Toasts ---------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 18px; border-radius: 99px;
  background: var(--surface-3); border: 1px solid var(--border-2);
  box-shadow: var(--shadow); font-size: 0.9rem;
  animation: rise 0.2s;
}
.toast.ok { border-color: rgba(78, 201, 138, 0.5); }
.toast.err { border-color: rgba(239, 106, 106, 0.5); }

/* ------------------------------ Sidebar : sections ---------------------- */
.side-sec {
  margin: 16px 8px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------ Choix du type --------------------------- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.type-tile:hover { background: var(--panel-2); border-color: rgba(231, 194, 106, 0.4); }
.type-tile:active { transform: translateY(1px); }
.type-tile .tico { font-size: 1.7rem; }

/* ------------------------------ Icônes par type ------------------------- */
.entry-ico.t-emoji {
  background: linear-gradient(135deg, #2a3140, #1a1f29);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 400;
}

/* ------------------------------ Pastilles de couleur (cartes) ----------- */
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(231, 194, 106, 0.45);
}

/* ------------------------------ Badges d'état --------------------------- */
.badge.warn   { color: var(--warn);   border-color: rgba(240, 184, 73, 0.4); }
.badge.danger { color: var(--danger); border-color: rgba(239, 106, 106, 0.4); }

/* ------------------------------ Analyse des mots de passe --------------- */
.an-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.an-score { font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.an-sec {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.an-sec summary {
  cursor: pointer;
  font-weight: 650;
  display: flex; align-items: center; gap: 8px;
}
.an-sec summary .count {
  margin-left: auto;
  font-size: 0.76rem; color: var(--muted);
  background: var(--panel-2);
  padding: 1px 8px; border-radius: 99px;
}
.an-hint { font-size: 0.78rem; margin: 8px 0 6px; }
.an-none { font-size: 0.85rem; margin: 8px 0 2px; }
.an-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 9px 10px; margin-top: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit; font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.an-item:hover { border-color: var(--border-2); background: rgba(0, 0, 0, 0.28); }
.an-item small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Calendriers / listes déroulantes en mode sombre */
input[type="date"], select { color-scheme: dark; }

/* ------------------------------ Profil ---------------------------------- */
.brand-col { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-size: 0.68rem; font-weight: 500; color: var(--muted); max-width: 180px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-line { font-weight: 600; color: var(--gold-2); min-height: 1em; margin: 0 0 6px; }
.opt { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ------------------------------ Kit de secours -------------------------- */
.kit-code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: 2px;
  text-align: center;
  padding: 16px 12px;
  margin: 6px 0 14px;
  color: var(--gold-2);
  background: rgba(231, 194, 106, 0.08);
  border: 2px dashed rgba(231, 194, 106, 0.5);
  border-radius: 12px;
  user-select: all;
  word-break: break-all;
}
a.btn { text-decoration: none; }

/* ------------------------------ Photos (pièces jointes) ----------------- */
.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.attach-grid:empty { display: none; }
.attach-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-2);
}
.attach-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.attach-thumb .attach-x {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
  cursor: pointer;
}
.attach-thumb .attach-x:hover { background: rgba(182, 59, 59, 0.9); }

#viewer {
  position: fixed; inset: 0; z-index: var(--z-viewer);
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.9);
  animation: fade 0.15s;
  cursor: zoom-out;
}
#viewer img {
  max-width: 94vw; max-height: 92vh;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
#viewer #viewer-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-2);
  color: #fff;
}

/* ------------------------------ Installer l'app ------------------------- */
.install-cta {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--gold-2);
  background: rgba(231, 194, 106, 0.08);
  border: 1px solid rgba(231, 194, 106, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.install-cta:hover { background: rgba(231, 194, 106, 0.15); }

.install-guide {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.install-guide.current {
  background: linear-gradient(135deg, rgba(231, 194, 106, 0.14), rgba(231, 194, 106, 0.05));
  border-color: rgba(231, 194, 106, 0.4);
}
.install-guide h3 { margin: 0 0 6px; font-size: 0.95rem; }
.install-guide ol { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; font-size: 0.9rem; }
.install-guide.current ol { color: var(--text); }

/* ------------------------------ Lien discret ---------------------------- */
.linklike {
  background: none; border: none; padding: 0;
  margin-top: 6px;
  color: var(--gold-2);
  font-family: inherit; font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike:hover { color: var(--gold); }

/* ------------------------------ Accessibilité & finitions --------------- */
/* Anneau de focus clavier visible et cohérent (fini les contours invisibles) */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Les champs gardent leur halo doré ; pas de double contour */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* Placeholders : contraste suffisant (≥ 4.5:1 sur fond sombre) */
::placeholder { color: #8593a6; opacity: 1; }

/* Titres : coupures de ligne équilibrées */
h1, h2, h3 { text-wrap: balance; }

/* Rangées de formulaire : pas de débordement sur petits écrans */
.row { flex-wrap: wrap; }
.row .grow { min-width: 140px; }

/* Respect de « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 820px) {
  .only-mobile { display: inline-flex; }
  .topbar-actions #tab-generator .label { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 63px; bottom: 0; left: 0; width: 250px; z-index: var(--z-sidebar);
    background: var(--bg-2); transform: translateX(-100%); transition: transform 0.22s;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .lock .label { display: none; }
  .entries { max-width: none; }
  /* Cibles tactiles ≥ 44px */
  .icon-btn, .btn, .cat-item, .menu button, .seg button { min-height: 44px; }
}
