/*
  QBuilder · design system « Classeur à intercalaires »
  Chaque questionnaire est un dossier, chaque section un intercalaire à onglet coloré.
  Feuilles blanc froid posées sur un bureau gris, dos de classeur graphite, onglets en carton teinté.
*/

:root {
  /* Bureau, feuilles, encre */
  --desk: #e7eaee;
  --desk-2: #dde1e6;
  --sheet: #ffffff;
  --sheet-2: #f6f7f9;
  --sheet-3: #eef0f3;
  --rule: #d6dae0;
  --rule-strong: #bcc2ca;
  --ink: #1d222b;
  --ink-2: #444c59;
  --ink-3: #5f6875;
  --ink-4: #8a929e;

  /* Dos du classeur */
  --spine: #20252e;
  --spine-2: #2a303b;
  --spine-3: #363d4a;
  --spine-ink: #e9ecf0;
  --spine-ink-2: #a9b1bd;

  /* Accent : pétrole (actions principales, sélection, focus) */
  --accent: #0b5d63;
  --accent-hover: #084a4f;
  --accent-ink: #ffffff;
  --accent-soft: #e0efef;
  --accent-line: #9ccaca;

  /* Carton des onglets */
  --tab-oxide: #b4472f;
  --tab-ochre: #b47a0c;
  --tab-fern: #2e7a4b;
  --tab-petrol: #0b5d63;
  --tab-slate: #3d5a88;
  --tab-plum: #7a4685;

  /* États */
  --ok: #23703f;      --ok-soft: #e3f2e8;      --ok-line: #a7d3b5;
  --warn: #8a5b00;    --warn-soft: #fbf0d6;    --warn-line: #e5c77d;
  --bad: #a63a25;     --bad-soft: #f9e5e0;     --bad-line: #e2aa9c;
  --info: #34507d;    --info-soft: #e5ebf5;    --info-line: #aebcd6;
  --mute: #4f5866;    --mute-soft: #eceef1;    --mute-line: #c9ced5;

  --radius: 4px;
  --radius-tab: 6px;
  --lift: 0 1px 1px rgba(20, 26, 36, .05), 0 6px 18px -10px rgba(20, 26, 36, .28);
  --lift-hi: 0 2px 4px rgba(20, 26, 36, .08), 0 18px 40px -18px rgba(20, 26, 36, .45);
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sidebar-w: 248px;
}

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("vendor/fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("vendor/fonts/archivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--desk);
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #bfe0df; color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.012em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
code { font-size: .92em; background: var(--sheet-3); border: 1px solid var(--rule); border-radius: 3px; padding: 0 .3em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Utilitaires ---------- */
.stack > * + * { margin-top: var(--gap, 16px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-end { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px !important; }
.mt-2 { margin-top: 12px !important; }
.mt-3 { margin-top: 20px !important; }
.hidden, [hidden] { display: none !important; }

/* ---------- Coque applicative ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-x: hidden;
  display: flex; flex-direction: column;
  background: var(--spine); color: var(--spine-ink);
  border-right: 1px solid #12161c;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: var(--spine-ink); text-decoration: none; border-bottom: 1px solid var(--spine-3); }
.brand:hover { color: #fff; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 5px); gap: 2px; align-items: end; height: 22px; }
.brand-mark span { display: block; border-radius: 2px 2px 0 0; }
.brand-mark span:nth-child(1) { height: 22px; background: var(--tab-oxide); }
.brand-mark span:nth-child(2) { height: 16px; background: var(--tab-ochre); }
.brand-mark span:nth-child(3) { height: 11px; background: #3fa39f; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.02em; font-stretch: 92%; }

.nav { padding: 12px 10px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-heading { padding: 0 10px 6px; font-size: 11.5px; font-weight: 600; color: var(--spine-ink-2); font-stretch: 88%; letter-spacing: .02em; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius);
  color: var(--spine-ink); text-decoration: none; font-weight: 500;
  transition: background-color .15s var(--ease);
}
.nav-link i { width: 16px; text-align: center; color: var(--spine-ink-2); font-size: 13px; }
.nav-link:hover { background: var(--spine-2); color: #fff; }
.nav-link[aria-current="page"] { margin-right: -10px; padding-right: 20px; background: var(--desk); color: var(--ink); font-weight: 650; border-radius: var(--radius-tab) 0 0 var(--radius-tab); }
.nav-link[aria-current="page"]:hover { background: var(--desk); color: var(--ink); }
.nav-link[aria-current="page"] i { color: var(--accent); }

.sidebar-foot { margin-top: auto; padding: 12px 10px 14px; border-top: 1px solid var(--spine-3); }
.whoami { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--spine-ink); text-decoration: none; }
.whoami:hover { background: var(--spine-2); color: #fff; }
.whoami[aria-current="page"] { background: var(--spine-3); }
.avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #3a4352; color: #fff; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.avatar--light { background: var(--sheet-3); color: var(--ink-2); border: 1px solid var(--rule); width: 28px; height: 28px; font-size: 11.5px; }
.whoami-name { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-mail { display: block; font-size: 11.5px; color: var(--spine-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 0 4px; }
.logout-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--spine-ink-2); font: inherit; font-size: 13px; padding: 6px; border-radius: var(--radius); cursor: pointer; }
.logout-btn:hover { color: #fff; background: var(--spine-2); }

/* Sélecteur de langue (segmenté) */
.lang-switch { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.lang-switch a { padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-decoration: none; letter-spacing: .03em; }
.lang-switch a + a { border-left: 1px solid var(--rule-strong); }
.lang-switch a:hover { background: var(--sheet-2); color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
.sidebar .lang-switch { border-color: var(--spine-3); background: transparent; }
.sidebar .lang-switch a { color: var(--spine-ink-2); }
.sidebar .lang-switch a + a { border-color: var(--spine-3); }
.sidebar .lang-switch a:hover { background: var(--spine-2); color: #fff; }
.sidebar .lang-switch a[aria-current="true"] { background: var(--spine-ink); color: var(--spine); }

.nav-scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 28px;
  background: rgba(231, 234, 238, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar .nav-toggle { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-3); margin: 0; padding: 0; list-style: none; }
.crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "/"; color: var(--ink-4); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page { width: 100%; padding: 24px 28px 56px; }
/* .page--narrow { max-width: 880px; } */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.page-sub { margin-top: 4px; color: var(--ink-3); max-width: 70ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-foot { margin-top: auto; padding: 16px 28px 22px; font-size: 12px; color: var(--ink-4); }

/* ---------- Feuilles (panneaux) ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--lift); }
.sheet + .sheet, .section-sheet + .sheet { margin-top: 16px; }
.sheet + .section-sheet { margin-top: 30px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.sheet-title { font-size: 14.5px; font-weight: 650; }
.sheet-desc { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.sheet-body { padding: 16px; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rule); background: var(--sheet-2); border-radius: 0 0 var(--radius) var(--radius); }
.sheet--flush .sheet-body { padding: 0; }
.sheet--muted { background: var(--sheet-2); box-shadow: none; }

.layout-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.layout-split > div > * + * { margin-top: 16px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.layout-2 > aside { position: sticky; top: 68px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 0 rgba(20, 26, 36, .04);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn i { font-size: 12px; }
.btn:hover { background: var(--sheet-2); border-color: #a9b0b9; color: var(--ink); }
.btn:active { background: var(--sheet-3); box-shadow: inset 0 1px 2px rgba(20, 26, 36, .08); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:active { background: #063c40; }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #1b5a32; border-color: #1b5a32; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sheet-3); border-color: transparent; }
.btn-danger { color: var(--ink-3); }
.btn-danger:hover, .btn-danger:focus-visible { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.danger-zone .btn-danger { color: var(--bad); border-color: var(--bad-line); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #8a2f1d; border-color: #8a2f1d; color: #fff; }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn-icon { width: 32px; padding: 0; }
.btn-sm.btn-icon { width: 27px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger-solid)[aria-busy="true"]::after { border-color: var(--ink-3) var(--ink-3) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.label .req { color: var(--bad); margin-left: 2px; }
.label .opt { font-weight: 500; color: var(--ink-4); margin-left: 4px; }
.input, .select, .textarea {
  width: 100%; min-width: 0;
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 6px 10px; min-height: 34px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 72px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235f6875' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input::placeholder, .textarea::placeholder { color: #7f8793; }
.input:hover, .select:hover, .textarea:hover { border-color: #9aa2ad; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 93, 99, .16); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--sheet-2); color: var(--ink-3); cursor: not-allowed; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
input[type="file"].input { padding: 4px; }
input[type="file"].input::file-selector-button { font: inherit; font-size: 12.5px; font-weight: 600; margin-right: 10px; padding: 4px 10px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--sheet-2); color: var(--ink); cursor: pointer; }
.hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12px; color: var(--bad); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.form-grid > * { grid-column: span 12; }
.span-2 { grid-column: span 2 !important; } .span-3 { grid-column: span 3 !important; } .span-4 { grid-column: span 4 !important; }
.span-5 { grid-column: span 5 !important; } .span-6 { grid-column: span 6 !important; } .span-7 { grid-column: span 7 !important; }
.span-8 { grid-column: span 8 !important; } .span-9 { grid-column: span 9 !important; } .span-12 { grid-column: span 12 !important; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { margin: 3px 0 0; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check-list { display: flex; flex-direction: column; gap: 6px; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; height: auto; }
.search { position: relative; }
.search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-size: 12px; pointer-events: none; }
.search .input { padding-left: 30px; }
.search--bar { max-width: 420px; margin-bottom: 14px; }
.sheet-head .search { min-width: min(300px, 100%); }
.table .textarea { field-sizing: content; min-height: 34px; max-height: 240px; }
.plain-list { list-style: none; margin: 0; padding: 0; }

/* ---------- Tableaux denses ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--sheet-2); padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--sheet-3); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s var(--ease); }
.table tbody tr:hover { background: #f8f9fa; }
.table tbody tr[aria-current="true"] { background: var(--accent-soft); }
.badge-stack { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table .num { text-align: right; }
.cell-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-title:hover { color: var(--accent); text-decoration: underline; }
.cell-sub { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.table-foot { padding: 10px 16px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--rule); background: var(--sheet-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Étiquettes d'état (onglets de carton miniatures) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; font-size: 12px; font-weight: 600; line-height: 1; border-radius: 3px; border: 1px solid var(--mute-line); background: var(--mute-soft); color: var(--mute); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; opacity: .85; }
.badge--plain::before { display: none; }
.badge--success, .status-published, .status-submitted, .status-active { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge--warning, .status-draft, .status-in_progress { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge--danger, .status-revoked { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.badge--info, .status-pending { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.badge--neutral, .status-archived, .status-inactive { background: var(--mute-soft); border-color: var(--mute-line); color: var(--mute); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.tag i { font-size: 11px; color: var(--ink-4); }

/* ---------- Alertes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--info-line); background: var(--info-soft); color: var(--info); border-radius: var(--radius); font-size: 13.5px; }
.alert > i { margin-top: 3px; flex: none; }
.alert-body { flex: 1 1 auto; min-width: 0; color: var(--ink); }
.alert-body strong { color: inherit; }
.alert--success { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.alert--error { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.alert--warning { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px 4px; border-radius: 3px; opacity: .7; font: inherit; }
.alert-close:hover { opacity: 1; background: rgba(0,0,0,.05); }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flashes .alert { animation: flash-in .35s var(--ease) both; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- États vides ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--sheet-3); color: var(--ink-3); font-size: 18px; margin-bottom: 4px; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--ink-3); max-width: 52ch; }
.empty .btn { margin-top: 8px; }

/* ---------- Bande de chiffres clés ---------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--lift); }
.figure { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--sheet); }
.figure-label { font-size: 12.5px; color: var(--ink-3); }
.figure-value { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.figure-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }

/* ---------- Dossiers (questionnaires récents) ---------- */
.dossiers { list-style: none; margin: 0; padding: 22px 16px 16px; display: flex; flex-direction: column; gap: 22px; }
.dossier { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 12px; background: var(--sheet-2); border: 1px solid var(--rule); border-top: 3px solid var(--tab-color, var(--rule-strong)); }
.dossier::before { content: ""; position: absolute; left: -1px; bottom: calc(100% + 3px); width: 64px; height: 9px; border-radius: var(--radius-tab) var(--radius-tab) 0 0; background: var(--tab-color, var(--rule-strong)); }
.dossier-title { flex: 1 1 220px; min-width: 0; font-weight: 650; color: var(--ink); text-decoration: none; }
a.dossier-title:hover { color: var(--accent); text-decoration: underline; }
.dossier-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.dossier-counts strong { color: var(--ink); font-weight: 650; }

/* ---------- Liste clé / valeur ---------- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Onglets de classeur ---------- */
.workspace-head { margin-bottom: 0; }
.workspace-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.workspace-title-row h1 { font-size: 21px; font-weight: 680; letter-spacing: -.02em; }
.workspace-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 0 8px; overflow-x: auto; overflow-y: hidden; position: relative; z-index: 1; margin-bottom: -1px; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 9px;
  font-size: 13px; font-weight: 600; font-stretch: 94%;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  background: var(--desk-2);
  border: 1px solid var(--rule); border-bottom-color: var(--rule);
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.tab::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: var(--radius-tab) var(--radius-tab) 0 0; background: var(--tab-color, var(--rule-strong)); }
.tab:hover { background: #eef0f3; color: var(--ink); }
.tab[aria-current="page"] { background: var(--sheet); color: var(--ink); border-bottom-color: var(--sheet); transform: translateY(-2px); padding-bottom: 11px; margin-bottom: -2px; }
.tab i { font-size: 12px; color: var(--tab-color, var(--ink-3)); }
.tab-count { min-width: 20px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 9px; font-size: 11.5px; font-weight: 650; background: rgba(29, 34, 43, .08); color: var(--ink-2); }
.tab[aria-current="page"] .tab-count { background: var(--sheet-3); }
.tab--structure { --tab-color: var(--tab-petrol); }
.tab--invitations { --tab-color: var(--tab-ochre); }
.tab--results { --tab-color: var(--tab-fern); }
.tab--preview { --tab-color: var(--tab-slate); }
.tab-panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 0 var(--radius) var(--radius) var(--radius); box-shadow: var(--lift); padding: 20px; }
.tab-panel > .sheet { box-shadow: none; }

/* ---------- Intercalaires de section ---------- */
.tab-c1 { --tab-color: var(--tab-petrol); }
.tab-c2 { --tab-color: var(--tab-ochre); }
.tab-c3 { --tab-color: var(--tab-fern); }
.tab-c4 { --tab-color: var(--tab-oxide); }
.tab-c5 { --tab-color: var(--tab-slate); }
.tab-c6 { --tab-color: var(--tab-plum); }
.section-sheet { position: relative; margin-top: 30px; background: var(--sheet); border: 1px solid var(--rule); border-top: 3px solid var(--tab-color, var(--rule-strong)); border-radius: 0; box-shadow: var(--lift); }
.section-sheet:first-child { margin-top: 28px; }
.section-sheet { scroll-margin-top: 84px; }
.qrow > .qedit { grid-column: 1 / -1; }
.section-tab {
  position: absolute; left: -1px; bottom: 100%;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 40px);
  padding: 5px 12px 4px;
  font-size: 12px; font-weight: 700; font-stretch: 88%; letter-spacing: .02em;
  color: #fff; background: var(--tab-color, var(--ink-3));
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.section-tab .num { opacity: .85; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.section-head h2, .section-head h3 { font-size: 16px; font-weight: 650; }
.section-head .sheet-desc { max-width: 75ch; }
.section-body { padding: 4px 16px 16px; }

/* Lignes de question */
.qrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--sheet-3); }
.qrow:last-child { border-bottom: 0; }
.qref { padding-top: 1px; font-size: 13px; font-weight: 650; color: var(--tab-color, var(--ink-3)); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qtitle { font-weight: 600; }
.qmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.qdesc { margin-top: 4px; font-size: 13px; color: var(--ink-3); white-space: pre-wrap; max-width: 75ch; }
.qactions { display: flex; gap: 4px; }

/* Bloc d'ajout replié */
.adder { margin-top: 12px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); background: var(--sheet-2); }
.adder > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); border-radius: var(--radius); }
.adder > summary::-webkit-details-marker { display: none; }
.adder > summary:hover { background: var(--sheet-3); }
.adder[open] { border-style: solid; background: var(--sheet); }
.adder[open] > summary { border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
.adder-body { padding: 14px; }
.adder--inline { margin-top: 6px; border-color: transparent; background: none; }
.adder--inline > summary { display: inline-flex; width: auto; padding: 3px 6px; margin-left: -6px; font-size: 12.5px; }
.adder--inline[open] { margin-top: 10px; border: 1px solid var(--rule); background: var(--sheet-2); }
.adder--inline[open] > summary { display: flex; margin-left: 0; padding: 8px 12px; background: var(--sheet); }

/* ---------- Zone sensible ---------- */
.danger-zone { margin-top: 28px; border: 1px solid var(--bad-line); border-radius: var(--radius); background: var(--sheet); }
.danger-zone-head { padding: 10px 16px; border-bottom: 1px solid var(--bad-line); color: var(--bad); font-weight: 650; font-size: 13.5px; }
.danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.danger-row + .danger-row { border-top: 1px solid var(--sheet-3); }

/* ---------- Menu déroulant (ex. Exporter) : <details class="menu"> ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .menu-caret { font-size: 11px; margin-left: 2px; transition: transform .15s var(--ease); }
.menu[open] > summary .menu-caret { transform: rotate(180deg); }
.menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 260px; padding: 4px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--lift-hi); animation: dialog-in .16s var(--ease) both; }
.menu--left .menu-list { right: auto; left: 0; }
.menu-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 3px; background: none; font: inherit; text-align: left; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-item > i { flex: none; width: 16px; margin-top: 2px; text-align: center; color: var(--accent); }
.menu-item:hover, .menu-item:focus-visible { background: var(--sheet-2); color: var(--ink); }
.menu-item-label { display: block; font-weight: 600; font-size: 13px; }
.menu-item-hint { display: block; font-size: 12px; color: var(--ink-3); }
.menu-item--danger > i, .menu-item--danger .menu-item-label { color: var(--bad); }
.menu-item--danger:hover, .menu-item--danger:focus-visible { background: var(--bad-soft); }
.menu-list hr { margin: 4px 0; border: 0; border-top: 1px solid var(--rule); }
/* Un menu ouvert dans un tableau défilant ne doit pas être rogné. */
.table-wrap:has(details.menu[open]) { overflow: visible; }

/* ---------- Contrôle segmenté (ex. mode d'envoi de la messagerie), même facture que .lang-switch ---------- */
.mail-mode { border: 0; margin: 0; padding: 0; min-width: 0; }
.mail-mode legend { padding: 0; margin-bottom: 6px; }
.mode-switch { display: inline-flex; align-self: flex-start; width: fit-content; max-width: 100%; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.mode-switch label { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.mode-switch label + label { border-left: 1px solid var(--rule-strong); }
.mode-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.mode-switch label:hover { background: var(--sheet-2); color: var(--ink); }
.mode-switch label:has(input:checked) { background: var(--ink); color: #fff; }
.mode-switch label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -4px; }
.mail-mode .hint { display: block; margin-top: 6px; }
.mail-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 720px) { .mail-state { align-items: flex-start; } .mode-switch label { padding: 0 11px; } }

/* ---------- Dialogues natifs ---------- */
dialog.dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); color: var(--ink); box-shadow: var(--lift-hi); }
dialog.dialog::backdrop { background: rgba(22, 27, 35, .45); }
dialog.dialog[open] { animation: dialog-in .22s var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.dialog-head h2 { font-size: 15.5px; }
.dialog-body { padding: 16px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rule); background: var(--sheet-2); }

/* ---------- Pièces jointes ---------- */
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list:empty { display: none; }
.file-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 6px 5px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet-2); font-size: 13px; }
.file-chip-icon { flex: none; width: 18px; text-align: center; font-size: 15px; color: var(--ink-3); }
.file-chip .fa-file-pdf { color: var(--tab-oxide); }
.file-chip .fa-file-word { color: var(--tab-slate); }
.file-chip .fa-file-excel { color: var(--tab-fern); }
.file-chip .fa-file-powerpoint { color: var(--tab-ochre); }
.file-chip .fa-file-image, .file-chip .fa-file-video { color: var(--tab-plum); }
.file-chip-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-type { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.file-chip-size { flex: none; font-size: 12px; color: var(--ink-3); min-width: 56px; text-align: right; }
.file-chip.is-pending { border-style: dashed; border-color: var(--accent-line); background: var(--accent-soft); }
.file-chip.is-pending .file-chip-type::after { content: attr(data-pending); margin-left: 8px; color: var(--accent); font-weight: 600; }
.file-chip.is-invalid { border-color: var(--bad-line); background: var(--bad-soft); }
.file-chip.is-invalid .file-chip-type { color: var(--bad); font-weight: 600; }

.dropzone { position: relative; }
.dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone-surface {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; cursor: pointer;
  border: 1.5px dashed var(--rule-strong); border-radius: var(--radius);
  background: var(--sheet-2); color: var(--ink-2);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dropzone-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: var(--sheet); border: 1px solid var(--rule); color: var(--accent); font-size: 16px; transition: transform .2s var(--ease); }
.dropzone-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dropzone-title { font-weight: 600; color: var(--ink); }
.dropzone-sub { font-size: 12.5px; color: var(--ink-3); }
.dropzone-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dropzone-surface:hover { border-color: var(--accent); background: #f2f8f8; }
.dropzone-input:focus-visible + .dropzone-surface { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.is-dragover .dropzone-surface { border-color: var(--accent); border-style: solid; background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(11, 93, 99, .14); }
.dropzone.is-dragover .dropzone-icon { transform: translateY(-3px); }
.dropzone.is-disabled .dropzone-surface { cursor: not-allowed; opacity: .6; }
.dropzone.is-disabled .dropzone-surface:hover { border-color: var(--rule-strong); background: var(--sheet-2); }
.dropzone .hint { margin-top: 6px; }
.dropzone-input[aria-invalid="true"] + .dropzone-surface { border-color: var(--bad); }
.attachments { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.attachments-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.attachments-title i { color: var(--ink-3); }
.attachments .dropzone-surface { padding: 8px 12px; gap: 10px; }
.attachments .dropzone-icon { width: 28px; height: 28px; font-size: 13px; }
.attachments .dropzone-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.attachments .dropzone-title { font-size: 13px; }
.attachments .dropzone .hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Écran de connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); }
.auth-spine { position: relative; overflow: hidden; background: var(--spine); color: var(--spine-ink); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-panel { background: var(--sheet); display: flex; flex-direction: column; justify-content: center; padding: 40px; border-left: 1px solid var(--rule); }
.auth-panel h1 { font-size: 22px; }
.auth-brand { padding: 0; border: 0; }
.auth-tagline { margin-top: 14px; color: var(--spine-ink-2); max-width: 38ch; font-size: 15px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-mobile-brand { display: none; color: var(--ink); }
.auth-mobile-brand:hover { color: var(--ink); }
.auth-binder { position: relative; max-width: 460px; padding-top: 28px; }
.auth-divider { position: relative; height: 54px; margin-top: -20px; background: var(--spine-2); border-top: 3px solid var(--tab-color); box-shadow: 0 -10px 24px -8px rgba(0, 0, 0, .45); }
.auth-divider:first-child { margin-top: 0; }
.auth-divider span { position: absolute; bottom: 100%; left: calc(var(--i) * 24%); padding: 5px 12px 4px; font-size: 12px; font-weight: 700; font-stretch: 88%; letter-spacing: .02em; color: #fff; background: var(--tab-color); border-radius: var(--radius-tab) var(--radius-tab) 0 0; }
.auth-divider:last-child { height: 120px; background: var(--spine-3); }
.auth-tabs { display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--spine-3); }
.auth-tabs span { display: block; width: 64px; border-radius: var(--radius-tab) var(--radius-tab) 0 0; background: var(--tab-color); opacity: .88; }
.auth-tabs span:nth-child(1) { height: 34px; } .auth-tabs span:nth-child(2) { height: 29px; } .auth-tabs span:nth-child(3) { height: 24px; }
.auth-tabs span:nth-child(4) { height: 19px; } .auth-tabs span:nth-child(5) { height: 14px; } .auth-tabs span:nth-child(6) { height: 10px; }

/* ---------- Espace répondant ---------- */
body.public { background: var(--desk); }
.public-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.public-top .brand { padding: 0; border: 0; color: var(--ink); }
.public-top .brand:hover { color: var(--ink); }
.public-top .lang-switch { margin-left: auto; }
.public-wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.public-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail { position: sticky; top: 20px; }
.rail-title { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.rail-list { list-style: none; margin: 0 1rem 0 0px; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: rail; }
.rail-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--rule); border-right: 0; background: var(--desk-2); border-radius: var(--radius-tab) 0 0 var(--radius-tab); color: var(--ink-2); text-decoration: none; font-size: 13px; transition: background-color .15s var(--ease); }
.rail-item::before { counter-increment: rail; content: counter(rail); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 5px 5px 0 0; font-size: 12px; font-weight: 700; font-stretch: 88%; color: #fff; background: var(--tab-color, var(--ink-3)); opacity: .55; }
.rail-item:hover { background: var(--sheet-3); color: var(--ink); }
.rail-item:hover::before { opacity: .85; }
.rail-item[aria-current="true"] { margin-right: calc(-1rem - 10px); padding-right: calc(1rem + 39px); background: var(--sheet); border-color: var(--rule); border-right-color: var(--sheet); color: var(--ink); font-weight: 650; box-shadow: var(--lift); }
.rail-item[aria-current="true"]::before { opacity: 1; }
.rail-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-item .rail-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.rail-item.is-done .rail-count { color: var(--ok); font-weight: 650; }
.progress { height: 6px; border-radius: 3px; background: var(--desk-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease); }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.doc-head { margin-bottom: 8px; }
.doc-head h1 { font-size: 26px; font-weight: 680; letter-spacing: -.022em; }
.doc-head .doc-desc { margin-top: 8px; color: var(--ink-2); white-space: pre-wrap; max-width: 75ch; }
.answer { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 18px 0; border-bottom: 1px solid var(--sheet-3); }
.answer:last-child { border-bottom: 0; }
.answer-title { font-weight: 600; font-size: 14.5px; }
.answer-title .req, .req { color: var(--bad); margin-left: 2px; }
.answer [aria-invalid="true"].check-list, .check-list[aria-invalid="true"] { outline: 1px solid var(--bad); outline-offset: 6px; border-radius: 2px; }
.answer-desc { margin-top: 3px; font-size: 13px; color: var(--ink-3); white-space: pre-wrap; max-width: 75ch; }
.answer-input { margin-top: 10px; max-width: 720px; }
.answer.is-answered .qref::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: 6px; font-size: 11px; color: var(--ok); }
.submit-bar { position: sticky; bottom: 0; z-index: 10; margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--lift-hi); }
.submit-bar .status { font-size: 13px; color: var(--ink-3); }
.public-foot { margin-top: 28px; font-size: 12px; color: var(--ink-4); text-align: center; }
.preview-ribbon { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 16px; background: var(--tab-slate); color: #fff; font-size: 13px; font-weight: 600; }
.preview-ribbon a { color: #fff; }

/* ---------- Page d'erreur ---------- */
.error-page { max-width: 520px; margin: 12vh auto 0; padding: 0 24px; }
.error-page .sheet-body { padding: 28px; }
.error-code { font-size: 13px; font-weight: 700; color: var(--bad); letter-spacing: .04em; }

/* ---------- Adaptation ---------- */
@media (max-width: 1080px) {
  .layout-2, .layout-split { grid-template-columns: minmax(0, 1fr); }
  .layout-2 > aside { position: static; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--lift-hi); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; }
  .nav-scrim { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(22, 27, 35, .45); }
  .topbar .nav-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .page { padding: 18px 16px 48px; }
  .app-foot { padding: 14px 16px 20px; }
  .public-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rail { position: static; }
  .rail-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .rail-item { flex: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-spine { display: none; }
  .auth-panel { border-left: 0; padding: 32px 20px; min-height: 100vh; justify-content: flex-start; padding-top: 12vh; }
  .auth-mobile-brand { display: flex; margin-bottom: 8px; }
}
@media (max-width: 720px) {
  .table-stack .row-actions { position: relative; }
  .table-stack .menu { position: static; }
  .table-stack .menu-list { right: auto; left: 0; }
  .attachments .dropzone-surface { padding: 6px 10px; }
  .attachments .dropzone-icon { width: 24px; height: 24px; font-size: 12px; }
  .attachments .dropzone-title, .attachments .dropzone-or { display: none; }
  .attachments .dropzone-link { display: inline-block; }
  .attachments .dropzone-link::first-letter { text-transform: uppercase; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tab:not([aria-current]) > span:not(.tab-count) { display: none; }
  .tab { padding-left: 11px; padding-right: 11px; }
  .rail-item:not([aria-current="true"]) .rail-name { display: none; }
  .rail-item[aria-current="true"] { margin-right: 0; padding-right: 10px; border-radius: var(--radius-tab) var(--radius-tab) 0 0; }
  .file-chip { flex-wrap: wrap; }
  .file-chip-name { flex-basis: calc(100% - 40px); }
  .file-chip-type, .file-chip-size { margin-left: 28px; min-width: 0; text-align: left; }
  .crumbs li:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .crumbs li:nth-last-child(2)::before { display: none; }
  .crumbs li, .crumbs a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .form-grid > [class*="span-"] { grid-column: span 12 !important; }
  .qrow, .answer { grid-template-columns: minmax(0, 1fr); }
  .qrow .qactions { justify-content: flex-start; }
  .tab-panel { padding: 14px; }
  .page-title, .workspace-title-row h1 { font-size: 19px; }
  .doc-head h1 { font-size: 22px; }
  .public-wrap { padding: 18px 16px 48px; }
  .public-top { padding: 0 16px; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 10px 16px; border-bottom: 1px solid var(--rule); }
  .table-stack td { padding: 2px 0 !important; border: 0; text-align: left !important; }
  .table-stack td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 110px; color: var(--ink-3); font-size: 12px; }
  .table-stack .row-actions { justify-content: flex-start; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .submit-bar, .tabs, .page-actions, .workspace-actions, .rail { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; }
  .sheet, .section-sheet, .tab-panel { box-shadow: none; }
}
