/* Système visuel Itema : voir DESIGN.md */
:root {
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --surface-2: #F1F1F3;
  --line: #E7E7EA;
  --line-strong: #D6D6DB;
  --ink: #1B1B1F;
  --ink-2: #62626B;
  --accent: #2460D6;
  --accent-soft: #E4EDFB;
  --ok: #17804D;
  --ok-soft: #E3F3EA;
  --warn: #A15C00;
  --danger: #C62828;
  --danger-soft: #FBE9E9;
  --radius-panel: 14px;
  --radius-field: 10px;
  --sidebar-width: 248px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Bootstrap anime tout défilement : la page ne doit pas bouger sous le doigt du répondant. */
:root { scroll-behavior: auto; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); }
input, textarea, button, select { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 1; }
input:focus, textarea:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
button, a, summary, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:not(:disabled):active { filter: brightness(.94); }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(.97); }
}
button:disabled { cursor: default; opacity: .55; }

/* ─── Icônes ───────────────────────────────────────────────────── */
.icon {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 40px; height: 40px; }

.btn-label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn.is-danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.has-border { background: var(--surface); border: 1px solid var(--line-strong); }

/* Le menu ne concerne que l'espace d'administration */
body:not(:has(#main-sidebar)) #hamburger-btn { display: none !important; }

/* ─── Marque ───────────────────────────────────────────────────── */
.brand-logo { display: block; width: auto; height: 32px; }
.brand-mark { flex: none; width: 28px; height: 28px; }

/* ─── Barre latérale ───────────────────────────────────────────── */
#main-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: var(--sidebar-width);
  padding: 16px 12px;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
#main-sidebar > * { flex: none; }
.sidebar-brand { padding: 0 6px 12px; }
.sidebar-new {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-bottom: 12px;
  padding: 0 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.sidebar-new:hover { color: var(--ink); background: var(--surface-2); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
}
.nav-item span:last-child { overflow: hidden; text-overflow: ellipsis; }
.nav-item .icon { color: var(--ink-2); }
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.is-active { font-weight: 500; background: #EAEAED; }
.sidebar-heading { margin: 16px 0 4px; padding: 0 10px; font-size: 12px; color: var(--ink-2); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sidebar-user-name { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 12px; color: var(--ink-2); }

/* ─── En-tête de page ──────────────────────────────────────────── */
.page-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 60px;
  margin: 0 -28px 20px;
  padding: 10px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-top:not(:has(.search-pill)) { grid-template-columns: minmax(0, 1fr) auto; }
.page-top:not(:has(.search-pill)) > div:nth-child(2) { display: none; }
.page-top-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.page-top-actions:empty { display: none; }
.page-note { margin: -8px 0 16px; font-size: 13px; color: var(--ink-2); }
.page-note a { font-weight: 500; text-decoration: none; }

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
}
.search-pill:focus-within { background: var(--surface); border-color: var(--accent); }
.search-pill input {
  flex: 1;
  min-width: 0;
  padding: 0;
  font-size: 14px;
  color: var(--ink);
  background: transparent !important;
  border: 0;
  outline: none;
}

/* ─── Grille ───────────────────────────────────────────────────── */
.sheet-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.sheet th {
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.sheet th:first-child, .sheet td:first-child { border-left: 0; }
.sheet-head { display: inline-flex; align-items: center; gap: 6px; }
.sheet-head .icon { width: 14px; height: 14px; color: var(--ink-2); }
.sheet td {
  height: 44px;
  padding: 8px 12px;
  vertical-align: middle;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.sheet tbody tr:last-child td { border-bottom: 0; }
.sheet tbody tr:not(.sheet-section):hover td { background: #FAFAFB; }
.sheet .num { width: 44px; color: var(--ink-2); text-align: center; }
.sheet .is-sticky { position: sticky; left: 0; z-index: 1; }
.sheet .cell-actions { width: 1%; white-space: nowrap; }
.sheet .is-sticky-end { position: sticky; right: 0; z-index: 1; }
.sheet:not(.sheet-stack) td { white-space: nowrap; }
.sheet:not(.sheet-stack) td.cell-main { min-width: 320px; white-space: normal; }
#questions-list-container td { white-space: normal; }
#questions-list-container .sheet .chip, #questions-list-container .mono, #questions-list-container td > .muted { white-space: nowrap; }
#questions-list-container .cell-main { min-width: 200px; }
#questions-list-container .sheet th, #questions-list-container .sheet td { padding-right: 8px; padding-left: 8px; }
.sheet .cell-actions > div { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.sheet .cell-main { min-width: 240px; }
.sheet .cell-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title { font-weight: 500; color: var(--ink); text-decoration: none; }
.cell-title:hover { color: var(--accent); }
.cell-sub { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.sheet-section td { height: 36px; font-size: 13px; font-weight: 600; background: var(--bg); scroll-margin-top: 70px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--ink-2); }
tr.has-row-action { position: relative; cursor: pointer; }

.scroll-hint { display: none; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.sheet-wrap { overscroll-behavior-x: contain; }
.sheet-more { display: flex; justify-content: center; margin-top: 12px; }

/* ─── Chips ────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  background: var(--surface-2);
  border-radius: 999px;
}
.chip .icon { width: 13px; height: 13px; color: var(--ink-2); }
.chip-ok { color: var(--ok); background: var(--ok-soft); }
.chip-active { color: var(--accent); background: var(--accent-soft); }
.chip-danger { color: var(--danger); background: var(--danger-soft); }
.chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ─── Statistiques ─────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin-bottom: 24px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; }
.stat { padding: 14px 18px; background: var(--surface); }
.stat-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.section-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; }

/* ─── Onglets ──────────────────────────────────────────────────── */
.pill-tabs { display: flex !important; gap: 4px; width: fit-content; height: auto !important; margin-bottom: 16px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.pill-tabs .pill-tab {
  width: auto !important;
  height: 30px;
  padding: 0 14px !important;
  line-height: 30px;
  color: var(--ink-2);
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px;
  cursor: pointer;
}
.pill-tabs .pill-tab.pill-tab--selected {
  background: var(--surface) !important; font-weight: 500; color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, .08); }

/* ─── Éditeur ──────────────────────────────────────────────────── */
.editor { display: grid; grid-template-columns: 208px minmax(0, 1fr); align-items: start; gap: 16px; }
.editor.is-flat { grid-template-columns: minmax(0, 1fr); }
.outline { position: sticky; top: 80px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  width: min(460px, 100vw);
  padding: 20px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(20, 20, 30, .08);
}
.side-panel-actions { position: sticky; bottom: -20px; z-index: 3; margin: 0 -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.side-panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 16px; font-weight: 600; }
.add-panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.add-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.add-panel summary::-webkit-details-marker { display: none; }
.add-panel[open] summary { border-bottom: 1px solid var(--line); }
.add-panel-body { padding: 16px; }

.visibility-radio-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.visibility-radio-group label, .visibility-radio-option { display: inline-flex; align-items: center; margin: 0; padding: 4px 12px; font-size: 13px; color: var(--ink-2); border-radius: 999px; cursor: pointer; }
.visibility-radio-option:has(input:checked) { font-weight: 500; color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, .08); }
.visibility-radio-input { position: absolute; opacity: 0; pointer-events: none; }

/* ─── Timeline ─────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 26px;
  bottom: -9px;
  left: 8.5px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}
.timeline-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #fff;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
}
.timeline-mark .icon { width: 11px; height: 11px; }
.timeline-text { flex: 1; min-width: 0; }
.timeline-count { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.timeline-item.is-done { color: var(--ink); }
.timeline-item.is-done .timeline-mark { background: var(--ok); border-color: var(--ok); }
.timeline-item.is-current { font-weight: 500; color: var(--ink); }
.timeline-item.is-current .timeline-mark { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--accent); }
a.timeline-item { color: var(--ink); }
a.timeline-item:hover { color: var(--accent); }

/* ─── Parcours répondant ───────────────────────────────────────── */
.play-topbar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.play-topbar-title { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-body { padding: 28px max(24px, env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: var(--surface); min-height: calc(100vh - 60px); min-height: calc(100dvh - 60px); }
.play-shell { display: grid; grid-template-columns: 240px minmax(0, 680px); justify-content: center; align-items: start; gap: 48px; }
.play-shell.is-flat { grid-template-columns: minmax(0, 680px); }
.play-rail { position: sticky; top: 24px; }
.play-bar { display: none; }
.play-bar-track { height: 4px; margin-bottom: 20px; background: var(--surface-2); border-radius: 2px; }
.play-bar-fill { height: 4px; background: var(--accent); border-radius: 2px; transition: width 200ms var(--ease); }
.play-bar-label { margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.play-section-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.play-section-intro { margin: 0 0 12px; color: var(--ink-2); }
.play-intro { margin: 0 0 20px; max-width: 65ch; font-size: 15px; line-height: 1.6; }
.play-nav { display: flex; gap: 10px; margin-top: 24px; }
.play-nav button { min-height: 46px; }
.play-end { max-width: 560px; margin: 0 auto; padding: 64px 24px; text-align: center; font-size: 15px; line-height: 1.6; }
.play-end .icon { color: var(--ok); margin-bottom: 12px; }

.q-block, .scale-matrix-row { scroll-margin-top: 12px; }
.q-block { padding: 20px 0; border-bottom: 1px solid var(--line); }
.q-text { margin-bottom: 12px; font-size: 15px; font-weight: 500; line-height: 1.45; }
.q-required { color: var(--danger); }
.q-hint { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.q-error { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--danger); }
.q-error:empty, .is-resolved .q-error { display: none; }

.opt {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 14px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  cursor: pointer;
}
@media (hover: hover) {
  .opt:not(:disabled):hover, .scale-btn:not(:disabled):hover { border-color: var(--accent); }
}
.opt:disabled, .scale-btn:disabled { color: var(--ink-2); opacity: 1; }
.opt.is-correct:disabled, .opt.is-missed:disabled, .opt.is-wrong:disabled { color: var(--ink); }
.opt-row { display: flex; align-items: center; gap: 10px; }
.opt-mark {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
}
.opt[data-single="1"] .opt-mark { border-radius: 50%; }
.opt-text { flex: 1; min-width: 0; font-weight: 500; }
.opt-badge { font-size: 12.5px; font-weight: 600; }
.opt-badge:empty { display: none; }
.opt.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.opt.is-selected .opt-mark { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.opt.is-correct, .opt.is-missed { background: var(--ok-soft); border-color: var(--ok); }
.opt.is-correct .opt-mark { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--ok-soft); }
.opt.is-correct .opt-badge, .opt.is-missed .opt-badge { color: var(--ok); }
.opt.is-wrong { background: var(--danger-soft); border-color: var(--danger); }
.opt.is-wrong .opt-mark { background: var(--danger); border-color: var(--danger); box-shadow: inset 0 0 0 3px var(--danger-soft); }
.opt.is-wrong .opt-badge { color: var(--danger); }

.scale-row { display: flex; gap: 6px; }
.scale-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 8px 4px;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  cursor: pointer;
}
.scale-btn.is-selected { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.scale-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.scale-caption { margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.scale-matrix { margin-top: 8px; }
.scale-matrix-head, .scale-matrix-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--scale-cols); align-items: center; gap: 8px; }
.scale-matrix-head { position: sticky; top: 0; z-index: 2; padding: 8px 0; font-size: 12px; line-height: 1.25; color: var(--ink-2); text-align: center; background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.scale-matrix-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.scale-matrix-row .q-text { margin: 0; font-size: 14px; }
.scale-matrix-cells { display: contents; }
.scale-matrix-row .q-error { grid-column: 1 / -1; margin-top: 0; }
.scale-legend { display: none; margin: 8px 0; font-size: 13px; color: var(--ink-2); }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.auth-card .brand-logo { height: 38px; margin: 0 0 6px -2px; }
.auth-sub { margin-bottom: 20px; color: var(--ink-2); }

/* ─── Guide ────────────────────────────────────────────────────── */
.guide { display: grid; grid-template-columns: 200px minmax(0, 760px); justify-content: center; align-items: start; gap: 40px; }
.guide-toc { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.guide-toc-title { margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.guide-toc a { padding: 4px 0; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.guide-toc a:hover { color: var(--accent); }
.guide-body { min-width: 0; padding-bottom: 48px; font-size: 15px; line-height: 1.65; }
.guide-lead { max-width: 65ch; margin: 0 0 8px; font-size: 17px; line-height: 1.55; }
.guide-section { padding-top: 28px; scroll-margin-top: 60px; }
.guide-section h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.guide-section h3 { margin: 20px 0 6px; font-size: 15px; font-weight: 600; }
.guide-section p, .guide-section ol, .guide-section ul { max-width: 68ch; margin: 0 0 12px; }
.guide-section ol, .guide-section ul { padding-left: 22px; }
.guide-section li { margin-bottom: 6px; padding-left: 2px; }
.guide-section .sheet { font-size: 14px; line-height: 1.45; }
.guide-section code { padding: 1px 5px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; background: var(--surface-2); border-radius: 5px; }
.guide-section pre { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; background: var(--surface-2); border-radius: var(--radius-field); }
.guide-note { max-width: 68ch; margin: 14px 0; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius-field); }
.guide-downloads { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.guide-download { padding: 7px 14px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; }
.guide-download:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Listes déroulantes Dash ──────────────────────────────────── */
.Select-control { min-height: 38px; background: var(--surface-2) !important; border: 1px solid var(--line) !important; border-radius: var(--radius-field) !important; box-shadow: none !important; }
.is-focused > .Select-control, .is-open > .Select-control { background: var(--surface) !important; border-color: var(--accent) !important; }
.Select-menu-outer { border: 1px solid var(--line-strong) !important; border-radius: var(--radius-field) !important; box-shadow: 0 8px 24px rgba(20, 20, 30, .1) !important; overflow: hidden; }

/* ─── Adaptation ───────────────────────────────────────────────── */
/* Doigt : cibles de 44 px et champs à 16 px, sans quoi iOS zoome au focus. */
@media (pointer: coarse), (max-width: 900px) {
  input:not([type=checkbox]):not([type=radio]), textarea, .Select-input > input { font-size: 16px !important; }
  input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
  .Select-input > input { min-height: 0; }
  button:not(.opt):not(.scale-btn), summary { min-height: 44px; }
  .Select-control { min-height: 44px; }
  .Select-placeholder, .Select--single > .Select-control .Select-value { line-height: 42px !important; }
  .Select-input { height: 42px !important; }
  .VirtualizedSelectOption { display: flex !important; align-items: center; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-item, .sidebar-new, .search-pill { height: 44px; }
  .search-pill input { min-height: 42px; }
  .opt, .scale-btn { min-height: 48px; }
  .timeline-item { min-height: 44px; }
  .guide-toc a { display: flex; align-items: center; min-height: 44px; padding: 0; }
  .guide-download { display: inline-flex; align-items: center; min-height: 44px; }
  .page-note a { display: inline-block; padding: 12px 0; }
  button[id*="btn-del-choice"], button[id*="btn-del-edit-choice"] { min-width: 44px; }
  .pill-tabs .pill-tab { height: 40px; line-height: 40px; }
  .visibility-radio-option { min-height: 38px; }
  input[type=checkbox], input[type=radio] { width: 20px !important; height: 20px !important; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display: flex !important; align-items: center; min-height: 44px; }
}

@media (max-width: 900px) {
  .page-top { position: static; grid-template-columns: minmax(0, 1fr) !important; gap: 10px; min-height: 0; margin: 0 0 16px; padding: 0 0 12px; }
  .page-top > div:nth-child(2):empty { display: none; }
  .page-top-title { flex-wrap: wrap; }
  .page-title { font-size: 20px; line-height: 1.3; white-space: normal; }
  .page-top-actions { justify-content: flex-start; }
  .editor { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .outline { position: static; padding: 0; background: none; border: 0; }
  .outline .section-title, .outline .timeline-mark { display: none; }
  .outline .timeline { flex-direction: row; gap: 6px; padding-bottom: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .outline .timeline-item { flex: none; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; background: var(--surface-2); border-radius: 999px; }
  .outline .timeline-item::before { display: none; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-toc { position: static; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-field); }
  .guide-section code { white-space: normal; }
  .play-shell { grid-template-columns: minmax(0, 680px); gap: 0; }
  .play-rail { display: none; }
  .play-bar { display: block; }
  .play-body { padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .play-topbar { padding: 10px 16px; }
  .scroll-hint { display: block; }
}

@media (max-width: 767px) {
  .sheet-stack thead { display: none; }
  .sheet-stack, .sheet-stack tbody, .sheet-stack tr { display: block; }
  .sheet-stack tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .sheet-stack tr:last-child { border-bottom: 0; }
  .sheet-stack tr.sheet-section { padding: 0; background: var(--bg); }
  .sheet-stack tr.sheet-section td { display: block; padding: 8px 12px; text-align: left; background: var(--bg); }
  .sheet-stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: auto; min-height: 30px; padding: 4px 0; text-align: right; border: 0; }
  .sheet-stack td[data-label]::before { flex: none; font-size: 13px; color: var(--ink-2); text-align: left; content: attr(data-label); }
  .sheet-stack td:empty, .sheet-stack td.num { display: none; }
  .sheet-stack td.cell-main { display: block; min-width: 0; text-align: left; }
  .sheet-stack td.cell-main::before { display: none; }
  .sheet-stack .cell-actions, .sheet-stack .is-sticky-end { position: static; width: auto; }
  .sheet-stack .cell-actions > div { justify-content: flex-start; width: 100%; }
  .sheet-stack .cell-actions .icon-btn.is-danger { margin-left: auto; }
  .sheet-stack .cell-clip { max-width: 62%; white-space: normal; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .scale-legend { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 0 12px; padding: 6px 0; line-height: 1.5; background: var(--surface); border-bottom: 1px solid var(--line); }
  .scale-legend span { white-space: nowrap; }
  .scale-legend strong { color: var(--ink); }
  .scale-matrix-head { display: none; }
  .scale-matrix-row { display: block; scroll-margin-top: 76px; }
  .scale-matrix-row .q-text { margin-bottom: 8px; }
  .scale-matrix-cells { display: flex; gap: 6px; }
  .scale-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .scale-caption { line-height: 1.2; overflow-wrap: anywhere; }
  .opt-row { flex-wrap: wrap; }
  .opt-text { flex: 1 1 calc(100% - 32px); }
  .opt-badge { flex-basis: 100%; padding-left: 28px; }
  .side-panel { width: 100vw; padding-top: calc(20px + env(safe-area-inset-top)); }
  .result-row > :first-child { flex: 1 1 100% !important; }
  .result-row > :nth-child(2) { margin-left: 0 !important; }
  .slide-nav { flex-wrap: wrap; }
  .slide-nav > div { order: -1; flex: 1 1 100% !important; }
  .slide-nav > button { flex: 1 1 0; }
  .q-card-head { flex-direction: column; align-items: flex-start !important; }
  #qr-modal-content, #img-modal-content { width: calc(100vw - 24px); min-width: 0 !important; padding-right: 16px !important; padding-left: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .play-bar-fill { transition: none; }
}

/* ─── Signes ───────────────────────────────────────────────────── */
.icon-home{-webkit-mask-image:url(icons/home.svg);mask-image:url(icons/home.svg)}
.icon-quiz{-webkit-mask-image:url(icons/quiz.svg);mask-image:url(icons/quiz.svg)}
.icon-survey{-webkit-mask-image:url(icons/survey.svg);mask-image:url(icons/survey.svg)}
.icon-session{-webkit-mask-image:url(icons/session.svg);mask-image:url(icons/session.svg)}
.icon-results{-webkit-mask-image:url(icons/results.svg);mask-image:url(icons/results.svg)}
.icon-plus{-webkit-mask-image:url(icons/plus.svg);mask-image:url(icons/plus.svg)}
.icon-search{-webkit-mask-image:url(icons/search.svg);mask-image:url(icons/search.svg)}
.icon-pencil{-webkit-mask-image:url(icons/pencil.svg);mask-image:url(icons/pencil.svg)}
.icon-trash{-webkit-mask-image:url(icons/trash.svg);mask-image:url(icons/trash.svg)}
.icon-eye{-webkit-mask-image:url(icons/eye.svg);mask-image:url(icons/eye.svg)}
.icon-download{-webkit-mask-image:url(icons/download.svg);mask-image:url(icons/download.svg)}
.icon-upload{-webkit-mask-image:url(icons/upload.svg);mask-image:url(icons/upload.svg)}
.icon-refresh{-webkit-mask-image:url(icons/refresh.svg);mask-image:url(icons/refresh.svg)}
.icon-logout{-webkit-mask-image:url(icons/logout.svg);mask-image:url(icons/logout.svg)}
.icon-user{-webkit-mask-image:url(icons/user.svg);mask-image:url(icons/user.svg)}
.icon-x{-webkit-mask-image:url(icons/x.svg);mask-image:url(icons/x.svg)}
.icon-check{-webkit-mask-image:url(icons/check.svg);mask-image:url(icons/check.svg)}
.icon-check-circle{-webkit-mask-image:url(icons/check-circle.svg);mask-image:url(icons/check-circle.svg)}
.icon-arrow-left{-webkit-mask-image:url(icons/arrow-left.svg);mask-image:url(icons/arrow-left.svg)}
.icon-arrow-right{-webkit-mask-image:url(icons/arrow-right.svg);mask-image:url(icons/arrow-right.svg)}
.icon-lock{-webkit-mask-image:url(icons/lock.svg);mask-image:url(icons/lock.svg)}
.icon-image{-webkit-mask-image:url(icons/image.svg);mask-image:url(icons/image.svg)}
.icon-paperclip{-webkit-mask-image:url(icons/paperclip.svg);mask-image:url(icons/paperclip.svg)}
.icon-lightbulb{-webkit-mask-image:url(icons/lightbulb.svg);mask-image:url(icons/lightbulb.svg)}
.icon-message{-webkit-mask-image:url(icons/message.svg);mask-image:url(icons/message.svg)}
.icon-stop{-webkit-mask-image:url(icons/stop.svg);mask-image:url(icons/stop.svg)}
.icon-play{-webkit-mask-image:url(icons/play.svg);mask-image:url(icons/play.svg)}
.icon-menu{-webkit-mask-image:url(icons/menu.svg);mask-image:url(icons/menu.svg)}
.icon-save{-webkit-mask-image:url(icons/save.svg);mask-image:url(icons/save.svg)}
.icon-alert{-webkit-mask-image:url(icons/alert.svg);mask-image:url(icons/alert.svg)}
.icon-inbox{-webkit-mask-image:url(icons/inbox.svg);mask-image:url(icons/inbox.svg)}
.icon-file-sheet{-webkit-mask-image:url(icons/file-sheet.svg);mask-image:url(icons/file-sheet.svg)}
.icon-type-choice{-webkit-mask-image:url(icons/type-choice.svg);mask-image:url(icons/type-choice.svg)}
.icon-type-select{-webkit-mask-image:url(icons/type-select.svg);mask-image:url(icons/type-select.svg)}
.icon-type-scale{-webkit-mask-image:url(icons/type-scale.svg);mask-image:url(icons/type-scale.svg)}
.icon-type-text{-webkit-mask-image:url(icons/type-text.svg);mask-image:url(icons/type-text.svg)}
.icon-type-integer{-webkit-mask-image:url(icons/type-integer.svg);mask-image:url(icons/type-integer.svg)}
.icon-type-decimal{-webkit-mask-image:url(icons/type-decimal.svg);mask-image:url(icons/type-decimal.svg)}
.icon-type-year{-webkit-mask-image:url(icons/type-year.svg);mask-image:url(icons/type-year.svg)}
.icon-type-date{-webkit-mask-image:url(icons/type-date.svg);mask-image:url(icons/type-date.svg)}
.icon-guide{-webkit-mask-image:url(icons/guide.svg);mask-image:url(icons/guide.svg)}
