/* ==========================================================================
   ACI RENOV — Helpdesk · portail.css
   Every colour is a variable on :root (also exposed to ::backdrop).
   No inline style anywhere; one component grid for every screen.
   ========================================================================== */

:root, ::backdrop {
  --b: #2e6fc6;
  --bd: #245aa3;
  --deep: #1d4f99;
  --l: #90b9ef;
  --t: #eaf2fc;
  --tint: #edf3fc;
  --ink: #12263f;
  --ink2: #5a6a7e;
  --ink3: #7a8aa0;
  --line: #d3e0f0;
  --line2: #eef2f7;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ok: #1f7a3f;
  --ok-bg: #e7f5ec;
  --ok-line: #b9dfc6;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --bad-line: #f3c2bd;
  --amber: #f0a33c;
  --amber-bg: #fff8ec;
  --amber-line: #f3d6a4;
  --amber-ink: #3d2400;
  --page-top: #f6f9fd;
  --on-deep: #ffffff;
  --on-deep-2: rgba(255, 255, 255, .82);
  --on-deep-glass: rgba(255, 255, 255, .13);
  --on-deep-glass-2: rgba(255, 255, 255, .22);
  --backdrop: rgba(18, 38, 63, .45);
  --shadow-bar: 0 2px 10px rgba(18, 38, 63, .15);
  --shadow-bar-up: 0 -4px 16px rgba(18, 38, 63, .08);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px;
  --r-card: 14px;
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-18: 18px;
  --r-pill: 99px;
  --ctl: 44px;
  --shadow: 0 1px 2px rgba(18, 38, 63, .05), 0 8px 22px rgba(46, 111, 198, .08);
  --shadow-pop: 0 2px 6px rgba(18, 38, 63, .08), 0 18px 40px rgba(18, 38, 63, .18);
  --ring: 0 0 0 3px rgba(144, 185, 239, .55);
  --plan:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 12px);
  --wrap: 1200px;
  --gap: 20px;
}

@media (max-width: 760px) {
  :root { --ctl: 48px; --gap: 14px; }
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; min-height: 100%; background: linear-gradient(180deg, var(--page-top), var(--t)); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 var(--font); color: var(--ink);
  background: transparent;
  overflow-x: hidden;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; overflow-wrap: anywhere; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--b); text-underline-offset: 2px; }
a:hover { color: var(--bd); }
img { max-width: 100%; height: auto; }
code, kbd, .key { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: .05em .35em; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 .4em; background: var(--surface); color: var(--ink2); }
hr { border: 0; border-top: 1px solid var(--line2); margin: 1.5em 0; }
.muted { color: var(--ink2); }
.small { font-size: .875rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.txt-bad { color: var(--bad); font-weight: 600; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-8); }
.field-in:focus-visible, .btn:focus-visible, .btn-icon:focus-visible { border-radius: var(--r); }
.btn-icon:focus-visible, .avatar-btn:focus-visible { border-radius: 50%; }

.ic { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.ic-lg { width: 32px; height: 32px; }
.ic-xl { width: 48px; height: 48px; color: var(--b); }

.skip { position: absolute; left: 12px; top: -120px; display: inline-flex; align-items: center; min-height: 44px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow-pop); }
.skip:focus { top: 12px; }

/* ---------- Header (bandeau bleu profond + plan d’architecte) ------------- */
.plan { background-color: var(--deep); background-image: var(--plan); }
.top { position: sticky; top: 0; z-index: 30; color: var(--on-deep); box-shadow: var(--shadow-bar); }
.top-in { max-width: var(--wrap); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-deep); text-decoration: none; min-height: 44px; flex-shrink: 0; }
.brand:hover { color: var(--on-deep); }
.brand-mark { width: 34px; height: 34px; padding: 5px; border-radius: var(--r); background: var(--on-deep-glass); }
.brand-mark--lg { width: 48px; height: 48px; padding: 8px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt strong { font-size: 1rem; letter-spacing: .04em; }
.brand-txt small { font-size: .78rem; color: var(--on-deep-2); }
.mainnav { display: flex; gap: 4px; margin-left: 10px; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r); color: var(--on-deep-2); text-decoration: none; font-weight: 500; }
.mainnav a:hover { background: var(--on-deep-glass); color: var(--on-deep); }
.mainnav a[aria-current="page"] { background: var(--on-deep-glass-2); color: var(--on-deep); }
.search-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; padding: 0 12px 0 14px; border-radius: var(--r-pill);
  background: var(--on-deep-glass); color: var(--on-deep); text-decoration: none; border: 1px solid var(--on-deep-glass-2); }
.search-btn:hover { background: var(--on-deep-glass-2); color: var(--on-deep); }
.search-btn-txt { color: var(--on-deep-2); min-width: 7rem; }
.search-btn kbd { white-space: nowrap; background: transparent; border-color: var(--on-deep-glass-2); color: var(--on-deep-2); }
.new-btn { flex-shrink: 0; }

/* Dropdown menus (details.menu) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; padding: 6px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-12); box-shadow: var(--shadow-pop); }
.menu-pop a, .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-8);
  background: none; color: var(--ink); font: inherit; text-decoration: none; text-align: left; cursor: pointer; }
.menu-pop a:hover, .menu-item:hover { background: var(--tint); color: var(--ink); }
.menu-item--bad, .menu-item--bad:hover { color: var(--bad); }
.menu-pop form { margin: 0; }
.menu-head { margin: 0 0 6px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; }
.menu-head span { color: var(--ink2); font-size: .85rem; }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; background: var(--t); color: var(--bd);
  font-weight: 700; font-size: .85rem; letter-spacing: .02em; border: 1px solid var(--line); }
.top .avatar { background: var(--surface); color: var(--deep); border-color: transparent; }
.avatar--sm { width: 26px; height: 26px; font-size: .7rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* ---------- Layout -------------------------------------------------------- */
main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 24px 20px 40px; min-width: 0; }
main:focus { box-shadow: none; }
.is-bare main { display: flex; flex-direction: column; justify-content: center; }
.stack { display: grid; gap: var(--gap); min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin: var(--gap) 0; align-items: start; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.layout-aside--wide { grid-template-columns: minmax(0, 1fr) 360px; }
.side-stack { display: grid; gap: var(--gap); min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: 2fr 3fr 1.4fr 1fr; }
.narrow { max-width: 560px; margin: 0 auto; width: 100%; }
.narrow-wide { max-width: 820px; margin: 0 auto; width: 100%; }
.section { margin: 28px 0; }
.section > h2 { margin-bottom: 14px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; font-size: .875rem; color: var(--ink2); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--ink2); }
.crumbs a { color: var(--ink2); display: inline-flex; min-height: 24px; align-items: center; }
.crumbs a:hover { color: var(--b); }
.crumbs [aria-current] { color: var(--ink); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.page-head--plain { justify-content: space-between; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 4px 0 0; }
.head-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.lead { color: var(--ink2); font-size: 1.02rem; }
.account-head { justify-content: flex-start; }

.foot { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 18px 20px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--ink2); font-size: .85rem; }
.foot a { color: var(--ink2); display: inline-flex; min-height: 44px; align-items: center; }

/* ---------- Cards --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-title { font-size: 1.08rem; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.card-title .ic { color: var(--b); }
.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.card-head .ic-lg { color: var(--b); }
.sub-card { border: 1px solid var(--line); border-radius: var(--r-12); padding: 16px; }
.side { padding: 18px; }
.empty-state { text-align: center; padding: 40px 24px; }
.empty-state h1, .empty-state h2 { margin-top: 12px; }
.empty-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink2); padding: 18px 8px; }
.empty-mini .ic-lg { color: var(--ok); }
.empty-mini p { margin: 0; }

/* ---------- Buttons ------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl); height: auto; padding: 8px 18px;
  border-radius: var(--r); border: 1px solid transparent; font: inherit; font-weight: 600; line-height: 1.1; text-decoration: none; cursor: pointer;
  text-align: center; transition: background-color .15s, border-color .15s, color .15s; min-width: 0; }
.btn > span { overflow-wrap: anywhere; }
.btn-primary { background: var(--b); color: var(--surface); }
.btn-primary:hover, .btn-primary:active { background: var(--bd); color: var(--surface); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--tint); color: var(--ink); border-color: var(--l); }
.btn-danger { background: var(--bad); color: var(--surface); }
.btn-danger:hover { background: var(--bad); color: var(--surface); filter: brightness(.9); }
.btn-light { background: var(--surface); color: var(--deep); }
.btn-light:hover { background: var(--t); color: var(--deep); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.btn-icon { width: var(--ctl); height: var(--ctl); min-width: var(--ctl); padding: 0; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; aspect-ratio: 1; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink2); }
.btn-ghost:hover { background: var(--tint); color: var(--ink); }
/* Groups: equal height and width whatever the label. */
.btn-group { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.btn-group > .btn, .btn-group > form > .btn { width: 100%; }
.btn-group--end { width: max-content; max-width: 100%; margin-left: auto; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; width: max-content; max-width: 100%; margin: 18px 0 0 auto; }
.actions > .btn { width: 100%; }
.actions--start { margin-left: 0; }
.actions--center { margin-left: auto; margin-right: auto; }
.actions--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; width: 100%; flex-wrap: wrap; }
.actions--split > .field { flex: 1 1 220px; margin: 0; }
.actions--split > .check { flex: 1 1 220px; }

/* ---------- Fields (Material style, floating label) ----------------------- */
.form { display: block; }
.form--narrow { max-width: 460px; }
.field { position: relative; margin: 0 0 18px; min-width: 0; }
.field-in { display: block; width: 100%; height: var(--ctl); padding: 0 14px; font: inherit; line-height: 1.4; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
.field-in:hover { border-color: var(--l); }
.field-in:focus { border-color: var(--b); box-shadow: var(--ring); }
/* Outlined style: the label sits inside, vertically centred, then moves onto
   the border; the typed text stays centred in a field as tall as the buttons. */
.field label { position: absolute; left: 10px; top: calc(var(--ctl) / 2); transform: translateY(-50%); padding: 0 5px; border-radius: 4px; color: var(--ink2);
  pointer-events: none; line-height: 1.2; transition: top .15s, font-size .15s, color .15s;
  max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; }
.field-in:focus + label, .field-in:not(:placeholder-shown) + label, .field--select label, .field--file label {
  top: 0; font-size: .75rem; font-weight: 600; background: var(--surface); }
.field-in:focus + label { color: var(--bd); }
.field-in[readonly] + label { background: linear-gradient(var(--surface) 50%, var(--bg) 50%); }
.field--area .field-in { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field--area label { top: 23px; }
.field--area .field-in:focus + label, .field--area .field-in:not(:placeholder-shown) + label { top: 0; }
.field--select .field-in { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.field--file .field-in { height: auto; min-height: var(--ctl); padding: 8px 10px; cursor: pointer; display: flex; align-items: center; }
.field--file .field-in::file-selector-button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--tint); color: var(--ink); border-radius: var(--r-8); padding: 6px 12px; margin-right: 12px; cursor: pointer; }
.field-in[readonly] { background: var(--bg); color: var(--ink2); }
.req { color: var(--bad); }
.field-hint { margin: 6px 2px 0; font-size: .83rem; color: var(--ink2); }
.field-err { display: flex; gap: 6px; align-items: flex-start; margin: 6px 2px 0; font-size: .85rem; color: var(--bad); font-weight: 600; }
.field-err .ic { width: 16px; height: 16px; margin-top: 2px; }
.has-err .field-in { border-color: var(--bad); }
.has-err .field-in:focus { box-shadow: 0 0 0 3px var(--bad-bg); }
.has-err label, .has-err .field-in:focus + label { color: var(--bad); }

.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; min-height: 44px; padding-top: 10px; }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--b); cursor: pointer; }
.check label { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.check-hint { font-size: .83rem; color: var(--ink2); }
.checks { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 14px 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.checks legend, .segmented legend { font-size: .8rem; font-weight: 600; color: var(--ink2); padding: 0 6px; }
.checks .check { margin-bottom: 0; }
.show-pw .check { margin-top: -6px; }

/* Segmented control (radio buttons, equal widths) */
.segmented { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; min-width: 0; }
.segmented--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented legend { padding: 0 2px 6px; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl); padding: 0 8px; text-align: center;
  border: 1px solid var(--line); margin-left: -1px; background: var(--surface); color: var(--ink2); font-weight: 600; cursor: pointer; font-size: .92rem; }
.segmented label:first-of-type { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.segmented label:last-of-type { border-radius: 0 var(--r) var(--r) 0; }
.segmented input:checked + label { background: var(--t); color: var(--bd); border-color: var(--b); position: relative; z-index: 1; }
.segmented input:focus-visible + label { box-shadow: var(--ring); position: relative; z-index: 2; }

/* ---------- Pills, chips, alerts ----------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; line-height: 1.35;
  border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.pill .ic { width: 14px; height: 14px; }
.pill--info { background: var(--t); color: var(--bd); border-color: var(--line); }
.pill--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill--bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill--amber { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.pill--amber .ic { color: var(--amber); }
.pill--neutre { background: var(--bg); color: var(--ink2); }
.chip { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); background: var(--tint); color: var(--bd); font-size: .78rem; font-weight: 600; white-space: nowrap; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-12); border: 1px solid var(--line); background: var(--tint); margin: 0 0 16px; }
.alert > .ic { margin-top: 1px; color: var(--b); }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert--bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--ink); }
.alert--bad > .ic { color: var(--bad); }
.alert--bad a { color: var(--bad); font-weight: 600; }
.alert--ok { background: var(--ok-bg); border-color: var(--ok-line); }
.alert--ok > .ic { color: var(--ok); }
.alert--amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.alert--amber > .ic { color: var(--amber-ink); }

.banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-12); text-decoration: none; margin: 18px 0; font-weight: 500; }
.banner > span { flex: 1; }
.banner--amber { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink); }
.banner--amber:hover { color: var(--amber-ink); border-color: var(--amber); }

/* ---------- Tabs ---------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; color: var(--ink2); text-decoration: none; font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: var(--r-8) var(--r-8) 0 0; }
.tabs a:hover { color: var(--ink); background: var(--tint); }
.tabs a[aria-current="page"] { color: var(--bd); border-bottom-color: var(--b); background: var(--t); }

/* ---------- Lists (one row per item) ------------------------------------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line2); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row > .row-main { padding: 8px 0; }
.row--link > a, .row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 56px; padding: 8px 10px; margin: 0 -10px;
  color: var(--ink); text-decoration: none; border-radius: var(--r); }
.row--link > a:hover, .row-link:hover { background: var(--tint); color: var(--ink); }
.row-ic { color: var(--ink2); }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: .85rem; color: var(--ink2); overflow-wrap: anywhere; }
.row-go { color: var(--ink2); }
.row-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex-shrink: 0; max-width: 55%; }
.row-menu .menu-pop { min-width: 200px; }
.assignee { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink2); }
.list-card { padding-top: 14px; }
.list-meta { font-size: .85rem; color: var(--ink2); margin: 0 0 6px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; margin: 0 -10px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.side-list a:hover { background: var(--tint); }
.side-list a[aria-current="page"] { background: var(--t); color: var(--bd); font-weight: 600; }
.side-list .ic { color: var(--b); }
.side-list span:first-of-type { flex: 1; min-width: 0; }
.side-list .count { font-size: .8rem; color: var(--ink2); }
.bullets { padding-left: 20px; margin: 0 0 12px; }
.bullets li { margin-bottom: 4px; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 16px; }
.pager > .btn:last-child { justify-self: end; }
.pager-info { color: var(--ink2); font-size: .9rem; text-align: center; }

.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 0 12px; align-items: start; padding: 16px 16px 0; margin-bottom: var(--gap); }
.filters--inline { padding: 0; box-shadow: none; border: 0; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.filters .field { margin-bottom: 16px; }
.filters-go .btn { width: 100%; }

/* ---------- Home ---------------------------------------------------------- */
.home { padding-top: 0; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  transition: border-color .15s, transform .15s; }

/* ---------- Article ------------------------------------------------------- */
.article-main { padding: 30px 34px; }
.article-head { border-bottom: 1px solid var(--line2); margin-bottom: 22px; padding-bottom: 14px; }
.article-head h1 { font-size: 1.9rem; }
.meta { display: flex; align-items: center; gap: 6px; color: var(--ink2); font-size: .87rem; margin: 0; }
.prose { font-size: 1rem; line-height: 1.65; max-width: 72ch; overflow-wrap: break-word; }
.prose h2 { font-size: 1.3rem; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1.1rem; margin: 1.3em 0 .4em; }
.prose h4 { font-size: 1rem; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose ol > li::marker { color: var(--b); font-weight: 700; }
.prose blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 4px solid var(--line); color: var(--ink2); }
.prose pre { background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r); padding: 14px; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose img { border-radius: var(--r); border: 1px solid var(--line2); }
.md-img { display: inline-block; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; max-width: 100%; }
.prose table, .table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.prose th, .prose td, .table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.prose th, .table th { background: var(--bg); font-weight: 700; color: var(--ink); }
.callout { border-radius: var(--r-12); padding: 14px 18px; margin: 0 0 1.1em; border: 1px solid var(--line); background: var(--tint); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; color: var(--bd); }
.callout--astuce { background: var(--ok-bg); border-color: var(--ok-line); }
.callout--astuce .callout-title { color: var(--ok); }
.callout--attention { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.callout--attention .callout-title { color: var(--amber-ink); }
.feedback { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line2); }
.feedback h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.feedback h2 .ic { color: var(--ok); }
.feedback .btn-group { max-width: 320px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; min-height: 36px; color: var(--ink2); text-decoration: none; border-left: 2px solid var(--line); padding: 4px 0 4px 12px; }
.toc a:hover { color: var(--b); border-left-color: var(--b); }
.toc-3 a { padding-left: 24px; font-size: .9rem; }
.help-card { background: var(--surface); }
.side-list--plain a { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.layout-aside > .side-stack { position: sticky; top: 84px; }

/* ---------- Search -------------------------------------------------------- */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; margin-bottom: 16px; }
.search-bar > .ic { color: var(--ink2); }
.search-bar input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: 1.05rem; min-height: var(--ctl); background: transparent; color: var(--ink); }
.search-bar input:focus-visible { box-shadow: none; }
.search-bar:focus-within { box-shadow: var(--shadow), var(--ring); }
.result-count { color: var(--ink2); }
main > .card + .card, main > .layout-aside + .card, main > .card + .layout-aside { margin-top: var(--gap); }

/* Deflection suggestions under the subject field */
.suggest { margin: -6px 0 16px; padding: 12px 14px; border-radius: var(--r-12); background: var(--ok-bg); border: 1px solid var(--ok-line); }
.suggest-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 6px; color: var(--ok); }
.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-list a { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; padding: 0 6px; border-radius: var(--r-8); }
.suggest-list a:hover { background: var(--surface); }
.service-help { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.service-help li { display: flex; flex-direction: column; font-size: .9rem; }
.service-help span { color: var(--ink2); }

/* ---------- Tickets ------------------------------------------------------- */
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: var(--gap); }
.ticket-head h1 { font-size: 1.5rem; margin-bottom: 8px; }
.ticket-head-main { min-width: 0; }
.ticket-ref { color: var(--ink2); font-size: .88rem; margin: 0 0 4px; }
.ticket-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.msgs { list-style: none; margin: 0 0 var(--gap); padding: 0; display: grid; gap: 14px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 14px 18px; }
.msg--staff .msg-body { border-left: 4px solid var(--b); }
.msg--staff .avatar { background: var(--b); color: var(--surface); }
.msg--interne .msg-body { background: var(--amber-bg); border-color: var(--amber-line); border-left: 4px solid var(--amber); }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; }
.msg-head time { color: var(--ink2); font-size: .83rem; margin-left: auto; }
.msg-text { overflow-wrap: anywhere; }
.msg-event { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 8px; color: var(--ink2); font-size: .85rem; text-align: center; }
.msg-event .ic { width: 16px; height: 16px; }
.msg-event time { color: var(--ink2); }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; background: var(--surface); max-width: 100%; }
.file a:hover { background: var(--tint); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; font-weight: 500; }
.file-meta { color: var(--ink2); font-size: .8rem; }
.file--img a { flex-direction: column; align-items: flex-start; padding: 6px; width: 168px; }
.file--img img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--r-8); background: var(--bg); }
.file--img .file-name { max-width: 150px; font-size: .85rem; }
.reply .card-title { margin-bottom: 12px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 10px; align-items: baseline; }
.facts dt { color: var(--ink2); font-size: .87rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.side .facts > div { grid-template-columns: 1fr; gap: 2px; }
.facts--code > div { grid-template-columns: 1fr; gap: 2px; }
.danger-zone { border-color: var(--bad-line); }
.danger-zone .card-title { color: var(--bad); }
.actions-card form { margin: 0 0 10px; }
.actions-card .btn { justify-content: flex-start; }

/* ---------- Auth ---------------------------------------------------------- */
.auth { width: 100%; max-width: 440px; margin: 20px auto; }
.card.auth-card { padding: 0; overflow: hidden; border-radius: var(--r-18); }
.auth-head { display: flex; align-items: center; gap: 14px; }
.auth-brand { margin: 0; display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand strong { font-size: 1.15rem; letter-spacing: .05em; }

.auth-body { padding: 24px 26px 26px; }
.auth-body h1 { font-size: 1.4rem; }
.auth-links { text-align: center; margin: 16px 0 0; }
.auth-links a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink2); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pow { margin: 0 0 14px; }
.pow-status { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: .88rem; margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--bg); }
.pow-status.is-done { color: var(--ok); background: var(--ok-bg); }

/* ---------- Account / 2FA ------------------------------------------------- */
.steps { padding-left: 1.3em; margin: 0; }
.steps > li { margin-bottom: 18px; }
.steps > li::marker { font-weight: 700; color: var(--b); }
.qr-wrap { display: inline-block; background: var(--surface); color: var(--ink); padding: 10px; border: 1px solid var(--line); border-radius: var(--r-12); margin: 6px 0 10px; }
.qr { display: block; width: 200px; height: 200px; }
.manual-key summary, .md-help summary { cursor: pointer; color: var(--b); min-height: 44px; display: flex; align-items: center; font-weight: 500; }
.key { letter-spacing: .08em; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0; margin: 0 0 16px; list-style: none; counter-reset: c; }
.codes li { counter-increment: c; display: flex; align-items: center; gap: 8px; }
.codes li::before { content: counter(c) "."; color: var(--ink2); font-size: .8rem; width: 1.6em; text-align: right; }
.codes code { font-size: 1rem; padding: 6px 10px; letter-spacing: .06em; }
.codes-card { border: 2px solid var(--amber-line); }

/* ---------- Admin --------------------------------------------------------- */
.tabs--scroll a .ic { width: 18px; height: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.stat { padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; align-items: start; }
.stat > .ic { grid-column: 2; grid-row: 1; color: var(--b); }
.stat-v { grid-column: 1; grid-row: 1; font-size: 1.7rem; font-weight: 700; margin: 0; line-height: 1.1; }
.stat-l { grid-column: 1 / 3; margin: 4px 0 0; color: var(--ink2); font-size: .88rem; }
.stat-s { grid-column: 1 / 3; margin: 2px 0 0; color: var(--ink2); font-size: .8rem; }
.stat--amber { border-color: var(--amber-line); background: var(--amber-bg); }
.stat--amber .stat-v, .stat--amber > .ic { color: var(--amber-ink); }
.stat--amber .stat-l { color: var(--amber-ink); }
.stat--bad { border-color: var(--bad-line); }
.stat--bad .stat-v, .stat--bad > .ic { color: var(--bad); }
.stat--ok > .ic { color: var(--ok); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: .9rem; }
.bar-l { overflow-wrap: anywhere; }
.bar { height: 10px; border-radius: var(--r-pill); background: var(--line2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--b); border-radius: var(--r-pill); }
.bar-v { color: var(--ink2); white-space: nowrap; }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; }
.w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; }
.w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.inline-edit-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-edit-head .card-title { margin: 0; }
.sub-title { font-size: .95rem; margin: 20px 0 10px; color: var(--ink2); }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: start; }
.inline-form .field, .inline-form .check { margin: 0; }
.inline-form .check { padding-top: 12px; }
.sla-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sla-row { border: 1px solid var(--line); border-radius: var(--r-12); padding: 10px 14px 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.sla-row legend { padding: 0 6px; }
.journal-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.journal-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.journal-status form { margin: 0; }
.table td { font-size: .9rem; }
.img-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.img-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 10px; align-items: center; }
.img-list img { grid-row: 1 / 3; width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-8); border: 1px solid var(--line2); }
.img-code { font-size: .75rem; }
.img-actions { display: flex; gap: 4px; }
.img-actions form { margin: 0; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.md-toolbar[hidden] { display: none; }
.md-help { margin: -4px 0 16px; }
.preview { border: 1px dashed var(--l); border-radius: var(--r-12); padding: 18px; margin: 0 0 16px; background: var(--page-top); }
.preview-label { margin: 0 0 8px; }
.preview-title { font-size: 1.5rem; }

/* ---------- Toasts -------------------------------------------------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(400px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: var(--r-12); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 5px solid var(--b); box-shadow: var(--shadow-pop); animation: toast-in .22s ease-out; }
.toast p { margin: 0; flex: 1; }
.toast > .ic { color: var(--b); }
.toast--ok { border-left-color: var(--ok); }
.toast--ok > .ic { color: var(--ok); }
.toast--bad { border-left-color: var(--bad); }
.toast--bad > .ic { color: var(--bad); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast .btn-icon { width: 44px; height: 44px; min-width: 44px; }

/* ---------- Ctrl+K palette ------------------------------------------------ */
.palette { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0; border: 0;
  border-radius: var(--r-16); box-shadow: var(--shadow-pop); background: var(--surface); color: var(--ink); overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: var(--backdrop); }
.palette-form { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line2); }
.palette-form > .ic { color: var(--ink2); }
.palette-form input { flex: 1; min-width: 0; min-height: 52px; border: 0; font: inherit; font-size: 1.08rem; color: var(--ink); background: transparent; }
.palette-form input:focus-visible { box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.palette-group { padding: 10px 12px 4px; font-size: .75rem; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.palette-item a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.palette-item .ic { color: var(--b); }
.palette-item[aria-selected="true"] a, .palette-item a:hover { background: var(--t); }
.palette-item-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.palette-item-i { color: var(--ink2); font-size: .82rem; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 22px; text-align: center; color: var(--ink2); }
.confirm { max-width: 460px; }
.confirm-in { padding: 22px; }
.confirm-in h2 { font-size: 1.15rem; }
.palette-help { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line2); font-size: .8rem; color: var(--ink2); }

/* ---------- Mobile tab bar ------------------------------------------------ */
.tabbar { display: none; }

@media (max-width: 1080px) {
  .mainnav a span { display: none; }
  .mainnav a { padding: 0 12px; }
  .search-btn-txt { min-width: 0; }
  .layout-aside, .layout-aside--wide { grid-template-columns: minmax(0, 1fr); }
  .layout-aside > .side-stack { position: static; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > .field:first-of-type { grid-column: 1 / -1; }
  .filters-go { grid-column: 1 / -1; margin-bottom: 16px; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .top-in { min-height: 56px; padding: 6px 12px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .mainnav, .new-btn, .search-btn-txt, .search-btn kbd { white-space: nowrap; display: none; }
  .search-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  main { padding: 16px 12px 24px; }
  .has-tabbar main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .has-tabbar .foot { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-bar-up); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--r); color: var(--ink2);
    text-decoration: none; font-size: .72rem; font-weight: 600; min-width: 0; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--bd); background: var(--t); }
  .cols, .grid-2, .grid-3, .grid-4, .sla-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; border-radius: var(--r-12); }
  .article-main { padding: 18px 16px; }
  .article-head h1 { font-size: 1.5rem; }
  .actions, .btn-group--end { width: 100%; }
  .actions--split { flex-direction: column; align-items: stretch; }
  .actions--split > .btn { width: 100%; }
  .actions--split > .field, .actions--split > .check { flex: 0 0 auto; }
  .page-head--plain > .btn, .head-actions { width: 100%; }
  .head-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .page-head--plain > .btn { order: 2; }
  .ticket-head { flex-direction: column; }
  .ticket-head form, .ticket-head .btn { width: 100%; }
  .row-link { flex-wrap: wrap; }
  .row-pills { max-width: 100%; justify-content: flex-start; }
  .ticket-row .row-link { align-items: flex-start; }
  .msg > .avatar { display: none; }
  .msg-body { padding: 12px 14px; }
  .msg-head time { margin-left: 0; width: 100%; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .filters { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 0; }
  .filters--inline { padding: 0; }
  .segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented label { border-radius: 0 !important; margin: -1px 0 0 -1px; }
  .segmented label:first-of-type { border-top-left-radius: var(--r) !important; }
  .segmented label:nth-of-type(2) { border-top-right-radius: var(--r) !important; }
  .segmented label:nth-last-of-type(2) { border-bottom-left-radius: var(--r) !important; }
  .segmented label:last-of-type { border-bottom-right-radius: var(--r) !important; }
  .segmented--2 { grid-template-columns: minmax(0, 1fr); }
  .segmented--2 label:first-of-type { border-radius: var(--r) var(--r) 0 0 !important; }
  .segmented--2 label:last-of-type { border-radius: 0 0 var(--r) var(--r) !important; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bars .bar { grid-column: 1 / -1; grid-row: 2; }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .inline-form .btn { width: 100%; }
  .toasts { top: calc(64px + env(safe-area-inset-top)); bottom: auto; right: 12px; left: 12px; width: auto; }
  .palette { margin-top: 12px; max-height: calc(100vh - 24px); }
  .palette-help { display: none; }
  .crumbs [aria-current] { max-width: 22ch; }
  .auth { margin: 0 auto; }
  .auth-head, .auth-body { padding-left: 18px; padding-right: 18px; }
  .file--img a { width: calc(50vw - 40px); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-info { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 420px) {
  .btn-group--3 { grid-auto-flow: row; }
}


/* ==========================================================================
   1.1 — Collaborator home: editorial layout, request tracker, simple view
   ========================================================================== */
.page-head .cat-ic { width: auto; height: auto; background: none; border-radius: 0; color: var(--b); }
.welcome { max-width: 780px; padding: 18px 0 6px; }
.welcome-hello { margin: 0; color: var(--ink2); font-weight: 600; }
.welcome-q { font-size: 2.15rem; letter-spacing: -.02em; margin: 2px 0 16px; }
.search-xl { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-12); padding: 5px 5px 5px 14px; transition: border-color .15s, box-shadow .15s; }
.search-xl > .ic { color: var(--ink2); }
.search-xl:hover { border-color: var(--l); }
.search-xl:focus-within { border-color: var(--b); box-shadow: var(--ring); }
.search-xl input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--ink); min-height: var(--ctl); }
.search-xl input:focus-visible { box-shadow: none; }
.search-xl--big input { font-size: 1.1rem; min-height: 52px; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.quick-l { color: var(--ink2); font-size: .875rem; margin-right: 4px; }
.quick-a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; }
.quick-a:hover { border-color: var(--b); color: var(--bd); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; margin: 30px 0 34px; }
.panel { background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.panel--plain { background: none; border: 0; box-shadow: none; padding: 4px 0 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.panel-head .sec-title { margin: 0; }
.panel-flag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink); font-size: .82rem; font-weight: 600; }
.panel-flag .ic { width: 15px; height: 15px; }
.panel-empty { color: var(--ink2); margin: 14px 0 0; }
.panel-foot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; width: max-content; max-width: 100%; }
.sec-title { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--t); color: var(--bd); font-size: .8rem; font-weight: 700; }

.reqs { list-style: none; margin: 10px 0 0; padding: 0; }
.req + .req { border-top: 1px solid var(--line2); }
.req-link { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: center; gap: 18px; padding: 14px 10px; margin: 0 -10px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.req-link:hover { background: var(--tint); color: var(--ink); }
.req-main { display: flex; flex-direction: column; min-width: 0; }
.req-title { font-weight: 600; overflow-wrap: anywhere; }
.req-meta { color: var(--ink2); font-size: .85rem; }
.reqs--list { margin-top: 0; }

.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .75rem; color: var(--ink2); line-height: 1.2; }
.track li + li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.track li.is-done::before, .track li.is-current::before { background: var(--b); }
.track-dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; flex-shrink: 0; }
.track-dot .ic { width: 12px; height: 12px; color: var(--surface); stroke-width: 3; }
.track .is-done .track-dot { background: var(--b); border-color: var(--b); }
.track .is-current .track-dot { border-color: var(--b); box-shadow: 0 0 0 3px var(--t); }
.track .is-current { color: var(--ink); font-weight: 700; }
.track-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; font-size: .8rem; font-weight: 600; color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: var(--r-pill); padding: 2px 10px; }
.track-note .ic { width: 14px; height: 14px; }
.track-note--muted { color: var(--ink2); background: var(--bg); border-color: var(--line); }
.ticket-track { max-width: 360px; margin-top: 10px; }

.toplist { list-style: none; margin: 0; padding: 0; counter-reset: top; }
.toplist li { counter-increment: top; }
.toplist li + li { border-top: 1px solid var(--line2); }
.toplist a { display: flex; align-items: baseline; gap: 12px; min-height: 44px; padding: 11px 0; color: var(--ink); text-decoration: none; }
.toplist a::before { content: counter(top, decimal-leading-zero); color: var(--b); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.toplist a:hover .toplist-t { color: var(--bd); text-decoration: underline; text-underline-offset: 3px; }
.toplist-t { flex: 1; min-width: 0; font-weight: 500; }
.toplist-c { color: var(--ink2); font-size: .8rem; white-space: nowrap; }

.index { margin: 0 0 10px; }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 36px; }
.index-list li { border-top: 1px solid var(--line); }
.index-list a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "ic t n" ". d d"; gap: 2px 12px; padding: 14px 0; color: var(--ink); text-decoration: none; }
.index-list .ic { grid-area: ic; color: var(--b); margin-top: 1px; }
.index-t { grid-area: t; font-weight: 600; }
.index-d { grid-area: d; color: var(--ink2); font-size: .87rem; }
.index-n { grid-area: n; color: var(--ink2); font-size: .8rem; white-space: nowrap; }
.index-list a:hover .index-t { color: var(--bd); text-decoration: underline; text-underline-offset: 3px; }

.view-switch { margin: 26px 0 0; display: flex; justify-content: center; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r); background: none; color: var(--b); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { background: var(--tint); color: var(--bd); }

.simple { max-width: 640px; margin: 0 auto; padding-top: 18px; }
.simple-hello { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 16px; }
.simple-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 28px; }
.big-action { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-16); background: var(--surface); color: var(--ink); text-decoration: none; }
.big-action:hover { border-color: var(--b); color: var(--ink); }
.big-action .ic { width: 28px; height: 28px; color: var(--b); margin-bottom: 6px; }
.big-action-t { font-weight: 700; font-size: 1.05rem; }
.big-action-s { color: var(--ink2); font-size: .87rem; }
.big-action--primary { background: var(--b); border-color: var(--b); color: var(--surface); }
.big-action--primary:hover { background: var(--bd); border-color: var(--bd); color: var(--surface); }
.big-action--primary .ic { color: var(--surface); }
.big-action--primary .big-action-s { color: var(--on-deep-2); }
.home--simple .req-link { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.home--simple .req-track { max-width: 340px; }
.field-hint--after { margin: -10px 2px 16px; }

@media (max-width: 760px) {
  .welcome { padding-top: 6px; }
  .welcome-q { font-size: 1.6rem; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 22px; }
  .panel { padding: 16px; }
  .panel-foot { width: 100%; }
  .req-link { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .quick-l { width: 100%; }
  .search-xl .btn { padding: 8px 14px; }
  .simple-hello { font-size: 1.5rem; }
}
@media (max-width: 360px) {
  .simple-actions { grid-template-columns: minmax(0, 1fr); }
  .search-xl .btn { display: none; }
}

/* ---------- 1.2 — Logos ---------------------------------------------------- */
.brand-logo { display: block; height: 34px; width: auto; max-width: 190px; object-fit: contain; }
.auth-strip { height: 8px; }
.auth-head { padding: 26px 26px 6px; color: var(--ink); }
.auth-head .brand-mark { background: var(--t); color: var(--deep); }
.auth-brand span { color: var(--ink2); }
.auth-logo { display: block; height: 52px; width: auto; max-width: 240px; object-fit: contain; }
.logo-cols { margin-top: 8px; }
.logo-preview { display: flex; align-items: center; min-height: 96px; padding: 20px; border-radius: var(--r-12); border: 1px solid var(--line); background: var(--surface); margin: 0 0 8px; }
.logo-preview--clair { color: var(--on-deep); border-color: transparent; background-color: var(--deep); background-image: var(--plan); }
.logo-preview--fonce { color: var(--ink); }
.logo-preview--fonce .brand-mark { background: var(--t); color: var(--deep); }
.logo-preview--fonce .brand-txt small { color: var(--ink2); }
.logo-preview--clair .brand-txt small { color: var(--on-deep-2); }
.logo-preview-img { display: block; height: 48px; width: auto; max-width: 100%; object-fit: contain; }
.logo-default { display: inline-flex; align-items: center; gap: 10px; }
.logo-state { margin: 0 0 18px; }
@media (max-width: 760px) {
  .brand-logo { height: 30px; max-width: 150px; }
  .auth-head { padding: 22px 18px 4px; }
}

/* ---------- 1.3 — Split sign-in screen with animated illustration --------- */
main.auth-main { max-width: none; padding: 0; display: block; }
.auth-split { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-visual { display: flex; align-items: center; justify-content: center; padding: 48px 56px; color: var(--on-deep); overflow: hidden; }
.auth-visual-in { width: 100%; max-width: 520px; }
.auth-kicker { margin: 0 0 8px; color: var(--on-deep-2); font-weight: 600; }
.auth-visual-t { color: var(--on-deep); font-size: 2.1rem; letter-spacing: -.02em; margin: 0 0 12px; }
.auth-visual-p { color: var(--on-deep-2); max-width: 44ch; font-size: 1.02rem; margin: 0; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--surface); }
.auth-panel-in { width: 100%; max-width: 400px; }
.auth-panel .auth-head { padding: 0; margin: 0 0 32px; }
.auth-panel h1 { font-size: 1.65rem; letter-spacing: -.01em; margin-bottom: 6px; }
.auth-panel .lead { margin-bottom: 22px; }
.auth-foot { margin: 36px 0 0; font-size: .85rem; }
.auth-foot a { color: var(--ink2); display: inline-flex; align-items: center; min-height: 44px; }
.auth-help { display: flex; gap: 8px; align-items: flex-start; margin: 22px 0 0; }
.auth-help .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--ink2); }
.btn-lg { min-height: 52px; font-size: 1.02rem; }
.pw-login { margin-top: 12px; }
.pw-login > summary { list-style: none; cursor: pointer; }
.pw-login > summary::-webkit-details-marker { display: none; }
.pw-chev { transition: transform .2s; }
.pw-login[open] > summary { margin-bottom: 22px; }
.pw-login[open] .pw-chev { transform: rotate(180deg); }
.pw-login[open] > .pw-form { animation: pw-in .2s ease-out; }
@keyframes pw-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Illustration: base styles are the final state (used when motion is reduced). */
.il { display: block; width: 100%; max-width: 480px; height: auto; margin-top: 28px; overflow: visible; }
.il g, .il rect, .il circle, .il path { transform-box: fill-box; }
.il-card { fill: var(--surface); }
.il-bar { fill: var(--tint); }
.il-dot { fill: var(--line); }
.il-search { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.il-stroke-b { fill: none; stroke: var(--b); stroke-width: 2.5; stroke-linecap: round; }
.il-stroke-w { fill: none; stroke: var(--surface); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.il-stroke-l { fill: none; stroke: var(--l); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.il-type { fill: var(--l); transform-origin: left center; }
.il-caret { fill: var(--b); }
.il-bubble-q { fill: var(--t); }
.il-txt-q { fill: var(--l); }
.il-bubble-a { fill: var(--b); }
.il-txt-a { fill: var(--on-deep-2); }
.il-avatar { fill: var(--deep); stroke: var(--surface); stroke-width: 3; }
.il-tdot { fill: var(--b); }
.il-track { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.il-track-fill { fill: none; stroke: var(--b); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 96; stroke-dashoffset: 0; }
.il-step { fill: var(--b); stroke: var(--surface); stroke-width: 3; }
.il-step--3 { fill: var(--ok); }
.il-check { fill: none; stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.il-badge { fill: var(--ok); }
.il-ring { fill: none; stroke: var(--on-deep-glass-2); stroke-width: 2; transform-origin: center; }
.il-typing { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .il-float { animation: il-float 6s ease-in-out infinite alternate; }
  .il-float--2 { animation-delay: -3s; }
  .il-ring { animation: il-ring 4.5s ease-in-out infinite; }
  .il-ring--2 { animation-delay: -2.2s; }
  .il-type { animation: il-type 9s ease-out infinite; }
  .il-caret { animation: il-caret 1s steps(2, start) infinite; }
  .il-q { animation: il-q 9s ease-out infinite; }
  .il-typing { animation: il-typing 9s linear infinite; }
  .il-tdot { animation: il-bounce .9s ease-in-out infinite; }
  .il-tdot--2 { animation-delay: .15s; }
  .il-tdot--3 { animation-delay: .3s; }
  .il-a { animation: il-a 9s ease-out infinite; }
  .il-ticket { animation: il-ticket 9s ease-out infinite; }
  .il-track-fill { animation: il-fill 9s ease-in-out infinite; }
  .il-step--2 { animation: il-step2 9s linear infinite; }
  .il-step--3 { animation: il-step3 9s linear infinite; }
  .il-check { animation: il-check 9s linear infinite; }
}
@keyframes il-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes il-ring { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.18); opacity: .35; } }
@keyframes il-type { 0%, 3% { transform: scaleX(0); } 18%, 92% { transform: scaleX(1); } 97%, 100% { transform: scaleX(0); } }
@keyframes il-caret { to { visibility: hidden; } }
@keyframes il-q { 0%, 20% { opacity: 0; transform: translateY(10px); } 25%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes il-typing { 0%, 29% { opacity: 0; } 31%, 44% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes il-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes il-a { 0%, 45% { opacity: 0; transform: translateY(10px); } 50%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes il-ticket { 0%, 52% { opacity: 0; transform: translateY(14px); } 57%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes il-fill { 0%, 58% { stroke-dashoffset: 96; } 64%, 68% { stroke-dashoffset: 48; } 74%, 100% { stroke-dashoffset: 0; } }
@keyframes il-step2 { 0%, 63% { fill: var(--line); } 64%, 100% { fill: var(--b); } }
@keyframes il-step3 { 0%, 73% { fill: var(--line); } 74%, 100% { fill: var(--ok); } }
@keyframes il-check { 0%, 74% { opacity: 0; } 76%, 100% { opacity: 1; } }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; }
  .auth-visual { padding: 24px 20px 18px; }
  .auth-visual-in { display: grid; grid-template-columns: minmax(0, 1fr) 132px; grid-template-areas: "k il" "t il"; align-items: center; gap: 0 12px; }
  .auth-kicker { grid-area: k; margin: 0 0 4px; font-size: .85rem; }
  .auth-visual-t { grid-area: t; font-size: 1.25rem; margin: 0; }
  .auth-visual-p { display: none; }
  .il { grid-area: il; margin: 0; max-width: 132px; }
  .auth-panel { padding: 28px 20px 32px; align-items: flex-start; }
  .auth-panel .auth-head { margin-bottom: 22px; }
  .auth-panel h1 { font-size: 1.4rem; }
}

@media print {
  .top, .tabbar, .foot, .toasts, .skip, .btn, form, .crumbs, .side-stack { display: none !important; }
  body { background: none; }
  .card { box-shadow: none; border: 0; }
  .codes-card, .codes-card * { display: revert !important; }
}
