/* Figtree (SIL OFL 1.1), served from here: no request to a font CDN (the rep's address stays with us) */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("assets/fonts/figtree-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("assets/fonts/figtree-latin-wght-italic.woff2") format("woff2"); }

/* Réponse CCTP — base styles shared by every screen (tokens and components from the design canvas,
   page « Parcours détaillés »). Screen-specific rules live below their section header; the consultation
   screen has its own file, consultation.css. */

/* ---------------------------------------------------------------------------------------------------------
   Tokens
   --------------------------------------------------------------------------------------------------------- */
:root {
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text: #0F1419;
  --text-2: #4C5258;      /* secondary text */
  --muted: #5A6067;       /* captions, hints */
  --faint: #666C73;
  --mute-ring: #A3A9AF;

  --line: #E6E9EB;        /* dividers, panel borders */
  --line-2: #EEF0F2;      /* row dividers */
  --card-line: #DDE1E5;   /* cards */
  --control-line: #D5D9DD;
  --dash: #C5CBD1;
  --drop-dash: #B9C3CE;
  --outline: #4D5256;     /* outline buttons */

  --bg: #FFFFFF;
  --side: #F8FAFA;        /* sidebars, soft panels */
  --field: #F4F6F7;       /* grey value fields */
  --seg: #E8EAED;         /* segmented control track */
  --track: #ECEEF0;       /* progress track */
  --doc-bg: #EEF1F3;      /* behind document pages */
  --dark: #15191D;        /* round unit badges */

  --accent: #0A63F2;
  --accent-hover: #0955D6;
  --link: #0B55D4;
  --link-hover: #0A47B0;
  --sel-bg: #E3EEFF;      /* selected item */
  --sel-text: #0B4FBF;
  --sel-card: #F7FAFF;
  --sel-line: #9DB8F5;
  --sel-cell: #F3F8FF;
  --accent-wash: rgba(10, 99, 242, 0.08);

  --ok: #12805C;  --ok-bg: #E5F5EE;
  --warn: #9A5800; --warn-bg: #FFF3E0; --warn-ring: #C27A0A;
  --bad: #B5300B;  --bad-bg: #FDECE7;  --bad-ring: #C4320A;
  --mute: #4C5258; --mute-bg: #EEF0F2;
  --attention-bg: #FFF8EC; --attention-title: #6E4100;

  --r-control: 8px;
  --r-card: 12px;
  --r-modal: 14px;
  --shadow-modal: 0 24px 64px rgba(15, 20, 25, 0.28);
  --shadow-drawer: -12px 0 32px rgba(15, 20, 25, 0.18);
  --shadow-page: 0 1px 4px rgba(15, 20, 25, 0.14);
  --shadow-seg: 0 1px 2px rgba(15, 20, 25, 0.12);
  --backdrop: rgba(15, 20, 25, 0.48);
  --backdrop-light: rgba(15, 20, 25, 0.32);
}

/* ---------------------------------------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sc { scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; }
.sc::-webkit-scrollbar { width: 8px; height: 8px; }
.sc::-webkit-scrollbar-thumb { background: var(--control-line); border-radius: 8px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------------------------------------- */
.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r-control); border: 1px solid transparent; background: transparent;
  font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; text-decoration: none; color: var(--text); flex: 0 0 auto;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #FFFFFF; padding: 0 20px; }
.btn-primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn-primary:disabled { background: var(--track); color: var(--muted); }
.btn-outline { border-color: var(--outline); background: #FFFFFF; color: var(--text); }
.btn-outline:hover { background: var(--side); color: var(--text); }
.btn-accent { border-color: var(--accent); background: #FFFFFF; color: var(--accent); }
.btn-accent:hover { background: var(--sel-card); color: var(--accent); }
.btn-soft { border-color: var(--control-line); background: #FFFFFF; color: var(--text); }
.btn-soft:hover { background: var(--side); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-link { height: auto; padding: 0; border: 0; color: var(--link); background: transparent; font-weight: 600; font-size: 14px; }
.btn-link:hover { color: var(--link-hover); text-decoration: underline; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-md { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 42px; }
.btn-block { width: 100%; }
.pill-new {
  height: 44px; border-radius: 999px; border: 1.5px solid var(--accent); background: #FFFFFF; color: var(--accent);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; width: 100%;
}
.pill-new:hover { background: var(--sel-card); }
.icon-btn {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: var(--r-control); border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text);
}
.icon-btn:hover { background: var(--field); }
.icon-btn.bordered { border: 1px solid var(--control-line); background: #FFFFFF; }
.icon-btn.sm { flex-basis: 34px; width: 34px; height: 34px; }

/* ---------------------------------------------------------------------------------------------------------
   Chips, badges, rings
   --------------------------------------------------------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-sm { padding: 1px 8px; font-size: 12px; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-mute { background: var(--mute-bg); color: var(--mute); }
.chip-accent { background: var(--sel-bg); color: var(--sel-text); }
.chip-grey { background: var(--field); color: var(--text); font-weight: 400; }
.chip-solid { background: var(--accent); color: #FFFFFF; }
.chip-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.code-chip { font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 8px; background: var(--field); }
.badge-unit {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--dark); color: #FFFFFF;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: -0.02em;
}
.badge-unit.sm { flex-basis: 24px; width: 24px; height: 24px; font-size: 10px; }
.mark { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.mark-ok { background: var(--ok-bg); color: var(--ok); }
.mark-close { background: var(--warn-bg); color: var(--warn); }
.mark-gap { background: var(--bad-bg); color: var(--bad); }
.mark-unknown, .mark-none { background: var(--mute-bg); color: var(--mute); }
.ring {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 2px solid var(--mute-ring); background: transparent; color: #FFFFFF;
}
.ring-ok { border-color: var(--ok); }
.ring-warn { border-color: var(--warn-ring); }
.ring-bad { border-color: var(--bad-ring); }
.ring-mute { border-color: var(--mute-ring); }
.ring-done { border-color: var(--ok); background: var(--ok); }
.ring-dashed { border: 1.5px dashed var(--mute-ring); }

/* ---------------------------------------------------------------------------------------------------------
   Tabs, segmented controls, fields
   --------------------------------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 28px; }
.tabs > button, .tab {
  padding: 12px 0; border: 0; background: transparent; font-size: 15px; color: var(--text-2); white-space: nowrap;
}
.tabs > button[aria-selected="true"], .tab[aria-selected="true"] { font-weight: 600; color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-n { color: var(--muted); font-weight: 500; }
.seg { display: flex; padding: 3px; border-radius: var(--r-control); background: var(--seg); }
.seg > button {
  flex: 1; height: 32px; padding: 0 12px; border: 0; border-radius: 6px; font-size: 13.5px; background: transparent;
  color: var(--text-2); white-space: nowrap;
}
.seg > button[aria-selected="true"], .seg > button[aria-pressed="true"], .seg > button[aria-checked="true"] { background: #FFFFFF; color: var(--text); font-weight: 600; box-shadow: var(--shadow-seg); }
.seg.inline { display: inline-flex; align-self: flex-start; }
.seg.inline > button { flex: 0 0 auto; }
.field {
  height: 40px; padding: 0 12px; border-radius: var(--r-control); border: 0; background: var(--field); font-size: 14.5px;
  color: var(--text); min-width: 0;
}
.field::placeholder { color: var(--muted); }
.field:focus { outline: 2px solid var(--accent); outline-offset: 0; background: #FFFFFF; }
.value-field {
  height: 40px; padding: 0 12px; border-radius: var(--r-control); background: var(--field); display: flex; align-items: center;
  font-size: 14.5px; min-width: 0;
}
.search-field {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--r-control);
  background: var(--field); color: var(--muted);
}
.search-field.white { background: #FFFFFF; border: 1px solid var(--line); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14.5px; color: var(--text); }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input[type="checkbox"] { flex: 0 0 auto; margin: 2px 0 0; width: 17px; height: 17px; accent-color: var(--accent); }
.label { font-size: 13px; color: var(--muted); }
.section-title { font-weight: 600; font-size: 16px; }
.hint { font-size: 13px; color: var(--muted); }
select.field { padding-right: 28px; }

/* ---------------------------------------------------------------------------------------------------------
   Progress, cards, thumbnails
   --------------------------------------------------------------------------------------------------------- */
.progress { height: 6px; border-radius: 6px; background: var(--track); overflow: hidden; display: block; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transition: width .3s ease; }
.progress.lg { height: 8px; border-radius: 8px; }
.progress.grey > span { background: var(--mute-ring); }
.card { border: 1px solid var(--card-line); border-radius: var(--r-card); background: #FFFFFF; }
.doc-thumb {
  flex: 0 0 auto; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: #FFFFFF;
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doc-thumb.empty { background: var(--field); display: inline-flex; align-items: center; justify-content: center; color: var(--mute-ring); }
.photo {
  flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--line); background: #FFFFFF; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.photo img { width: 100%; height: 100%; object-fit: contain; }
.photo .none { font-size: 11px; color: var(--muted); text-align: center; padding: 4px; }
.skeleton { background: linear-gradient(90deg, var(--field) 0%, #FAFBFB 50%, var(--field) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------------------------------------
   Modals and drawers
   --------------------------------------------------------------------------------------------------------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: var(--backdrop); display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.backdrop.light { background: var(--backdrop-light); justify-content: flex-end; padding: 0; }
.modal {
  width: 760px; max-width: 100%; max-height: 100%; background: #FFFFFF; border-radius: var(--r-modal);
  box-shadow: var(--shadow-modal); display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px 0; }
.modal-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 28px 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.drawer {
  width: 640px; max-width: 100%; height: 100%; background: #FFFFFF; box-shadow: var(--shadow-drawer); display: flex;
  flex-direction: column;
}
.steps-nav {
  flex: 0 0 230px; padding: 20px 12px; background: var(--side); border-right: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 2px;
}
.steps-nav .title { padding: 6px 10px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.step { height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 8px; font-size: 14.5px; }
.step .n {
  flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--text-2); font-size: 11px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.step.on { background: var(--sel-bg); color: var(--sel-text); font-weight: 600; }
.step.on .n { background: var(--accent); color: #FFFFFF; }
.step.done .n { background: var(--ok); color: #FFFFFF; }

/* ---------------------------------------------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 44px; max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px 10px 16px; border-radius: 10px; background: var(--text); color: #FFFFFF; font-size: 14px;
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.24);
}
.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }
.toast button { border: 0; background: transparent; color: #FFFFFF; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.toast button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------------------------------------------------------------------------------------------------------
   App shell: sidebar + main (Accueil and the other list pages)
   --------------------------------------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 248px; min-height: 100vh; padding: 20px 16px; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: -0.015em; white-space: nowrap; }
.brand-accent { color: #0060AA; } /* Eledone lapis-lazuli, as the mark */
.brand-by { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.org-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: #FFFFFF; border: 1px solid var(--line); }
.org-logo-box { flex: 0 0 auto; width: 64px; height: 32px; display: flex; align-items: center; justify-content: center; }
.org-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.org-logo-indigo { filter: brightness(0); } /* the only Indigo logo is white */
.org-logo-miidex { mix-blend-mode: multiply; } /* its image has a white background */
.org-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--dark); color: #FFFFFF; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav button {
  height: 40px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; text-decoration: none;
  color: var(--text); border: 0; background: transparent; font-size: 15px; text-align: left; width: 100%;
}
.nav a:hover, .nav button:hover { background: #EEF2F4; color: var(--text); }
.nav a[aria-current="page"] { background: var(--sel-bg); color: var(--sel-text); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 13px; }
.user-block { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--dark); color: #FFFFFF; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.main { flex: 1; min-width: 0; padding: 32px 40px 40px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }

/* sidebar details */
.sidebar { min-width: 0; }
.org-text, .user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.org-name { font-weight: 600; font-size: 14.5px; }
.org-sub { font-size: 12.5px; color: var(--muted); }
.user-text { flex: 1; }
.user-name { font-weight: 600; font-size: 14px; }
.user-org { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--link); white-space: nowrap; border-radius: 4px; }
.link-btn:hover { color: var(--link-hover); text-decoration: underline; }
.nav .count { color: inherit; font-weight: 500; }
.nav .count:empty { display: none; }
.skip-link {
  position: absolute; left: 12px; top: 8px; z-index: 200; padding: 8px 14px; border-radius: 8px; border: 0; background: var(--accent);
  color: #FFFFFF; font-weight: 600; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.main:focus { outline: none; }
.page-title { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.page-sub { font-size: 14.5px; color: var(--muted); min-height: 21px; }
.page-sub:empty { display: none; }
.page-head .field { width: 220px; max-width: 100%; }

/* ---------------------------------------------------------------------------------------------------------
   Accueil: cards, tabs, table
   --------------------------------------------------------------------------------------------------------- */
.home-search { width: 320px; max-width: 100%; padding: 0 14px; }
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.home-card { border: 1px solid var(--card-line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.home-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.home-card-title { font-weight: 600; font-size: 17px; }
.home-card-head .hint { font-size: 13.5px; }
.dropzone-big {
  flex: 1; min-height: 138px; border: 1.5px dashed var(--drop-dash); border-radius: 10px; background: var(--side); display: flex; align-items: center;
  gap: 14px 18px; padding: 20px 22px; text-align: left; color: var(--text); width: 100%; flex-wrap: wrap;
}
.dropzone-big:hover { border-color: var(--accent); background: var(--sel-card); }
.dz-icon { flex: 0 0 52px; height: 52px; border-radius: 50%; background: var(--sel-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.dz-icon.sm { flex-basis: 44px; height: 44px; }
.dz-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dz-title { font-weight: 600; font-size: 16px; }
.dz-desc { font-size: 14px; color: var(--text-2); }
.dz-btn { flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: #FFFFFF; font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.dropzone-big:hover .dz-btn { background: var(--accent-hover); }
.resume-slot { display: flex; min-width: 0; }
.resume-slot > .home-card { flex: 1; }
.home-card.resume { flex-direction: row; gap: 18px; }
.resume-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.resume-kicker { font-size: 13px; font-weight: 600; color: var(--text-2); }
.resume-title { font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.resume-last { font-size: 13.5px; color: var(--muted); }
.resume-prog { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.resume-prog .progress { flex: 1; }
.resume-prog strong { color: var(--text); }
.resume-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.resume .doc-thumb { border-radius: 6px; }
.resume-actions .btn { padding: 0 16px; }
.resume-actions .btn-outline { padding: 0 14px; }

.home-list { display: flex; flex-direction: column; gap: 14px; }
.list-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 28px; border-bottom: 1px solid var(--line); }
.tabs.compact { gap: 28px; flex-wrap: wrap; }
.tabs.compact > button { padding: 10px 0; }
.sort { margin-left: auto; padding-bottom: 8px; font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; }
.sort-box { position: relative; display: inline-flex; align-items: center; color: var(--text); }
.sort-select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--text);
  padding: 4px 22px 4px 4px; border-radius: 6px; cursor: pointer;
}
.sort-select:hover { background: var(--field); }
.sort-box > svg { position: absolute; right: 5px; pointer-events: none; }

.tbl-wrap { border: 1px solid var(--card-line); border-radius: var(--r-card); overflow: hidden; container-type: inline-size; }
.tbl { --cols: minmax(0, 2.6fr) 140px 90px minmax(0, 1.1fr) 120px 190px; }
.tbl .tr { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.tbl .tr.th { padding: 10px 20px; background: var(--side); font-size: 13px; font-weight: 600; color: var(--text-2); border-top: 0; }
.tbl .tr.clickable { cursor: pointer; }
.tbl .tr.clickable:hover { background: #FBFCFC; }
.td { min-width: 0; }
.row-main {
  display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; text-decoration: none; color: var(--text); background: none; border: 0; padding: 0;
  text-align: left; font: inherit; cursor: pointer;
}
span.row-main { cursor: default; }
.row-main:hover { color: var(--text); }
a.row-main:hover .row-title, button.row-main:hover .row-title { text-decoration: underline; }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-status { padding: 3px 10px; }
.td-count { font-size: 14px; }
.td-prog { display: flex; flex-direction: column; gap: 5px; }
.prog-text { font-size: 13px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.prog-text.bad { color: var(--bad); }
.td-when { font-size: 13.5px; color: var(--muted); }
.td-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.td-actions .btn { height: 36px; padding: 0 16px; font-size: 14px; }
.td-actions .btn.sm { padding: 0 12px; font-size: 13.5px; gap: 6px; }
.td-actions .btn-link { font-size: 14px; text-decoration: none; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: progress; }
.td-actions .btn-link:hover { text-decoration: underline; }
.tbl-empty { padding: 36px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); }
.tbl-empty p { margin: 0; }
.tbl-empty.big { padding: 56px 20px; gap: 10px; }
.tbl-empty.card { border: 1px solid var(--card-line); }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--field); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.tbl-note { margin-top: 10px; }
.ph-lines { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.list-skel { display: flex; flex-direction: column; gap: 10px; }

/* the table gives up its « Articles » column, then becomes cards, as its own width shrinks */
@container (max-width: 999px) {
  .tbl { --cols: minmax(0, 2.2fr) 132px minmax(0, 1.2fr) 112px 176px; }
  .tbl .td-count, .tbl .tr.th > :nth-child(3) { display: none; }
  .tbl.tbl-exports { --cols: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 120px 190px; }
  .tbl.tbl-exports .td-count, .tbl.tbl-exports .tr.th > :nth-child(3) { display: block; }
}
@container (max-width: 879px) {
  .tbl .tr.th { display: none; }
  .tbl .tr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .tbl .td-main { grid-column: 1; grid-row: 1; }
  .tbl .td-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .tbl .td-prog { grid-column: 1 / -1; grid-row: 2; }
  .tbl .td-when { grid-column: 1; grid-row: 3; }
  .tbl .td-actions { grid-column: 2; grid-row: 3; }
  .tbl.tbl-exports .tr { grid-template-columns: minmax(0, 1fr); }
  .tbl.tbl-exports .tr > * { grid-column: 1; grid-row: auto; }
  .tbl.tbl-exports .td-actions { justify-content: flex-start; }
}

/* ---------------------------------------------------------------------------------------------------------
   « Nouvelle consultation » and « Lecture en cours » dialogs
   --------------------------------------------------------------------------------------------------------- */
.modal:focus, .modal:focus-visible { outline: none; }
.modal.wide { width: 1080px; height: 760px; flex-direction: row; }
.modal-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.modal-head.ruled { align-items: flex-start; gap: 16px; padding: 22px 28px 16px; border-bottom: 1px solid var(--line); }
.modal-sub { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.steps-nav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps-note { margin-top: auto; padding: 12px 10px 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.steps-note strong { color: var(--text); font-weight: 600; }
.foot-left { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.foot-note { font-size: 14px; color: var(--text-2); }
.foot-problem { font-size: 13.5px; color: var(--bad); }
.foot-problem:empty { display: none; }
.btn-38 { height: 38px; padding: 0 16px; font-size: 14px; }

.depot-tabs { gap: 24px; padding: 0 28px; margin-top: 10px; border-bottom: 1px solid var(--line); }
.depot-tabs > button { padding: 8px 0; display: inline-flex; align-items: center; gap: 8px; }
.depot-tabs > button.soon { cursor: not-allowed; }
.dz { border: 1.5px dashed var(--drop-dash); border-radius: 10px; background: var(--side); padding: 18px 20px; display: flex; align-items: center; gap: 16px; }
.dz.over { border-color: var(--accent); background: var(--sel-card); }
.dz .dz-text { gap: 0; }
.dz .dz-title { font-size: 15px; }
.dz .hint { font-size: 13.5px; }
.list-head { display: flex; flex-direction: column; gap: 2px; }
.f-list { display: flex; flex-direction: column; gap: 16px; }
.f-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.f-row[data-state="error"] { border-color: #F0C2B5; background: #FFFBFA; }
.f-thumb { flex: 0 0 38px; display: inline-flex; }
.f-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.f-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-name .chip { margin-left: 8px; font-weight: 500; vertical-align: 1px; }
.f-detail { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-error { color: var(--bad); white-space: normal; }
.f-sending { display: flex; align-items: center; gap: 12px; }
.f-sending .progress { flex: 0 0 180px; }
.f-sending .progress > span { background: var(--accent); }
.f-side { flex: 0 0 auto; display: inline-flex; }
.f-pages { width: 72px; height: 36px; border-radius: 8px; background: var(--field); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.f-none { font-size: 14px; color: var(--muted); text-align: center; padding: 6px 0; }
.rule { height: 1px; background: var(--line); flex: 0 0 auto; }
.depot-options { display: flex; flex-wrap: wrap; gap: 24px; }
.depot-group { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; }
.depot-group:last-child { flex-basis: 320px; gap: 10px; }
.group-title { font-weight: 600; font-size: 15px; }
.modal.wide .modal-body > * { flex: 0 0 auto; }

.modal.wide .modal-body { gap: 16px; }
.modal.wide .read-list { gap: 14px; }
.read-card { border: 1px solid var(--card-line); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.read-top { display: flex; align-items: center; gap: 14px; }
.read-dyn { display: flex; flex-direction: column; gap: 12px; }
.read-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.read-name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.read-sub { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.read-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rs { display: flex; flex-direction: column; gap: 6px; }
.rs-bar { height: 5px; border-radius: 5px; background: var(--track); }
.rs-label { font-size: 12.5px; color: var(--faint); }
.rs.done .rs-bar { background: var(--accent); }
.rs.done.last .rs-bar { background: var(--ok); }
.rs.done .rs-label { color: var(--text-2); }
.rs.cur .rs-bar { background: var(--accent); opacity: 0.4; animation: breathe 1.6s ease-in-out infinite; }
.rs.cur .rs-label { color: var(--text); font-weight: 600; }
.rs.bad .rs-bar { background: var(--bad-ring); }
.rs.bad .rs-label { color: var(--bad); font-weight: 600; }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }
.read-status { font-size: 13.5px; color: var(--text-2); }
.read-status.bad { color: var(--bad); }
.read-note { display: block; font-size: 13px; color: var(--muted); }
.read-found { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--side); }
.found-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.found-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.found-code { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; background: #FFFFFF; border: 1px solid var(--card-line); font-weight: 700; font-size: 12.5px; }
.found-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.found-qty { flex: 0 0 auto; font-size: 13px; color: var(--text-2); }
.found-more { font-size: 13px; color: var(--muted); }

.drop-veil {
  position: fixed; inset: 0; z-index: 60; background: rgba(10, 99, 242, 0.08); border: 3px dashed var(--accent); display: flex; align-items: center;
  justify-content: center; pointer-events: none;
}
.drop-veil-box { background: #FFFFFF; border-radius: var(--r-modal); padding: 28px 40px; box-shadow: var(--shadow-modal); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--accent); }
.drop-veil-box strong { font-size: 17px; color: var(--text); }
.drop-veil-box span { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------------------------------------------------
   Login and full-page messages
   --------------------------------------------------------------------------------------------------------- */
.message { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; background: var(--side); }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 48px 16px; background: #F5F7F9; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark.lg { width: 44px; height: 44px; border-radius: 11px; }
.brand-text.lg .brand-name { font-size: 22px; }
.login-card { width: 420px; max-width: 100%; padding: 40px clamp(20px, 6vw, 36px); border-radius: 16px; border-color: #E3E7EB; box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04), 0 12px 32px rgba(15, 20, 25, 0.06); }
.login .field-lg, .login .btn-lg { height: 48px; font-size: 16px; } /* 16px: no zoom on focus on iOS */
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-title { gap: 6px; }
.login-form h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.login-field { gap: 6px; }
.login-safe { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.login-safe svg { color: var(--ok); flex: 0 0 auto; }
.field-lg { height: 44px; font-size: 15px; }
.field[aria-invalid="true"] { outline: 2px solid var(--bad-ring); }
.form-error { font-size: 14px; color: var(--bad); background: var(--bad-bg); border-radius: var(--r-control); padding: 10px 12px; }
.form-error:empty { display: none; }
.login-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--sel-bg), #EDE9FF); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.login-icon.sent { background: linear-gradient(135deg, var(--ok-bg), #DDF3FF); color: var(--ok); }
.login-actions { flex-wrap: wrap; gap: 8px 16px; }
.demo-link { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px; background: var(--attention-bg); font-size: 14px; }
.demo-link p { margin: 0; color: var(--attention-title); }
.login-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.login-foot .org-logo { height: 24px; width: auto; max-width: 140px; }
.login-foot .org-logo-indigo { height: 44px; } /* square mark: needs more height to read */
.message-card { width: 480px; max-width: 100%; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.message-card h1 { font-size: 22px; font-weight: 600; }
.loading-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------------------------------------------------
   Catalogue, Réponses téléchargées, Réglages, Aide
   --------------------------------------------------------------------------------------------------------- */
.cat-count { font-size: 14px; color: var(--muted); margin: 0 0 10px; min-height: 20px; }
.cat-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--card-line); border-radius: var(--r-card); overflow: hidden; }
.cat-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.cat-row:first-child { border-top: 0; }
.cat-photo { width: 64px; height: 64px; border-radius: 8px; }
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cat-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cat-name { font-size: 15px; }
.cat-line .code-chip { font-size: 12.5px; padding: 1px 8px; }
.cat-des { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-spec { font-size: 13.5px; color: var(--muted); }
.cat-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.cat-link:hover { text-decoration: underline; }
.cat-list .tbl-empty:first-child { border-top: 0; }


.tbl-exports { --cols: minmax(0, 2.6fr) minmax(0, 2fr) minmax(0, 1.4fr) 130px 200px; }
.tbl .td > .ellipsis { display: block; }
.tbl .td > a { text-decoration: none; }
.tbl .td > a:hover { text-decoration: underline; }
.td-file { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 14.5px; }
.td-file .fmt { flex: 0 0 auto; }
.tbl-exports .td { font-size: 14px; }
.tbl-exports .td-when { font-size: 13.5px; }

.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.set-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.set-field { display: flex; flex-direction: column; gap: 6px; }
.set-logout { align-self: flex-start; }

.help-section { display: flex; flex-direction: column; gap: 12px; }
.help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.help-steps li { display: flex; gap: 12px; align-items: flex-start; }
.help-steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.help-steps .badge-unit { margin-top: 1px; }
kbd {
  font-family: var(--font); font-size: 12.5px; font-weight: 600; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--control-line); border-bottom-width: 2px; background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
}
.kbd-list { margin: 0; display: flex; flex-direction: column; }
.kbd-row { display: flex; align-items: center; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.kbd-row:first-child { border-top: 0; }
.kbd-row dt { flex: 0 0 150px; display: flex; align-items: center; gap: 6px; }
.kbd-row dd { margin: 0; font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
  .rs.cur .rs-bar { animation: none; }
  .progress > span, .skeleton { transition: none; animation: none; }
}

/* ---------------------------------------------------------------------------------------------------------
   Narrow windows (down to 900 px and below): the sidebar becomes a bar on top
   --------------------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: static; height: auto; min-height: 0; flex: 0 0 auto; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a, .nav button { width: auto; height: 36px; padding: 0 10px; gap: 8px; font-size: 14px; }
  .nav .count { margin-left: 2px; }
  .nav-spacer { display: none; }
  .pill-new { width: auto; height: 38px; padding: 0 16px; }
  .org-card { padding: 6px 10px; }
  .user-block { border-top: 0; padding: 0; margin-left: auto; }
  .main { padding: 24px 16px; }
  .backdrop { padding: 16px; }
  .modal.wide { width: 100%; height: 100%; }
  .modal.wide .steps-nav { display: none; }
  .modal-head, .modal-head.ruled { padding-left: 20px; padding-right: 20px; }
  .modal-body, .modal-foot { padding-left: 20px; padding-right: 20px; }
  .depot-tabs { padding: 0 20px; flex-wrap: wrap; }
  .home-cards { grid-template-columns: 1fr; }
  .home-card.resume { flex-wrap: wrap; }
  .read-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------------------------------------------
   Accueil details: greeting, drop zone
   --------------------------------------------------------------------------------------------------------- */
.page-kicker { font-size: 13.5px; font-weight: 600; color: var(--accent); }
.home-card:first-child { background: linear-gradient(180deg, #FFFFFF 0%, #FAFCFF 100%); }
.dropzone-big { background: radial-gradient(120% 140% at 0% 0%, var(--sel-card) 0%, var(--side) 60%); }
.dz-icon { box-shadow: 0 0 0 6px rgba(10, 99, 242, 0.06); }

/* ---------------------------------------------------------------------------------------------------------
   Catalogue: search, family chips, marks, pages
   --------------------------------------------------------------------------------------------------------- */
.cat-tools { display: flex; flex-direction: column; gap: 14px; }
.cat-search { height: 48px; padding: 0 8px 0 16px; border-radius: 12px; background: #FFFFFF; border: 1px solid var(--control-line); box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04); }
.cat-search input { font-size: 15.5px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  height: 32px; padding: 0 6px 0 12px; border-radius: 99px; border: 1px solid var(--control-line); background: #FFFFFF;
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2);
}
.cat-chip:hover { border-color: var(--sel-line); color: var(--text); }
.cat-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.cat-chip-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--field); color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cat-chip[aria-pressed="true"] .cat-chip-n { background: rgba(255, 255, 255, 0.22); color: #FFFFFF; }
.cat-count strong { color: var(--text); font-weight: 600; }
.cat-list { transition: opacity .15s ease; }
.cat-list.loading { opacity: 0.55; }
.cat-row:hover { background: var(--side); }
.cat-photo .none { color: var(--mute-ring); display: flex; }
mark { background: #FFF1B8; color: inherit; border-radius: 3px; padding: 0 1px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager:empty { display: none; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn, .pager-n {
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--control-line); background: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text);
}
.pager-n { padding: 0 8px; border-color: transparent; }
.pager-btn:hover:not(:disabled), .pager-n:hover { background: var(--side); border-color: var(--control-line); }
.pager-btn:disabled { color: var(--mute-ring); }
.pager-n[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 700; }
.pager-gap { padding: 0 4px; color: var(--muted); }
