/*
 * SPS-CARBON × BoardUI: the application frame.
 * BoardUI's app-shell (floating sidebar on a canvas), its sidebar elevation,
 * footer stat cards and data-table header band, rebuilt in the platform's own
 * language: petrol shade instead of black, viridian signal, soft radii, Mona
 * Sans. Controls stay gel.css's. Screen only: paper keeps the classic layout.
 */
@media screen {

/* ---------- Window: a floating sidebar on the canvas ---------- */
:root { --r-frame: 20px; }

@media (min-width: 1001px) {
  :root { --frame: 12px; --toolbar-h: 68px; --sidebar-w: 284px; }
  html.side-compact { --sidebar-w: 84px; }

  .sidebar {
    inset: var(--frame) auto var(--frame) var(--frame);
    width: calc(var(--sidebar-w) - 2 * var(--frame));
    border-right: 0; border-radius: var(--r-frame);
    background: var(--side-bg);
    box-shadow: var(--sidebar-shadow);
  }
  /* The logo row lines up with the toolbar's content row. */
  .side-top { height: calc(var(--toolbar-h) - var(--frame)); }
  .toolbar { padding-top: var(--frame); }
}

@media (max-width: 1000px) {
  .sidebar {
    inset: 8px auto 8px 8px; border-right: 0; border-radius: var(--r-frame);
    background: var(--side-bg);
    transform: translateX(calc(-100% - 16px));
  }
  .scrim { background: rgb(6 33 41 / 0.24); }
}

/* ---------- Tones: BoardUI's palette, one name per colour ----------
 * --t1 → --t2: the tile gradient under a white glyph; --tt / --tk: the soft
 * tint and its ink (avatars, chips). */
[data-tone="emerald"] { --t1: var(--emerald-500); --t2: var(--emerald-600); --tt: var(--emerald-100); --tk: var(--emerald-700); }
[data-tone="sky"] { --t1: var(--sky-500); --t2: var(--sky-600); --tt: var(--sky-100); --tk: var(--sky-700); }
[data-tone="blue"] { --t1: var(--blue-500); --t2: var(--blue-600); --tt: var(--blue-100); --tk: var(--blue-700); }
[data-tone="indigo"] { --t1: var(--indigo-500); --t2: var(--indigo-600); --tt: var(--indigo-100); --tk: var(--indigo-700); }
[data-tone="violet"] { --t1: var(--violet-500); --t2: var(--violet-600); --tt: var(--violet-100); --tk: var(--violet-700); }
[data-tone="purple"] { --t1: var(--purple-500); --t2: var(--purple-600); --tt: var(--purple-100); --tk: var(--purple-700); }
[data-tone="pink"] { --t1: var(--pink-500); --t2: var(--pink-600); --tt: var(--pink-100); --tk: var(--pink-700); }
[data-tone="rose"] { --t1: var(--rose-500); --t2: var(--rose-600); --tt: var(--rose-100); --tk: var(--rose-700); }
[data-tone="orange"] { --t1: var(--orange-500); --t2: var(--orange-600); --tt: var(--orange-100); --tk: var(--orange-700); }
[data-tone="amber"] { --t1: var(--amber-600); --t2: var(--amber-700); --tt: var(--amber-100); --tk: var(--amber-800); }
[data-tone="lime"] { --t1: var(--lime-600); --t2: var(--lime-700); --tt: var(--lime-100); --tk: var(--lime-800); }
[data-tone="teal"] { --t1: var(--teal-500); --t2: var(--teal-600); --tt: var(--teal-100); --tk: var(--teal-700); }
[data-tone="cyan"] { --t1: var(--cyan-500); --t2: var(--cyan-600); --tt: var(--cyan-100); --tk: var(--cyan-700); }
[data-tone="slate"] { --t1: var(--slate-500); --t2: var(--slate-600); --tt: var(--slate-100); --tk: var(--slate-700); }
/* Key-figure tiles name a meaning, not a hue (figIcon in components.js): a
 * judgement is a solid colour, a plain fact ("calm") stays tinted in the
 * brand green, so the eye goes to what needs attention. */
[data-tone="good"], [data-tone="calm"] { --t1: var(--emerald-500); --t2: var(--emerald-600); --tt: var(--emerald-100); --tk: var(--emerald-700); }
[data-tone="warn"] { --t1: var(--amber-600); --t2: var(--amber-700); --tt: var(--amber-100); --tk: var(--amber-800); }
[data-tone="bad"] { --t1: var(--rose-500); --t2: var(--rose-600); --tt: var(--rose-100); --tk: var(--rose-700); }

/* ---------- Sidebar: white in light, dark in dark; icons in one ink ----------
 * Colour means something on this platform (where you are; good, to check, a
 * problem; the scopes in charts), so the sidebar draws its icons in ink and
 * only the row you are on turns viridian. */
.side-item { height: 32px; gap: 0.6rem; padding: 0 0.5rem 0 0.4rem; font-weight: 500; }
.side-ic { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; color: var(--label-3); transition: color var(--m-150) var(--ease); }
.side-item .side-ic .i, .side-item.is-active .side-ic .i { width: 18px; height: 18px; }
.side-item:is(:hover, :focus-visible) .side-ic { color: var(--label); }
.side-item.is-active .side-ic { color: var(--emerald-700); }
html[data-theme="dark"] .side-item.is-active .side-ic { color: #7fe8c4; }
@media (min-width: 1001px) {
  .side-compact .side-item { height: 40px; }
  .side-compact .side-ic { width: 30px; height: 30px; }
  .side-compact .side-item .side-ic .i { width: 20px; height: 20px; }
}
/* Selected row and its sliding highlight: a soft green pill. Labels stay
 * dark on it, so the highlight can glide behind any of them. */
.side-item.is-active, .side-ghost {
  background: linear-gradient(180deg, color-mix(in srgb, var(--emerald-100) 55%, #ffffff), var(--emerald-100));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--emerald-500) 26%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.95), 0 6px 14px -9px color-mix(in srgb, var(--emerald-600) 70%, transparent);
}
.side-item.is-active { color: var(--emerald-800); font-weight: 650; }
html[data-theme="dark"] .side-item.is-active, html[data-theme="dark"] .side-ghost {
  background: linear-gradient(180deg, rgb(45 212 160 / 0.22), rgb(45 212 160 / 0.12));
  box-shadow: inset 0 0 0 1px rgb(69 220 167 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.07), 0 6px 14px -9px rgb(0 0 0 / 0.8);
}
html[data-theme="dark"] .side-item.is-active { color: #ffffff; }
.side-item.is-active.side-arriving { background: transparent; box-shadow: none; }
.side-context:not(.is-static) { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); }
button.side-context:hover { background: var(--fill-3); }

/* Counters and "Nouveau": BoardUI chips. */
.side-count, .side-item.is-active .side-count { color: var(--orange-700); background: var(--orange-100); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange-500) 25%, transparent); }
.side-new { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--emerald-500) 22%, transparent); }
html[data-theme="dark"] .side-count, html[data-theme="dark"] .side-item.is-active .side-count { color: oklch(83.7% 0.128 66.29); background: color-mix(in srgb, var(--orange-950) 70%, transparent); }
html[data-theme="dark"] .side-new { color: #7fe8c4; background: rgb(45 212 160 / 0.14); }
.badge { background: var(--rose-500); color: #ffffff; box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Avatars: one BoardUI tint per person ---------- */
.avatar[data-tone] { background: var(--tt); color: var(--tk); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t1) 22%, transparent); }
html[data-theme="dark"] .avatar[data-tone] { background: color-mix(in srgb, var(--t1) 26%, transparent); color: color-mix(in srgb, var(--t1) 55%, #ffffff); }

/* ---------- File cards: a miniature page with its format tag, in one ink ---------- */
/* Drawn in page units (--u): 56 x 72 at "m", half at "s". A format is not a meaning: no hue. */
.file-card { --u: 0.5px; position: relative; flex: none; display: inline-block; width: calc(56 * var(--u)); height: calc(72 * var(--u)); border-radius: calc(var(--r-xs) * 0.6); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep-2), 0 1px 2px rgb(6 33 41 / 0.06); vertical-align: middle; }
.file-card-m { --u: 1px; border-radius: var(--r-xs); }
.file-card svg { display: block; width: 100%; height: 100%; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.file-card path { fill: currentColor; stroke: currentColor; }
.file-card .fs { color: var(--label); opacity: 0.26; }
.file-card .fw { color: var(--label); opacity: 0.13; }
.file-card .fa { color: var(--label); opacity: 0.32; }
.file-card-s .fs { opacity: 0.34; }
.file-card-s .fw { opacity: 0.2; }
.file-card > .file-tag { position: absolute; right: calc(-8 * var(--u)); bottom: calc(6 * var(--u)); padding: max(calc(2 * var(--u)), 1px) max(calc(6 * var(--u)), 3px); border-radius: calc(var(--r-xs) * 0.5); background: var(--surface); color: var(--label-2); box-shadow: inset 0 0 0 1px var(--sep-2), 0 1px 2px rgb(6 33 41 / 0.08); font: 650 max(calc(8 * var(--u)), 7px) / 1.25 var(--font); letter-spacing: 0.04em; white-space: nowrap; }
html[data-theme="dark"] :is(.file-card, .file-card > .file-tag) { background: var(--surface-raised); }
.file-line { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

/* ---------- Status chips: BoardUI's pairs (200 / 800 in light) ---------- */
.status, .pill-tag { --cb: var(--slate-200); --ck: var(--slate-700); }
.pill-tag.ok, .status[data-status="valide"] { --cb: var(--emerald-200); --ck: var(--emerald-800); }
.pill-tag.info, .status[data-status="soumis"], .status[data-status="en_revue"] { --cb: var(--sky-200); --ck: var(--sky-800); }
.pill-tag.wait { --cb: var(--amber-200); --ck: var(--amber-800); }
.pill-tag.miss, .status[data-status="a_corriger"] { --cb: var(--rose-200); --ck: var(--rose-800); }
.status, .pill-tag { color: var(--ck); background: var(--cb); box-shadow: none; }
html[data-theme="dark"] :is(.status, .pill-tag) { --cb: rgb(148 163 184 / 0.16); --ck: oklch(86.9% 0.022 252.894); }
html[data-theme="dark"] :is(.pill-tag.ok, .status[data-status="valide"]) { --cb: color-mix(in srgb, var(--emerald-950) 70%, transparent); --ck: oklch(76.5% 0.177 163.223); }
html[data-theme="dark"] :is(.pill-tag.info, .status[data-status="soumis"], .status[data-status="en_revue"]) { --cb: color-mix(in srgb, var(--sky-950) 70%, transparent); --ck: oklch(74.6% 0.16 232.661); }
html[data-theme="dark"] .pill-tag.wait { --cb: color-mix(in srgb, var(--amber-950) 70%, transparent); --ck: oklch(82.8% 0.189 84.429); }
html[data-theme="dark"] :is(.pill-tag.miss, .status[data-status="a_corriger"]) { --cb: color-mix(in srgb, var(--rose-950) 70%, transparent); --ck: oklch(71.2% 0.194 13.428); }
.status-select.tone-ok { --cb: var(--emerald-200); --ck: var(--emerald-800); }
.status-select.tone-info { --cb: var(--sky-200); --ck: var(--sky-800); }
.status-select.tone-wait { --cb: var(--amber-200); --ck: var(--amber-800); }
.status-select.tone-miss { --cb: var(--rose-200); --ck: var(--rose-800); }
.status-select.tone-ok, .status-select.tone-info, .status-select.tone-wait, .status-select.tone-miss { color: var(--ck); background-color: var(--cb); background-image: var(--chev); box-shadow: none; }

/* ---------- Primary action: a viridian gel with deep-green ink ----------
 * BoardUI's gradient button; the gradient is twice the height of the button
 * and slides up on hover, so the change is smooth (CSS cannot fade one
 * gradient into another). */
.btn-primary {
  color: var(--accent-ink); font-weight: 650;
  background: linear-gradient(180deg, #74e9c1 0%, #3fd7a3 50%, #1fbf8a 100%) 0 100% / 100% 200%;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), inset 0 0 0 1px rgb(4 96 64 / 0.16), 0 1px 2px rgb(4 60 40 / 0.18), 0 8px 18px -8px rgb(37 198 145 / 0.7);
  transition: background-position var(--m-300) var(--ease), box-shadow var(--m-200) var(--ease), transform 0.5s var(--ease-spring);
}
.btn-primary:hover { background-position: 0 0; background-color: transparent; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 0 0 1px rgb(4 96 64 / 0.16), 0 1px 2px rgb(4 60 40 / 0.18), 0 12px 24px -10px rgb(37 198 145 / 0.8); }
.btn-primary .i { color: var(--accent-ink); }
/* The page-action sphere and the "add a line" bead: green glass, not petrol. */
:root { --sphere-1: #b6f5dc; --sphere-2: #34d39e; --sphere-3: #14a777; --sphere-ink: #ffffff; }

/* ---------- Living icons ----------
 * Each icon acts out its meaning with its own parts (icons.js names them .b
 * to .e) when its control is pointed at or reached with the keyboard: the
 * bell swings and its clapper follows, the truck's body bobs as it drives, the
 * bin's lid lifts, the paper plane flies off and comes back, the gauge needle
 * sweeps. Transform and opacity only, never looping, every move ends exactly at
 * rest. Pace (the user, 19 Nov 2026: "a medium speed"): one move 520 ms, a
 * two-beat move 720 ms, on a soft ease-out (--ic-ease) rather than a snap.
 * gel.js keeps .is-acting for the whole move, so it always plays to its end.
 * Every icon in a control plays, the sphere, the add bead, the droplets and
 * the drop zones included: gel.js moves those controls as a whole (the
 * sphere's plus turns into a cross), the parts below still act out the icon. */
:root { --ic-move: 520ms; --ic-move-2: 720ms; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); }
.i * { transform-box: fill-box; transform-origin: 50% 50%; }
/* Arms drawn with rotate(a 12 12) (snow, sun, recycle) keep SVG's own origin. */
.i [transform] { transform-box: view-box; transform-origin: 0 0; }
.i.is-acting, .i.is-acting :is(.b, .c, .d, .e) {
  animation-duration: var(--act, var(--ic-move)); animation-timing-function: var(--ic-ease); animation-fill-mode: backwards;
}
/* Turns around the icon's centre end on a symmetric pose, so nothing jumps. */
:is(.i-plus, .i-close, .i-gear, .i-snow, .i-sun, .i-refresh, .i-recycle, .i-history, .i-target, .i-gauge, .i-scales) :is(.b, .c) { transform-box: view-box; transform-origin: 12px 12px; }
.i-gauge .b { transform-origin: 12px 14px; }
.i-scales .b { transform-origin: 12px 7.5px; }
.i-bell :is(.b, .c) { transform-origin: 50% 0%; }
:is(.i-flame, .i-chart, .i-report, .i-waterfall, .i-drop) :is(.b, .c, .d, .e) { transform-origin: 50% 100%; }
:is(.i-file, .i-note, .i-menu, .i-monitor, .i-book) :is(.b, .c, .d) { transform-origin: 0% 50%; }
.i-trend .b, .i-leaf .b { transform-origin: 0% 100%; }
.i-fall .b { transform-origin: 0% 0%; }
.i-trash .b { transform-origin: 8% 100%; }
.i-mail .b { transform-origin: 50% 0%; }
.i-seedling .b { transform-origin: 100% 100%; }
.i-seedling .c { transform-origin: 0% 100%; }
.i-search .b { transform-origin: 40% 40%; }

/* Actions */
.i-plus.is-acting .b, .i-close.is-acting .b { animation-name: ic-turn-90; }
.i-check.is-acting .b, .i-shield.is-acting .b { animation-name: ic-appear; }
.i-shield { --act: var(--ic-move-2); }
.i-shield.is-acting .b { animation-delay: 130ms; }
.i-chevron.is-acting .b, .i-enter.is-acting .b { animation-name: ic-right; }
.i-back.is-acting .b, .i-logout.is-acting .b, .i-undo.is-acting .b { animation-name: ic-left; }
.i-down.is-acting .b, .i-caret.is-acting .b, .i-download.is-acting .b { animation-name: ic-dip; }
.i-upload.is-acting .b, .i-lock.is-acting .b, .i-user.is-acting .b { animation-name: ic-rise; }
.i-menu.is-acting :is(.b, .c, .d), .i-file.is-acting :is(.b, .c), .i-note.is-acting :is(.b, .c), .i-monitor.is-acting .b { animation-name: ic-write; }
:is(.i-menu, .i-file, .i-note, .i-report, .i-chart, .i-waterfall, .i-grid, .i-comment, .i-building, .i-team, .i-filter) .c { animation-delay: 100ms; }
:is(.i-menu, .i-report, .i-chart, .i-waterfall, .i-grid, .i-comment, .i-building) .d { animation-delay: 190ms; }
:is(.i-waterfall, .i-grid) .e { animation-delay: 280ms; }
.i-filter.is-acting :is(.b, .c) { animation-name: ic-widen; }
.i-search.is-acting .b { animation-name: ic-scan; }
.i-copy.is-acting .b { animation-name: ic-unstack; }
/* The pen tips toward the line, then the line is written. */
.i-pen { --act: var(--ic-move-2); }
.i-pen .b { transform-origin: 20% 90%; }
.i-pen .c { transform-origin: 0% 50%; }
.i-pen.is-acting .b { animation-name: ic-tilt; }
.i-pen.is-acting .c { animation-name: ic-write; animation-delay: 160ms; }
.i-trash.is-acting .b { animation-name: ic-lid; }
.i-refresh.is-acting .b { animation-name: ic-turn-180; }
.i-send { --act: var(--ic-move-2); }
.i-send.is-acting .b { animation-name: ic-fly; }
.i-stop.is-acting .b { animation-name: ic-pop; }
.i-link.is-acting .b { animation-name: ic-part-out; }
.i-link.is-acting .c { animation-name: ic-part-in; }
.i-clip.is-acting .b, .i-help.is-acting .b { animation-name: ic-tilt; }
.i-printer.is-acting .b { animation-name: ic-feed; }
.i-eye { --act: var(--ic-move-2); }
.i-eye.is-acting .b { animation-name: ic-look; }
.i-sidebar.is-acting .b { animation-name: ic-from-left; }

/* Information */
.i-alert.is-acting .b, .i-calendar.is-acting .b { animation-name: ic-pop; }
.i-info.is-acting .b { animation-name: ic-rise; }
.i-bell { --act: var(--ic-move-2); }
.i-bell.is-acting .b { animation-name: ic-swing; }
.i-bell.is-acting .c { animation-name: ic-clapper; animation-delay: 70ms; }
.i-comment.is-acting :is(.b, .c, .d) { animation-name: ic-type; }
.i-mail.is-acting .b { animation-name: ic-flap; }
.i-mic.is-acting .b { animation-name: ic-rise; }
.i-mic.is-acting .c { animation-name: ic-widen; animation-delay: 100ms; }
.i-speaker :is(.b, .c) { transform-origin: 0% 50%; }
.i-speaker.is-acting :is(.b, .c) { animation-name: ic-wave; }
.i-speaker.is-acting .c { animation-delay: 130ms; }
.i-history { --act: var(--ic-move-2); }
.i-history.is-acting .b { animation-name: ic-rewind; }
.i-target.is-acting .b { animation-name: ic-ring; }
.i-target.is-acting .c { animation-name: ic-appear; animation-delay: 150ms; }
.i-sparkles.is-acting .b { animation-name: ic-star; }
.i-sparkles.is-acting .c { animation-name: ic-appear; animation-delay: 150ms; }
.i-gear.is-acting .b, .i-sun.is-acting .b { animation-name: ic-turn-45; }

/* Documents and data */
.i-report.is-acting :is(.b, .c, .d), .i-chart.is-acting :is(.b, .c, .d), .i-waterfall.is-acting :is(.b, .c, .d, .e) { animation-name: ic-grow; }
.i-book.is-acting .b { animation-name: ic-page; }
.i-trend.is-acting .b, .i-fall.is-acting .b { animation-name: ic-draw; }
.i-trend.is-acting .c { animation-name: ic-arrow-in; animation-delay: 160ms; }
.i-fall.is-acting .c { animation-name: ic-arrow-down-in; animation-delay: 160ms; }
.i-pulse.is-acting .b { animation-name: ic-beat; }
.i-pie.is-acting .b { animation-name: ic-slice; }
.i-gauge { --act: var(--ic-move-2); }
.i-gauge.is-acting .b { animation-name: ic-needle; }
.i-grid.is-acting :is(.b, .c, .d, .e) { animation-name: ic-tile; }
.i-layers.is-acting .b { animation-name: ic-spread-1; }
.i-layers.is-acting .c { animation-name: ic-spread-2; }
.i-scales { --act: var(--ic-move-2); }
.i-scales.is-acting .b { animation-name: ic-balance; }

/* People and places */
.i-users.is-acting .b { animation-name: ic-join; }
.i-team.is-acting :is(.b, .c) { animation-name: ic-rise; }
.i-building.is-acting :is(.b, .c, .d) { animation-name: ic-light; }
.i-factory, .i-bed { --act: var(--ic-move-2); }
.i-factory.is-acting .b, .i-bed.is-acting .b { animation-name: ic-smoke; }
.i-globe.is-acting .b { animation-name: ic-spin-globe; }

/* Emission sources */
.i-flame { --act: var(--ic-move-2); }
.i-flame.is-acting .b { animation-name: ic-flicker; }
.i-flame.is-acting .c { animation-name: ic-flare; animation-delay: 100ms; }
.i-truck { --act: var(--ic-move-2); }
.i-truck.is-acting { animation-name: ic-drive; }
.i-truck.is-acting .b { animation-name: ic-bob; }
.i-drop.is-acting .b { animation-name: ic-drip; }
.i-drop.is-acting .c { animation-name: ic-appear; animation-delay: 190ms; }
.i-snow.is-acting .b { animation-name: ic-turn-60; }
.i-leaf.is-acting .b { animation-name: ic-sway; }
.i-seedling.is-acting .b { animation-name: ic-open-l; }
.i-seedling.is-acting .c { animation-name: ic-open-r; animation-delay: 100ms; }
.i-bolt.is-acting .b { animation-name: ic-flash; }
.i-box.is-acting .b { animation-name: ic-fold; }
.i-cylinder.is-acting .b { animation-name: ic-band; }
.i-flask { --act: var(--ic-move-2); }
.i-flask.is-acting .b { animation-name: ic-slosh; }
.i-flask.is-acting .c { animation-name: ic-bubble; }
.i-recycle.is-acting .b { animation-name: ic-turn-120; }
.i-plane { --act: var(--ic-move-2); }
.i-plane.is-acting .b { animation-name: ic-take-off; }
.i-cloud.is-acting .b { animation-name: ic-drift; }
.i-moon.is-acting .b { animation-name: ic-tilt-in; }

/* Every move starts from a pose and ends at rest (the drawn icon). */
@keyframes ic-turn-45 { from { transform: rotate(-45deg); } }
@keyframes ic-turn-60 { from { transform: rotate(-60deg); } }
@keyframes ic-turn-90 { from { transform: rotate(-90deg); } }
@keyframes ic-turn-120 { from { transform: rotate(-120deg); } }
@keyframes ic-turn-180 { from { transform: rotate(-180deg); } }
@keyframes ic-rewind { from { transform: rotate(360deg); } }
@keyframes ic-needle { from { transform: rotate(-95deg); } }
@keyframes ic-appear { from { opacity: 0; transform: scale(0.55); } }
@keyframes ic-pop { 40% { transform: scale(1.22); } }
@keyframes ic-right { 45% { transform: translateX(2.5px); } }
@keyframes ic-left { 45% { transform: translateX(-2.5px); } }
@keyframes ic-dip { 45% { transform: translateY(2.5px); } }
@keyframes ic-rise { 45% { transform: translateY(-2.2px); } }
@keyframes ic-write { from { transform: scaleX(0); } }
@keyframes ic-widen { from { transform: scaleX(0.3); } }
@keyframes ic-grow { from { transform: scaleY(0.25); } }
@keyframes ic-tile { from { opacity: 0.35; transform: scale(0.7); } }
@keyframes ic-type { from { opacity: 0; transform: translateY(1.5px); } }
@keyframes ic-scan { 45% { transform: rotate(-14deg) scale(1.08); } }
@keyframes ic-unstack { from { opacity: 0; transform: translate(3px, 3px); } }
@keyframes ic-lid { 45% { transform: translate(-0.4px, -2.2px) rotate(-16deg); } }
@keyframes ic-fly {
  0% { animation-timing-function: cubic-bezier(0.55, 0, 0.8, 0.2); }
  42% { opacity: 0; transform: translate(9px, -9px); }
  43% { opacity: 0; transform: translate(-9px, 9px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
}
@keyframes ic-take-off {
  0% { animation-timing-function: cubic-bezier(0.55, 0, 0.8, 0.2); }
  42% { opacity: 0; transform: translateY(-10px); }
  43% { opacity: 0; transform: translateY(10px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
}
@keyframes ic-part-out { 45% { transform: translate(1.3px, -1.3px); } }
@keyframes ic-part-in { 45% { transform: translate(-1.3px, 1.3px); } }
@keyframes ic-tilt { 40% { transform: rotate(-14deg); } }
@keyframes ic-tilt-in { from { transform: rotate(-22deg); } }
@keyframes ic-feed { from { transform: translateY(-3px); } }
@keyframes ic-look { 30% { transform: translateX(-1.7px); } 65% { transform: translateX(1.7px); } }
@keyframes ic-from-left { from { transform: translateX(-3px); } }
@keyframes ic-swing { 20% { transform: rotate(13deg); } 45% { transform: rotate(-9deg); } 70% { transform: rotate(4deg); } }
@keyframes ic-clapper { 25% { transform: translateX(-1.8px); } 50% { transform: translateX(1.4px); } 75% { transform: translateX(-0.5px); } }
@keyframes ic-flap { from { opacity: 0.3; transform: scaleY(0.2); } }
@keyframes ic-wave { from { opacity: 0; transform: translateX(-2.5px) scale(0.8); } }
@keyframes ic-ring { from { opacity: 0.3; transform: scale(0.55); } }
@keyframes ic-star { from { transform: rotate(-90deg) scale(0.7); } }
@keyframes ic-page { 45% { transform: scaleX(0.55); } }
@keyframes ic-draw { from { opacity: 0.2; transform: scale(0.3); } }
@keyframes ic-arrow-in { from { opacity: 0; transform: translate(-2.5px, 2.5px); } }
@keyframes ic-arrow-down-in { from { opacity: 0; transform: translate(-2.5px, -2.5px); } }
@keyframes ic-beat { 35% { transform: scaleY(1.3); } 65% { transform: scaleY(0.9); } }
@keyframes ic-slice { 45% { transform: translate(1.4px, -1.4px); } }
@keyframes ic-spread-1 { 45% { transform: translateY(1.4px); } }
@keyframes ic-spread-2 { 45% { transform: translateY(2.8px); } }
@keyframes ic-balance { 30% { transform: rotate(8deg); } 65% { transform: rotate(-5deg); } }
@keyframes ic-join { from { opacity: 0; transform: translateX(-3px); } }
@keyframes ic-light { from { opacity: 0.1; } }
@keyframes ic-smoke { 55% { opacity: 0; transform: translate(1px, -3px); } 56% { opacity: 0; transform: translate(0, 1.5px); } }
@keyframes ic-spin-globe { 50% { transform: scaleX(0.15); } }
@keyframes ic-flicker { 30% { transform: scale(0.95, 1.07); } 62% { transform: scale(1.03, 0.97); } }
@keyframes ic-flare { from { opacity: 0.4; transform: scale(0.5); } }
@keyframes ic-drive { 40% { translate: 2px 0; } }
@keyframes ic-bob { 25% { transform: translateY(-1.2px); } 50% { transform: none; } 75% { transform: translateY(-0.6px); } }
@keyframes ic-drip { 35% { transform: translateY(-2px) scale(0.94, 1.06); } 70% { transform: translateY(0.5px) scale(1.04, 0.96); } }
@keyframes ic-sway { 40% { transform: rotate(-9deg); } }
@keyframes ic-open-l { from { transform: rotate(20deg); } }
@keyframes ic-open-r { from { transform: rotate(-20deg); } }
@keyframes ic-flash { 20% { opacity: 0.25; transform: scale(0.92); } 45% { opacity: 1; transform: scale(1.08); } 65% { opacity: 0.6; } }
@keyframes ic-fold { from { opacity: 0; transform: translateY(-2px); } }
@keyframes ic-band { from { opacity: 0; transform: translateY(-4px); } }
@keyframes ic-slosh { 30% { transform: rotate(-9deg); } 65% { transform: rotate(5deg); } }
@keyframes ic-bubble { 65% { opacity: 0; transform: translateY(-4.5px); } 66% { opacity: 0; transform: none; } }
@keyframes ic-drift { 50% { transform: translateX(1.6px); } }
/* The solid SPS mark standing as an icon (SPS IA button): it leans in and settles. */
.i-mark.is-acting { animation: ic-mark var(--ic-move-2) var(--ic-ease); }
@keyframes ic-mark { 35% { transform: rotate(-10deg) scale(1.12); } 70% { transform: rotate(3deg) scale(0.97); } }
@media (prefers-reduced-motion: reduce) { .i, .i * { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { .i-mark { animation: none !important; } }
html.reduce-motion :is(.i, .i *, .i-mark) { animation: none !important; }

/* ---------- Toolbar: frosted glass, edge appears once the page scrolls ---------- */
.toolbar { background: transparent; }
/* The glass sits on a pseudo-element: a backdrop-filter on the toolbar itself
 * would become the containing block of its fixed-position menus. */
.toolbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
@supports (animation-timeline: scroll()) {
  .toolbar { border-bottom-color: transparent; animation: frame-edge linear both; animation-timeline: scroll(root block); animation-range: 0 48px; }
  @keyframes frame-edge { to { border-bottom-color: var(--sep-2); box-shadow: 0 12px 24px -22px rgb(var(--shade, 6 33 41) / 0.5); } }
}

/* ---------- Key figures: BoardUI stat cards ----------
 * A white card per figure, headed by a coloured tile (the figure's meaning),
 * then the label, the value, and the comparison on a recessed band. No card
 * carries a decorative light: green means good, nothing else. */
.summary { gap: 0.75rem; background: none; border-radius: 0; box-shadow: none; }
.summary-cell, .summary-cell + .summary-cell, .summary-cell:nth-child(n), .kpi {
  display: flex; flex-direction: column; gap: 0; min-width: 0;
  padding: 0.5rem; border: 0; border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--card-shadow);
}
.kpi.is-link { padding: 0; transition: box-shadow var(--m-150) var(--ease), transform 0.5s var(--ease-spring); }
.kpi.is-link a { display: flex; flex-direction: column; gap: 0; flex: 1; padding: 0.5rem; }
.kpi.is-link:hover { box-shadow: var(--card-shadow), 0 14px 28px -18px rgb(var(--shade, 6 33 41) / 0.38); transform: translateY(-1px); }
/* ---------- Icon tiles ----------
 * Every icon that sits on a tile shares one recipe: a soft tint of its meaning,
 * the icon drawn in that meaning's ink, a hairline of the same ink. Never a
 * solid colour with a white glyph (the old, stock look). A plain fact is
 * neutral grey; green, amber and red only say good, to check, a problem.
 * Shape: a rounded square at 30 % of its side, with continuous (squircle)
 * corners where the browser can draw them. Sizes: 40 key figures, 36 sources
 * and products, 32 insights, 28 history, 24 notifications and settings; the
 * icon at half the side (14 px at the two smallest). */
:is(.fig-ic, .insight-ic, .timeline-icon, .notif-glyph, .settings-ic, .product-ic, .src-tile, .src-ic, .src-drop-ic) {
  --tile-bg: var(--fill-2); --tile-ink: var(--label-2); --tile-line: var(--sep);
  display: inline-grid; place-items: center; flex: none;
  width: var(--tile); height: var(--tile); border: 0; border-radius: calc(var(--tile) * 0.3);
  background: var(--tile-bg); color: var(--tile-ink); box-shadow: inset 0 0 0 1px var(--tile-line);
}
:is(.fig-ic, .insight-ic, .timeline-icon, .notif-glyph, .settings-ic, .product-ic, .src-tile, .src-ic, .src-drop-ic) > .i { width: var(--tile-ic); height: var(--tile-ic); color: inherit; }
@supports (corner-shape: squircle) {
  :is(.fig-ic, .insight-ic, .timeline-icon, .notif-glyph, .settings-ic, .product-ic, .src-tile, .src-ic, .src-drop-ic) { corner-shape: squircle; border-radius: calc(var(--tile) * 0.46); }
}
.fig-ic { --tile: 40px; --tile-ic: 20px; align-self: flex-start; margin: 0.5rem 0.6rem 0.35rem; }
.product-ic, .src-ic, .src-drop-ic { --tile: 36px; --tile-ic: 18px; }
.src-tile { --tile: var(--s, 36px); --tile-ic: calc(var(--tile) / 2); }
.insight-ic { --tile: 32px; --tile-ic: 16px; }
.timeline-icon { --tile: 28px; --tile-ic: 14px; }
.notif-glyph, .settings-ic { --tile: 24px; --tile-ic: 14px; }
/* Meaning: good, to check, a problem. */
.fig-ic[data-tone]:not([data-tone="calm"]) { --tile-bg: color-mix(in srgb, var(--t1) 13%, transparent); --tile-ink: var(--tk); --tile-line: color-mix(in srgb, var(--t1) 22%, transparent); }
html[data-theme="dark"] .fig-ic[data-tone]:not([data-tone="calm"]) { --tile-bg: color-mix(in srgb, var(--t1) 20%, transparent); --tile-ink: color-mix(in srgb, var(--t1) 58%, #ffffff); --tile-line: color-mix(in srgb, var(--t1) 30%, transparent); }
.insight.tone-good .insight-ic, .timeline li[data-action-type="valide"] .timeline-icon { --tile-bg: var(--accent-soft); --tile-ink: var(--accent-text); --tile-line: transparent; }
.insight.tone-warn .insight-ic, .timeline li[data-action-type="soumis"] .timeline-icon { --tile-bg: var(--orange-soft); --tile-ink: var(--orange); --tile-line: transparent; }
.timeline li[data-action-type="a_corriger"] .timeline-icon { --tile-bg: var(--red-soft); --tile-ink: var(--red); --tile-line: transparent; }
/* Where you act, or where you are: viridian. */
.src-drop-ic { --tile-ink: var(--accent-text); }
.settings-link.is-active .settings-ic { --tile-bg: rgb(255 255 255 / 0.2); --tile-ink: currentColor; --tile-line: transparent; }
/* A guided-entry source keeps the colour its owner chose, as a tint. */
:is(.src-tile, .src-ic.is-on) { --tile-bg: color-mix(in srgb, var(--c) 15%, transparent); --tile-ink: color-mix(in oklab, var(--c) 72%, var(--label)); --tile-line: color-mix(in srgb, var(--c) 26%, transparent); }
html[data-theme="dark"] :is(.src-tile, .src-ic.is-on) { --tile-bg: color-mix(in srgb, var(--c) 22%, transparent); --tile-ink: color-mix(in oklab, var(--c) 66%, #ffffff); }
.src-ic { cursor: pointer; transition: background var(--m-150) var(--ease), box-shadow var(--m-150) var(--ease); }
.src-ic:not(.is-on):hover { --tile-bg: var(--fill); --tile-ink: var(--label); }
.src-ic.is-on { --tile-line: var(--c); box-shadow: inset 0 0 0 1.5px var(--tile-line); }
.summary-label, .kpi > span, .kpi > a > span { padding: 0.45rem 0.6rem 0; }
.summary-value, .kpi > b, .kpi > a > b { padding: 0 0.6rem; margin-bottom: 0.85rem; }
.summary-meta, .summary-scopes .legend, .kpi > small, .kpi > a > small {
  margin-top: auto; padding: 0.5rem 0.65rem; min-height: 2.25rem;
  border-radius: var(--r-m); background: var(--fill-3); box-shadow: inset 0 0 0 1px var(--sep);
}
.summary-scopes .stackbar { margin: 0.5rem 0.6rem 0.95rem; }
.summary-cell > .progress { margin: auto 0.6rem 0.6rem; }

/* ---------- Dashboard first screen: the reading, then the path ----------
 * One instrument panel instead of a row of stat cards: no tile on top, no
 * recessed band below. The total is the instrument's figure (it rolls up on
 * arrival); the change against the reference year is written beside it in its
 * meaning's colour (trendClass: a rise red, amber under 3 %, a fall viridian);
 * the scopes are one proportional bar named in three columns (scope colours:
 * data); the secondary readings sit on one line between hairlines. Under it,
 * the target is a path (targetStatus): the gap between this year and the
 * expected level is drawn in its meaning (good, to check, a problem).
 * The panels follow the room they really have (container queries). */
.dash-reading, .dash-path { container-type: inline-size; }
.dash-reading { display: grid; gap: 1.25rem; padding: 1.5rem 1.6rem 1.2rem; }
.dash-reading-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.9rem 2rem; }
.dash-figure-label { color: var(--label-2); font-size: var(--t-callout); font-weight: 560; }
.dash-total { display: flex; align-items: baseline; gap: 0.55rem; margin-top: 0.2rem; font-size: clamp(3rem, 2.1rem + 2.6vw, 4.5rem); font-weight: 600; font-stretch: var(--figure-stretch); letter-spacing: -0.05em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.dash-total small { color: var(--label-2); font-size: var(--t-body); font-weight: 560; letter-spacing: 0; }
.dash-change { display: grid; justify-items: end; gap: 0.2rem; padding-bottom: 0.3rem; text-align: right; }
.dash-change b { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 1.4rem; font-weight: 640; font-stretch: var(--figure-stretch); letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-change b .i { width: 20px; height: 20px; stroke-width: 1.5px; }
.dash-change span { max-width: 22rem; color: var(--label-2); font-size: var(--t-foot); }
.dash-change.is-calm b { color: var(--label); font-size: var(--t-body); letter-spacing: 0; }

.dash-scopebar { display: flex; gap: 3px; height: 12px; }
.dash-seg { flex: var(--g) 1 0; min-width: 6px; border-radius: var(--r-xs); background: var(--c); transform-origin: left center; transition: opacity var(--m-150) var(--ease); }
.dash-scopebar:hover .dash-seg:not(:hover) { opacity: 0.4; }
.page-enter .dash-seg { animation: dash-seg-in 760ms var(--ease-out) both; animation-delay: calc(200ms + var(--k) * 130ms); }
@keyframes dash-seg-in { from { transform: scaleX(0); } }
.dash-scopecols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin: -0.35rem 0 0; padding: 0; list-style: none; }
.dash-scopecols li { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; min-width: 0; padding-top: 0.6rem; border-top: 2px solid var(--c); }
.dash-scope-name, .dash-scope-fig { display: grid; gap: 0.1rem; min-width: 0; line-height: 1.3; }
.dash-scope-name b, .dash-scope-fig b { font-size: var(--t-callout); font-weight: 600; }
.dash-scope-name small, .dash-scope-fig small { color: var(--label-3); font-size: var(--t-cap); }
.dash-scope-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-scope-fig { flex: none; text-align: right; font-variant-numeric: tabular-nums; }

.dash-reading-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.9rem 1.5rem; padding-top: 1.05rem; border-top: 1px solid var(--sep); }
.dash-readouts { display: flex; flex-wrap: wrap; gap: 0.75rem 0; margin: 0; }
.dash-readouts > div { display: grid; align-content: start; gap: 0.25rem; padding: 0 1.4rem; border-left: 1px solid var(--sep); }
.dash-readouts > div:first-child { padding-left: 0; border-left: 0; }
.dash-readouts dt { color: var(--label-3); font-size: var(--t-cap); font-weight: 560; }
.dash-readouts dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.45rem; margin: 0; color: var(--label); font-size: var(--t-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-readouts dd small { color: var(--label-3); font-size: var(--t-cap); font-weight: 500; }
.dash-readouts .gauge { font-size: var(--t-callout); }

.card.dash-path { display: grid; gap: 0.9rem; padding: 1.25rem 1.6rem 1.2rem; }
.dash-path .card-head { margin: 0; }
.dash-path.is-empty { gap: 0; }
.dash-path[data-tone] { --ink: var(--tk); }
.dash-path[data-tone="calm"] { --ink: var(--label); }
html[data-theme="dark"] .dash-path[data-tone]:not([data-tone="calm"]) { --ink: color-mix(in srgb, var(--t1) 58%, #ffffff); }
.dash-ink { color: var(--ink); }
.dash-path-chart { display: block; width: 100%; height: auto; overflow: visible; }
.dash-path-chart.is-compact { display: none; } /* the narrow drawing, swapped in under 560 px of room (below) */
.dp-axis { stroke: var(--sep-2); stroke-width: 1; }
.dp-year { fill: var(--label-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.dp-year.is-now { fill: var(--label); font-weight: 650; }
.dp-goal { fill: none; stroke: var(--label-3); stroke-width: 1.5; stroke-dasharray: 5 6; stroke-linecap: round; }
.dp-measured { fill: none; stroke: var(--label); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dp-dot { fill: var(--label); stroke: var(--surface); stroke-width: 2.5; }
.dp-dot.is-prov { fill: var(--label-3); }
.dp-expected { fill: var(--surface); stroke: var(--label-2); stroke-width: 1.5; }
.dp-gap { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.dp-now { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.dp-goal-dot { fill: var(--surface); stroke: var(--label-2); stroke-width: 2; }
.dp-label, .dp-sub { paint-order: stroke fill; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; font-family: var(--font); font-variant-numeric: tabular-nums; }
.dp-label { fill: var(--label); font-size: 13px; font-weight: 640; }
.dp-sub { fill: var(--label-3); font-size: 11px; font-weight: 500; }
.dp-sub.is-ink { fill: var(--ink); font-weight: 600; }
/* One moment: the measured line draws, the gap and today's point land. */
.page-enter .dp-measured { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 700ms var(--ease-out) 260ms forwards; }
.page-enter :is(.dp-now, .dp-gap, .dp-expected) { transform-box: fill-box; transform-origin: center; animation: dash-land 520ms var(--ease-out) 700ms both; }
@keyframes dash-land { from { opacity: 0; transform: scale(0.4); } }

/* The lower sections read the same way: a section opens on its conclusion
 * (.dash-lead), figures sit in named columns (.dash-ledger), small headings
 * carry their count (.dash-minihead). The pair beside each other share a height. */
.grid-2.dash-pair { align-items: stretch; }
.dash-lead { display: flex; align-items: baseline; gap: 0.7rem; margin: 0 0 1rem; color: var(--label-2); font-size: var(--t-callout); line-height: 1.4; }
.dash-lead b { flex: none; color: var(--label); font-size: 2.1rem; font-weight: 600; font-stretch: var(--figure-stretch); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-qbar { margin-bottom: 0.8rem; }
.dash-quality .legend { margin-top: 0; }
.dash-minihead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.3rem 0 0.35rem; padding-top: 1rem; border-top: 1px solid var(--sep); font-size: var(--t-callout); font-weight: 620; }
.dash-minihead span { color: var(--label-3); font-size: var(--t-cap); font-weight: 500; }

.dash-ledger { --cols: minmax(7rem, 9rem) minmax(0, 1fr) 4.6rem 3.2rem 4.4rem; }
.dash-ledger-head, .dash-ledger-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 0.9rem; }
.dash-ledger-head { padding: 0 0.35rem 0.45rem; border-bottom: 1px solid var(--sep); color: var(--label-3); font-size: var(--t-cap); font-weight: 560; }
.dash-ledger-head span:nth-child(n + 3) { text-align: right; }
.dash-ledger ol { margin: 0; padding: 0; list-style: none; }
.dash-ledger li + li .dash-ledger-row { border-top: 0.5px solid var(--sep); }
.dash-ledger-row { min-height: 40px; padding: 0.45rem 0.35rem; border-radius: var(--r-xs); color: inherit; font-size: var(--t-callout); transition: background var(--m-100) var(--ease); }
.dash-ledger-row:hover { background: var(--fill-3); }
.dash-ledger-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.dash-ledger-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 520; }
.dash-ledger-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ledger-name .i { flex: none; width: 16px; height: 16px; color: var(--label-3); }
.dash-ledger-bar { display: block; height: 6px; }
.dash-ledger-bar i { display: block; width: max(6px, calc(var(--w) * 100%)); height: 100%; border-radius: 999px; background: var(--c); transform-origin: left center; } /* a real width: scaling would flatten the round ends */
.page-enter .dash-ledger-bar i { animation: dash-seg-in 700ms var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 35ms); }
.dash-ledger-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-ledger-num.is-soft { color: var(--label-2); font-weight: 500; }
.dash-ledger-gauge { display: flex; justify-content: flex-end; }
.dash-pair > .card { container-type: inline-size; }

/* ---------- Ledgers: bilans as rows of one card ----------
 * Mes bilans, the portfolio and the verifier's missions share one pattern: one
 * card, one row per bilan between hairlines (no floating card per row), named
 * columns. Each page sets its columns (--cols, inherited by head and rows) and
 * says which cells give way as the room narrows (container queries). Cells:
 * .ledger-year (the year as a figure), .ledger-main (a name or a state over
 * a line of detail), .ledger-num (a figure, right), .ledger-gauge, .ledger-end. */
.hist-card { container-type: inline-size; }
.hist-readouts { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--sep); }
.ledger { container-type: inline-size; padding-bottom: 0.7rem; }
.ledger-head, .ledger-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 1rem; }
.ledger-head { padding: 0 0.6rem 0.5rem; border-bottom: 1px solid var(--sep); color: var(--label-3); font-size: var(--t-cap); font-weight: 560; }
.ledger-head .is-end { text-align: right; }
.ledger-rows { margin: 0; padding: 0; list-style: none; }
.ledger-rows li + li .ledger-row { border-top: 0.5px solid var(--sep); }
.ledger-row { min-height: 64px; padding: 0.7rem 0.6rem; border-radius: var(--r-m); color: inherit; transition: background var(--m-100) var(--ease); }
.ledger-row:hover { background: var(--fill-3); }
.ledger-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.ledger-year { font-size: 1.6rem; font-weight: 600; font-stretch: var(--figure-stretch); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ledger-main { display: grid; gap: 0.3rem; min-width: 0; }
.ledger-main > b { overflow: hidden; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.ledger-main-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ledger-main > small { color: var(--label-2); font-size: var(--t-foot); line-height: 1.45; }
.ledger-progress { display: grid; justify-items: end; gap: 0.3rem; color: var(--label-3); font-size: var(--t-cap); }
.ledger-num { display: grid; justify-items: end; gap: 0.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-num b { font-size: var(--t-body); font-weight: 650; }
.ledger-num b small { color: var(--label-2); font-size: var(--t-cap); font-weight: 500; }
.ledger-num > small { font-size: var(--t-cap); font-weight: 560; }
:where(.ledger-num > small) { color: var(--label-3); } /* a change keeps its meaning's colour (trendClass) */
.ledger-gauge, .ledger-end { display: flex; justify-content: flex-end; }
.ledger-go { width: 14px; height: 14px; color: var(--label-4); }

/* Mes bilans: year, state, postes filled, total, reliability. */
.ledger.is-bilans { --cols: 4.4rem minmax(0, 1fr) 8.5rem 8.5rem 6.4rem 16px; }
@container (max-width: 760px) {
  .is-bilans :is(.ledger-head, .ledger-row) { --cols: 3.6rem minmax(0, 1fr) 7.5rem 16px; gap: 0.8rem; }
  .is-bilans :is(.ledger-progress, .ledger-gauge, .ledger-head .is-wide) { display: none; }
}
@container (max-width: 460px) {
  .is-bilans :is(.ledger-head, .ledger-row) { --cols: 3.1rem minmax(0, 1fr) auto; gap: 0.7rem; }
  .is-bilans :is(.ledger-go, .ledger-head .is-go) { display: none; }
  .is-bilans .ledger-year { font-size: 1.3rem; }
}
/* Portfolio: client, year, total, reliability, status. */
.ledger.is-portfolio { --cols: minmax(0, 1fr) 4rem 8.5rem 6.4rem 7.4rem 16px; }
/* Missions: client, year, sample, total, reliability, opinion. */
.ledger.is-missions { --cols: minmax(0, 1fr) 4rem 8.5rem 8.5rem 6.4rem 7.4rem 16px; }
.is-portfolio .ledger-year, .is-missions .ledger-year { font-size: 1.25rem; }
@container (max-width: 820px) {
  .is-portfolio :is(.ledger-head, .ledger-row) { --cols: minmax(0, 1fr) 3.4rem 7.4rem 16px; gap: 0.8rem; }
  .is-missions :is(.ledger-head, .ledger-row) { --cols: minmax(0, 1fr) 3.4rem 7.4rem 16px; gap: 0.8rem; }
  :is(.is-portfolio, .is-missions) :is(.ledger-num, .ledger-gauge, .ledger-progress, .ledger-head .is-wide) { display: none; }
}
@container (max-width: 460px) {
  :is(.is-portfolio, .is-missions) :is(.ledger-head, .ledger-row) { --cols: minmax(0, 1fr) 3rem auto; gap: 0.7rem; }
  :is(.is-portfolio, .is-missions) :is(.ledger-go, .ledger-head .is-go) { display: none; }
}

/* Plan actions: action, start, effect, cost per tonne, status, scenario, edit. Rows hold controls (not links). */
.ledger.is-actions { --cols: minmax(0, 1fr) 3.6rem 7.5rem 8.5rem 8rem 4rem 36px; }
.ledger.is-actions.is-readonly { --cols: minmax(0, 1fr) 3.6rem 7.5rem 8.5rem 7rem; }
.is-actions .ledger-row { min-height: 60px; }
.is-actions .ledger-row.is-off { opacity: 0.5; }
.is-actions .ledger-row:hover { background: none; }
.dash-scopecols.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (max-width: 820px) {
  .is-actions :is(.ledger-head, .ledger-row) { --cols: minmax(0, 1fr) 6.5rem 7.5rem 4rem 36px; gap: 0.7rem; }
  .is-actions.is-readonly :is(.ledger-head, .ledger-row) { --cols: minmax(0, 1fr) 6.5rem 7rem; }
  .is-actions :is(.is-wide-cell, .ledger-head .is-wide) { display: none; }
}
@container (max-width: 520px) {
  .is-actions .ledger-head { display: none; }
  .is-actions .ledger-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
  .is-actions .ledger-row > .collect-main { flex: 1 1 100%; }
}

/* The portfolio at a glance: how its bilans divide between the steps of the review. */
.port-reading { display: grid; gap: 1.1rem; padding: 1.35rem 1.6rem 1.25rem; }
.port-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; margin: -0.3rem 0 0; padding: 0; list-style: none; }
.port-counts li { display: grid; gap: 0.15rem; min-width: 0; padding-top: 0.65rem; border-top: 2px solid var(--c); }
.port-counts b { font-size: 2rem; font-weight: 600; font-stretch: var(--figure-stretch); letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.port-counts span { font-size: var(--t-callout); font-weight: 600; }
.port-counts small { color: var(--label-3); font-size: var(--t-cap); }
.port-counts li.is-zero b { color: var(--label-3); }
.port-reading { container-type: inline-size; }
@container (max-width: 560px) { .port-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; } }
.ledger .card-head-row .gel-tabrow { flex: none; }
.ledger .card-head-row .seg { margin: 0; }
@container (max-width: 520px) {
  .dash-ledger { --cols: minmax(0, 1fr) 4.4rem 3rem; }
  .dash-ledger-head, .dash-ledger-row { gap: 0.6rem; }
  .dash-ledger-head span:nth-child(2), .dash-ledger-head span:nth-child(5), .dash-ledger-bar, .dash-ledger-gauge { display: none; }
}

@container (max-width: 560px) {
  .dash-path-chart { display: none; }
  .dash-path-chart.is-compact { display: block; }
}
/* Readouts that no longer fit on one line become a two-column grid: no divider left hanging at a line start. */
@container (max-width: 760px) {
  .dash-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; width: 100%; }
  .dash-readouts > div { padding: 0; border-left: 0; }
}
@container (max-width: 640px) {
  .dash-change { justify-items: start; text-align: left; }
  .dash-scopecols, .dash-scopecols.is-two { grid-template-columns: minmax(0, 1fr); gap: 0.55rem; margin-top: -0.4rem; }
  .dash-scopecols li { padding-top: 0.45rem; }
}
@media (max-width: 560px) {
  .dash-reading { padding: 1.15rem 1.1rem 1rem; }
  .card.dash-path { padding: 1rem 1.1rem; }
  .dash-total { font-size: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .page-enter :is(.dash-seg, .dp-now, .dp-gap, .dp-expected, .dash-ledger-bar i) { animation: none; }
  .page-enter .dp-measured { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* ---------- Tables: BoardUI header band, separators between rows only ---------- */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th { background: var(--fill-3); border-bottom: 0; padding-block: 0.55rem; }
.table thead tr > :first-child { border-radius: var(--r-s) 0 0 var(--r-s); }
.table thead tr > :last-child { border-radius: 0 var(--r-s) var(--r-s) 0; }
.table tbody:last-of-type tr:last-child > * { border-bottom-color: transparent; }
/* Hover on the row, at the lowest specificity: row states (.is-open…) win. */
:where(.table tbody tr) { transition: background-color var(--m-100) var(--ease); }
:where(.table tbody tr):hover { background-color: var(--fill-3); }

/* ---------- Touch: phones and tablets ----------
 * A finger needs var(--touch) to land, and a text field needs 16 px or iOS
 * zooms the page when it takes focus. Sizes under a mouse stay as they are. */
@media (pointer: coarse) {
  .btn, .seg button, .window-tabs button, .yn button, .input, select.input, .switch,
  .side-item, .settings-link, .rankbars-row, .dash-ledger-row, .ledger-row, .hm-cell,
  .src-chip, .src-add, .src-gap, .src-detail-link, .src-back, .link-btn, .ai-chip, .ai-act, .src-mp { min-height: var(--touch); }
  .btn-icon, .gel-filter-x, .gel-sphere, .search-field, .toolbar-trail .btn { min-width: var(--touch); }
  .gel-filter-x, .gel-sphere, .search-field { min-height: var(--touch); }
  /* !important: the dense entry sheet and the search boxes set smaller sizes with more specific rules. */
  input.input, select.input, textarea.input, .src-find-input, .src-unit { font-size: max(16px, 1em) !important; }
  /* Sidebar rows (the phone drawer, the tablet sidebar), but not the separators of the compact rail. */
  html:not(.side-compact) :is(.side-step, .side-subhead) { min-height: var(--touch); }
  .side-more { display: flex; align-items: center; min-height: var(--touch); }
  .side-me, .side-logo { min-height: var(--touch); align-items: center; }
  .side-me { min-width: var(--touch); justify-content: center; }
  .src-legend a { min-height: var(--touch); }
  /* A link in a line of text keeps its size and gains a taller landing area. */
  .row-item a:not(.btn), .legend a, .link-quiet, .crumbs a { padding-block: 0.8rem; }
}

/* ---------- Key figures two by two (tablets and phones) ----------
 * One card per row, four figures filled a phone's first screens before any
 * content; two by two they read at a glance. A lone last card takes the full
 * row. On phones the tile, value and band shrink to the narrower card. */
@media (max-width: 1240px) {
  .summary > .summary-cell:last-child:nth-child(odd), .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .summary, .kpis { gap: 0.6rem; }
  .summary-cell, .summary-cell + .summary-cell, .summary-cell:nth-child(n), .kpi { padding: 0.3rem; border-radius: var(--r-l); }
  .kpi.is-link { padding: 0; }
  .kpi.is-link a { padding: 0.3rem; }
  .fig-ic { --tile: 32px; --tile-ic: 16px; margin: 0.4rem 0.45rem 0.2rem; }
  .summary-label, .kpi > span, .kpi > a > span { padding: 0.35rem 0.45rem 0; }
  .summary-value, .kpi > b, .kpi > a > b { flex-wrap: wrap; padding: 0 0.45rem; margin-bottom: 0.6rem; font-size: 1.6rem; }
  .summary-meta, .summary-scopes .legend, .kpi > small, .kpi > a > small { padding: 0.4rem 0.5rem; font-size: var(--t-cap); }
  .summary-scopes .stackbar { margin: 0.4rem 0.45rem 0.7rem; }
}

}

/* ---------- Continuous corners ----------
 * Where the browser can draw them (corner-shape), every surface whose radius
 * comes from the tokens gets Apple-style continuous corners: the curve eases
 * into the straight edge instead of meeting it at a joint. A continuous corner
 * looks tighter at the same radius, so the tokens grow by half inside this
 * block. Pills (999px) and circles keep their round ends. Generated list:
 * every rule that draws its radius with a token, or inherits one. */
@supports (corner-shape: squircle) {
  :root { --r-xs: 12px; --r-s: 15px; --r-m: 18px; --r-l: 24px; --r-xl: 33px; }
  :where(.boot-file, .input, .status, .pill-tag, .skip-link, .side-context, .side-user, .side-item, .notice, .card, .panel, .kpi, .sheet-block, .factor-btn, .detail, .formula, .unc > div, .summary, .hist-hit, .rankbars-row, .todo a, .timeline, .lib-tab, .lib-main, .lib-search .input, .picker-search .input, .report, .report-draft, #tooltip, .toast, .dialog, .picker-list [role="option"], .command-list [role="option"], .equation > div, .window-card, .choice, .deliverables, .open-data .deliverable, .sim-result, .public-window, .popover, .notif-item, .agenda-item, .agenda-day, .theme-card, .theme-preview, .about-brand, .side-context-badge, .settings-link, .integration, .effects > div, .product-figures > div, .lib-actions li, .help-card, .report-doc, .qr-placeholder, .report-annex, .verify-check, .verify-print, .session-row, .insight, .hm-cell, .sim-row, .sim-result-card, .pareto-row, .import-delta, .recalc-test, .budget-years > div, .toast-action, .bulk-bar, .s2-compare > div, .side-ghost, .drop-veil::before, .drop-card, .since, .tour-spot, .tour-card, .side-next, .side-step, .side-subhead, .step-nav-link, .switcher-row, .switcher-foot a, .welcome-steps li, .welcome-tip, .auth-path, .auth-card, .lock-card, .lock-card .btn-primary, .public-seal, .public-seal .qr, .fx-doc, .fx-sheet, .import-card, .src-attr, .src-find, .src-res, .src-res-item, .src-gap, .src-row, .src-add, .src-month, .src-bar, .src-eq-b, .src-eq-res, .src-detail-link, .src-inp-u, .src-unit, .src-mp, .src-drop, .src-warn-box, .src-ttile, .src-pv, .src-opt, .src-factor, .src-summary, .console-row, .ticket-msg > div, .json-view, .summary-cell, .summary-cell + .summary-cell, .summary-cell:nth-child(n), .summary-meta, .summary-scopes .legend, .kpi > small, .kpi > a > small, .table thead tr > :first-child, .table thead tr > :last-child, .ai-msg.is-user, .ai-table, .ai-act, .ai-mic, .ai-voice-btn, .ai-capsule, .ai-attach, .ai-send, .ai-note summary, .ai-guide, .ai-prop, .ai-prop-effect, .ai-msg.is-error, .ai-card, .ai-file, .ai-drop, .ai-cover, .ia-intro, .ia-ask, .help-hero, .report-photo, .file-card, .file-tag, .dash-seg, .dash-ledger-row, .ledger-row, .auth-error, .auth-info, .invite-code) { corner-shape: squircle; }
  :where(.recalc-bar > span, .tour-bar i, .hold-fill, .gel-face, .switch > span::before, .kpi.is-link a) { corner-shape: inherit; }
}
