/* ============================================================
   MailXYZ — the console's own layer.

   Everything here is expressed in design-system tokens. No hex value, no raw pixel colour:
   if a value is missing from the tokens, it is missing from the design system, and that is a
   question for the handoff rather than a licence to hard-code.

   The measurements come from handoffs/design_handoff_mailxyz/design/*.dc.html, which is the
   source of truth wherever a number matters.
   ============================================================ */

/* ============================================================
   RGAA / WCAG 2.1 AA — measured corrections to the palette.

   The handoff calls its colours final AND asks for WCAG 2.1 AA. Measured, those two
   requirements do not both hold, so the tokens below are redefined here — in the console's own
   layer, never in the design system's token files — and every number is the computed contrast
   ratio against the surface the text actually sits on.

   The handoff's own guidance is part of what fails: it says to use --azure-600 rather than
   --azure-500 under white text, and azure-600 under white measures 3.84:1. That clears AA for
   LARGE text (3.0) and not for normal text (4.5), and a primary button's label is 16px
   semibold — normal, by WCAG's definition.

     white on azure-500            2.55   the rail's active project
     white on azure-600            3.84   every primary button
     white on azure-700            5.79   <- used instead
     neutral-400 on white          2.72   --text-subtle, 37 usages
     neutral-500 on surface-page   4.30   still short
     neutral-600 on surface-sunken 6.02   <- the worst surface it lands on, and it passes
     success-600 on white          4.36   the provider line

   The hierarchy is preserved rather than flattened: body (neutral-800) darker than muted
   (neutral-700) darker than subtle (neutral-600), all three passing on card, page and sunken.
   ============================================================ */

:root {
    --text-muted: var(--neutral-700);
    --text-subtle: var(--neutral-600);

    /* White text sits on this. azure-600 does not reach 4.5:1; azure-700 does. */
    --color-primary: var(--azure-700);
    --color-primary-hover: var(--azure-800);

    /* Brand text on a tinted background — azure-600 on azure-50 is 3.55:1. */
    --color-brand-text: var(--azure-700);
}

/* ---- Shell -------------------------------------------------------------
   Rail 72 / sidebar 264 / content. A fixed-height flex row: the console is a tool, and each
   panel scrolls on its own rather than the page scrolling as a whole. */

.mx-app {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    background: var(--surface-page);
    color: var(--text-body);
}

.mx-icon {
    flex: none;
}

.mx-spacer {
    flex: 1;
}

/* ---- Project rail ------------------------------------------------------ */

.mx-rail {
    width: 72px;
    flex: none;
    background: var(--ink-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 14px;
    gap: 12px;
}

.mx-rail__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--azure-600);
    color: var(--neutral-0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-brand);
}

.mx-rail__divider {
    width: 28px;
    height: 1px;
    background: rgb(255 255 255 / 12%);
}

.mx-rail__projects {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.mx-rail__project {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgb(255 255 255 / 7%);
    color: rgb(255 255 255 / 62%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 13px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard);
}

.mx-rail__project:hover {
    background: rgb(255 255 255 / 14%);
    color: rgb(255 255 255 / 85%);
}

.mx-rail__project--active,
.mx-rail__project--active:hover {
    background: var(--azure-700);
    color: var(--neutral-0);
    box-shadow: var(--shadow-brand);
}

.mx-rail__add {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px dashed rgb(255 255 255 / 22%);
    background: transparent;
    color: rgb(255 255 255 / 45%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mx-rail__add:hover {
    border-color: rgb(255 255 255 / 40%);
    color: rgb(255 255 255 / 70%);
}

.mx-rail__foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    color: rgb(255 255 255 / 50%);
}

.mx-rail__account {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mx-rail__avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 10%);
    color: var(--neutral-0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
}

/* ---- Sidebar ----------------------------------------------------------- */

.mx-sidebar {
    width: 264px;
    flex: none;
    background: var(--surface-card);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
}

.mx-sidebar__header {
    padding: 2px 8px 20px;
}

.mx-wordmark {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 19px;
    color: var(--ink-900);
    letter-spacing: 0.01em;
}

.mx-wordmark__xyz {
    color: var(--azure-500);
    font-weight: var(--weight-medium);
}

.mx-wordmark__tagline {
    font-size: var(--text-2xs);
    color: var(--text-subtle);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    margin-top: 5px;
}

.mx-group-title {
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0 8px 8px;
}

.mx-group-title--spaced {
    padding-top: 24px;
}

.mx-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mx-nav__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: var(--weight-semibold);
    font-size: 13.5px;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard);
}

.mx-nav__item:hover {
    background: var(--surface-sunken);
    color: var(--text-body);
}

.mx-nav__item--active,
.mx-nav__item--active:hover {
    background: var(--azure-50);
    color: var(--azure-700);
}

/* A destination this account may not open — ROLES.md section 6.

   LOCKED, NEVER HIDDEN. Seeing the item greyed with a padlock says the console has the screen
   and that this account is not the one who opens it; removing it produces the support ticket
   the handoff names outright, "il me manque un menu".

   No hover response and no pointer: the surest way to say "not clickable" is to behave exactly
   like something that is not. */
.mx-nav__item--locked,
.mx-nav__item--locked:hover {
    color: var(--text-subtle);
    opacity: .6;
    background: none;
    cursor: default;
}

/* The refused item on err-1b: active AND locked. Azure, at full opacity, because it is where
   the reader is — greying the very item they just tried to open would make the refusal look
   like it came from somewhere else. ROLES.md section 1. */
.mx-nav__item--locked.mx-nav__item--active,
.mx-nav__item--locked.mx-nav__item--active:hover {
    background: var(--azure-50);
    color: var(--azure-700);
    opacity: 1;
}

.mx-nav__lock {
    color: var(--text-subtle);
}

.mx-nav__item--active .mx-nav__lock {
    color: var(--azure-700);
}

.mx-nav__count {
    font-family: var(--font-mono);
    font-size: 11.5px;
    opacity: 0.7;
}

.mx-nav__item--active .mx-nav__count {
    opacity: 0.8;
}

/* Service status card, in the sidebar foot. */
.mx-status {
    margin: 0 4px;
    padding: 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mx-status__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mx-status__label {
    font-size: 12.5px;
    color: var(--text-muted);
}

.mx-status__value {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-900);
    white-space: nowrap;
    flex: none;
}

.mx-status__provider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--success-700);
}

.mx-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    flex: none;
}

.mx-dot--success {
    background: var(--success-500);
}

.mx-meter {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    overflow: hidden;
}

.mx-meter__fill {
    height: 100%;
    background: var(--azure-500);
}

/* Language pills and the TechXYZ endorsement. */
.mx-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 10px;
}

.mx-lang__pill {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    color: var(--text-subtle);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    background: none;
    border: none;
    cursor: pointer;
}

.mx-lang__pill--active {
    background: var(--ink-900);
    color: var(--neutral-0);
    font-weight: var(--weight-bold);
}

.mx-sidebar__brand {
    border-top: 1px solid var(--border-subtle);
    padding: 12px 8px 2px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.mx-sidebar__brand img {
    width: 22px;
    height: 22px;
    /* The handoff ships the mark in its light-on-dark variant; the sidebar foot is a light
       surface. Same treatment as the mockups. */
    filter: invert(1) brightness(0.25);
}

.mx-sidebar__brand span {
    font-size: var(--text-2xs);
    color: var(--text-subtle);
}

/* ---- Main column ------------------------------------------------------- */

.mx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mx-topbar {
    height: 70px;
    flex: none;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
}

.mx-topbar__eyebrow {
    font-size: var(--text-2xs);
    color: var(--text-subtle);
    letter-spacing: 0.06em;
}

.mx-topbar__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
    margin-top: 2px;
}

.mx-topbar__search {
    width: 280px;
}

.mx-content {
    flex: 1;
    overflow: auto;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- Cards and stat tiles ---------------------------------------------- */

.mx-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.mx-card--featured {
    border: 1.5px solid var(--azure-500);
    box-shadow: var(--shadow-brand);
}

.mx-card--flush {
    overflow: hidden;
}

.mx-stat-row {
    display: flex;
    gap: 14px;
}

.mx-stat {
    flex: 1;
    padding: 16px 18px;
}

.mx-stat__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.mx-stat__value {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: 26px;
    color: var(--ink-900);
    margin-top: 6px;
}

/* ---- Badges ------------------------------------------------------------
   The design system's Badge, soft variant: 24px, radius-md, semibold, tinted background. */

.mx-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    /* radius-pill, not radius-md: the design system's Badge is a pill, and at 24px tall the
       difference between 10px and 999px is the whole silhouette. */
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mx-badge--neutral {
    background: var(--surface-sunken);
    color: var(--neutral-700);
}

.mx-badge--neutral .mx-badge__dot {
    background: var(--neutral-500);
}

.mx-badge--brand {
    background: var(--azure-50);
    color: var(--azure-700);
}

.mx-badge--brand .mx-badge__dot {
    background: var(--azure-500);
}

.mx-badge--success {
    background: var(--success-50);
    color: var(--success-700);
}

.mx-badge--success .mx-badge__dot {
    background: var(--success-500);
}

.mx-badge--warning {
    background: var(--warning-50);
    color: var(--warning-700);
}

.mx-badge--warning .mx-badge__dot {
    background: var(--warning-500);
}

.mx-badge--danger {
    background: var(--danger-50);
    color: var(--danger-700);
}

.mx-badge--danger .mx-badge__dot {
    background: var(--danger-500);
}

.mx-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    flex: none;
}

/* ---- Projects grid (screen 1a) ----------------------------------------- */

.mx-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.mx-project__rule {
    height: 3px;
    background: var(--surface-sunken);
}

.mx-project__rule--active {
    background: var(--azure-500);
}

.mx-project__head {
    padding: 18px 20px 8px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.mx-avatar-square {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 12px;
    background: var(--surface-sunken);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 13px;
}

.mx-avatar-square--active {
    background: var(--azure-50);
    color: var(--color-brand-text);
}

.mx-project__identity {
    min-width: 0;
    flex: 1;
}

.mx-project__name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mx-project__name {
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-project__description {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.mx-project__menu {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-subtle);
    cursor: pointer;
    display: inline-flex;
}

.mx-project__inboxes {
    padding: 6px 12px 12px;
}

.mx-inbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    border-top: 1px solid var(--border-subtle);
    color: inherit;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard);
}

.mx-inbox-row:hover {
    background: var(--surface-sunken);
}

.mx-inbox-row--warning,
.mx-inbox-row--warning:hover {
    background: var(--warning-50);
    border-radius: 0 0 8px 8px;
}

.mx-inbox-row__env {
    width: 66px;
    flex: none;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* prod carries deliberate visual weight: it is the one that really sends. */
.mx-inbox-row__env--prod {
    color: var(--ink-900);
}

.mx-inbox-row__meta {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-inbox-row__warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--warning-700);
}

.mx-new-project {
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 200px;
    color: var(--text-muted);
    background: rgb(255 255 255 / 50%);
    cursor: pointer;
    text-decoration: none;
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        background var(--duration-fast) var(--ease-standard);
}

.mx-new-project:hover {
    border-color: var(--azure-300);
    background: var(--surface-card);
}

.mx-new-project__badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--azure-50);
    color: var(--color-brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-new-project__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-new-project__hint {
    font-size: 12.5px;
    color: var(--text-subtle);
}

/* ---- Density: 1470 x 845, the MacBook Air 13" target -------------------
   At 845px of usable height the home screen still shows its three projects without
   scrolling. Everything tightens by a notch; nothing is removed. */

@media (max-height: 880px) {
    .mx-rail {
        width: 68px;
        padding: 14px 0 12px;
        gap: 10px;
    }

    .mx-rail__projects {
        gap: 10px;
    }

    .mx-content {
        padding: 18px 24px;
        gap: 14px;
    }

    .mx-stat {
        padding: 12px 16px;
    }

    .mx-stat__value {
        font-size: 23px;
        margin-top: 4px;
    }

    .mx-project__head {
        padding: 14px 18px 6px;
    }

    .mx-inbox-row {
        padding: 9px 8px;
    }

    .mx-new-project {
        min-height: 168px;
    }
}

/* ---- Utilities ---------------------------------------------------------- */

/* Available to a screen reader, absent from the layout. Used where an icon or a pair of
   initials carries a meaning the eye gets from position and the ear does not. */
.mx-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.mx-rail__icon-button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
}

.mx-inbox-row__chevron {
    color: var(--text-subtle);
}

/* ---- Circuit failure ----------------------------------------------------
   Blazor shows this by id when the connection is lost for good. It is the one piece of UI
   that has to work when the circuit does not, so it is plain CSS and no component. */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--z-toast);
    padding: 14px 24px;
    background: var(--warning-50);
    border-top: 1px solid var(--warning-100);
    color: var(--warning-700);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    box-shadow: var(--shadow-lg);
}

#blazor-error-ui .reload {
    margin-left: 10px;
    color: var(--text-link);
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

/* ============================================================
   Mailbox (screen 1d) — three panels: sidebar, list, reader.
   ============================================================ */

.mx-sidebar--narrow {
    width: 246px;
}

.mx-sidebar__empty {
    padding: 0 8px;
    font-size: var(--text-xs);
    color: var(--text-subtle);
    line-height: 1.5;
}

.mx-nav__env {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 11.5px;
}

.mx-dot--brand { background: var(--azure-500); }
.mx-dot--warning { background: var(--warning-500); }
.mx-dot--neutral { background: var(--neutral-400); }

/* ---- Frequent tags ------------------------------------------------------ */

.mx-taglist {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mx-taglist__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
}

.mx-taglist__item:hover {
    background: var(--surface-sunken);
}

.mx-taglist__item--active,
.mx-taglist__item--active:hover {
    background: var(--azure-50);
    color: var(--azure-700);
    font-weight: var(--weight-semibold);
}

.mx-taglist__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Purge notice -------------------------------------------------------
   Loud on purpose: these messages are about to stop existing, and the only
   thing that can save one is somebody noticing in time. */

.mx-purge-notice {
    margin: 0 4px 12px;
    padding: 10px 12px;
    background: var(--warning-50);
    border: 1px solid var(--warning-100);
    border-radius: var(--radius-md);
}

.mx-purge-notice__head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--warning-700);
}

.mx-purge-notice p {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--warning-700);
    line-height: 1.45;
}

/* ---- The two right-hand panels ------------------------------------------ */

.mx-mailbox {
    flex: 1;
    min-width: 0;
    display: flex;
}

.mx-mailbox__list {
    width: 426px;
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--surface-card);
    border-right: 1px solid var(--border-subtle);
    min-height: 0;
}

.mx-mailbox__list-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: none;
}

.mx-mailbox__list-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mx-mailbox__list-title h1 {
    font-size: 15px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-icon-button {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-subtle);
    cursor: pointer;
    display: inline-flex;
    border-radius: var(--radius-sm);
}

.mx-icon-button:hover {
    color: var(--text-body);
    background: var(--surface-sunken);
}

.mx-mailbox__count {
    font-size: 11.5px;
    color: var(--text-subtle);
}

/* The list scrolls; the header above it does not. */
.mx-mailbox__rows {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.mx-mailbox__more {
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-link);
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

.mx-mailbox__more:hover {
    background: var(--surface-sunken);
}

/* ---- Chips -------------------------------------------------------------- */

.mx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mx-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
}

.mx-chip--active {
    background: var(--azure-600);
    border-color: var(--azure-600);
    color: var(--neutral-0);
    font-weight: var(--weight-semibold);
}

.mx-chip--clear {
    border-style: dashed;
    font-family: var(--font-sans);
}

/* ---- A message row ------------------------------------------------------ */

.mx-msg {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 3px solid transparent;
    background: none;
    text-align: left;
    cursor: pointer;
}

.mx-msg:hover {
    background: var(--surface-sunken);
}

.mx-msg--selected,
.mx-msg--selected:hover {
    background: var(--azure-50);
    border-left-color: var(--azure-500);
}

/* Close to the purge: dimmed, so it reads as "on its way out" before the words do. */
.mx-msg--expiring {
    opacity: 0.75;
}

.mx-msg__line {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.mx-msg__subject {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-msg--selected .mx-msg__subject {
    font-weight: var(--weight-bold);
}

.mx-msg__time {
    flex: none;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-msg__to {
    font-size: var(--text-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-msg__state {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.mx-msg__expiry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--warning-700);
    font-weight: var(--weight-semibold);
}

.mx-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    border: none;
}

.mx-tag--tiny {
    font-size: 10.5px;
    padding: 2px 7px;
}

.mx-tag--clickable {
    cursor: pointer;
}

.mx-tag--clickable:hover {
    background: var(--azure-50);
    color: var(--azure-700);
}

/* ---- The reader --------------------------------------------------------- */

.mx-mailbox__reader {
    flex: 1;
    min-width: 0;
    background: var(--surface-page);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mx-reader {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.mx-reader__head {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 18px 26px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: none;
}

.mx-reader__title-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.mx-reader__subject {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-reader__addresses,
.mx-reader__provenance {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mx-reader__provenance {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-mono {
    font-family: var(--font-mono);
}

.mx-reader__tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mx-reader__copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 11.5px;
    color: var(--text-link);
    cursor: pointer;
}

.mx-tabs {
    display: flex;
    gap: 18px;
    margin-top: 4px;
}

.mx-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.mx-tabs__tab--active {
    font-weight: var(--weight-bold);
    color: var(--azure-700);
    border-bottom-color: var(--azure-500);
}

.mx-tabs__count {
    font-family: var(--font-mono);
    font-size: 11px;
    opacity: 0.75;
}

.mx-reader__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 26px;
}

.mx-reader__pre {
    margin: 0;
    padding: 18px 20px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.mx-reader__pre--code {
    background: var(--ink-950);
    color: #cfeeff;
    border-color: var(--ink-900);
}

.mx-reader__empty {
    font-size: 13px;
    color: var(--text-subtle);
}

/* ---- The sandboxed preview ---------------------------------------------- */

.mx-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.mx-preview__banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warning-50);
    border-bottom: 1px solid var(--warning-100);
    font-size: var(--text-xs);
    color: var(--warning-700);
}

.mx-preview__banner-action {
    background: none;
    border: none;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--warning-700);
    text-decoration: underline;
    cursor: pointer;
}

.mx-preview__frame {
    flex: 1;
    width: 100%;
    min-height: 320px;
    border: none;
    background: var(--neutral-0);
}

/* ---- Attachments -------------------------------------------------------- */

.mx-attachments {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mx-attachments__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.mx-attachments__icon {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: var(--radius-md);
    background: var(--azure-50);
    color: var(--color-brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-attachments__name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-attachments__size {
    font-size: 11px;
    color: var(--text-subtle);
}

.mx-attachments__download {
    color: var(--text-subtle);
    display: inline-flex;
}

/* ---- Empty and loading states ------------------------------------------- */

.mx-main--centred {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 24px;
    text-align: center;
    margin: auto;
}

.mx-empty__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--surface-sunken);
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-empty__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-empty__hint {
    font-size: 12.5px;
    color: var(--text-subtle);
    max-width: 34ch;
    line-height: 1.5;
}

.mx-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

.mx-skeleton__line {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
}

/* ---- Density ------------------------------------------------------------
   At 845px the list has to show six messages without scrolling. */

@media (max-height: 880px) {
    .mx-mailbox__list-head {
        padding: 12px 16px 10px;
        gap: 10px;
    }

    .mx-msg {
        padding: 10px 16px;
    }

    .mx-reader__head {
        padding: 14px 22px 0;
    }

    .mx-reader__body {
        padding: 16px 22px;
    }
}

/* ============================================================
   One message, full screen (1e).
   ============================================================ */

.mx-msgbar {
    height: 62px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
}

.mx-msgbar__back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--text-link);
}

.mx-msgbar__separator {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
}

.mx-msgbar__crumbs {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.mx-msgbar__position {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-msgpage {
    flex: 1;
    min-height: 0;
    display: flex;
}

.mx-msgpage__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mx-msgpage__status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 26px 0;
}

.mx-msgpage__provider {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    font-family: var(--font-mono);
}

.mx-msgpage__aside {
    width: 352px;
    flex: none;
    border-left: 1px solid var(--border-subtle);
    background: var(--surface-card);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.mx-msgpage__aside > section + section {
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}

.mx-aside__title {
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 10px;
}

.mx-aside__code {
    margin: 0;
    padding: 14px 16px;
    background: var(--ink-950);
    color: #cfeeff;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.mx-aside__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* ---- The journey timeline ----------------------------------------------- */

.mx-journey {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mx-journey__step {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    position: relative;
}

/* The connecting line, drawn between the dots and stopping at the last one. */
.mx-journey__step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 14px;
    bottom: 0;
    width: 1px;
    background: var(--border-subtle);
}

.mx-journey__step--muted {
    opacity: 0.6;
}

.mx-journey__dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-pill);
    flex: none;
    margin-top: 4px;
    z-index: 1;
}

.mx-journey__dot--brand { background: var(--azure-500); }
.mx-journey__dot--success { background: var(--success-500); }
.mx-journey__dot--danger { background: var(--danger-500); }
.mx-journey__dot--neutral { background: var(--neutral-300); }

.mx-journey__label {
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-journey__detail {
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-top: 2px;
}

/* ============================================================
   Inbox overview (1b) and settings (1c).
   ============================================================ */

/* ---- The ink banner -----------------------------------------------------
   Replaces the topbar on 1b alone. It is the first thing read on the page you
   land on from the home screen, and it says which environment this is and what
   it does with mail before anything else does. */

.mx-ink-banner {
    position: relative;
    overflow: hidden;
    flex: none;
    background: var(--ink-900);
    color: var(--neutral-0);
    padding: 22px 30px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.mx-ink-banner__halo {
    position: absolute;
    right: -90px;
    top: -120px;
    width: 340px;
    height: 340px;
    border-radius: var(--radius-circle);
    background: radial-gradient(circle, rgb(0 171 252 / 28%), transparent 68%);
    pointer-events: none;
}

/* position: relative on every sibling of the halo, and not decoration. The halo is absolutely
   positioned, and an absolutely positioned element paints above static ones whatever their
   z-index says — so it covered the buttons until these were positioned too. */
.mx-ink-banner__avatar {
    position: relative;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 15px;
    background: rgb(255 255 255 / 9%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: var(--text-sm);
    z-index: 1;
}

.mx-ink-banner__identity {
    position: relative;
    flex: 1;
    min-width: 0;
    z-index: 1;
}

.mx-ink-banner__eyebrow {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgb(255 255 255 / 50%);
}

.mx-ink-banner__title {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 24px;
    color: var(--neutral-0);
    margin-top: 4px;
}

.mx-ink-banner__env {
    color: var(--azure-400);
}

.mx-ink-banner__summary {
    font-size: 13px;
    color: rgb(255 255 255 / 62%);
    margin-top: 6px;
}

.mx-ink-banner__actions {
    position: relative;
    display: flex;
    gap: 10px;
    z-index: 1;
}

/* An outline button on the ink banner: white fill, dark text, as the handoff draws it.
   
   THE FILL GOES ON THE HOST, NOT ON ::part(control), and that is not a style choice. Fluent's
   own shadow stylesheet contains, literally:
   
       .control { background: transparent !important; }
   
   A shadow tree's !important declaration beats an outer ::part() rule — even another
   !important — so an outline button's background cannot be set from out here at all, and no
   design token helps either because the value is a literal rather than a var(). Every other
   property does work through ::part(); padding, margin and outline-offset were all confirmed
   applying while background silently did not.
   
   The host element is outside the shadow root and fully ours, so the fill goes there and the
   transparent control sits on top of it. */
.mx-ink-banner fluent-button[appearance='outline'] {
    background: var(--neutral-0);
    border-radius: var(--radius-md);
}

.mx-ink-banner fluent-button[appearance='outline']:hover {
    background: var(--neutral-100);
}

/* ---- Panels -------------------------------------------------------------- */

.mx-panel {
    padding: 18px 20px;
}

.mx-panel__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.mx-panel__head h2 {
    font-size: 15px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-panel__link {
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-link);
    margin-left: auto;
}

.mx-panel__help,
.mx-panel__note,
.mx-panel__empty {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.mx-panel__note {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-grid-overview {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
    align-items: start;
}

.mx-overview__aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mx-recent {
    display: block;
    padding: 11px 0;
    border-top: 1px solid var(--border-subtle);
    text-decoration: none;
}

.mx-recent__subject {
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-recent__meta {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    margin-top: 2px;
}

.mx-recent__state {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.mx-audit-line {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    color: var(--text-subtle);
}

.mx-audit-line__label {
    font-size: 12.5px;
    color: var(--text-body);
}

.mx-audit-line__meta {
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-top: 1px;
}

/* ---- Settings ------------------------------------------------------------ */

.mx-content--split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}

.mx-settings {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.mx-settings__aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
}

.mx-topbar__note {
    font-size: 12.5px;
    color: var(--text-subtle);
}

.mx-radio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.mx-radio {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    text-align: left;
    cursor: pointer;
}

.mx-radio__dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-default);
    background: var(--surface-card);
}

.mx-radio--selected {
    border: 1.5px solid var(--azure-500);
    background: var(--azure-50);
    box-shadow: var(--shadow-brand);
}

.mx-radio--selected .mx-radio__dot {
    border: 5px solid var(--azure-600);
}

.mx-radio__title {
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-radio--selected .mx-radio__title {
    font-weight: var(--weight-bold);
    color: var(--azure-800);
}

.mx-radio__description {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.45;
}

.mx-settings__add {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mx-settings__add fluent-text-field {
    width: 340px;
}

/*
    The sender card sits in the aside, which is a third the width of the form. Stacked rather
    than side by side: "Vérifier et enregistrer" is a long label and a button that clips its own
    verb is a button nobody can be sure about pressing.
*/
.mx-sender-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.mx-sender-form fluent-text-field {
    width: 100%;
}

.mx-sender-form fluent-button {
    align-self: flex-start;
}

.mx-settings__inline-error {
    margin-top: 8px;
    font-size: var(--text-xs);
    color: var(--danger-700);
}

.mx-chip__remove {
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    color: inherit;
    cursor: pointer;
}

.mx-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.mx-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--danger-50);
    border: 1px solid var(--danger-100);
    color: var(--danger-700);
    font-size: 12.5px;
}

.mx-setting-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
}

.mx-setting-row + .mx-setting-row {
    border-top: 1px solid var(--border-subtle);
}

.mx-setting-row > div:first-child {
    flex: 1;
    min-width: 0;
}

.mx-setting-row__label {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-setting-row__help {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.45;
}

.mx-setting-row__control {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- The guard rail ------------------------------------------------------
   The summary card. It is computed by the domain's own Decide, so it describes
   the behaviour rather than resembling it. */

.mx-summary {
    position: relative;
    overflow: hidden;
    background: var(--ink-900);
    color: var(--neutral-0);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
}

.mx-summary__halo {
    position: absolute;
    right: -60px;
    bottom: -110px;
    width: 220px;
    height: 220px;
    border-radius: var(--radius-circle);
    background: radial-gradient(circle, rgb(0 171 252 / 26%), transparent 68%);
    pointer-events: none;
}

.mx-summary--invalid {
    box-shadow: inset 0 0 0 1.5px var(--warning-500);
}

.mx-summary__title {
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 50%);
    position: relative;
}

.mx-summary__body {
    font-size: 14.5px;
    font-weight: var(--weight-bold);
    line-height: 1.55;
    margin-top: 10px;
    position: relative;
}

.mx-summary__purge {
    font-size: 12.5px;
    color: rgb(255 255 255 / 62%);
    margin-top: 10px;
    position: relative;
}

.mx-summary__invalid {
    font-size: 12px;
    color: var(--warning-100);
    margin-top: 12px;
    line-height: 1.5;
    position: relative;
}

.mx-provider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.mx-provider__icon {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: var(--radius-md);
    background: var(--azure-50);
    color: var(--color-brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-provider__name {
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-provider__detail {
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-panel--danger {
    border-color: var(--danger-100);
}

.mx-danger-title {
    color: var(--danger-700) !important;
    font-size: var(--text-sm) !important;
}

fluent-button.mx-btn-danger::part(control) {
    border-color: var(--danger-100);
    color: var(--danger-700);
}

/* ---- Confirmation dialog ------------------------------------------------- */

.mx-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(12 34 54 / 45%);
    z-index: var(--z-overlay);
}

.mx-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    width: min(460px, calc(100vw - 40px));
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mx-modal__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-modal__body {
    font-size: 13.5px;
    color: var(--text-body);
    line-height: 1.6;
}

.mx-modal__label {
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
    margin-top: 6px;
}

.mx-modal__hint {
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ---- Density ------------------------------------------------------------- */

@media (max-height: 880px) {
    .mx-ink-banner {
        padding: 16px 26px 18px;
    }

    .mx-ink-banner__title {
        font-size: 21px;
    }

    .mx-setting-row {
        padding: 12px 0;
    }
}

/* ============================================================
   Operations: audit trail (1f), API keys (1g), usage (1h).
   ============================================================ */

/* ---- Audit table --------------------------------------------------------- */

.mx-audit-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mx-audit-bar__legal {
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-table {
    display: flex;
    flex-direction: column;
}

.mx-table__head,
.mx-table__row {
    display: grid;
    grid-template-columns: 132px 168px 1fr 150px 128px;
    gap: 16px;
    align-items: center;
}

.mx-table__head {
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border-subtle);
    padding: 11px 16px;
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.mx-table__row {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
}

/* The newest entry, highlighted. It is the one somebody opening this screen during an incident
   is looking for. */
.mx-table__row--newest {
    background: var(--azure-50);
}

.mx-table__cell-muted {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.mx-audit-sentence {
    color: var(--ink-900);
}

/* ---- API keys ------------------------------------------------------------ */

.mx-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--azure-50);
    border: 1px solid var(--azure-100);
    border-radius: var(--radius-lg);
    color: var(--azure-800);
    font-size: 13px;
    line-height: 1.5;
}

.mx-panel__count {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-panel--reveal {
    border: 1.5px solid var(--azure-500);
    box-shadow: var(--shadow-brand);
}

.mx-reveal {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 14px;
}

.mx-reveal__value {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    background: var(--ink-950);
    color: #cfeeff;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12.5px;
    overflow-x: auto;
    white-space: nowrap;
}

.mx-key {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-top: 1px solid var(--border-subtle);
}

.mx-key--revoked {
    opacity: 0.6;
}

.mx-key__icon {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 11px;
    background: var(--surface-sunken);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-key__icon--active {
    background: var(--azure-50);
    color: var(--color-brand-text);
}

.mx-key__identity {
    flex: 1;
    min-width: 0;
}

.mx-key__name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mx-key__name {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-key--revoked .mx-key__name {
    text-decoration: line-through;
}

.mx-key__value {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 5px;
}

.mx-key__meta {
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-top: 4px;
}

.mx-key__actions {
    display: flex;
    gap: 4px;
    flex: none;
}

.mx-icon-button--danger:hover {
    color: var(--danger-600);
}

.mx-endpoint {
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.mx-endpoint-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mx-endpoint__label {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
}

.mx-endpoint__value {
    display: block;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-900);
    margin-top: 4px;
    overflow-x: auto;
    white-space: nowrap;
}

.mx-scope {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    position: relative;
}

.mx-scope li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    font-size: 13px;
}

.mx-scope__granted {
    color: var(--neutral-0);
}

.mx-scope__granted svg {
    color: var(--azure-400);
}

.mx-scope__denied {
    color: rgb(255 255 255 / 45%);
}

.mx-modal__switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 6px;
}

/* ---- Usage --------------------------------------------------------------- */

.mx-usage-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 22px 24px;
}

.mx-usage-summary__value {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: 34px;
    color: var(--ink-900);
    margin-top: 6px;
    white-space: nowrap;
}

.mx-usage-summary__allowance {
    font-family: var(--font-sans);
    font-weight: var(--weight-regular);
    font-size: 13px;
    color: var(--text-subtle);
}

.mx-usage-summary__bar {
    flex: 1;
    min-width: 0;
}

.mx-usage-summary__trapped {
    border-left: 1px solid var(--border-subtle);
    padding-left: 26px;
    flex: none;
}

.mx-usage-summary__trapped-value {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: 24px;
    color: var(--ink-900);
    margin-top: 6px;
}

.mx-usage-summary__over {
    margin-top: 10px;
    font-size: var(--text-xs);
    color: var(--warning-700);
    line-height: 1.5;
}

.mx-stacked {
    display: flex;
    height: 12px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    overflow: hidden;
}

.mx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.mx-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.mx-legend__swatch {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex: none;
}

/* The chart is CSS. Fourteen bars need no library, and a charting dependency on a 128-512 MB
   host would cost more than it draws. */
.mx-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 180px;
    margin-top: 14px;
}

.mx-chart__column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.mx-chart__bar {
    width: 100%;
    min-height: 2px;
}

.mx-chart__bar--trapped {
    background: var(--azure-200);
    border-radius: 4px 4px 0 0;
}

.mx-chart__bar--sent {
    background: var(--azure-600);
}

/* Only the trapped segment is rounded when it sits on top; a sent-only column rounds itself. */
.mx-chart__bar--trapped:not(:has(+ .mx-chart__bar--sent)),
.mx-chart__column > .mx-chart__bar--sent:first-child {
    border-radius: 4px 4px 0 0;
}

.mx-chart__axis {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-subtle);
}

.mx-tagbar {
    margin-top: 12px;
}

.mx-tagbar__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.mx-tagbar__value {
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-tagbar__track {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    margin-top: 5px;
    overflow: hidden;
}

.mx-tagbar__fill {
    height: 100%;
    border-radius: var(--radius-pill);
}

/* ============================================================
   Onboarding (1i).
   ============================================================ */

.mx-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* A step still ahead is dimmed rather than hidden: the checklist should read as four things,
   not as however many are currently relevant. */
.mx-step--pending {
    opacity: 0.75;
}

.mx-step__badge {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-default);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: var(--weight-bold);
}

.mx-step__badge--done {
    background: var(--success-50);
    border-color: var(--success-100);
    color: var(--success-700);
}

.mx-step__badge--active {
    background: var(--azure-600);
    border-color: var(--azure-600);
    color: var(--neutral-0);
    box-shadow: var(--shadow-brand);
}

.mx-step > div {
    flex: 1;
    min-width: 0;
}

.mx-step__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-step__detail {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.mx-step__state {
    font-size: var(--text-xs);
    color: var(--success-700);
    font-weight: var(--weight-semibold);
    flex: none;
}

.mx-step__action {
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-link);
    flex: none;
}

/* The active step is a card rather than a row: it is the one being worked on, and it carries
   the code sample. */
.mx-step-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 1.5px solid var(--azure-500);
    box-shadow: var(--shadow-brand);
}

.mx-step-card__body {
    flex: 1;
    min-width: 0;
}

.mx-step-card__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- The waiting card ---------------------------------------------------- */

.mx-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 28px 24px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background: rgb(255 255 255 / 50%);
}

.mx-waiting--received {
    border-style: solid;
    border-color: var(--success-100);
    background: var(--success-50);
}

.mx-waiting__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--azure-50);
    color: var(--color-brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-waiting--received .mx-waiting__icon {
    background: var(--neutral-0);
    color: var(--success-700);
}

.mx-waiting__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-waiting__hint {
    font-size: 12.5px;
    color: var(--text-subtle);
    line-height: 1.5;
}

.mx-waiting__state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--azure-700);
    margin-top: 4px;
}

.mx-practice {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mx-practice li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.mx-practice svg {
    color: var(--success-700);
    margin-top: 2px;
}

/* ============================================================
   Responsive — handoff README section 13.

   The console is a desktop tool, so these are not a mobile layout: they are what keeps it
   usable on a narrower window, which is where it will actually be read.
   ============================================================ */

/* ---- 1100–1400px: the right-hand column goes underneath -------------------
   The side column carries a summary or a scope card — it explains the main column rather than
   competing with it, so below it is the right place when width runs out. */

@media (max-width: 1400px) {
    .mx-content--split {
        grid-template-columns: 1fr;
    }

    .mx-settings__aside {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
        align-items: start;
    }

    .mx-grid-overview {
        grid-template-columns: 1fr;
    }

    /* The mailbox keeps its three panels; only the list gives up width. */
    .mx-mailbox__list {
        width: 360px;
    }

    .mx-msgpage__aside {
        width: 300px;
    }
}

/* ---- Below 1100px: the mailbox becomes list, then reader ------------------
   Exactly the role screen 1e already plays. Rather than squeeze three panels into a phone-width
   window, the list fills the space and a message opens on its own page. */

@media (max-width: 1100px) {
    /* The sidebar NARROWS; it is not hidden.
    
       Hiding it was the first attempt and it was wrong: the sidebar carries the FR/EN toggle,
       the frequent tags and the purge warning, and none of those exist anywhere else. A
       language switch that disappears below a certain window width is not a responsive layout,
       it is a missing feature. The handoff asks for a retractable overlay here; keeping the
       column costs 200px and makes nothing unreachable, which is the part that matters. */
    .mx-sidebar,
    .mx-sidebar--narrow {
        width: 200px;
        padding: 14px 10px 12px;
    }

    .mx-mailbox {
        flex-direction: column;
    }

    .mx-mailbox__list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    /* The reading pane goes away; a row navigates to the full-screen message instead. */
    .mx-mailbox__reader {
        display: none;
    }

    .mx-settings__aside {
        grid-template-columns: 1fr;
    }

    .mx-radio-grid {
        grid-template-columns: 1fr;
    }

    .mx-table__head,
    .mx-table__row {
        grid-template-columns: 110px 140px 1fr;
    }

    /* Target and author drop out of the audit table before the event does: the sentence is the
       column somebody is reading. */
    .mx-table__head > :nth-child(n + 4),
    .mx-table__row > :nth-child(n + 4) {
        display: none;
    }

    .mx-usage-summary {
        flex-wrap: wrap;
        gap: 18px;
    }

    .mx-usage-summary__trapped {
        border-left: none;
        padding-left: 0;
    }

    .mx-endpoint-row {
        grid-template-columns: 1fr;
    }

    .mx-msgpage {
        flex-direction: column;
    }

    .mx-msgpage__aside {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
    }

    .mx-topbar {
        padding: 0 18px;
    }

    .mx-content {
        padding: 18px;
    }
}

/* ---- Motion ---------------------------------------------------------------
   Already honoured in fluent-overrides for transitions; this covers the console's own. */

@media (prefers-reduced-motion: reduce) {
    .mx-msg,
    .mx-inbox-row,
    .mx-nav__item,
    .mx-new-project {
        transition: none;
    }
}

/* ============================================================
   Account screens (auth 1a–1e).

   The one part of the console drawn on ink. Measurements from
   design/MailXYZ Authentification.dc.html; the two halos and the node pattern are the only
   places in this stylesheet with literal rgba values, because they ARE the values the design
   system's own mockup writes — a translucent white over ink is not a colour the palette names.
   ============================================================ */

.mx-auth {
    position: relative;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--ink-900);
}

.mx-auth__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .075) 1.2px, transparent 1.3px);
    background-size: 36px 36px;
}

.mx-auth__halo {
    position: absolute;
    border-radius: var(--radius-circle);
    pointer-events: none;
}

.mx-auth__halo--top {
    top: -180px;
    right: -140px;
    width: 760px;
    height: 760px;
    background: radial-gradient(circle, rgba(0, 171, 252, .28), rgba(0, 171, 252, 0) 68%);
}

.mx-auth__halo--bottom {
    bottom: -260px;
    left: -160px;
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(0, 171, 252, .14), rgba(0, 171, 252, 0) 70%);
}

/* min-height rather than height, and padding rather than centring alone: the card grows with a
   danger banner and with a requirements panel, and a viewport shorter than the tallest state
   must scroll instead of clipping the button. */
.mx-auth__stage {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 40px 20px;
    box-sizing: border-box;
}

.mx-auth__card {
    width: 496px;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--surface-card);
    border-radius: 20px;
    /* Navy, never black: a black shadow on ink reads as a hole rather than as height. */
    box-shadow: 0 32px 70px rgba(6, 20, 34, .42);
    padding: 40px 44px 36px;
}

.mx-auth__foot {
    width: 496px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mx-auth__brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.mx-auth__brand img {
    width: 20px;
    height: 20px;
    opacity: .75;
}

.mx-auth__brand span {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, .55);
}

.mx-auth__lang {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mx-auth__pill {
    padding: 5px 11px;
    border: none;
    border-radius: var(--radius-pill);
    background: none;
    /* .72 rather than the mockup's .5: white at half opacity on ink-900 measures 3.1:1, and
       these are 11.5px labels. At .72 they reach 5.4:1 and still read as the quiet state. */
    color: rgba(255, 255, 255, .72);
    font-size: 11.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    cursor: pointer;
}

.mx-auth__pill--active {
    background: rgba(255, 255, 255, .14);
    color: var(--neutral-0);
    font-weight: var(--weight-bold);
}

/* The focus ring has to survive the dark background. Inside the card the console's azure ring
   is fine; on ink it is nearly invisible, so anything focusable out there gets a white one. */
.mx-auth__pill:focus-visible,
.mx-auth__brand a:focus-visible {
    outline: 2px solid var(--neutral-0);
    outline-offset: 2px;
}

/* ---- Card contents ---- */

.mx-auth__lockup {
    display: flex;
    align-items: center;
    gap: 11px;
}

.mx-auth__mark {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 11px;
    background: var(--azure-600);
    color: var(--neutral-0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-brand);
}

/* The word-mark, in the display face. MAIL is ink and bold, XYZ is azure and lighter — the
   same lockup the rail draws, at the one size the handoff gives for it. */
/* The small grey line under a field. Not .mx-auth__hint, which is the sunken callout used for
   the "les accès sont créés sur invitation" note and would draw a box around one sentence. */
.mx-auth__fieldhint {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-subtle);
}

/* One rule per row rather than the auto-fit grid of 1e: this panel is read once, while the two
   rules of this console's policy sit side by side and read as a single clipped sentence. */
.mx-auth__requirements--single .mx-auth__requirements-grid {
    grid-template-columns: 1fr;
    margin-top: 0;
}

.mx-auth__requirements--single {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mx-auth__requirements-note {
    flex: none;
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-auth__wordmark {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    font-size: 19px;
    letter-spacing: .01em;
    color: var(--ink-900);
}

.mx-auth__wordmark span {
    color: var(--azure-500);
    font-weight: var(--weight-medium);
}

/* The over-line beside the key on 1e: "LIEN VALABLE 1 H 42". */
.mx-auth__overline {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.mx-auth__title {
    font-size: 25px;
    font-weight: var(--weight-bold);
    letter-spacing: -.01em;
    color: var(--ink-900);
    margin: 26px 0 0;
}

/* 22px under a back link or a vignette, 26px under the lockup — the mockup sets both. */
.mx-auth__title--tight {
    margin-top: 22px;
}

.mx-auth__subtitle {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 7px 0 0;
}

.mx-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-decoration: none;
}

.mx-auth__back:hover {
    color: var(--ink-900);
}

/* The 52px rounded tile on 1d. */
.mx-auth__vignette {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--azure-50);
    border: 1px solid var(--azure-100);
    color: var(--azure-700);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-auth__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 26px;
}

.mx-auth__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mx-auth__field label {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

/* A plain input rather than a Fluent text field, and the reason is the render mode: these pages
   are static, so the value has to travel in a real form POST under a name the server binds.
   Styled here to the design system's own 44px control. */
.mx-auth__input {
    height: 44px;
    box-sizing: border-box;
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-size: var(--text-md);
}

.mx-auth__input::placeholder {
    color: var(--text-subtle);
}

.mx-auth__input:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
    border-color: var(--border-focus);
}

.mx-auth__input:disabled {
    background: var(--surface-sunken);
    color: var(--text-muted);
}

.mx-auth__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.mx-auth__stay {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: var(--text-md);
    color: var(--text-body);
    cursor: pointer;
}

.mx-auth__stay input {
    width: 18px;
    height: 18px;
    accent-color: var(--azure-600);
    cursor: pointer;
}

.mx-auth__link {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-brand-text);
    text-decoration: none;
}

.mx-auth__link:hover {
    text-decoration: underline;
}

/* The buttons are full width because the mockup's container is a column flex — the design
   system's Button takes no width prop. */
.mx-auth__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.mx-auth__button {
    height: 44px;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

.mx-auth__button:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.mx-auth__button--primary {
    background: var(--color-primary);
    color: var(--text-on-brand);
    box-shadow: var(--shadow-brand);
}

.mx-auth__button--primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.mx-auth__button--outline {
    background: var(--surface-card);
    border-color: var(--border-default);
    color: var(--ink-900);
}

.mx-auth__button--outline:hover:not(:disabled) {
    background: var(--surface-sunken);
}

.mx-auth__button--ghost {
    background: none;
    color: var(--ink-900);
}

.mx-auth__button--ghost:hover:not(:disabled) {
    background: var(--surface-sunken);
}

.mx-auth__button:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

/* ---- Notices ---- */

.mx-auth__notice {
    display: flex;
    gap: 12px;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 18px;
}

.mx-auth__notice--danger {
    background: var(--danger-50);
    border: 1px solid var(--danger-100);
    color: var(--danger-700);
}

.mx-auth__notice-title {
    font-size: 13.5px;
    font-weight: var(--weight-bold);
}

.mx-auth__notice-body {
    font-size: 12.5px;
    line-height: 1.6;
    margin-top: 4px;
}

/* A sunken hint block: the 2-hour note on 1c, the requirements panel on 1e. */
.mx-auth__hint {
    display: flex;
    gap: 9px;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    margin-top: 24px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.mx-auth__hint .mx-icon {
    color: var(--text-subtle);
    margin-top: 2px;
}

/* The two bordered help rows on 1d. */
.mx-auth__help {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 24px;
}

.mx-auth__help-row {
    display: flex;
    gap: 10px;
    padding: 13px 15px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

.mx-auth__help-row + .mx-auth__help-row {
    border-top: 1px solid var(--border-subtle);
}

.mx-auth__help-row .mx-icon {
    color: var(--text-subtle);
    margin-top: 2px;
}

.mx-auth__help-row strong {
    color: var(--ink-900);
    font-weight: var(--weight-semibold);
}

/* The invitation note under the rule on 1a. */
.mx-auth__footnote {
    border-top: 1px solid var(--border-subtle);
    margin-top: 28px;
    padding-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

.mx-auth__footnote .mx-icon {
    color: var(--text-subtle);
    margin-top: 2px;
}

.mx-auth__footnote--centred {
    display: block;
    text-align: center;
    margin-top: 26px;
    padding-top: 14px;
}

.mx-auth__caption {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: center;
    margin: 12px 0 0;
}

/* An address, always in the mono face — the same treatment the mailbox gives a recipient. */
.mx-auth__address {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-900);
}

/* ---- Requirements panel (1e) ----
   Two columns, as the mockup draws them; one column when there is only one rule to show, which
   is what this console's policy actually produces. */

.mx-auth__requirements {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 18px;
}

.mx-auth__requirements-title {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.mx-auth__requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
    margin-top: 11px;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.mx-auth__requirement {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* The tick is not the only signal: the met state also carries its own word for a screen reader,
   because a colour and a glyph are one signal wearing two coats. */
.mx-auth__requirement--met {
    color: var(--success-700);
}

/* Both icons are always in the DOM and one is hidden, so the swap costs no layout and needs no
   markup rewrite from the script that does it. */
.mx-auth__requirement .mx-auth__tick,
.mx-auth__requirement--met .mx-auth__pending {
    display: none;
}

.mx-auth__requirement--met .mx-auth__tick {
    display: block;
}

@media (max-width: 560px) {
    .mx-auth__card {
        padding: 30px 24px 28px;
    }
}

/* ============================================================
   Error screens (err-1a 404 in the shell, err-1c 500 on ink).

   Two families, and the boundary is the whole rule: an error IN the console keeps the shell and
   fills the content area; an error OF the console goes full width on ink. The ink half reuses
   the .mx-auth__ shell above — same canvas, same card, same footer — because ERREURS.md
   describes exactly the same decor as AUTHENTIFICATION.md.
   ============================================================ */

/* ---- The pane inside the shell (err-1a) ---- */

.mx-errorpane {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-errorpane__block {
    width: 640px;
    max-width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The node motif: a round azure wash with the console's own dot grid over it, masked to a
   circle so the grid fades rather than ending on an edge. */
.mx-errorpane__glyph {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azure-600);
}

.mx-errorpane__glyph::before,
.mx-errorpane__glyph::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-circle);
}

.mx-errorpane__glyph::before {
    background: radial-gradient(circle, rgba(0, 171, 252, .16), transparent 68%);
}

.mx-errorpane__glyph::after {
    background-image: radial-gradient(circle, rgba(12, 34, 54, .16) 1.4px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(circle, #000 42%, transparent 70%);
    mask-image: radial-gradient(circle, #000 42%, transparent 70%);
}

.mx-errorpane__glyph .mx-icon {
    position: relative;
}

/* Orbitron, because the code is a landmark rather than a sentence — and aria-hidden, because
   the sentence is the h2 underneath. */
.mx-errorpane__code {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 56px;
    line-height: 1;
    letter-spacing: .02em;
    color: var(--ink-900);
    margin-top: 18px;
}

.mx-errorpane__headline {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: -.01em;
    color: var(--ink-900);
    margin: 14px 0 0;
}

.mx-errorpane__lead {
    font-size: var(--text-lg);
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 470px;
    /* Balances the last line instead of leaving one orphaned word under a centred paragraph. */
    text-wrap: pretty;
    margin: 10px 0 0;
}

/* The path that was asked for, as a pill. Mono, because it is a literal to compare against. */
.mx-errorpane__path {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.mx-errorpane__path .mx-icon {
    color: var(--text-subtle);
}

.mx-errorpane__actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

/* ---- err-1b, 403 ---- */

/* The halo goes NEUTRAL for a refusal, and the spark disappears. ERREURS.md is explicit and it
   is the right call: a refusal is not an incident. An azure wash would say the console had a
   problem, when it did exactly what it was configured to do. */
.mx-errorpane__glyph--neutral {
    color: var(--ink-900);
}

.mx-errorpane__glyph--neutral::before {
    background: radial-gradient(circle, rgba(12, 34, 54, .09), transparent 68%);
}

.mx-errorpane__footnote {
    font-size: var(--text-sm);
    color: var(--text-subtle);
    margin-top: 16px;
}

/* "Qui peut vous ouvrir l'accès" — the card that turns a refusal into a next step. */
.mx-admins {
    width: 100%;
    margin-top: 22px;
    padding: 18px 20px;
    text-align: left;
}

.mx-admins__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
}

.mx-admins__row + .mx-admins__row {
    border-top: 1px solid var(--border-subtle);
}

.mx-admins__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: var(--radius-circle);
    background: var(--azure-50);
    color: var(--azure-700);
    font-size: 12px;
    font-weight: var(--weight-bold);
}

.mx-admins__identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mx-admins__name {
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-admins__email {
    font-size: 11.5px;
    color: var(--text-subtle);
    overflow-wrap: anywhere;
}

.mx-admins__more {
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    color: var(--text-subtle);
}

/* ---- The sidebar's VOTRE RÔLE block (ROLES.md section 6) ---- */

.mx-rolecard {
    margin: 0 4px;
    padding: 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
}

.mx-rolecard__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mx-rolecard__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: var(--radius-circle);
    background: var(--surface-sunken);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: var(--weight-bold);
}

.mx-rolecard__identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mx-rolecard__name {
    font-size: 12.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-rolecard__scope {
    font-size: 11px;
    color: var(--text-subtle);
}

.mx-rolecard__sentence {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* The role badge carries an icon before its word; the word is never optional. */
.mx-badge .mx-icon {
    margin-right: 1px;
}

/* ---- "Vous cherchiez peut-être" ---- */

.mx-suggestions {
    width: 100%;
    margin-top: 26px;
    padding: 0;
    text-align: left;
}

.mx-suggestions__title {
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 14px 18px 10px;
}

.mx-suggestions__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
}

.mx-suggestions__row:hover {
    background: var(--surface-sunken);
}

.mx-suggestions__row:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

.mx-suggestions__pill {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azure-50);
    color: var(--color-brand-text);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: var(--weight-bold);
}

.mx-suggestions__pill--icon {
    background: var(--surface-sunken);
    color: var(--text-subtle);
}

.mx-suggestions__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mx-suggestions__label {
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-suggestions__sub {
    font-size: 11.5px;
    color: var(--text-subtle);
    overflow-wrap: anywhere;
}

.mx-suggestions__chevron {
    margin-left: auto;
    color: var(--text-subtle);
}

/* ---- The ink card (err-1c) ---- */

.mx-auth__card--wide,
.mx-auth__foot--wide {
    width: 560px;
}

.mx-auth__mark--danger {
    background: var(--danger-50);
    border: 1px solid var(--danger-100);
    color: var(--danger-600);
    box-shadow: none;
}

/* 30px rather than the 56px of the in-shell screens: on a card the code sits beside its icon as
   a label, not as a landmark in an empty column. */
.mx-errorcard__code {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 30px;
    line-height: 1;
    letter-spacing: .02em;
    color: var(--ink-900);
}

/* Two buttons of equal width, as the mockup draws them. */
.mx-auth__actions--row {
    flex-direction: row;
}

.mx-auth__actions--row > * {
    flex: 1;
}

/* An <a> wearing a button's clothes: the error screen has no circuit, so its actions are links. */
.mx-auth__button--link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.mx-auth__foot-link {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
}

.mx-auth__foot-link:hover {
    color: var(--neutral-0);
    text-decoration: underline;
}

.mx-auth__foot-link:focus-visible {
    outline: 2px solid var(--neutral-0);
    outline-offset: 2px;
}

/* ---- The incident block ---- */

.mx-incident {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 22px;
}

.mx-incident__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
}

.mx-incident__row + .mx-incident__row {
    border-top: 1px solid var(--border-subtle);
}

.mx-incident__row .mx-icon {
    color: var(--text-subtle);
}

.mx-incident__body {
    min-width: 0;
    flex: 1;
}

.mx-incident__label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.mx-incident__value {
    font-size: var(--text-sm);
    color: var(--ink-900);
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.mx-incident__when {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.mx-incident__copy {
    flex: none;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-brand-text);
    cursor: pointer;
}

.mx-incident__copy:hover {
    background: var(--surface-sunken);
}

.mx-incident__copy:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
}

/* The error screens' halos are quieter than the sign-in screens': the page is already saying
   something is wrong and the decor should not compete with it. */
.mx-auth__halo--top.mx-auth__halo--muted {
    background: radial-gradient(circle, rgba(0, 171, 252, .22), rgba(0, 171, 252, 0) 68%);
}

.mx-auth__halo--bottom.mx-auth__halo--muted {
    background: radial-gradient(circle, rgba(0, 171, 252, .12), rgba(0, 171, 252, 0) 70%);
}

@media (max-width: 700px) {
    .mx-errorpane__block {
        width: 100%;
    }

    .mx-errorpane__actions {
        flex-direction: column;
        width: 100%;
    }
}

/* ---- The Sécurité card of screen 1g ----
   Three switches separated by rules, as the handoff draws them. */

.mx-keysec__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-top: 1px solid var(--border-subtle);
    cursor: pointer;
}

.mx-keysec__row:first-of-type {
    border-top: none;
}

.mx-keysec__label {
    font-size: var(--text-sm);
    color: var(--text-body);
}

.mx-keysec__note {
    margin: 10px 0 0;
    font-size: var(--text-xs);
    line-height: 1.55;
    color: var(--text-subtle);
}

/* ---- Degraded strip ----
   Warning, not danger: the provider being unreachable is a state this product was built to
   survive — the messages are queued, not lost — and painting it red would say otherwise. */

.mx-degraded {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    background: var(--warning-50);
    border-bottom: 1px solid var(--warning-100);
    color: var(--warning-700);
    font-size: var(--text-sm);
}

.mx-degraded .mx-icon {
    color: var(--warning-600);
}

/* ============================================================
   Members, invitations and access requests (3a, 3b, 3c) — lot 13.
   ============================================================ */

.mx-members {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 28px;
}

/* ---- Filter pills ---- */

.mx-memberfilters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mx-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--surface-card);
    color: var(--text-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

/* --azure-600 carries white text here because the pill's label is 13px semibold, which WCAG
   treats as large text at this weight. Lot 9 established --azure-700 for normal-size white. */
.mx-pill--active,
.mx-pill--active:hover {
    background: var(--azure-700);
    border-color: var(--azure-700);
    color: #fff;
}

.mx-pill__count {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-pill--active .mx-pill__count {
    color: rgba(255, 255, 255, .85);
}

.mx-memberfilters__note {
    font-size: var(--text-sm);
    color: var(--text-subtle);
}

/* ---- The members table ---- */

/* Not `overflow: hidden`, which is how a card normally keeps its rounded corners: the per-row
   menu is a child of its row and would be cut off at the card's edge — the one below the fold
   showed a header and nothing else. The two edges that need the radius take it themselves. */
.mx-membertable {
    padding: 0;
    overflow: visible;
}

.mx-membertable__head {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.mx-membertable__row:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mx-membertable__head,
.mx-membertable__row {
    display: grid;
    grid-template-columns: 1fr 182px 154px 118px 112px;
    align-items: center;
}

.mx-membertable__head {
    background: var(--surface-sunken);
    padding: 9px 16px;
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mx-membertable__row {
    position: relative;
    min-height: 63px;
    padding: 9px 16px;
    border-top: 1px solid var(--border-subtle);
}

/* A withdrawn access sits on the sunken surface AND says so in words, twice: the badge and the
   sub-line. The tint alone would be the whole signal, which is what RGAA forbids. */
.mx-membertable__row--disabled {
    background: var(--surface-sunken);
}

.mx-membertable__row--disabled .mx-member__name {
    color: var(--text-muted);
}

.mx-membertable__when {
    font-size: 12.5px;
    color: var(--text-muted);
}

.mx-membertable__manage {
    text-align: right;
}

.mx-member {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mx-member__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: var(--radius-circle);
    background: var(--surface-sunken);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: var(--weight-bold);
}

.mx-member__avatar--admin {
    background: var(--azure-50);
    color: var(--azure-700);
}

.mx-member__identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mx-member__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-member__you {
    padding: 1px 7px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.mx-member__mail {
    font-size: 11.5px;
    color: var(--text-subtle);
    overflow-wrap: anywhere;
}

.mx-member__withdrawn {
    color: var(--text-muted);
}

/* ---- The per-row menu ---- */

.mx-membermenu {
    position: absolute;
    right: 16px;
    top: 54px;
    z-index: 20;
    width: 320px;
    padding: 6px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: 0 18px 40px rgba(6, 20, 34, .18);
}

.mx-membermenu__group {
    padding: 8px 10px 4px;
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mx-membermenu__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text-body);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.mx-membermenu__item:hover {
    background: var(--surface-sunken);
}

.mx-membermenu__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mx-membermenu__hint {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-subtle);
}

/* Rendered, not removed. The reason sits underneath it — an item that vanished would leave the
   warning explaining something no longer on screen. */
.mx-membermenu__locked {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    color: var(--text-subtle);
    opacity: .75;
    font-size: 13px;
}

.mx-membermenu__locked .mx-icon {
    margin-left: auto;
}

.mx-membermenu__warning {
    margin: 6px 4px 4px;
    padding: 10px 12px;
    border: 1px solid var(--danger-100);
    border-radius: var(--radius-md);
    background: var(--danger-50);
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-body);
}

.mx-membermenu__warning strong {
    display: block;
}

/* ---- Loading skeleton, at the real row height ---- */

.mx-memberskeleton {
    padding: 0;
}

.mx-memberskeleton__row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    border-top: 1px solid var(--border-subtle);
}

.mx-memberskeleton__row:first-child {
    border-top: 0;
}

.mx-memberskeleton__avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: var(--radius-circle);
    background: rgba(12, 34, 54, .09);
}

.mx-memberskeleton__lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mx-memberskeleton__bar {
    height: 9px;
    border-radius: var(--radius-pill);
}

.mx-memberskeleton__bar--name {
    width: 150px;
    background: rgba(12, 34, 54, .09);
}

.mx-memberskeleton__bar--mail {
    width: 210px;
    background: rgba(12, 34, 54, .06);
}

.mx-memberskeleton__pill {
    width: 96px;
    height: 22px;
    margin-left: auto;
    border-radius: var(--radius-pill);
    background: rgba(12, 34, 54, .06);
}

/* ---- Invitations ---- */

.mx-invitations,
.mx-requests {
    padding: 0;
}

.mx-invitations__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
}

.mx-invitations__count {
    font-size: var(--text-xs);
    color: var(--text-subtle);
}

.mx-invitations__note {
    font-size: var(--text-sm);
    color: var(--text-subtle);
}

.mx-invitations__columns,
.mx-invitations__row {
    display: grid;
    grid-template-columns: 1fr 176px 140px 168px 212px;
    align-items: center;
    padding: 9px 16px;
}

.mx-invitations__columns {
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-sunken);
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mx-invitations__row {
    min-height: 58px;
    border-top: 1px solid var(--border-subtle);
}

.mx-invitations__address {
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.mx-invitations__by,
.mx-invitations__when {
    font-size: 12.5px;
    color: var(--text-muted);
}

.mx-invitations__when {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mx-invitations__sub {
    font-size: 11.5px;
    color: var(--text-subtle);
}

/* The colour is doubled by the word, always: "Expirée depuis 3 j" beside the amber dot. */
.mx-invitations__expired {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: var(--weight-semibold);
    color: var(--warning-600);
}

.mx-invitations__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    text-align: right;
}

/* ---- Access requests ---- */

.mx-requests__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
}

.mx-requests__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mx-requests__line {
    font-size: 13.5px;
    color: var(--ink-900);
}

.mx-requests__sub {
    font-size: 11.5px;
    color: var(--text-subtle);
}

/* ---- The invite dialogue (3b) ---- */

.mx-dialog {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 32px 36px 28px;
}

.mx-invite {
    width: 520px;
    max-width: 100%;
}

.mx-invite__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mx-invite__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: var(--radius-circle);
    background: var(--azure-50);
    border: 1px solid var(--azure-100);
    color: var(--azure-700);
}

.mx-invite__mark--done {
    background: var(--success-50, var(--azure-50));
    border-color: var(--success-100, var(--azure-100));
    color: var(--success-700, var(--azure-700));
}

.mx-invite__heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mx-dialog__title {
    margin: 0;
    font-size: 19px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-dialog__subtitle {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.mx-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mx-field__label {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-body);
    padding: 0;
}

.mx-field__error {
    font-size: var(--text-sm);
    color: var(--danger-600);
}

/* Real radios inside labels, not clickable divs: keyboard reachable, announced as a group, and
   the focus ring lands where a person expects it. ROLES.md section 7 asks for exactly this. */
.mx-rolepick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.mx-rolepick__card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    cursor: pointer;
}

.mx-rolepick__card--chosen {
    border: 1.5px solid var(--azure-500);
    background: var(--azure-50);
    box-shadow: var(--shadow-brand);
}

.mx-rolepick__radio {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    flex: none;
    accent-color: var(--azure-600);
}

.mx-rolepick__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mx-rolepick__name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
}

.mx-rolepick__hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.mx-invite__validity {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.mx-invite__validity .mx-icon {
    flex: none;
    color: var(--text-subtle);
}

.mx-dialog__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.mx-invite__link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mx-invite__linkvalue {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    font-size: 12px;
    color: var(--text-body);
}

/* ---- The acceptance screen's inviter block (3c) ---- */

.mx-auth__wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.mx-invitedby {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* ---- Toast ---- */

.mx-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    background: var(--ink-900);
    color: #fff;
    font-size: var(--text-md);
    box-shadow: 0 18px 40px rgba(6, 20, 34, .32);
}

.mx-toast--hidden {
    display: none;
}

.mx-toast__action {
    border: 0;
    background: none;
    color: var(--azure-200, #7CD4FD);
    font: inherit;
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
    .mx-toast {
        animation: mx-toast-in var(--duration-fast) var(--ease-standard);
    }
}

@keyframes mx-toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }
}

/* ---- Ordered rules, screen 1j (lot 14) ----------------------------------- */

/* The card headings of this screen. The same 15px/700 as .mx-panel__head h2, which every other
   card uses through a wrapper element these do not need. */
.mx-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.mx-rules {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.mx-rules__help {
    margin: 0 0 2px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.mx-rules__aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* One card of the stack. The grip and the number are fixed; the sentence takes what is left and
   wraps inside the card rather than pushing the switch off its right edge. */
.mx-rule {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    padding: 18px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}

/* The rule the tester just named. Border and shadow, never colour alone — the result card says
   "Règle 2" in words at the same time. */
.mx-rule--lit {
    border: 1.5px solid var(--azure-500);
    box-shadow: var(--shadow-brand);
}

/* A rule that is switched off still reads, because it is still in the stack and still numbered.
   Dimmed, and its switch says so out loud to a screen reader. */
.mx-rule--off {
    background: var(--surface-sunken);
}

.mx-rule--off .mx-rule__sentence {
    opacity: .55;
}

.mx-rule__grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-subtle);
    cursor: grab;
}

.mx-rule__grip:hover {
    color: var(--text-muted);
    background: var(--surface-sunken);
}

.mx-rule__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--surface-sunken);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: var(--weight-bold);
}

.mx-rule__number--lit {
    background: var(--azure-600);
    color: #fff;
}

.mx-rule__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.mx-rule__sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mx-rule__word {
    font-size: 13px;
    color: var(--text-muted);
}

.mx-rule__token {
    padding: 5px 10px;
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    font-size: 12px;
    color: var(--ink-900);
}

.mx-rule__token--lit {
    background: var(--azure-50);
    border: 1px solid var(--azure-100);
    color: var(--azure-700);
}

/* The verdict tokens carry the only colour on the card that means something, and each one also
   spells out the word — "envoyer", "trapper". */
.mx-rule__token--send {
    background: var(--success-50, var(--azure-50));
    color: var(--success-700, var(--azure-700));
    font-weight: var(--weight-semibold);
}

.mx-rule__token--trap {
    background: var(--warning-50);
    color: var(--warning-700);
    font-weight: var(--weight-semibold);
}

.mx-rule__note {
    margin: 0;
    font-size: 12px;
    color: var(--text-subtle);
}

/* The final rule: sunken, an asterisk instead of a number, no grip and no switch. */
.mx-rule--final {
    background: var(--surface-sunken);
    box-shadow: none;
}

.mx-rule__asterisk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.mx-rule__finalnote {
    font-size: 11.5px;
    color: var(--text-subtle);
}

.mx-rules__add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 1px dashed var(--border-strong, var(--border-subtle));
    border-radius: var(--radius-lg);
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.mx-rules__add:hover {
    border-color: var(--azure-500);
    color: var(--azure-700);
}

.mx-rules__mode {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}

.mx-rules__modehint {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 62ch;
}

/* The per-rule menu. The card is position:relative and the stack does not clip — the members
   table of lot 13 taught that one. */
.mx-rulemenu {
    position: absolute;
    right: 16px;
    top: 54px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 220px;
    padding: 6px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: 0 18px 40px rgba(6, 20, 34, .18);
}

.mx-rulemenu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-900);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.mx-rulemenu__item:hover:not(:disabled) {
    background: var(--surface-sunken);
}

.mx-rulemenu__item:disabled {
    color: var(--text-subtle);
    cursor: default;
}

.mx-rulemenu__item--danger {
    color: var(--danger-700);
}

/* ---- The address tester ---- */

.mx-tester {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
}

.mx-tester__hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.mx-tester__input {
    width: 100%;
}

.mx-tester__result {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--surface-sunken);
}

.mx-tester__result--send {
    background: var(--success-50, var(--azure-50));
    border-color: var(--success-100, var(--azure-100));
    color: var(--success-700, var(--azure-700));
}

.mx-tester__result--trap {
    background: var(--warning-50);
    border-color: var(--warning-100);
    color: var(--warning-700);
}

.mx-tester__result--error {
    background: var(--danger-50);
    border-color: var(--danger-100);
    color: var(--danger-700);
}

.mx-tester__verdict {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.mx-tester__because {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: inherit;
}

/* ---- Effect last week ---- */

.mx-ruleeffect {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
}

.mx-ruleeffect__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}

.mx-ruleeffect__label {
    font-size: 12.5px;
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-ruleeffect__count {
    font-size: 13px;
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

/* ---- The rule editor ---- */

/* Sized on the content, like the invite dialogue of lot 13 — Fluent's dialogue grows to it up to
   its own default. Setting --dialog-width from a stylesheet does not work: the component writes
   that variable as an inline style on the host, which no class rule can outrank. */
/* 500px, because that is what Fluent's dialogue actually gives: it writes --dialog-width as an
   inline style on its own host from its own default, and neither a stylesheet nor the Style
   parameter can outrank that. Wider content simply hangs over the edges. The tighter padding
   below is what buys the condition row enough room inside it. */
.mx-ruleeditor {
    width: 500px;
}

.mx-ruleeditor.mx-dialog {
    padding: 28px 24px 24px;
}

.mx-dialog__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mx-dialog__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.mx-dialog__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.mx-ruleeditor__legend {
    margin: 8px 0 2px;
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mx-ruleeditor__condition {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Fluent's fields size to their content inside a flex row, which collapsed both tag boxes to a
   single character. `flex: 1` alone does not fix it — the host needs a width to resolve against
   before flex distributes it. The kind picker is fixed; the values take what is left. */
/* min-width, not just width: Fluent's select carries a 250px minimum of its own, which took
   half the row and left "template" showing one character. */
.mx-ruleeditor__condition fluent-select {
    flex: none;
    width: 150px;
    min-width: 0;
}

.mx-ruleeditor__condition fluent-button {
    flex: none;
    width: 28px;
    min-width: 0;
}

.mx-ruleeditor__condition fluent-text-field,
.mx-ruleeditor__wide,
.mx-ruleeditor__field fluent-text-field,
.mx-ruleeditor__field fluent-select {
    flex: 1;
    width: 100%;
    min-width: 0;
}

.mx-ruleeditor__wide {
    flex: 1;
    min-width: 0;
}

.mx-ruleeditor__add {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.mx-ruleeditor__add:hover {
    border-color: var(--azure-500);
    color: var(--azure-700);
}

.mx-ruleeditor__outcomes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mx-ruleeditor__outcome {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
    cursor: pointer;
}

.mx-ruleeditor__outcome--on {
    border: 1.5px solid var(--azure-500);
    background: var(--azure-50);
}

.mx-ruleeditor__outcome input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mx-ruleeditor__outcome:focus-within {
    outline: 2px solid var(--focus-ring, var(--azure-500));
    outline-offset: 2px;
}

.mx-ruleeditor__outcomehint {
    font-size: 11.5px;
    font-weight: var(--weight-regular);
    line-height: 1.45;
    color: var(--text-muted);
}

.mx-ruleeditor__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink-900);
}

/* ---- Workspace-level messages and keys (lot 15) -------------------------- */

/*
   The workspace list is rows inside a card, where the mailbox's rows are a panel of their own.
   Negative margins so the rows reach the card's edges — a row that stopped 20px short would
   read as a list of boxes rather than a list.
*/
.mx-msglist {
    margin: 0 -20px;
    border-top: 1px solid var(--border-subtle);
}

.mx-msglist .mx-msg:last-child {
    border-bottom: none;
}

/* A row that is a link, not a button: undo the two things an anchor brings with it. */
.mx-msg--link {
    color: inherit;
    text-decoration: none;
}

/*
   Which inbox the message landed in, first on the line. Mono because it is an identifier, and
   the same identifier the URL carries.
*/
.mx-msg__scope {
    flex: none;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
}

/* prod carries deliberate weight here too: it is the one that really sends. */
.mx-msg__scope--prod {
    background: var(--azure-50);
    color: var(--color-brand-text);
}

.mx-msg__scope-sep {
    opacity: 0.55;
    padding: 0 3px;
}

/* The workspace key inventory: one card per inbox, its identity in the card's head. */
.mx-avatar-square--small {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 11px;
}

.mx-panel__env {
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}
