/* public/app.css — Design system hermes-apps.
   Dark only, une seule police, densité élevée assumée. Desktop et téléphone
   sont deux mises en page du même contenu : barre en haut sur l'un, barre en
   bas sur l'autre, jamais de contenu tronqué. */

:root {
  --bg: #0f1117;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --border: #27272a;
  --border-strong: #3f3f46;
  --fg: #e4e4e7;
  --muted: #a1a1aa;
  --accent: #60a5fa;
  --accent-hover: #7cb4fb;
  --on-accent: #0b1220;
  --danger: #ef4444;
  --danger-text: #f87171; /* --danger fails AA on small text over tinted bg */
  --ok: #22c55e;
  --warn: #f59e0b;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', SFMono-Regular, monospace;
  --radius: 6px;
  --nav-h: 52px;
  --tap: 44px; /* cible tactile minimale */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }

code, pre { font-family: var(--mono); font-size: .9em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Mouvement réduit : on garde les fondus, on retire les déplacements. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .toast, .modal, .nav-more-sheet, .btn, .nav-item { transform: none !important; }
}

/* Survol réservé aux pointeurs fins : sur tactile, un tap laisse le hover collé. */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; }
  .nav-item:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
  .btn:hover { background: var(--surface-2); text-decoration: none; }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
  .table tr:hover td { background: rgba(255,255,255,.025); }
  .feed-item:hover { background: rgba(255,255,255,.025); text-decoration: none; }
}

/* ── Layout ────────────────────────────────────── */

.layout { display: flex; flex-direction: column; min-height: 100dvh; }

.main {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── Navigation ────────────────────────────────── */

.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .15rem;
  height: var(--nav-h);
  padding: 0 .75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-item {
  color: var(--muted);
  padding: .4rem .6rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: color 120ms var(--ease-out), background-color 120ms var(--ease-out), transform 160ms var(--ease-out);
}

.nav-item:active { transform: scale(.97); }
.nav-item.active { color: var(--fg); background: var(--border); }

.nav-spacer { flex: 1; }

.nav-brand { display: flex; margin-right: .6rem; border-radius: 50%; }
.nav-brand img { border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong); }

/* Pastille de non-lus : après le libellé sur desktop, posée sur l'icône sur téléphone */
.nav-dot {
  order: 1;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.nav-dot:empty { display: none; }

/* Sur grand écran tout tient dans la barre : pas de « Plus », pas de feuille. */
.nav-more, .nav-more-sheet { display: none; }

/* ── Icônes ────────────────────────────────────── */

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 28px; height: 28px; }

/* ── En-tête de page ───────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
  min-height: var(--tap);
  flex-wrap: wrap;
}
.page-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.page-subtitle { color: var(--muted); font-size: .8rem; }
.page-header .spacer { flex: 1; }
.page-header > .icon { color: var(--accent); }

/* ── Carte ─────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 0;
}

.card-flush { padding: 0; overflow: hidden; }
.card-danger { border-color: var(--danger); color: var(--danger-text); }

.card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  font-weight: 600;
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.card-header .spacer { flex: 1; }
.card-header .icon { width: 14px; height: 14px; }
/* Le libellé d'en-tête est en capitales ; ses boutons ne doivent pas en hériter. */
.card-header .btn { text-transform: none; letter-spacing: normal; font-weight: 400; }

/* ── Bouton ────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .4rem .8rem;
  min-height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), color 120ms var(--ease-out), transform 160ms var(--ease-out);
  white-space: nowrap;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }

.btn-danger { border-color: rgba(239,68,68,.5); color: var(--danger-text); }

.btn-sm { padding: .25rem .55rem; min-height: 30px; font-size: .8rem; }
.btn-icon { padding: .35rem; min-width: 32px; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Champ ─────────────────────────────────────── */

.input {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 1rem; /* < 16px déclenche un zoom automatique sur iOS */
  padding: .45rem .65rem;
  font-family: inherit;
  width: 100%;
  min-height: 36px;
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.input:focus { border-color: var(--accent); }
.input:focus-visible { box-shadow: 0 0 0 1px var(--accent); }
.input::placeholder { color: var(--muted); }

textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
select.input {
  appearance: none;
  padding-right: 1.75rem;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .55rem center;
}

.input-group { display: flex; gap: .5rem; align-items: flex-start; }
.input-group .input { flex: 1; }

.form-row { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.form-label { font-size: .8rem; color: var(--muted); }

/* ── Barre d'outils ────────────────────────────── */

.toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar .spacer { flex: 1; }
.toolbar .btn { min-height: 36px; } /* aligned with .input */
.divider-v { width: 1px; height: 16px; background: var(--border-strong); margin: 0 .25rem; }

/* ── Tableau ───────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left;
  padding: .5rem .7rem;
  color: var(--muted);
  font-weight: 500;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child > * { border-bottom: none; }
.table td { transition: background-color 120ms var(--ease-out); }
/* En-tête de ligne (tableaux clé/valeur) : pas le style des en-têtes de colonne */
.table tbody th {
  text-transform: none;
  letter-spacing: normal;
  font-size: .8rem;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table .actions { display: flex; gap: .3rem; justify-content: flex-end; }
.table .col-num { text-align: right; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Un tableau large scrolle dans son conteneur, la page ne part jamais de côté */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-fixed { table-layout: fixed; }

/* ── Étiquette ─────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-ok { background: rgba(34,197,94,.15); color: var(--ok); }
.badge-warn { background: rgba(245,158,11,.15); color: var(--warn); }
.badge-danger { background: rgba(239,68,68,.15); color: var(--danger-text); }
.badge-muted { background: var(--border); color: var(--muted); }
.badge-accent { background: rgba(96,165,250,.15); color: var(--accent); }

/* ── Fil d'événements ──────────────────────────── */

.feed { display: flex; flex-direction: column; }

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background-color 120ms var(--ease-out);
}
.feed-item:last-child { border-bottom: none; }

.feed-icon {
  color: var(--muted);
  margin-top: .15rem;
  flex-shrink: 0;
}
.feed-item[data-kind="page"] .feed-icon { color: var(--accent); }
.feed-item[data-kind="reply"] .feed-icon { color: var(--ok); }
.feed-item[data-kind="file"] .feed-icon { color: var(--warn); }

.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: .9rem; font-weight: 500; }
.feed-meta {
  font-size: .76rem;
  color: var(--muted);
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .1rem;
  font-variant-numeric: tabular-nums;
}
.feed-item.is-new .feed-title::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: .4rem;
  vertical-align: middle;
}

/* ── Vide ──────────────────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
  text-wrap: pretty;
}
.empty .icon { color: var(--border-strong); }

/* ── Statistiques ──────────────────────────────── */

.stats { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.stat-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ── Toast ─────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  right: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: min(380px, 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  pointer-events: auto;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
/* Transitions plutôt que keyframes : plusieurs toasts d'affilée restent interruptibles. */
.toast[data-state="enter"] { opacity: 0; transform: translateY(8px); }
.toast[data-state="exit"] { opacity: 0; transform: translateY(4px); transition-duration: 150ms; }
.toast-ok { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warn { border-left: 3px solid var(--warn); }

/* ── Modale ────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  z-index: 1000;
  transition: opacity 200ms var(--ease-out);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.modal-overlay[data-state] { opacity: 0; }
.modal-overlay[data-state] .modal { opacity: 0; transform: scale(.96); }
.modal-overlay[data-state="exit"],
.modal-overlay[data-state="exit"] .modal { transition-duration: 150ms; pointer-events: none; }
.modal-title { font-weight: 500; margin-bottom: 1rem; text-wrap: balance; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.modal-actions .btn { min-height: var(--tap); }

/* ── Zone de dépôt ─────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.drop-zone.drag-over { border-color: var(--accent); background: rgba(96,165,250,.05); color: var(--accent); }

/* ── Progression ───────────────────────────────── */

.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.progress-bar-fill.is-done { background: var(--ok); }
.progress-bar-fill.is-error { background: var(--danger); }

/* ── Journal ───────────────────────────────────── */

.log-entry {
  display: flex;
  gap: .75rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  font-family: var(--mono);
}
.log-entry:last-child { border-bottom: none; }
.log-ts { color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.log-module { color: var(--accent); flex-shrink: 0; width: 80px; overflow: hidden; text-overflow: ellipsis; }
.log-level { flex-shrink: 0; width: 45px; }
.log-level-info  { color: var(--fg); }
.log-level-debug { color: var(--muted); }
.log-level-warn  { color: var(--warn); }
.log-level-error { color: var(--danger); }
.log-msg { flex: 1; word-break: break-all; }

/* ── Journal : conteneur défilant + témoin de flux ─────────────── */

.logs-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 75vh;
  overflow: auto;
  padding: .5rem .75rem;
  font-family: var(--mono);
  -webkit-overflow-scrolling: touch;
}
.logs-container .empty { font-family: var(--font); }

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  animation: blink 1.2s ease infinite;
}
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* ── Items eat ─────────────────────────────────── */

.eat-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity 200ms var(--ease-out);
}
.eat-item.consumed { opacity: .65; }
.eat-item-body { flex: 1; min-width: 0; }
.eat-item-title { font-weight: 500; margin-bottom: .2rem; }
.eat-item-meta { font-size: .75rem; color: var(--muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.eat-item-preview { font-size: .82rem; color: var(--muted); margin-top: .35rem; white-space: pre-wrap; word-break: break-word; max-height: 4.5em; overflow: hidden; }

/* ── Utilitaires ───────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; align-items: center; gap: .5rem; }

.muted { color: var(--muted); }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.accent { color: var(--accent); }

.text-sm { font-size: .8rem; }
.text-xs { font-size: .72rem; }
.text-mono { font-family: var(--mono); }
.text-num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sortie d'une ligne supprimée — voir animateOut() dans app.js */
tr[data-state="exit"], .eat-item[data-state="exit"], .feed-item[data-state="exit"] {
  opacity: 0;
  transition: opacity 150ms var(--ease-out);
}

/* ── Readme ────────────────────────────────────── */

.markdown-body { font-size: .875rem; line-height: 1.7; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1rem 0 .5rem; font-weight: 600; }
.markdown-body h1 { font-size: 1.2rem; }
.markdown-body h2 { font-size: 1.05rem; }
.markdown-body h3 { font-size: .95rem; }
.markdown-body p { margin-bottom: .6rem; }
.markdown-body ul, .markdown-body ol { margin: .4rem 0 .6rem 1.5rem; }
.markdown-body li { margin-bottom: .2rem; }
.markdown-body code { background: var(--border); padding: .1rem .3rem; border-radius: 3px; font-family: var(--mono); }
.markdown-body pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; overflow: auto; margin-bottom: .75rem; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.markdown-body table { width: 100%; display: block; overflow-x: auto; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.code-block { background: var(--bg); padding: .5rem; border-radius: var(--radius); overflow: auto; }

kbd {
  background: var(--border);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: .05rem .35rem;
  font-size: .75rem;
  font-family: var(--mono);
  color: var(--muted);
}

/* ── Téléphone ─────────────────────────────────────────────────────────
   La barre passe en bas : c'est là que le pouce arrive. Les entrées
   secondaires basculent dans une feuille dépliable pour tenir en 5 colonnes. */

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .main {
    padding: 1rem .875rem calc(var(--nav-h) + 1.5rem + env(safe-area-inset-bottom));
  }

  .nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding: 0 .25rem env(safe-area-inset-bottom);
    border-bottom: none;
    border-top: 1px solid var(--border);
    justify-content: space-around;
    gap: 0;
  }

  .nav-spacer, .nav-brand { display: none; }

  .nav-item {
    flex-direction: column;
    gap: .15rem;
    font-size: .65rem;
    padding: .35rem .25rem;
    min-width: var(--tap);
    min-height: var(--tap);
    justify-content: center;
    flex: 1;
    max-width: 5rem;
  }

  .nav-item .icon { width: 19px; height: 19px; }
  .nav-item.active { background: none; color: var(--accent); }
  .nav-dot { position: absolute; order: 0; top: .1rem; left: 50%; margin-left: 2px; }

  /* Entrées secondaires : masquées dans la barre, listées dans la feuille */
  .nav-item[data-secondary] { display: none; }
  .nav-more { display: flex; }

  /* La feuille glisse depuis derrière la barre, qui la déclenche. */
  .nav-more-sheet {
    display: grid;
    visibility: hidden;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out), visibility 0s 180ms;
    position: fixed;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: .5rem;
    z-index: 99;
    grid-template-columns: repeat(4, 1fr);
    gap: .25rem;
  }
  .nav-more-sheet.open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: transform 240ms var(--ease-out), opacity 240ms var(--ease-out), visibility 0s;
  }
  .nav-more-sheet .nav-item { display: flex; max-width: none; padding: .6rem .25rem; }

  .page-header { margin-bottom: 1rem; }
  .page-header input.input { max-width: none !important; width: 100%; }
  .page-header .btn-row { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: .875rem; }
  .card-flush { padding: 0; }
  .toolbar > form, .toolbar .input-group { width: 100%; max-width: none !important; }

  /* Les éléments secondaires cèdent avant que la page ne scrolle de côté */
  .hide-sm { display: none !important; }
  .table th, .table td { padding: .55rem .5rem; }
  .btn, .toolbar .btn, .input { min-height: var(--tap); }
  .btn-icon { min-width: var(--tap); }

  .log-entry { flex-wrap: wrap; gap: 0 .5rem; }
  .log-msg { flex-basis: 100%; }

  #toast-container { align-items: stretch; bottom: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
