/* Dossier d'enquête : interface d'application, claire ou sombre (système, ou choix du joueur).
 *
 * Grand écran (≥ 1200 px) : trois panneaux qui défilent chacun de leur côté.
 * En dessous : un panneau à la fois, choisi dans la barre du bas.
 */

/* ---------- Jetons ---------- */

:root {
  --bg: #f3f1ed;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --surface-3: #efece6;
  --border: #e5e1d9;
  --border-strong: #cdc6b9;
  --text: #1c1a17;
  --text-2: #57524a;
  --text-3: #8a8378;
  --accent: #b4232c;
  --accent-hover: #981c24;
  --accent-soft: #fbeaea;
  --on-accent: #ffffff;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --victim: #6b645c;
  --tint-s: 62%;
  --tint-l: 86%;
  --tint-edge-l: 52%;
  --tint-ink: #1c1a17;
  --shadow-sm: 0 1px 2px rgb(30 25 15 / .06);
  --shadow-md: 0 4px 16px rgb(30 25 15 / .08), 0 1px 3px rgb(30 25 15 / .06);
  --shadow-lg: 0 24px 64px rgb(20 15 10 / .22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --topbar-h: 60px;
  --nav-h: 64px;
  --toolbar-h: 52px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --font-hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #1a1a1d;
    --surface-2: #202024;
    --surface-3: #29292e;
    --border: #2d2d33;
    --border-strong: #3f3f47;
    --text: #edebe7;
    --text-2: #b4b0a9;
    --text-3: #85817a;
    --accent: #f0646c;
    --accent-hover: #ff7f86;
    --accent-soft: rgb(240 100 108 / .14);
    --on-accent: #1a0c0d;
    --danger: #ff7b72;
    --danger-soft: rgb(255 123 114 / .12);
    --ok: #7ccf83;
    --ok-soft: rgb(124 207 131 / .12);
    --victim: #b8b0a6;
    --tint-s: 32%;
    --tint-l: 30%;
    --tint-edge-l: 58%;
    --tint-ink: #f1ede6;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-md: 0 4px 16px rgb(0 0 0 / .35);
    --shadow-lg: 0 24px 64px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #1a1a1d;
  --surface-2: #202024;
  --surface-3: #29292e;
  --border: #2d2d33;
  --border-strong: #3f3f47;
  --text: #edebe7;
  --text-2: #b4b0a9;
  --text-3: #85817a;
  --accent: #f0646c;
  --accent-hover: #ff7f86;
  --accent-soft: rgb(240 100 108 / .14);
  --on-accent: #1a0c0d;
  --danger: #ff7b72;
  --danger-soft: rgb(255 123 114 / .12);
  --ok: #7ccf83;
  --ok-soft: rgb(124 207 131 / .12);
  --victim: #b8b0a6;
  --tint-s: 32%;
  --tint-l: 30%;
  --tint-edge-l: 58%;
  --tint-ink: #f1ede6;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 4px 16px rgb(0 0 0 / .35);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; display: block; }
.muted { color: var(--text-2); }
.small { font-size: .8rem; }
.spacer { flex: 1; }
.ref { font: .72rem var(--font-mono); color: var(--text-3); }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 38px;
  padding: 0 .95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 550;
  font-size: .9rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary.done { background: var(--ok); border-color: var(--ok); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.quiet:hover { color: var(--text); background: var(--surface-3); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.btn.block { width: 100%; height: 44px; }
.btn.sm { height: 30px; padding: 0 .65rem; border-radius: 8px; font-size: .8rem; gap: .35rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- Barre du haut ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--topbar-h);
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 19px var(--font-serif);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / .15);
}
.brand-name { font: 600 1.25rem var(--font-serif); letter-spacing: .01em; }

.case-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 34px;
  padding: 0 .4rem 0 .75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
}
.case-chip:hover { border-color: var(--border-strong); }
.level {
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: .75rem;
  font-weight: 600;
}
.level[data-level="2"] { background: color-mix(in srgb, #d18a00 15%, transparent); color: #b06f00; }
.level[data-level="3"] { background: var(--accent-soft); color: var(--accent); }

.progress { display: flex; gap: .9rem; margin-left: .5rem; color: var(--text-3); font-size: .8rem; min-width: 0; overflow: hidden; }
.progress-item { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }

/* ---------- Chargement ---------- */

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 50vh;
  padding: 2rem 16px;
  color: var(--text-2);
  text-align: center;
}
.status[hidden] { display: none; }
.status.error { color: var(--danger); }
.status.error .spinner { display: none; }
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  max-width: 34rem;
}
.loading-card strong { font-size: 1.05rem; color: var(--text); }
.status.error .loading-card strong { color: var(--danger); }
.loading-card p { margin: 0; line-height: 1.5; }
.loading-card p:empty { display: none; }
.loading-elapsed { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: .85rem; }
.loading-card .spinner { width: 36px; height: 36px; border-width: 3px; margin-bottom: .4rem; }
.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mise en page ---------- */

.layout[hidden] { display: none; }
.pane { min-width: 0; }
.pane-case, .pane-evidence { padding: 16px; }
.pane-board { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 1200px) {
  .layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 340px;
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
  }
  .pane { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  .pane-case { border-right: 1px solid var(--border); }
  .pane-evidence { border-left: 1px solid var(--border); background: var(--surface-2); }
  .pane-board { overflow: hidden; }
  .bottom-nav { display: none; }
  .layout[data-center="timeline"] .view-map,
  .layout[data-center="map"] .view-timeline { display: none; }
}

@media (min-width: 1500px) {
  .layout { grid-template-columns: 340px minmax(0, 1fr) 420px; }
}

@media (max-width: 1199px) {
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .layout { display: block; }
  .pane { display: none; }
  .layout[data-tab="case"] .pane-case,
  .layout[data-tab="evidence"] .pane-evidence,
  .layout[data-tab="timeline"] .pane-board,
  .layout[data-tab="map"] .pane-board { display: flex; flex-direction: column; }
  .layout[data-tab="case"] .pane-case, .layout[data-tab="evidence"] .pane-evidence { display: block; max-width: 760px; margin: 0 auto; }
  .layout[data-tab="timeline"] .view-map,
  .layout[data-tab="map"] .view-timeline { display: none; }
  .board-toolbar .segmented { display: none; }
  .board-toolbar { position: sticky; top: var(--topbar-h); z-index: 5; }
}

@media (max-width: 720px) {
  .hide-sm { display: none; }
  .progress { display: none; }
  .brand-name { display: none; }
  .topbar { gap: .5rem; padding: 0 10px; }
  #accuse span { display: none; }
  #accuse { padding: 0 .7rem; }
  .pane-case, .pane-evidence, .pane-board { padding: 12px; }
  /* Hauteur fixe : les en-têtes de la frise se collent juste en dessous. */
  .board-toolbar { height: var(--toolbar-h); flex-wrap: nowrap; padding: 0 6px; }
  .scrubber { min-width: 0; }
  .map { max-height: 75vh; }
}
@media (max-width: 1100px) and (min-width: 721px) {
  .progress-item.total { display: none; }
}

/* ---------- Barre du bas (petit écran) ---------- */

.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: .72rem;
  font-weight: 600;
}
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button.active .icon { transform: translateY(-1px); }
@media (min-width: 1200px) { .bottom-nav { display: none; } }

/* ---------- Cartes, groupes ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.summary { display: flex; flex-direction: column; gap: 18px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 2px 2px;
}
.eyebrow { display: flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }

.briefing-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.briefing { font: 1.02rem/1.6 var(--font-serif); color: var(--text); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.facts > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.facts dt { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: .9rem; }
.question { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .82rem; color: var(--text-2); }
.tag { padding: .05rem .55rem; border-radius: 999px; background: var(--surface-3); font-weight: 600; font-size: .78rem; color: var(--text); }

.person-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
button.person-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.person-card.focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.person-card.victim { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-head > div { display: flex; flex-direction: column; min-width: 0; }
.person-head strong { font-size: .95rem; }
.role { font-size: .78rem; color: var(--text-3); }
.doubt-count { color: var(--danger); }
.line { display: flex; gap: .45rem; align-items: flex-start; font-size: .85rem; color: var(--text-2); }
.line .icon { margin-top: 3px; }
.line.motive .icon { color: var(--accent); }
.line.secret { font-style: italic; color: var(--text-3); }
.item-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.item-row strong { font-size: .92rem; }
.origin { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-3); }

.banner { display: flex; align-items: center; gap: .6rem; padding: 10px 14px; border-radius: var(--radius); font-weight: 600; font-size: .9rem; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.neutral { background: var(--surface-3); color: var(--text-2); }

/* Avatars et pastilles */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--pawn, var(--text-3));
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar.md { width: 36px; height: 36px; font-size: .8rem; }
.avatar.xs { width: 20px; height: 20px; font-size: .58rem; }
.avatar.victim { background: transparent; color: var(--victim); box-shadow: inset 0 0 0 2px var(--victim); }
.avatar.item { background: var(--surface-3); color: var(--text-2); }
.avatar.accent { background: var(--accent-soft); color: var(--accent); }
.avatar.ok { background: var(--ok-soft); color: var(--ok); }

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .05rem .55rem .05rem .45rem;
  border-radius: 999px;
  background: hsl(var(--room-h) var(--tint-s) var(--tint-l));
  color: var(--tint-ink);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.room-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--room-h) 55% var(--tint-edge-l)); }
.room-chip.dashed { background: transparent; border: 1.5px dashed hsl(var(--room-h) 45% var(--tint-edge-l)); }
.room-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; background: hsl(var(--room-h) var(--tint-s) var(--tint-l)); box-shadow: inset 0 0 0 1.5px hsl(var(--room-h) 45% var(--tint-edge-l)); }
.room-swatch.lg { width: 28px; height: 28px; border-radius: 8px; }

/* ---------- Barre d'outils du tableau ---------- */

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 32px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: .86rem;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.scrubber { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 260px; }
.slot-label { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: 4.8rem; font: 600 1rem var(--font-mono); color: var(--text); }
.death-tag { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-3); color: var(--victim); font: 700 .8rem var(--font-ui); }
.scrubber input[type="range"] {
  flex: 1;
  min-width: 80px;
  height: 6px;
  margin: 0 8px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--surface-3) var(--progress, 0%));
}
.scrubber input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-md);
  cursor: grab;
}
.scrubber input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  cursor: grab;
}

.board-view { min-height: 0; }
@media (min-width: 1200px) {
  .board-view { flex: 1; display: flex; flex-direction: column; }
  .timeline-wrap, .map-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
  .timeline-scroll { flex: 1; min-height: 0; }
  .map-canvas { flex: 1; min-height: 0; }
}
.timeline-wrap, .map-panel { display: flex; flex-direction: column; gap: 10px; }
.board-hint { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--text-2); }
.board-hint strong { font-family: var(--font-mono); color: var(--accent); }

/* ---------- Frise ---------- */

.timeline-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.timeline { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.timeline th, .timeline td { padding: 0; }

.timeline thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font: 600 .72rem var(--font-mono);
  color: var(--text-3);
}
.timeline thead th button {
  width: 100%;
  border: 0;
  background: none;
  padding: .6rem .1rem .5rem;
  color: inherit;
  font: inherit;
  border-radius: 0;
  position: relative;
}
.timeline thead th button:hover { color: var(--text); }
.timeline thead th.selected button { color: var(--accent); }
.timeline thead th.selected button::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.timeline thead th.death-window { background: color-mix(in srgb, var(--victim) 10%, var(--surface)); }
.timeline thead th.death-window button::before { content: "✝"; position: absolute; top: 0; left: 0; right: 0; font-size: .6rem; line-height: 1; color: var(--victim); }
.timeline .corner { position: sticky; left: 0; z-index: 4; text-align: left; padding-left: 14px; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .06em; }

.timeline tr.group th {
  position: sticky;
  left: 0;
  text-align: left;
  padding: .9rem 14px .35rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface);
}
.timeline tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  font-weight: normal;
  padding: 2px 8px 2px 8px;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 8px -6px rgb(0 0 0 / .15);
}
.row-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  max-width: 168px;
  padding: .3rem .4rem;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-size: .84rem;
  white-space: nowrap;
}
button.row-label:hover { background: var(--surface-3); }
.row-label.static { font-size: .8rem; color: var(--text-2); }
.row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.row-name { overflow: hidden; text-overflow: ellipsis; }
.row-text small { color: var(--text-3); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; }
.sensor-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--text-3); }
tr.focused .row-label { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
tr.focused td.cell button { box-shadow: inset 0 -2px 0 var(--accent); }

.timeline td { text-align: center; padding: 2px 1.5px; }
.timeline td.selected { background: color-mix(in srgb, var(--accent) 7%, transparent); }

.timeline td.cell button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: 600 .74rem var(--font-mono);
  line-height: 1.15;
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.timeline td.cell button:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 1; }
.timeline td.sure button { background: hsl(var(--room-h) var(--tint-s) var(--tint-l)); color: var(--tint-ink); border-color: transparent; font-weight: 700; }
.timeline td.claimed button {
  background: repeating-linear-gradient(135deg, hsl(var(--room-h) var(--tint-s) var(--tint-l) / .7) 0 4px, transparent 4px 8px), var(--surface);
  border: 1.5px dashed hsl(var(--room-h) 45% var(--tint-edge-l));
  color: var(--tint-ink);
  font-style: italic;
}
.timeline td.conflict button { border: 2px solid var(--danger); background: var(--danger-soft); color: var(--danger); font-size: .6rem; letter-spacing: -.02em; }
.timeline td.doubted .abbr { text-decoration: line-through; color: var(--text-3); }
.timeline td.noted button { border-style: dotted; border-color: hsl(var(--room-h) 45% var(--tint-edge-l)); }
.timeline td.death button { box-shadow: inset 0 0 0 2px var(--victim); }
.timeline td.selected.cell button { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: -1px; }
.timeline .flag {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font: 700 .65rem var(--font-ui);
}
.timeline .note { font: .7rem var(--font-hand); color: hsl(var(--room-h) 50% 38%); }
:root[data-theme="dark"] .timeline .note { color: hsl(var(--room-h) 60% 72%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .timeline .note { color: hsl(var(--room-h) 60% 72%); }
}

.timeline tr.sensor td { height: 1.6rem; }
.sensor-bar { display: block; height: 6px; margin: 0 1px; border-radius: 3px; }
.timeline td.sensor-cell.on .sensor-bar { background: color-mix(in srgb, var(--ok) 55%, transparent); }
.timeline td.sensor-cell.off .sensor-bar { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 5px); }
.timeline td.sensor-cell.unknown .sensor-bar { height: 0; border-top: 2px dotted var(--border-strong); background: none; margin-top: 2px; }

/* Frise transposée (écran étroit) : une ligne par tranche, une colonne par entité du groupe choisi.
 * Rien ne défile horizontalement : les en-têtes se collent à la page, sous la barre de l'heure. */

.timeline-groups { display: flex; }
.timeline-groups button { flex: 1; justify-content: center; gap: .35rem; padding: 0 .4rem; height: 36px; font-size: .82rem; }
.timeline-groups .count { font-size: .7rem; font-weight: 600; color: var(--text-3); }
.timeline-groups button.active .count { color: var(--accent); }

.timeline-wrap.compact .timeline-scroll { overflow: visible; }
.timeline.compact { width: 100%; table-layout: fixed; }
.timeline.compact thead th {
  top: calc(var(--topbar-h) + var(--toolbar-h));
  vertical-align: bottom;
  padding: 6px 1px 4px;
  font-family: var(--font-ui);
}
.timeline.compact thead th:first-child { border-top-left-radius: var(--radius); }
.timeline.compact thead th:last-child { border-top-right-radius: var(--radius); }
.timeline.compact .corner { width: 3.3rem; padding: 0 0 10px; text-align: center; color: var(--text-3); }
.col-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
}
button.col-label:hover { background: var(--surface-3); }
.col-label[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.col-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-width: 100%;
  overflow: hidden;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  hyphens: auto;
}
.col-name.single { display: block; white-space: nowrap; text-overflow: ellipsis; }
.timeline.compact .corner .icon { display: block; margin: 0 auto; }

.sensor-key { gap: .35rem 1rem; }
.key-bar { display: inline-block; width: 6px; height: 1rem; border-radius: 3px; }
.key-bar.on { background: color-mix(in srgb, var(--ok) 55%, transparent); }
.key-bar.off { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 5px); }
.key-bar.unknown { width: 0; border-left: 2px dotted var(--border-strong); border-radius: 0; }

.timeline.compact tbody th[scope="row"] { position: static; padding: 0; box-shadow: none; }
.timeline.compact tbody th button {
  position: relative;
  width: 100%;
  height: 2.6rem;
  border: 0;
  background: none;
  font: 600 .72rem var(--font-mono);
  color: var(--text-3);
}
.timeline.compact tr.selected th button { color: var(--accent); }
.timeline.compact tr.selected th button::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.timeline.compact tr.death-window th { background: color-mix(in srgb, var(--victim) 10%, var(--surface)); }
.timeline.compact tr.death-window th button::after { content: "✝"; position: absolute; top: 2px; right: 4px; font: .6rem var(--font-ui); color: var(--victim); }

.timeline.compact td { padding: 2px; }
.timeline.compact td.cell button { width: 100%; height: 2.4rem; font-size: .72rem; }
.timeline.compact td.cell button:hover { transform: none; }
.timeline.compact td.focused button { box-shadow: inset 0 -2px 0 var(--accent); }
.timeline.compact td.death button { box-shadow: inset 0 0 0 2px var(--victim); }
.timeline.compact td.sensor-cell { height: 2.6rem; padding: 0; }
.timeline.compact .sensor-bar { width: 6px; height: 100%; margin: 0 auto; }
.timeline.compact td.sensor-cell.unknown .sensor-bar { width: 0; height: 100%; margin: 0 auto; border-top: 0; border-left: 2px dotted var(--border-strong); }

.room-key { gap: .35rem .75rem; color: var(--text-2); }
.legend-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.legend-box > summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: 10px 12px;
  list-style: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.legend-box > summary::-webkit-details-marker { display: none; }
.legend-box > :not(summary) { margin: 0 12px 12px; }

/* Légendes */

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; font-size: .78rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.legend-item.rooms { gap: .35rem .75rem; flex-wrap: wrap; flex-basis: 100%; color: var(--text-3); }
.abbr-key b { display: inline-block; padding: 0 .35rem; border-radius: 4px; background: hsl(var(--room-h) var(--tint-s) var(--tint-l)); color: var(--tint-ink); font: 600 .7rem var(--font-mono); }
.swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.4rem;
  padding: 0 .35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: 600 .7rem var(--font-mono);
  color: var(--text);
}
.swatch.sure { background: hsl(var(--room-h) var(--tint-s) var(--tint-l)); border-color: transparent; color: var(--tint-ink); }
.swatch.claimed {
  background: repeating-linear-gradient(135deg, hsl(var(--room-h) var(--tint-s) var(--tint-l) / .7) 0 4px, transparent 4px 8px);
  border: 1.5px dashed hsl(var(--room-h) 45% var(--tint-edge-l));
  font-style: italic;
}
.swatch.conflict { border: 2px solid var(--danger); color: var(--danger); background: var(--danger-soft); min-width: 1.4rem; }
.swatch.doubted { text-decoration: line-through; color: var(--text-3); }
.swatch.noted { font-family: var(--font-hand); border-style: dotted; font-weight: 400; }
.swatch.death { box-shadow: inset 0 0 0 2px var(--victim); color: var(--victim); min-width: 1.4rem; }

.pawn-key { width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); }
.pawn-key.claimed { background: transparent; border: 2px dashed var(--text-2); }
.pawn-key.note { background: transparent; border: 1px solid var(--text-2); opacity: .8; }
.pawn-key.conflict { background: transparent; border: 3px solid var(--danger); }

/* ---------- Plan ---------- */

.map-canvas {
  display: flex;
  padding: 12px;
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 20px 20px,
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.map { width: 100%; height: 100%; max-height: 640px; display: block; }
.map .passage line { stroke: var(--border-strong); stroke-width: 7; stroke-linecap: round; }
.map .passage text { fill: var(--text-2); font: 600 11px var(--font-ui); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.map .room-box { fill: hsl(var(--room-h) var(--tint-s) var(--tint-l)); stroke: hsl(var(--room-h) 40% var(--tint-edge-l)); stroke-width: 1.5; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .08)); }
.map .room.scene .room-box { stroke: var(--victim); stroke-width: 3; stroke-dasharray: 7 4; }
.map .room-name { fill: var(--tint-ink); font: 700 14px var(--font-ui); }
.map .sensor { font: 600 10px var(--font-ui); fill: var(--ok); }
.map .sensor.off { fill: var(--text-3); }
.map .sensor.unknown { fill: var(--text-3); font-style: italic; }
.map .items { fill: var(--tint-ink); font: italic 11px var(--font-ui); opacity: .85; }
.map .pawn circle { fill: var(--pawn); stroke: var(--surface); stroke-width: 2.5; }
.map .pawn text { fill: #fff; font: 700 10px var(--font-ui); pointer-events: none; }
.map .pawn.claimed circle { fill: var(--surface); stroke: var(--pawn); stroke-width: 2.5; stroke-dasharray: 4 2.5; }
.map .pawn.claimed text, .map .pawn.note text { fill: var(--pawn); }
.map .pawn.note circle { fill: var(--surface); stroke: var(--pawn); stroke-width: 1.2; opacity: .85; }
.map .pawn.conflict circle { stroke: var(--danger); stroke-width: 3.5; }
.map .pawn { transition: opacity .2s; }

/* ---------- Dossier ---------- */

.evidence { display: flex; flex-direction: column; gap: 12px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pane-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.count { font-size: .75rem; font-weight: 600; color: var(--text-3); background: var(--surface-3); padding: .05rem .5rem; border-radius: 999px; }
.evidence-tools { display: flex; flex-direction: column; gap: 8px; position: sticky; top: -16px; z-index: 2; margin: 0 -16px; padding: 8px 16px; background: inherit; }
@media (min-width: 1200px) { .evidence-tools { background: var(--surface-2); } }
@media (max-width: 1199px) { .evidence-tools { top: var(--topbar-h); background: var(--bg); } }
.search {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 30px;
  padding: 0 .75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 600;
}
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip-btn.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; }
.focus-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 30px;
  padding: 0 .55rem 0 .75rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
}

.evidence-list { display: flex; flex-direction: column; gap: 10px; }
.ev-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ev-group > summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  font-size: .9rem;
  border-radius: var(--radius);
}
.ev-group > summary::-webkit-details-marker { display: none; }
.ev-group > summary:hover { background: var(--surface-2); }
.group-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.group-name { flex: 1; min-width: 0; }
.caret { color: var(--text-3); transition: transform .15s; }
.ev-group[open] .caret { transform: rotate(90deg); }
.ev-body { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }

.ev-card { padding: 9px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; }
.ev-card.trace { border-left: 3px solid var(--ok); }
.ev-card.claim { border-left: 3px solid var(--border-strong); }
.ev-card.doubted { border-left-color: var(--danger); background: var(--danger-soft); }
.ev-card.doubted .text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--text-2); }
.ev-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: 4px; }
.ev-meta .doubt-btn { margin-left: auto; }
.ev-period { display: flex; align-items: flex-start; gap: .45rem; font-size: .82rem; color: var(--text-2); padding: 2px 0 4px; }
.ev-period .icon { margin-top: 3px; color: var(--ok); }
.ev-period .ref { margin-left: auto; }

.time-btn {
  height: 22px;
  padding: 0 .45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: 600 .72rem var(--font-mono);
  color: var(--text-2);
}
.time-btn:hover { border-color: var(--accent); color: var(--accent); }
.time-btn.selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.records { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.records li { display: flex; align-items: flex-start; gap: .6rem; padding: 3px 0; }
.records .time-btn { margin-top: 2px; flex: none; }
.record-people { display: flex; flex-wrap: wrap; gap: 4px; }
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 26px;
  padding: 0 .55rem 0 .2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .8rem;
  white-space: nowrap;
}

.doubt-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 26px;
  padding: 0 .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.doubt-btn:hover { border-color: var(--danger); color: var(--danger); }
.doubt-btn.on { background: var(--danger); border-color: var(--danger); color: #fff; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; text-align: center; color: var(--text-3); font-size: .9rem; }
.empty-state.small { padding: .75rem; font-size: .85rem; align-items: flex-start; text-align: left; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; }

/* ---------- Fenêtres ---------- */

dialog.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
dialog.sheet.wide { width: min(780px, calc(100vw - 32px)); }
dialog.sheet[open] { animation: rise .2s ease-out; }
dialog::backdrop { background: rgb(10 8 6 / .5); backdrop-filter: blur(3px); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

@media (max-width: 640px) {
  dialog.sheet, dialog.sheet.wide {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 0;
  }
  @keyframes rise { from { transform: translateY(40px); opacity: .6; } }
}

.sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sheet-title h2 { font-size: 1.2rem; }
.sheet-title .muted { font-size: .86rem; }
.sheet-section { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 14px; }

.slot-nav { display: flex; align-items: center; gap: 2px; margin-left: -6px; }
.slot-now { display: inline-flex; align-items: center; gap: .35rem; font: 600 .9rem var(--font-mono); color: var(--accent); padding: 0 .25rem; }

.cell-marks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mark { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.mark.sure { border-left: 3px solid var(--ok); }
.mark.doubted { background: var(--danger-soft); border-left: 3px solid var(--danger); }
.mark.doubted .mark-text { text-decoration: line-through; color: var(--text-2); }
.mark-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.mark-head .ref { margin-left: auto; }
.mark-text { font-size: .9rem; }
.mark .doubt-btn { align-self: flex-start; }
.kind-tag { font-size: .72rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; }
.kind-tag.trace { background: var(--ok-soft); color: var(--ok); }
.kind-tag.claim { background: var(--surface-3); color: var(--text-2); }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.room-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: .88rem;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.room-option:hover { border-color: hsl(var(--room-h) 45% var(--tint-edge-l)); background: hsl(var(--room-h) var(--tint-s) var(--tint-l) / .35); }
.room-option.chosen { border: 2px solid hsl(var(--room-h) 50% var(--tint-edge-l)); background: hsl(var(--room-h) var(--tint-s) var(--tint-l)); color: var(--tint-ink); }

/* Formulaires (choix d'affaire, accusation) */

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.field > span, .field > legend { font-size: .82rem; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 6px; }
.field input[type="number"] {
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: 600 1.05rem var(--font-mono);
}
.field input[type="number"]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.level-grid, .option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.size-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.size-grid .field > span { margin-bottom: 0; }
.size-grid small { font-size: .75rem; }
.size-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--warning, #b08a1e);
  background: color-mix(in srgb, var(--warning, #b08a1e) 12%, transparent);
  color: var(--text);
  font-size: .85rem;
  line-height: 1.45;
}
.size-warning[hidden] { display: none; }
.size-warning svg { flex: none; margin-top: 2px; color: var(--warning, #b08a1e); }
.option-grid.motives { grid-template-columns: 1fr; }
.option-card { position: relative; display: block; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-body {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .9rem;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.level-grid .option-body { flex-direction: column; align-items: flex-start; gap: 4px; }
.level-grid .option-body small { color: var(--text-3); font-size: .78rem; }
.option-card:hover .option-body { border-color: var(--border-strong); }
.option-card input:checked + .option-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.option-card input:focus-visible + .option-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-body .icon { color: var(--accent); }
.level-dots { display: inline-flex; gap: 3px; }
.level-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.level-dots[data-level="1"] i:nth-child(-n+1),
.level-dots[data-level="2"] i:nth-child(-n+2),
.level-dots[data-level="3"] i:nth-child(-n+3) { background: var(--accent); }

.step { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step legend { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.step-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--surface); font-size: .72rem; }

.accuse-summary { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.accuse-sentence { font: 1.02rem/1.6 var(--font-serif); }
.accuse-sentence .blank { display: inline-block; min-width: 3rem; border-bottom: 2px dotted var(--border-strong); color: var(--text-3); }
.verdict { min-height: 1.2em; font-size: .86rem; color: var(--text-2); }
.verdict.wrong { color: var(--danger); font-weight: 600; }
.shake { animation: shake .4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.reveal.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.reveal .accuse-sentence { font-size: 1.15rem; }

/* Interrogatoires et fouilles (M8) */

.inquiry-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.inquiry-hint { font-size: .84rem; color: var(--text-2); }
.inquiry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.inquiry-list + .inquiry-list { border-top: 1px solid var(--border); padding-top: 8px; }
.inquiry-list li { display: flex; align-items: center; gap: .55rem; min-height: 36px; }
.inquiry-name { font-weight: 600; font-size: .88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inquiry-count { flex: 1; display: inline-flex; justify-content: flex-end; align-items: center; gap: .25rem; font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.questions { display: flex; flex-direction: column; gap: 8px; }
.question-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.question-label { font: 600 .95rem var(--font-serif); }
.question-row select { height: 38px; min-width: 0; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.question-row select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 640px) {
  .question-row { grid-template-columns: minmax(0, 1fr) auto; }
  .question-label { grid-column: 1 / -1; }
}

.answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qa { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); background: var(--surface-2); display: flex; flex-direction: column; gap: 5px; }
.qa.fresh { border-left-color: var(--accent); animation: rise .2s ease-out; }
.qa .q { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .86rem; color: var(--text-2); }
.qa .reply { font-size: .9rem; }
.qa .reply.muted { font-style: italic; }

/* Aide */

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: rule; }
.rules li { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.rules strong { display: block; margin-bottom: 2px; }
.rules p, .how p { font-size: .87rem; color: var(--text-2); }
.rule-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--accent-soft); color: var(--accent); }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.how li { display: flex; gap: 10px; }
.how li > .icon { margin-top: 3px; color: var(--text-3); }

/* ---------- Notifications ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
@media (max-width: 1199px) { .toasts { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); } }
.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--surface);
  font-size: .88rem;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease-out;
  transition: opacity .3s, transform .3s;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(8px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
