/* AlternHub — système d'interface « espace collaborateurs », v1 (DA validée le 16/09/2026)
   Tout est scopé sous .ah : posez class="ah" sur <body> d'une page pour l'activer, les autres pages ne bougent pas.
   Les jetons sont préfixés --ah-. Seul --ah-brand vient de brand-config.js ; le reste en découle par color-mix().
   Options : data-theme="dark" et data-density="compact" sur le même élément .ah.
   Polices : « Source Sans 3 » (interface) et « Bricolage Grotesque » (titres),
   declarees par la feuille commune /fonts/polices.css — PAS ici. Cette feuille
   en portait ses propres @font-face, avec ses propres fichiers : la famille
   etait donc declaree DEUX FOIS, et le navigateur chargeait les deux. NE PAS
   les redeclarer. Le pourquoi est dans CLAUDE.md. */

/* ── Repli pour les navigateurs sans color-mix() ─────────────────────────────
   Tous les jetons de couleur derivent de color-mix(). Sans cette fonction ils
   ne sont pas approximatifs mais INVALIDES : la page perd son fond, ses filets
   et le fond de sa colonne. Illisible, pas degradee.
   Ce bloc fige les valeurs calculees pour l'indigo par defaut (#4f46e5).
   Consequence assumee : sur ces navigateurs la couleur du client ne s'applique
   pas, l'interface reste lisible avec la teinte AlternHub.
   color-mix() est disponible depuis Chrome 111, Safari 16.2 et Firefox 113 (2023).
   ───────────────────────────────────────────────────────────────────────────── */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .ah {
    --ah-rail: #332d97;
    --ah-rail-ink: #dcdafa;
    --ah-brand-900: #292477;
    --ah-brand-700: #3f38b7;
    --ah-brand-100: #e6e5fb;
    --ah-brand-50: #f4f4fd;
    --ah-paper: #f4f4fc;
    --ah-line: #d5d4ee;
    --ah-line-2: #b0aee0;
  }
  .ah[data-theme="dark"] {
    --ah-rail: #25216a;
    --ah-brand-900: #c1bef6;
    --ah-brand-700: #847eed;
    --ah-brand-100: #29256d;
    --ah-brand-50: #201e50;
    --ah-paper: #131232;
    --ah-surface: #1c1a44;
    --ah-line: rgba(255,255,255,0.11);
    --ah-line-2: rgba(255,255,255,0.2);
  }
}
.ah {
  --ah-brand: var(--teal, #4f46e5);
  --ah-rail: color-mix(in srgb, var(--ah-brand) 58%, #0d0b2b);
  --ah-rail-ink: color-mix(in srgb, #fff 80%, var(--ah-brand));
  --ah-brand-900: color-mix(in srgb, var(--ah-brand) 52%, black);
  --ah-brand-700: color-mix(in srgb, var(--ah-brand) 80%, black);
  --ah-brand-100: color-mix(in srgb, var(--ah-brand) 14%, white);
  --ah-brand-50: color-mix(in srgb, var(--ah-brand) 6%, white);
  --ah-paper: color-mix(in srgb, var(--ah-brand) 4%, #fbfbfd);
  --ah-surface: #fff;
  --ah-ink: #1a1936; --ah-ink-2: #4b4a6c; --ah-ink-3: #5f5e80;
  --ah-line: color-mix(in srgb, var(--ah-brand) 12%, #e7e7ef); --ah-line-2: color-mix(in srgb, var(--ah-brand) 24%, #cfcfdf);
  --ah-gold: #f2c200; --ah-gold-ink: #5c4600; --ah-gold-bg: #fff3c2;
  --ah-ok-bg: #dcf3e6; --ah-ok-ink: #0f5132; --ah-late-bg: #fbe4e1; --ah-late-ink: #8a2a1f; --ah-wait-bg: #e7e7f1; --ah-wait-ink: #3f3e5e;
  --ah-shadow: rgba(26,25,54,.4);
  --ah-ui: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ah-display: "Bricolage Grotesque", var(--ah-ui);
  --ah-t: 160ms cubic-bezier(.2,.7,.2,1);
  --ah-pad: 16px; --ah-cell: 11px; --ah-tile-gap: 12px;
}
.ah[data-theme="dark"] {
  --ah-rail: color-mix(in srgb, var(--ah-brand) 38%, #0b0a1f);
  --ah-brand-900: color-mix(in srgb, var(--ah-brand) 35%, white);
  --ah-brand-700: color-mix(in srgb, var(--ah-brand) 70%, white);
  --ah-brand-100: color-mix(in srgb, var(--ah-brand) 32%, #171634);
  --ah-brand-50: color-mix(in srgb, var(--ah-brand) 16%, #171634);
  --ah-paper: color-mix(in srgb, var(--ah-brand) 7%, #0f0e24);
  --ah-surface: color-mix(in srgb, var(--ah-brand) 9%, #171634);
  --ah-ink: #ececf6; --ah-ink-2: #bdbcd4; --ah-ink-3: #a3a2be;
  --ah-line: color-mix(in srgb, #fff 11%, transparent); --ah-line-2: color-mix(in srgb, #fff 20%, transparent);
  --ah-gold-bg: rgba(242,194,0,.16); --ah-gold-ink: #ffd84d;
  --ah-ok-bg: rgba(52,199,123,.18); --ah-ok-ink: #8fe0b4; --ah-late-bg: rgba(240,90,70,.18); --ah-late-ink: #ffb3a7; --ah-wait-bg: rgba(255,255,255,.1); --ah-wait-ink: #cfcfe4;
  --ah-shadow: rgba(0,0,0,.6);
  color-scheme: dark;
}
.ah[data-density="compact"] { --ah-pad: 11px; --ah-cell: 7px; --ah-tile-gap: 8px; }
.ah * { box-sizing: border-box; }
.ah { margin: 0; background: var(--ah-paper); color: var(--ah-ink); font: 400 14px/1.5 var(--ah-ui); caret-color: var(--ah-brand-700); }
.ah ::selection { background: var(--ah-brand-100); color: var(--ah-brand-900); }
.ah :focus-visible { outline: 2px solid var(--ah-brand-700); outline-offset: 2px; border-radius: 4px; }
.ah button { font: inherit; color: inherit; }
.ah h1, .ah h2, .ah h3, .ah p { margin: 0; }
.ah .num { font-variant-numeric: tabular-nums; }
.ah svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ah .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ah [hidden] { display: none !important; }


.ah .app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* rail */
.ah .rail { background: var(--ah-rail); color: #fff; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.ah .brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; text-decoration: none; color: #fff; }
.ah .brand .mark { width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, #fff 14%, transparent); display: grid; place-items: center; }
.ah .brand .mark svg { width: 22px; height: 22px; }
.ah .brand b { display: block; font: 600 19px/1 var(--ah-display); }
.ah .brand small { display: block; font-size: 12px; color: var(--ah-rail-ink); margin-top: 3px; }
.ah .nav { display: flex; flex-direction: column; gap: 2px; }
.ah .nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--ah-rail-ink); text-decoration: none; transition: background var(--ah-t), color var(--ah-t); }
.ah .nav a:hover { background: color-mix(in srgb, #fff 9%, transparent); color: #fff; }
.ah .nav a[aria-current="page"] { background: color-mix(in srgb, #fff 15%, transparent); color: #fff; font-weight: 600; }
.ah .nav a:focus-visible { outline-color: #fff; }
.ah .nav .n { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: transparent; padding: 0; min-width: 0; height: auto; }
.ah .nav .n::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ah-gold); }
.ah .navgroup { display: flex; flex-direction: column; }
.ah .navgroup > .row { display: flex; align-items: center; gap: 2px; }
.ah .navgroup > .row > a { flex: 1; }
.ah .navgroup .tog { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; color: var(--ah-rail-ink); cursor: pointer; display: grid; place-items: center; transition: background var(--ah-t), color var(--ah-t); }
.ah .navgroup .tog:hover { background: color-mix(in srgb, #fff 9%, transparent); color: #fff; }
.ah .navgroup .tog:focus-visible { outline-color: #fff; }
.ah .navgroup .tog svg { transition: transform 200ms cubic-bezier(.2,.7,.2,1); }
.ah .navgroup[data-open="true"] .tog svg { transform: rotate(90deg); }
.ah .navgroup > .row > a[data-within="true"]:not([aria-current]) { color: #fff; }
.ah .sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms cubic-bezier(.2,.7,.2,1); }
.ah .navgroup[data-open="true"] .sub { grid-template-rows: 1fr; }
.ah .sub > div { overflow: hidden; }
.ah .sub .list { position: relative; margin: 2px 0 4px 22px; padding-left: 12px; display: flex; flex-direction: column; gap: 1px; }
.ah .sub .list::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: color-mix(in srgb, #fff 22%, transparent); }
.ah .sub a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--ah-rail-ink); text-decoration: none; font-size: 13.5px; transition: background var(--ah-t), color var(--ah-t); }
.ah .sub a:hover { background: color-mix(in srgb, #fff 9%, transparent); color: #fff; }
.ah .sub a[aria-current="page"] { background: color-mix(in srgb, #fff 15%, transparent); color: #fff; font-weight: 600; }
.ah .sub a[aria-current="page"]::before { content: ""; position: absolute; left: -1px; width: 3px; height: 18px; border-radius: 2px; background: var(--ah-gold); }
.ah .sub a:focus-visible { outline-color: #fff; }
.ah .sub .n { margin-left: auto; font-size: 12px; font-weight: 600; color: #fff; background: transparent; padding: 0; min-width: 0; height: auto; display: inline-flex; align-items: center; gap: 6px; }
.ah .sub .n.hot { background: transparent; color: #fff; padding: 0; }
.ah .sub .n.hot::before { width: 6px; height: 6px; margin: 0; }
.ah .sub .n:not(.hot) { color: var(--ah-rail-ink); }
.ah .sub .n:not(.hot)::before { display: none; }
.ah .crumb { display: flex; align-items: center; gap: 8px; color: var(--ah-ink-3); font-size: 13px; margin-bottom: 8px; }
.ah .crumb a { color: var(--ah-ink-3); text-decoration: none; }
.ah .crumb a:hover { color: var(--ah-brand-700); text-decoration: underline; }
.ah .crumb svg { width: 14px; height: 14px; }
.ah .catdesc { color: var(--ah-ink-2); max-width: 64ch; margin: -14px 0 24px; }
.ah .chips.tools-chips { display: none; }
.ah .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, #fff 7%, transparent); font-size: 13px; color: var(--ah-rail-ink); }
.ah .me b { display: block; color: #fff; font-weight: 600; }
.ah .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ah-gold); color: #5c4600; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }

/* contenu */
.ah .main { padding: 34px 44px 72px; position: relative; overflow: hidden; }
.ah .watermark { position: absolute; right: -90px; top: -150px; width: 460px; height: 460px; opacity: .05; pointer-events: none; }
.ah .head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; position: relative; margin-bottom: 26px; }
.ah .head .date, .ah .head .kicker { color: var(--ah-ink-3); font-size: 13px; margin-bottom: 8px; }
.ah .head h1 { font: 600 34px/1.05 var(--ah-display); letter-spacing: -.015em; text-wrap: balance; }
.ah .head h1.big { font-size: 40px; }
.ah .head .tools { display: flex; align-items: center; gap: 10px; flex: 1 1 380px; max-width: 560px; }
.ah .search { position: relative; flex: 1; }
.ah .search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ah-ink-3); }
.ah .search input { width: 100%; height: 42px; border: 1px solid var(--ah-line-2); border-radius: 10px; background: var(--ah-surface); padding: 0 12px 0 38px; font: inherit; color: var(--ah-ink); transition: border-color var(--ah-t), box-shadow var(--ah-t); }
.ah .search input::placeholder { color: var(--ah-ink-3); }
.ah .search input:hover { border-color: var(--ah-brand); }
.ah .search input:focus { outline: 0; border-color: var(--ah-brand-700); box-shadow: 0 0 0 3px var(--ah-brand-100); }
.ah .btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; border: 1px solid var(--ah-line-2); background: var(--ah-surface); color: var(--ah-ink); border-radius: 10px; padding: 0 16px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--ah-t), border-color var(--ah-t), transform 80ms; }
.ah .btn:hover { background: var(--ah-brand-50); border-color: var(--ah-brand); }
.ah .btn:active { transform: scale(.98); }
.ah .btn:disabled { opacity: .55; cursor: default; }
.ah .btn.primary { background: var(--ah-brand); border-color: var(--ah-brand); color: #fff; }
.ah .btn.primary:hover { background: var(--ah-brand-700); border-color: var(--ah-brand-700); }
.ah .btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.ah .btn.ghost { border-color: transparent; background: transparent; }
.ah .btn.ghost:hover { background: var(--ah-brand-50); }

/* bandeau de la journée */
.ah .ribbon { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); background: var(--ah-surface); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--ah-line), 0 6px 14px -12px var(--ah-shadow); }
.ah .queue { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; border-left: 1px solid var(--ah-line); color: var(--ah-ink); text-decoration: none; position: relative; transition: background var(--ah-t); }
.ah .queue:first-child { border-left: 0; }
.ah .queue:hover { background: var(--ah-brand-50); }
.ah .queue .big { font: 600 30px/1 var(--ah-display); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.ah .queue[data-hot="true"] .big::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ah-gold); box-shadow: 0 0 0 4px var(--ah-gold-bg); }
.ah .queue .lbl { font-weight: 600; margin-top: 4px; }
.ah .queue .sub { color: var(--ah-ink-3); font-size: 13px; }
.ah .queue .go { position: absolute; right: 14px; top: 16px; color: var(--ah-ink-3); opacity: 0; transition: opacity var(--ah-t), transform var(--ah-t); }
.ah .queue:hover .go { opacity: 1; transform: translateX(2px); color: var(--ah-brand-700); }

/* sections, tuiles */
.ah section.block { margin-top: 40px; }
.ah .sec { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ah .sec h2 { font: 600 20px/1.2 var(--ah-display); display: flex; align-items: center; gap: 12px; }
.ah .sec h2 .cnt { font: 400 13px/1 var(--ah-ui); color: var(--ah-ink-3); }
.ah .sec .hint { color: var(--ah-ink-3); font-size: 13px; }
.ah .mags { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--ah-tile-gap); }
.ah .mag { position: relative; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 14px; align-items: start; padding: var(--ah-pad); background: var(--ah-surface); border: 1px solid var(--ah-line); border-radius: 14px; text-decoration: none; color: var(--ah-ink); transition: border-color var(--ah-t), transform var(--ah-t), box-shadow var(--ah-t); }
.ah .mag:hover { border-color: color-mix(in srgb, var(--ah-brand) 45%, var(--ah-line)); transform: translateY(-2px); box-shadow: 0 10px 22px -14px var(--ah-shadow); }
.ah .mag .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--ah-brand-100); color: var(--ah-brand-900); display: grid; place-items: center; transition: background var(--ah-t), color var(--ah-t); }
.ah .mag:hover .ic { background: var(--ah-brand); color: #fff; }
.ah .mag .ic svg { width: 20px; height: 20px; }
.ah .mag b { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; padding-right: 30px; }
.ah .mag span.d { display: block; color: var(--ah-ink-2); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.ah .n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--ah-brand-100); color: var(--ah-brand-900); }
.ah .n.hot { background: var(--ah-gold-bg); color: var(--ah-gold-ink); }
.ah .n.hot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ah-gold); margin-right: 5px; }
.ah .mag .n { position: absolute; right: 12px; top: 12px; }
.ah .pin { position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: var(--ah-ink-3); cursor: pointer; opacity: 0; display: grid; place-items: center; transition: opacity var(--ah-t), background var(--ah-t), color var(--ah-t); }
.ah .pin svg { width: 15px; height: 15px; }
.ah .mag:hover .pin, .ah .pin:focus-visible, .ah .mag[data-pinned="true"] .pin { opacity: 1; }
.ah .pin:hover { background: var(--ah-brand-50); color: var(--ah-brand-700); }
.ah .mag[data-pinned="true"] .pin { color: var(--ah-brand); }
.ah .empty { padding: 26px 20px; border: 1px dashed var(--ah-line-2); border-radius: 14px; color: var(--ah-ink-2); font-size: 14px; text-align: center; }
.ah .empty b { display: block; color: var(--ah-ink); font-weight: 600; margin-bottom: 3px; }
.ah .empty .btn { margin-top: 12px; }
.ah .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.ah .chip { border: 1px solid var(--ah-line-2); background: var(--ah-surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--ah-ink-2); transition: background var(--ah-t), color var(--ah-t), border-color var(--ah-t); display: inline-flex; align-items: center; gap: 8px; }
.ah .chip:hover { border-color: var(--ah-brand); color: var(--ah-ink); }
.ah .chip[aria-pressed="true"] { background: var(--ah-ink); border-color: var(--ah-ink); color: var(--ah-paper); font-weight: 600; }
.ah .chip[aria-pressed="true"] .n { background: color-mix(in srgb, var(--ah-paper) 22%, var(--ah-ink)); color: var(--ah-paper); }
.ah .cat { margin-top: 26px; }
.ah .cat h3 { font: 600 15px/1.3 var(--ah-ui); color: var(--ah-ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.ah .cat h3::after { content: ""; flex: 1; height: 1px; background: var(--ah-line); order: 1; }
.ah .cat h3 .hint { order: 2; color: var(--ah-ink-3); font-size: 13px; text-decoration: none; }
.ah .cat h3 .hint:hover { color: var(--ah-brand-700); text-decoration: underline; }

/* tableaux */
.ah table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--ah-surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--ah-line); overflow: hidden; }
.ah thead th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ah-ink-2); padding: 12px 14px; border-bottom: 1px solid var(--ah-line); background: color-mix(in srgb, var(--ah-brand) 3%, var(--ah-surface)); }
.ah thead th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ah thead th button:hover { color: var(--ah-ink); }
.ah tbody td { padding: var(--ah-cell) 14px; border-bottom: 1px solid var(--ah-line); vertical-align: middle; }
.ah tbody tr:last-child td { border-bottom: 0; }
.ah tbody tr { transition: background var(--ah-t); }
.ah tbody tr:hover, .ah tbody tr:focus-within { background: var(--ah-brand-50); }
.ah td .name { font-weight: 600; color: var(--ah-ink); text-decoration: none; }
.ah td .name:hover { text-decoration: underline; }
.ah td small { display: block; color: var(--ah-ink-2); font-size: 13px; }
.ah td.mute { color: var(--ah-ink-2); }
.ah td .acts { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity var(--ah-t); }
.ah tr:hover .acts, .ah tr:focus-within .acts { opacity: 1; }
.ah .status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.ah .status.todo { background: var(--ah-gold-bg); color: var(--ah-gold-ink); }
.ah .status.todo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ah-gold); }
.ah .status.late { background: var(--ah-late-bg); color: var(--ah-late-ink); }
.ah .status.wait { background: var(--ah-wait-bg); color: var(--ah-wait-ink); }
.ah .status.ok { background: var(--ah-ok-bg); color: var(--ah-ok-ink); }
.ah .foot { display: flex; justify-content: space-between; gap: 12px; color: var(--ah-ink-3); font-size: 13px; padding: 10px 4px 0; }
.ah .foot a { color: var(--ah-brand-700); }

/* panneau dossier */
.ah .panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(440px, 100vw); background: var(--ah-surface); border-left: 1px solid var(--ah-line); box-shadow: -8px 0 24px -12px var(--ah-shadow); padding: 28px 28px 32px; transform: translateX(104%); transition: transform 220ms cubic-bezier(.2,.7,.2,1); overflow-y: auto; z-index: 60; }
.ah .panel[data-open="true"] { transform: none; }
.ah .panel .close { position: absolute; top: 16px; right: 16px; width: 36px; padding: 0; justify-content: center; }
.ah .panel .kicker { color: var(--ah-ink-3); font-size: 13px; }
.ah .panel h2 { font: 600 26px/1.15 var(--ah-display); margin: 6px 0 2px; }
.ah .panel .sub { color: var(--ah-ink-2); margin: 0 0 22px; }
.ah .kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0 0 24px; }
.ah .kv dt { color: var(--ah-ink-3); margin: 0; }
.ah .kv dd { margin: 0; }
.ah .timeline { list-style: none; margin: 0 0 24px; padding: 0 0 0 14px; border-left: 2px solid var(--ah-line); }
.ah .timeline li { position: relative; padding: 0 0 14px 14px; }
.ah .timeline li::before { content: ""; position: absolute; left: -19px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ah-line-2); box-shadow: 0 0 0 2px var(--ah-surface), 0 0 0 4px var(--ah-line-2); }
.ah .timeline li.now::before { background: var(--ah-brand); box-shadow: 0 0 0 2px var(--ah-surface), 0 0 0 4px var(--ah-brand); }
.ah .timeline li.next::before { background: var(--ah-gold); box-shadow: 0 0 0 2px var(--ah-surface), 0 0 0 4px var(--ah-gold); }
.ah .timeline li b { font-weight: 600; }
.ah .timeline li span { display: block; color: var(--ah-ink-3); font-size: 13px; }
.ah .panel .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* messagerie */
.ah .chat { display: grid; grid-template-columns: 300px minmax(0,1fr); background: transparent; border-radius: 14px; box-shadow: 0 0 0 1px var(--ah-line); overflow: hidden; min-height: 560px; }
.ah .threads { border-right: 1px solid var(--ah-line); display: flex; flex-direction: column; background: var(--ah-surface); }
.ah .threads .poles { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--ah-line); flex-wrap: wrap; }
.ah .threads .chip { padding: 4px 11px; font-size: 13px; }
.ah .thread { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--ah-line); background: transparent; text-align: left; cursor: pointer; width: 100%; transition: background var(--ah-t); }
.ah .thread:hover { background: var(--ah-brand-50); }
.ah .thread[aria-current="true"] { background: var(--ah-brand-50); box-shadow: inset 3px 0 0 var(--ah-brand); }
.ah .thread .av { width: 36px; height: 36px; border-radius: 50%; background: var(--ah-brand-100); color: var(--ah-brand-900); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.ah .thread b { display: block; font-weight: 600; }
.ah .thread small { display: block; color: var(--ah-ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah .thread .when { color: var(--ah-ink-3); font-size: 12px; align-self: start; }
.ah .convo { display: flex; flex-direction: column; background: var(--ah-surface); }
.ah .convo header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--ah-line); }
.ah .convo header b { font-weight: 600; font-size: 15px; }
.ah .convo header small { display: block; color: var(--ah-ink-3); font-size: 13px; }
.ah .msgs { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--ah-paper); }
.ah .msg { max-width: 68%; padding: 10px 14px; border-radius: 14px; background: var(--ah-surface); box-shadow: 0 0 0 1px var(--ah-line); line-height: 1.45; }
.ah .msg small { display: block; color: var(--ah-ink-3); font-size: 11px; margin-top: 4px; }
.ah .msg.mine { align-self: flex-end; background: var(--ah-brand); color: #fff; box-shadow: none; border-bottom-right-radius: 4px; }
.ah .msg.mine small { color: color-mix(in srgb, #fff 75%, var(--ah-brand)); }
.ah .msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.ah .compose { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--ah-line); background: var(--ah-surface); }
.ah .compose textarea { flex: 1; min-height: 42px; max-height: 120px; resize: vertical; border: 1px solid var(--ah-line-2); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ah-ink); background: var(--ah-surface); }
.ah .compose textarea:focus { outline: 0; border-color: var(--ah-brand-700); box-shadow: 0 0 0 3px var(--ah-brand-100); }

/* maintenance */
.ah .settings { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 24px; align-items: start; }
.ah .subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 56px; }
.ah .subnav button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border: 0; background: transparent; border-radius: 8px; color: var(--ah-ink-2); cursor: pointer; }
.ah .subnav button:hover { background: var(--ah-brand-50); color: var(--ah-ink); }
.ah .subnav button[aria-current="true"] { background: var(--ah-surface); color: var(--ah-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--ah-line); }
.ah .card { background: var(--ah-surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--ah-line); padding: 22px 24px; margin-bottom: 16px; }
.ah .card h2 { font: 600 18px/1.2 var(--ah-display); margin-bottom: 4px; }
.ah .card > p { color: var(--ah-ink-2); margin-bottom: 18px; max-width: 62ch; }
.ah .form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 20px; }
.ah .field { display: flex; flex-direction: column; gap: 6px; }
.ah .field.wide { grid-column: 1 / -1; }
.ah .field label { font-weight: 600; font-size: 13px; }
.ah .field .help { color: var(--ah-ink-3); font-size: 12px; }
.ah .field input[type=text], .ah .field input[type=url], .ah .field select { height: 40px; border: 1px solid var(--ah-line-2); border-radius: 8px; padding: 0 12px; font: inherit; color: var(--ah-ink); background: var(--ah-surface); }
.ah .field input:focus, .ah .field select:focus { outline: 0; border-color: var(--ah-brand-700); box-shadow: 0 0 0 3px var(--ah-brand-100); }
.ah .field .color { display: flex; align-items: center; gap: 10px; }
.ah .field .color input[type=color] { width: 40px; height: 40px; border: 1px solid var(--ah-line-2); border-radius: 8px; padding: 3px; background: var(--ah-surface); cursor: pointer; }
.ah .field .color code { font: 13px ui-monospace, Menlo, monospace; color: var(--ah-ink-2); }
.ah .drop { border: 1px dashed var(--ah-line-2); border-radius: 10px; padding: 18px; display: flex; align-items: center; gap: 14px; color: var(--ah-ink-2); }
.ah .drop .logo { width: 48px; height: 48px; border-radius: 10px; background: var(--ah-brand); display: grid; place-items: center; }
.ah .drop .logo svg { width: 28px; height: 28px; color: #fff; }
.ah .card .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--ah-line); }
.ah .card .row:first-of-type { border-top: 0; }
.ah .card .row b { font-weight: 600; display: block; }
.ah .card .row small { color: var(--ah-ink-3); }
.ah .err { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--ah-late-bg); color: var(--ah-late-ink); }
.ah .err svg { margin-top: 2px; }
.ah .err b { font-weight: 600; }
.ah .save { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* chargement */
.ah @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.ah.loading .sk { color: transparent !important; background: var(--ah-line) !important; border-radius: 6px; animation: pulse 1.2s ease-in-out infinite; box-shadow: none !important; }
.ah.loading .sk * { visibility: hidden; }
.ah.loading .queue .big::before { display: none; }

.ah .toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; background: var(--ah-ink); color: var(--ah-paper); border-radius: 10px; padding: 10px 16px; font-size: 14px; box-shadow: 0 10px 28px -10px var(--ah-shadow); opacity: 0; transform: translateY(8px); transition: opacity var(--ah-t), transform var(--ah-t); pointer-events: none; z-index: 70; }
.ah .toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) { .ah .ribbon { grid-template-columns: repeat(3, minmax(0,1fr)); } .ah .queue:nth-child(4) { border-left: 0; } .ah .queue:nth-child(n+4) { border-top: 1px solid var(--ah-line); } .ah .settings { grid-template-columns: 1fr; } .ah .subnav { position: static; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 860px) {
  .ah .app { grid-template-columns: 1fr; }
  .ah .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; overflow-x: auto; }
  .ah .nav { flex-direction: row; } .ah .nav a span.l { display: none; } .ah .me { display: none; } .ah .navgroup .tog, .ah .sub { display: none; } .ah .chips.tools-chips { display: flex; }
  .ah .main { padding: 24px 18px 56px; } .ah .head h1, .ah .head h1.big { font-size: 30px; } .ah .watermark { display: none; } .ah .sec .hint { display: none; }
  .ah .ribbon { grid-template-columns: repeat(2, minmax(0,1fr)); } .ah .queue:nth-child(3) { border-left: 0; } .ah .queue:nth-child(n+3) { border-top: 1px solid var(--ah-line); }
  .ah td.hide, .ah th.hide { display: none; } .ah td .acts { opacity: 1; }
  .ah .chat { grid-template-columns: 1fr; } .ah .threads { max-height: 260px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--ah-line); }
  .ah .form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .ah *, .ah *::before, .ah *::after { transition-duration: 1ms !important; animation: none !important; } }

/* ── Déconnexion : bloc utilisateur de la colonne ──────────────────────
   Bouton neutralisé (all: unset) : les pages d'outil stylent souvent
   <button> de façon globale, leurs règles ne doivent pas déteindre ici. */
.ah .rail .me .deco {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ah-rail-ink);
  opacity: .8;
  cursor: pointer;
}
.ah .rail .me .deco svg { width: 14px; height: 14px; flex: none; }
.ah .rail .me .deco:hover { opacity: 1; color: #fff; }
.ah .rail .me .deco:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }

/* Petit écran : la colonne devient une barre et le kit y masque le bloc
   utilisateur. On n'en garde que le bouton, en icône, au bout de la barre.
   « body.ah » passe devant la protection injectée par ah-shell.js. */
@media (max-width: 860px) {
  body.ah .rail .me { display: flex; margin: 0 0 0 auto; padding: 0; background: none; }
  body.ah .rail .me .avatar,
  body.ah .rail .me b,
  body.ah .rail .me .deco span { display: none; }
  body.ah .rail .me .deco { margin: 0; padding: 8px; border-radius: 8px; }
  body.ah .rail .me .deco svg { width: 18px; height: 18px; }
}

/* Petit écran : la barre défile horizontalement ; le bouton de
   déconnexion reste épinglé à droite, sur le fond de la barre. */
@media (max-width: 860px) {
  body.ah .rail .me { position: sticky; right: 0; background: inherit; padding-left: 6px; }
}
