/* Bundle of the stylesheets below, in this order (FCC.OperatorsControl.UI.Shared/build/Fingerprinting.targets). */

/* ==== tokens.css ==== */
/* =====================================================================
   Design tokens shared by the administration panel and Unit Control, and the cascade layers of every
   stylesheet. This file is linked first (Unit Control links it from the administration panel, same URL).

   Layers, weakest first for normal declarations:
     forced  only !important declarations: the few that must beat the framework's !important utilities
             (.text-muted, .border, .mb-3...) or another stylesheet's !important. For important declarations
             the FIRST layer wins, so they compare among themselves by specificity and order, as before.
     vendor  Bootstrap (imported by vendor.css, linked before this file) and the Blazor template defaults (app.css).
     base    the design tokens (this file).
     shared  the shared look: agency.css, geometry-editor.css, unit-map.css, relations.css, components.css.
     app     what one application adds on top: command.css (Unit Control). It wins over shared and vendor
             whatever their specificity, so it needs no !important for that.
   Unlayered rules beat every layer. Leaflet's own stylesheets are injected unlayered by the map scripts, so the
   few rules that restyle Leaflet's elements (selectors with .leaflet-*) stay unlayered at the end of their file.
   Inline style attributes still beat every normal declaration.
   Our own stylesheets are never @imported from each other: their URLs carry a content fingerprint.
   ===================================================================== */
@layer forced, vendor, base, shared, app;

@layer base {
    :root {
        /* Console (dark) */
        --ag-bg:#04070a;
        --ag-panel:#0a0f15;
        --ag-panel-2:#0e151d;
        --ag-panel-3:#121b25;
        --ag-line:#1b2632;
        --ag-line-2:#2a3a4a;
        --ag-text:#d3dae1;
        --ag-text-2:#a9b5c0;
        --ag-muted:#9aa8b5;       /* secondary text on the dark panels: >= 7:1 (was #6e7e8d, ~4.2:1 on the cards) */
        --ag-gold:#c9a24a;
        --ag-gold-2:#e3c06b;
        --ag-gold-dim:rgba(201,162,74,.14);
        --ag-red:#c8323a;
        --ag-red-2:#e5484f;
        --ag-green:#3fbf7f;
        --ag-cyan:#67c7d9;
        --ag-banner:#7d1a1f;

        /* Dossier (manila paper) */
        --paper:#e9e0c8;
        --paper-2:#dccfae;
        --paper-edge:#b9a77b;
        --paper-shadow:#5d4f31;
        --ink:#1f1b14;
        --ink-2:#463f30;
        --ink-muted:#5a503f;      /* secondary text on the manila paper: >= 5:1 (was #7a6e55, ~3.6:1) */
        --stamp:#a8261f;

        /* Type */
        --ag-display:"Barlow Condensed","Oswald","Arial Narrow",sans-serif;
        --ag-mono:"IBM Plex Mono",Consolas,"Cascadia Mono","Courier New",monospace;
        --ag-type:"Special Elite","Courier Prime","Courier New",monospace;

        /* Aliases consumed by the geometry editor (geometry-editor.css). */
        --ops-bg:var(--ag-bg);
        --ops-panel:var(--ag-panel);
        --ops-panel-2:var(--ag-panel-2);
        --ops-line:var(--ag-line);
        --ops-line-bright:var(--ag-line-2);
        --ops-text:var(--ag-text);
        --ops-muted:var(--ag-muted);
        --ops-cyan:var(--ag-gold-2);
        --ops-cyan-dim:var(--ag-gold);
        --ops-green:var(--ag-green);
        --ops-amber:var(--ag-gold-2);
        --ops-red:var(--ag-red-2);

        /* Unit Control design system (command.css). */
        /* Containers: one radius, one border width, one shadow per surface, one glow for what is selected. */
        --uc-radius:3px;
        --uc-border:1px;
        --uc-shadow-dark:0 1px 2px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.22);
        --uc-shadow-paper:0 1px 1px rgba(93,79,49,.22), 0 6px 16px rgba(93,79,49,.14);

        /* Labels: never thinner than medium, never below ~10.5 px, with real contrast on both surfaces. */
        --uc-label-size:.66rem;
        --uc-label-weight:600;
        --uc-label-tracking:.1em;
        --uc-label-dark:#b3c1ce;   /* ~9:1 on the dark panels */
        --uc-label-paper:#463d2c;  /* ~9:1 on the manila paper */

        /* States: amber = active selection, green = nominal, grey = vacant or inactive, red = alert. The bright inks are
           for the dark panels, the *-paper ones for paper; the administration panel uses them too (status tags, links). */
        --uc-amber:#e8b040;
        --uc-amber-2:#f4c862;
        --uc-amber-bg:rgba(232,176,64,.16);
        --uc-glow:0 0 0 2px var(--uc-amber), 0 0 24px rgba(232,176,64,.45);
        --uc-green:#3fbf7f;
        --uc-green-paper:#23683f;
        --uc-green-bg:rgba(63,191,127,.14);
        --uc-grey:#97a3ae;
        --uc-grey-paper:#5f5747;
        --uc-grey-bg:rgba(151,163,174,.14);
        --uc-red:#ef5a60;
        --uc-red-paper:#9c231d;
        --uc-red-bg:rgba(200,50,58,.12);

        /* Main call to action: filled with the system accent. */
        --uc-cta:#c9a24a;
        --uc-cta-hover:#e3c06b;
        --uc-cta-border:#7c5d17;
        --uc-cta-text:#171004;
    }
}


/* ==== app.css ==== */
/* Blazor template defaults. In the vendor layer (tokens.css declares the layers), after Bootstrap: they keep their
   place in the cascade (above Bootstrap, below every shared or application stylesheet). */
@layer vendor {
    html, body {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    }

    h1:focus {
        outline: none;
    }

    a, .btn-link {
        color: #0071c1;
    }

    .btn-primary {
        color: #fff;
        background-color: #1b6ec2;
        border-color: #1861ac;
    }

    .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
      box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    }

    .content {
        padding-top: 1.1rem;
    }

    .valid.modified:not([type=checkbox]) {
        outline: 1px solid #26b050;
    }

    .invalid {
        outline: 1px solid red;
    }

    .validation-message {
        color: red;
    }

    #blazor-error-ui {
        color-scheme: light only;
        background: lightyellow;
        bottom: 0;
        box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
        box-sizing: border-box;
        display: none;
        left: 0;
        padding: 0.6rem 1.25rem 0.7rem 1.25rem;
        position: fixed;
        width: 100%;
        z-index: 1000;
    }

        #blazor-error-ui .dismiss {
            cursor: pointer;
            position: absolute;
            right: 0.75rem;
            top: 0.5rem;
        }

    .blazor-error-boundary {
        background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
        padding: 1rem 1rem 1rem 3.7rem;
        color: white;
    }

        .blazor-error-boundary::after {
            content: "An error has occurred."
        }

    .loading-progress {
        position: absolute;
        display: block;
        width: 8rem;
        height: 8rem;
        inset: 20vh 0 auto 0;
        margin: 0 auto 0 auto;
    }

        .loading-progress circle {
            fill: none;
            stroke: #e0e0e0;
            stroke-width: 0.6rem;
            transform-origin: 50% 50%;
            transform: rotate(-90deg);
        }

            .loading-progress circle:last-child {
                stroke: #1b6ec2;
                stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
                transition: stroke-dasharray 0.05s ease-in-out;
            }

    .loading-progress-text {
        position: absolute;
        text-align: center;
        font-weight: bold;
        inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    }

        .loading-progress-text:after {
            content: var(--blazor-load-percentage-text, "Loading");
        }

    code {
        color: #c02d76;
    }

    .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
        color: var(--bs-secondary-color);
        text-align: end;
    }

    .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
        text-align: start;
    }
}


/* ==== agency.css ==== */
/* =====================================================================
   FCC OPERATORS CONTROL DIRECTORATE: intelligence-agency theme
   Dark situation-room console + manila paper dossier for the detail panel.
   ===================================================================== */
/* The design tokens (--ag-*, --paper, --ink*, --ops-*) are in tokens.css, linked first. */
@layer shared {
    /* ---------- Boot screen (shown while Blazor loads) ---------- */
    .agency-boot {
        position:fixed;
        inset:0;
        z-index:2000;
        display:grid;
        place-items:center;
        background:radial-gradient(ellipse at 50% 40%,#0d1620 0,#04070a 70%);
        color:var(--ag-gold);
        font-family:var(--ag-mono);
    }
    .agency-boot-inner { display:grid; justify-items:center; gap:18px; width:min(420px,86vw); text-align:center; }
    .agency-boot svg { width:110px; height:110px; animation:agency-spin 18s linear infinite; }
    .agency-boot strong { font-family:var(--ag-display); font-size:1.6rem; font-weight:700; letter-spacing:.28em; color:#e8edf1; }
    .agency-boot small { color:var(--ag-muted); font-size:.66rem; letter-spacing:.22em; }
    .agency-boot-bar { width:100%; height:3px; background:#16202b; overflow:hidden; }
    .agency-boot-bar i {
        display:block;
        height:100%;
        width:var(--blazor-load-percentage,8%);
        background:linear-gradient(90deg,var(--ag-gold),var(--ag-gold-2));
        box-shadow:0 0 12px rgba(227,192,107,.7);
        transition:width .15s ease;
    }
    .agency-boot-status { color:var(--ag-text-2); font-size:.7rem; letter-spacing:.16em; }
    .agency-boot-status::after { content:" " var(--blazor-load-percentage-text,""); color:var(--ag-gold-2); }
    @keyframes agency-spin { to { transform:rotate(360deg); } }

    /* ---------- Page chrome ---------- */
    /* The console sets its own colours and font (inherited by everything inside it) instead of styling the body with a
       document-wide body:has(...) selector, which every change of the page had to re-check. It covers the whole viewport. */

    .entity-admin-shell {
        position:relative;
        display:grid;
        grid-template-columns:240px minmax(0,1fr);
        grid-template-rows:minmax(0,1fr);
        color-scheme:dark;
        color:var(--ag-text);
        font-family:var(--ag-mono);
        height:100vh;
        overflow:hidden;
        gap:0 12px;
        padding:0 12px;
        background:
            radial-gradient(ellipse at 70% -10%,rgba(201,162,74,.08),transparent 55%),
            radial-gradient(ellipse at 0% 100%,rgba(103,199,217,.05),transparent 50%),
            linear-gradient(rgba(120,150,180,.04) 1px,transparent 1px) 0 0/32px 32px,
            linear-gradient(90deg,rgba(120,150,180,.04) 1px,transparent 1px) 0 0/32px 32px,
            var(--ag-bg);
    }
    /* CRT scanlines + vignette over the console (never captures the pointer). */
    .entity-admin-shell::after {
        content:"";
        position:fixed;
        inset:0;
        z-index:40;
        pointer-events:none;
        background:
            repeating-linear-gradient(0deg,rgba(255,255,255,.014) 0 1px,transparent 1px 3px),
            radial-gradient(ellipse at center,transparent 60%,rgba(0,0,0,.45) 100%);
    }
    /* Not over the live views (map, graphs): they move every frame and the overlay would be composited over each one. */
    .entity-admin-shell.is-live-view::after { content:none; }
    .entity-admin-shell ::selection { background:var(--ag-gold); color:#0a0a0a; }
    .entity-admin-shell ::-webkit-scrollbar { width:8px; height:8px; }
    .entity-admin-shell ::-webkit-scrollbar-track { background:transparent; }
    .entity-admin-shell ::-webkit-scrollbar-thumb { background:#223140; border:2px solid var(--ag-bg); }
    .entity-admin-shell ::-webkit-scrollbar-thumb:hover { background:var(--ag-gold); }

    @keyframes agency-blink { 50% { opacity:.25; } }

    /* ---------- Sidebar ---------- */
    .entity-sidebar-panel { grid-row:1; display:flex; flex-direction:column; gap:10px; min-height:0; padding:12px 0; }
    .entity-brand {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        padding:10px 12px;
        border:1px solid var(--ag-line);
        background:linear-gradient(140deg,#0e1620,#070b10);
        position:relative;
        overflow:hidden;
    }
    .entity-brand::after {
        content:"";
        position:absolute;
        inset:0;
        background:linear-gradient(100deg,transparent 40%,rgba(227,192,107,.07) 50%,transparent 60%);
        transform:translateX(-100%);
        animation:agency-sheen 7s ease-in-out infinite;
    }
    @keyframes agency-sheen { 60%,100% { transform:translateX(100%); } }
    @media (prefers-reduced-motion: reduce) {
        /* No endless sheen over the brand nor spinning boot emblem. */
        .entity-brand::after { animation:none; }
        .agency-boot svg { animation:none; }
    }
    .entity-brand strong, .entity-brand span, .entity-brand small { display:block; }
    .entity-brand strong { font-family:var(--ag-display); font-size:1.5rem; font-weight:700; line-height:.9; letter-spacing:.18em; color:#eef2f5; }
    .entity-brand span { margin-top:2px; font-family:var(--ag-display); font-size:.78rem; font-weight:600; letter-spacing:.2em; color:var(--ag-gold); }

    .entity-sidebar {
        flex:1;
        min-height:0;
        overflow:auto;
        display:flex;
        flex-direction:column;
        gap:14px;
        padding:12px 0;
        border:1px solid var(--ag-line);
        background:rgba(8,12,17,.85);
    }
    .agency-nav-group { display:flex; flex-direction:column; }
    .agency-nav-title {
        display:flex;
        align-items:center;
        gap:8px;
        padding:0 14px 6px;
        color:var(--ag-muted);
        font-size:.58rem;
        letter-spacing:.2em;
        text-transform:uppercase;
    }
    .agency-nav-title::after { content:""; flex:1; height:1px; background:var(--ag-line); }
    .entity-nav-item {
        position:relative;
        display:flex;
        align-items:center;
        gap:10px;
        min-height:34px;
        padding:0 14px;
        border-left:2px solid transparent;
        color:var(--ag-text-2);
        font-size:.72rem;
        letter-spacing:.06em;
        text-decoration:none;
        text-transform:uppercase;
        transition:background .15s,color .15s,border-color .15s;
    }
    .agency-nav-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .entity-nav-item:hover { background:rgba(201,162,74,.06); color:#f0f3f5; }
    .entity-nav-item.active { border-left-color:var(--ag-gold); background:linear-gradient(90deg,rgba(201,162,74,.2),rgba(201,162,74,.02)); color:#fff; }
    .entity-nav-item.active::after { content:"▸"; position:absolute; right:12px; color:var(--ag-gold-2); }

    /* ---------- Main ---------- */
    .entity-main-panel { grid-row:1; display:flex; flex-direction:column; gap:10px; min-width:0; min-height:0; padding:12px 0; }
    .entity-command-header { display:flex; flex-direction:column; gap:10px; flex:none; }
    .entity-page-header {
        position:relative;
        display:grid;
        grid-template-columns:minmax(180px,auto) minmax(0,1fr) auto;
        align-items:center;
        gap:18px;
        padding:10px 16px;
        border:1px solid var(--ag-line);
        background:linear-gradient(110deg,#0d151e 0%,#090e14 60%,#0b1016 100%);
        overflow:hidden;
    }
    .entity-page-header::before {
        content:"";
        position:absolute;
        left:0;
        top:0;
        bottom:0;
        width:3px;
        background:var(--ag-gold);
        box-shadow:0 0 14px rgba(201,162,74,.5);
    }
    .agency-header-main { min-width:0; }
    .agency-breadcrumb { color:var(--ag-gold); font-size:.6rem; letter-spacing:.2em; }
    .entity-page-header h1 {
        margin:0;
        overflow:hidden;
        color:#f1f4f6;
        font-family:var(--ag-display);
        font-size:clamp(1.3rem,1.8vw,1.9rem);
        font-weight:700;
        letter-spacing:.06em;
        line-height:1.05;
        text-overflow:ellipsis;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .agency-stats { display:flex; gap:8px; }
    .agency-stats > div { min-width:96px; padding:6px 12px; border:1px solid var(--ag-line-2); background:rgba(4,7,10,.6); }
    .agency-stats small { display:block; color:var(--ag-muted); font-size:.55rem; letter-spacing:.16em; text-transform:uppercase; }
    .agency-stats strong {
        display:block;
        margin-top:2px;
        color:#eef2f5;
        font-family:var(--ag-display);
        font-size:1.4rem;
        font-weight:600;
        letter-spacing:.06em;
        line-height:1;
        font-variant-numeric:tabular-nums;
    }

    .entity-toolbar { display:flex; align-items:center; gap:10px; padding:10px; border:1px solid var(--ag-line); background:rgba(9,14,20,.9); }
    .agency-search { flex:1; display:flex; align-items:stretch; min-width:0; margin:0; }
    .agency-search-label {
        display:grid;
        place-items:center;
        padding:0 10px;
        border:1px solid var(--ag-line-2);
        border-right:0;
        background:var(--ag-gold-dim);
        color:var(--ag-gold-2);
        font-size:.85rem;
        letter-spacing:0;
        text-transform:uppercase;
    }
    .entity-search.form-control {
        flex:1;
        min-width:0;
        height:38px;
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background:#05080c;
        color:var(--ag-text);
        font-family:var(--ag-mono);
        font-size:.74rem;
    }
    .entity-search.form-control::placeholder { color:var(--ag-muted); }
    .entity-search.form-control:focus { border-color:var(--ag-gold); background:#070b10; color:#fff; box-shadow:0 0 0 3px rgba(201,162,74,.12); }
    .entity-filter-group { display:flex; flex:none; }
    .entity-filter {
        height:38px;
        min-width:96px;
        margin-left:-1px;
        padding:0 14px;
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background:#080c11;
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.62rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .entity-filter:hover { color:#fff; background:#0e151d; }
    .entity-filter.selected { position:relative; z-index:1; border-color:var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-gold-2); }

    html .entity-admin-shell .alert { margin:0; border:1px solid; border-left-width:3px; border-radius:0; font-family:var(--ag-mono); font-size:.72rem; }
    .agency-alert.alert-success { border-color:rgba(63,191,127,.45); border-left-color:var(--ag-green); background:rgba(63,191,127,.08); color:#bfeed4; }
    .agency-alert.alert-danger { border-color:rgba(200,50,58,.5); border-left-color:var(--ag-red); background:rgba(200,50,58,.1); color:#ffc9cc; }
    .agency-alert strong { letter-spacing:.12em; }

    /* ---------- Workspace ---------- */
    .entity-workspace { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(420px,1.05fr); gap:12px; }

    /* Record index */
    .entity-record-list { display:flex; flex-direction:column; min-width:0; min-height:0; border:1px solid var(--ag-line); background:rgba(8,12,17,.94); }
    .entity-list-header {
        flex:none;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        min-height:56px;
        padding:0 14px;
        border-bottom:1px solid var(--ag-line);
        background:linear-gradient(180deg,#0f1720,#0b1118);
    }
    .entity-list-header h2 {
        display:flex;
        align-items:center;
        gap:10px;
        margin:0;
        color:#e8edf1;
        font-family:var(--ag-display);
        font-size:1.15rem;
        font-weight:600;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .entity-list-header h2 > span:last-child {
        padding:1px 7px;
        border:1px solid var(--ag-line-2);
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.7rem;
        letter-spacing:.08em;
    }
    .entity-list-header-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
    .agency-record-scroll { flex:1; min-height:0; overflow:auto; }
    .entity-record-row {
        position:relative;
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        align-items:center;
        gap:10px;
        min-height:52px;
        padding:7px 14px;
        border-bottom:1px solid rgba(27,38,50,.7);
        transition:background .15s;
    }
    .entity-record-row::before { content:""; position:absolute; left:0; top:0; bottom:0; width:2px; background:transparent; }
    .entity-record-row:hover { background:rgba(201,162,74,.05); }
    .entity-record-row:hover::before { background:var(--ag-line-2); }
    .entity-record-row.is-selected { background:linear-gradient(90deg,rgba(201,162,74,.16),rgba(201,162,74,.03)); }
    .entity-record-row.is-selected::before { background:var(--ag-gold); box-shadow:0 0 10px rgba(201,162,74,.6); }
    .entity-record-title {
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:2px;
        min-width:0;
        padding:0;
        border:0;
        background:transparent;
        color:inherit;
        font-family:inherit;
        text-align:left;
    }
    .entity-record-title strong {
        max-width:100%;
        overflow:hidden;
        color:#e6ebef;
        font-family:var(--ag-display);
        font-size:1.02rem;
        font-weight:600;
        letter-spacing:.05em;
        text-overflow:ellipsis;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .entity-record-title:hover strong { color:var(--ag-gold-2); }
    .entity-record-title small {
        max-width:100%;
        overflow:hidden;
        color:var(--ag-muted);
        font-size:.6rem;
        letter-spacing:.04em;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .agency-status-tag { margin-top:3px; padding:1px 6px; border:1px solid; font-size:.52rem; font-style:normal; letter-spacing:.16em; }
    /* State inks of tokens.css (--uc-*), the same as in Unit Control: the bright ones on the dark panels (the red at
       4.6:1 even on a selected row, where --ag-red-2 gave 3.96:1), the dark ones on paper (where it gave 3.44:1). */
    .agency-status-tag.is-ok { border-color:rgba(63,191,127,.5); color:var(--uc-green); }
    .agency-status-tag.is-bad { border-color:rgba(200,50,58,.55); color:var(--uc-red); }
    .agency-status-tag.is-neutral { border-color:var(--ag-line-2); color:var(--ag-text-2); }
    :is(.entity-details-panel, .profile-page, .umap-modal, .auth-card) .agency-status-tag.is-ok { border-color:currentColor; color:var(--uc-green-paper); }
    :is(.entity-details-panel, .profile-page, .umap-modal, .auth-card) .agency-status-tag.is-bad { border-color:currentColor; color:var(--uc-red-paper); }
    :is(.entity-details-panel, .profile-page, .umap-modal, .auth-card) .agency-status-tag.is-neutral { border-color:currentColor; color:var(--uc-grey-paper); }
    /* Always at full opacity: dimmed to .55 their text fell under 4.5:1 (the red "Delete" at 2.2:1). */
    .entity-record-actions { display:flex; gap:6px; }
    .agency-loading { display:grid; gap:10px; padding:28px 18px; color:var(--ag-gold-2); font-size:.66rem; letter-spacing:.2em; text-transform:uppercase; }
    .agency-loading span::after { content:"…"; animation:agency-blink 1s steps(2) infinite; }
    .agency-loading i {
        height:2px;
        background:linear-gradient(90deg,transparent,var(--ag-gold),transparent) 0 0/40% 100% no-repeat,#16202b;
        animation:agency-scan 1.2s linear infinite;
    }
    @keyframes agency-scan { from { background-position:-40% 0,0 0; } to { background-position:140% 0,0 0; } }
    .agency-empty { display:grid; gap:6px; padding:40px 20px; text-align:center; }
    .agency-empty strong { color:var(--ag-text-2); font-family:var(--ag-display); font-size:1.2rem; letter-spacing:.14em; text-transform:uppercase; }
    .agency-empty small { color:var(--ag-muted); font-size:.65rem; }

    /* Console buttons (index, header, alerts) */
    .entity-admin-shell .btn { border-radius:0; font-family:var(--ag-mono); font-size:.62rem; letter-spacing:.12em; text-transform:uppercase; }
    .entity-record-list .btn-primary { border:1px solid var(--ag-gold); background:var(--ag-gold); color:#120e05; font-weight:600; }
    .entity-record-list .btn-primary:hover { background:var(--ag-gold-2); border-color:var(--ag-gold-2); }
    .entity-record-list .btn-outline-primary { border-color:var(--ag-line-2); color:var(--ag-text-2); }
    .entity-record-list .btn-outline-primary:hover { border-color:var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .entity-record-list .btn-outline-danger { border-color:rgba(200,50,58,.45); color:var(--ag-red-2); }
    .entity-record-list .btn-outline-danger:hover { border-color:var(--ag-red); background:var(--ag-red); color:#fff; }

    /* ---------- Dossier (detail panel on manila paper) ---------- */
    .entity-details-panel {
        position:relative;
        min-width:0;
        min-height:0;
        overflow:auto;
        padding:18px 22px 22px;
        color-scheme:light;
        color:var(--ink);
        font-family:var(--ag-mono);
        border:1px solid var(--paper-edge);
        background:
            radial-gradient(circle at 18% 12%,rgba(255,255,255,.35),transparent 40%),
            radial-gradient(circle at 85% 90%,rgba(140,110,50,.18),transparent 45%),
            repeating-linear-gradient(0deg,rgba(90,70,30,.035) 0 1px,transparent 1px 26px),
            linear-gradient(180deg,var(--paper),var(--paper-2));
        box-shadow:inset 0 0 60px rgba(120,90,40,.22),0 10px 30px rgba(0,0,0,.5);
    }
    .entity-details-panel > * { position:relative; z-index:1; }

    .entity-details-panel h2 {
        margin:0;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1.5rem;
        font-weight:700;
        letter-spacing:.05em;
        text-transform:uppercase;
    }
    .entity-details-panel h3, .entity-details-panel .h6 {
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    /* (p, small and .text-muted of the paper: --ink-muted, in the forced layer at the end of the file.) */
    .entity-details-panel hr { border-color:var(--paper-edge); opacity:1; border-top-style:dashed; }
    .entity-details-panel code { color:var(--stamp); }
    .entity-details-panel .form-label {
        margin-bottom:4px;
        color:var(--ink-2);
        font-size:.58rem;
        font-weight:600;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .entity-details-panel .form-control, .entity-details-panel .form-select {
        border:0;
        border-bottom:1.5px solid var(--ink-2);
        border-radius:0;
        background-color:rgba(255,253,245,.45);
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.9rem;
        letter-spacing:.02em;
        box-shadow:none;
    }
    .entity-details-panel .form-control:focus, .entity-details-panel .form-select:focus {
        border-bottom-color:var(--stamp);
        background-color:rgba(255,253,245,.8);
        box-shadow:0 2px 0 -0.5px var(--stamp);
        outline:none;
    }
    .entity-details-panel .form-control:disabled, .entity-details-panel .form-select:disabled {
        background-color:rgba(120,100,60,.08);
        color:var(--ink-muted);
        border-bottom-style:dashed;
    }
    .entity-details-panel textarea.form-control { border:1.5px solid var(--ink-2); font-family:var(--ag-mono); font-size:.72rem; }
    .entity-details-panel .form-check-input { border:1.5px solid var(--ink-2); border-radius:0; background-color:rgba(255,253,245,.6); }
    .entity-details-panel .form-check-input:checked { border-color:var(--ink); background-color:var(--ink); }
    .entity-details-panel .input-group > .btn { border-bottom-width:1.5px; }
    .entity-details-panel .btn-primary { border:1px solid var(--ink); background:var(--ink); color:var(--paper); font-weight:600; }
    .entity-details-panel .btn-primary:hover:not(:disabled) { background:#000; color:#fff; }
    .entity-details-panel .btn-secondary, .entity-details-panel .btn-outline-secondary {
        border:1px dashed var(--ink-2);
        background:transparent;
        color:var(--ink-2);
    }
    .entity-details-panel .btn-secondary:hover, .entity-details-panel .btn-outline-secondary:hover {
        border-style:solid;
        background:rgba(31,27,20,.08);
        color:var(--ink);
    }
    .entity-details-panel .btn-outline-primary { border:1px solid var(--ink-2); background:rgba(255,253,245,.35); color:var(--ink); }
    .entity-details-panel .btn-outline-primary:hover:not(:disabled) { background:var(--ink); color:var(--paper); }
    .entity-details-panel .btn-outline-danger { border:1px solid var(--stamp); background:transparent; color:var(--stamp); }
    .entity-details-panel .btn-outline-danger:hover { background:var(--stamp); color:#fff6ea; }
    .entity-details-panel .btn-link {
        color:var(--ink);
        text-decoration:underline dotted;
        text-underline-offset:3px;
        font-family:var(--ag-type);
        text-transform:none;
        letter-spacing:0;
        font-size:.8rem;
    }
    .entity-details-panel .border { background:rgba(255,253,245,.28); }
    .entity-details-panel .alert {
        border:1px solid var(--paper-edge);
        border-left:3px solid var(--ink-2);
        border-radius:0;
        background:rgba(255,253,245,.4);
        color:var(--ink-2);
        font-size:.72rem;
    }
    .entity-details-panel .alert-warning { border-left-color:#a77a12; }

    /* Read view: cover sheet */
    .entity-selected-view { display:flex; flex-direction:column; gap:16px; }

    .entity-related-manager { padding:14px; border:1px solid var(--paper-edge); background:rgba(255,253,245,.3); }
    .entity-related-manager h3 { margin:0 0 12px; padding-bottom:8px; border-bottom:1px solid var(--ink-2); }
    .entity-details-panel details { padding:10px 12px; border:1px dashed var(--paper-edge); color:var(--ink-2); font-size:.68rem; }
    .entity-details-panel details summary { cursor:pointer; font-weight:600; letter-spacing:.16em; text-transform:uppercase; }
    .entity-details-panel pre { margin:10px 0 0; padding:12px; background:rgba(31,27,20,.88); color:#e9dfc4; font-family:var(--ag-mono); font-size:.66rem; }

    /* Empty dossier */
    .entity-empty-detail { display:grid; place-items:center; align-content:center; gap:10px; min-height:60%; padding:40px 20px; text-align:center; }
    .entity-empty-detail strong { color:var(--ink-2); font-family:var(--ag-display); font-size:1.3rem; letter-spacing:.16em; text-transform:uppercase; }
    .entity-empty-detail small { font-family:var(--ag-type); font-size:.8rem; }

    /* ---------- Responsive ---------- */
    @media (max-width:1400px) {
        .entity-page-header { grid-template-columns:minmax(0,1fr) auto; }
        .entity-page-header > .entity-toolbar { grid-column:1/-1; grid-row:2; }
        .entity-workspace { grid-template-columns:minmax(0,1fr) minmax(380px,1fr); }
    }
    @media (max-width:1100px) {
        .entity-admin-shell { height:auto; min-height:100vh; overflow:visible; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; }
        .entity-toolbar { flex-wrap:wrap; }
        .agency-search { flex-basis:100%; }
        .entity-filter-group { width:100%; }
        .entity-filter { flex:1; min-width:0; }
        .entity-workspace { grid-template-columns:minmax(0,1fr); }
        .entity-page-header { grid-template-columns:minmax(0,1fr) auto; }
        .entity-page-header > .entity-toolbar { grid-column:1/-1; grid-row:2; }
        .entity-sidebar-panel { grid-row:1; }
        .entity-main-panel { grid-row:2; }
        .entity-sidebar { flex-direction:row; flex-wrap:nowrap; overflow:auto; padding:8px; }
        .agency-nav-group { flex:none; }
        .entity-record-list, .entity-details-panel { max-height:none; }
        .agency-record-scroll { max-height:60vh; }
    }
    @media (max-width:700px) {
        /* The figures of the header go below the title instead of over it. */
        .entity-page-header { grid-template-columns:minmax(0,1fr); gap:10px; }
        .entity-page-header h1 { white-space:normal; }
        .entity-admin-shell .entity-page-header > .agency-stats { justify-self:stretch; flex-wrap:wrap; }
        .entity-admin-shell .entity-page-header > .agency-stats > div { flex:1 1 0; min-width:0; }
        .entity-toolbar { flex-wrap:wrap; }
        .entity-filter-group { width:100%; }
        .entity-filter { flex:1; min-width:0; }
    }

    /* Keyboard focus: gold ring instead of the Bootstrap blue one (app.css). */
    .entity-admin-shell .btn:focus-visible, .entity-admin-shell .entity-filter:focus-visible, .entity-admin-shell .entity-nav-item:focus-visible,
    .entity-admin-shell .entity-record-title:focus-visible {
        outline:2px solid var(--ag-gold-2);
        outline-offset:2px;
        box-shadow:none;
    }
    .entity-admin-shell .btn:focus:not(:focus-visible) { box-shadow:none; }
    .entity-details-panel .btn:focus-visible { outline-color:var(--stamp); }

    /* Language switcher (sidebar brand, sign-in card): the short name of the current language in a small box; the
       transparent select over it opens the browser's list of the six. */
    .agency-lang {
        position:relative;
        z-index:1;
        display:inline-flex;
        flex:none;
        justify-self:start;
        align-items:center;
        gap:5px;
        height:20px;
        margin:0;
        padding:0 6px 0 8px;
        border:1px solid var(--ag-line-2);
        color:var(--ag-text-2);
        cursor:pointer;
    }
    .agency-lang .agency-lang-current {
        display:inline;
        margin:0;
        font-family:inherit;
        font-size:.6rem;
        font-weight:700;
        letter-spacing:.14em;
        line-height:18px;
        color:inherit;
    }
    .agency-lang .agency-lang-caret { width:8px; height:5px; flex:none; }
    .agency-lang select {
        position:absolute;
        inset:0;
        width:100%;
        height:100%;
        opacity:0;
        cursor:pointer;
        font-size:.8rem;
    }
    .agency-lang:hover { background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .agency-lang:focus-within { outline:2px solid var(--ag-gold-2); outline-offset:1px; }

    /* Image fields stored as Base64 (Unit.PictureBase64) */
    .agency-image-field { display:flex; gap:14px; align-items:flex-start; }
    .agency-image-preview {
        flex:none;
        display:grid;
        place-items:center;
        width:112px;
        height:112px;
        padding:4px;
        overflow:hidden;
        border:1.5px dashed var(--ink-2);
        background:repeating-conic-gradient(rgba(31,27,20,.07) 0 25%,transparent 0 50%) 0 0/14px 14px,rgba(255,253,245,.45);
    }
    .agency-image-preview img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
    .agency-image-preview span { padding:6px; color:var(--ink-muted); font-family:var(--ag-type); font-size:.7rem; text-align:center; }
    .agency-image-actions { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; }
    .agency-image-actions label.btn { cursor:pointer; }
    .agency-image-actions label.btn.disabled { pointer-events:none; opacity:.5; }
    .agency-image-actions small { font-size:.62rem; line-height:1.4; }

    /* ---------- Compact header: title, search and filters on one bar ---------- */
    .entity-page-header > .entity-toolbar { padding:0; border:0; background:transparent; }
    .agency-api-link { color:var(--ag-text-2); font-size:.62rem; letter-spacing:.14em; text-decoration:none; text-transform:uppercase; white-space:nowrap; }
    .agency-api-link:hover { color:var(--ag-gold-2); }
    .agency-notfound { padding:18px 20px; border:1px solid var(--ag-line); color:var(--ag-text-2); font-size:.8rem; }
    .agency-notfound a { color:var(--ag-gold-2); }
    .entity-page-header > .agency-stats { justify-self:end; }
    .agency-list-note {
        margin:6px 12px;
        padding:6px 10px;
        border:1px solid rgba(201,162,74,.45);
        background:rgba(201,162,74,.08);
        color:var(--ag-gold-2);
        font-size:.62rem;
        letter-spacing:.04em;
    }
    .agency-boot-logo { display:block; width:min(220px,60vw); height:auto; animation:agency-boot-glow 2.4s ease-in-out infinite; }
    @keyframes agency-boot-glow { 0%,100% { opacity:.85; } 50% { opacity:1; } }

    /* Form of one record inside another page's window (unit map): the window is already the paper and scrolls. */
    .entity-details-panel.is-embedded { overflow:visible; padding:0; border:0; background:transparent; box-shadow:none; }

    /* ---------- Recruitment dashboard (Pages/RecruitmentDashboardPage.razor) ---------- */
    .agency-nav-dashboard .agency-nav-label::before { content:"▤ "; color:var(--ag-gold); }
    .recdash { flex:1; min-height:0; overflow:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-content:start; }
    .recdash-kpis { grid-column:1 / -1; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
    .recdash-kpi {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:4px;
        padding:14px 16px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(160deg,#111b25,#0a1016);
    }
    .recdash-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--ag-gold); }
    .recdash-kpi small { color:var(--ag-muted); font-size:.58rem; letter-spacing:.18em; text-transform:uppercase; }
    .recdash-kpi strong { color:#f0f3f5; font-family:var(--ag-display); font-size:2.1rem; font-weight:700; line-height:1; }
    .recdash-kpi span { color:var(--ag-text-2); font-size:.64rem; }
    .recdash-kpi a { position:absolute; right:12px; top:10px; color:var(--ag-gold-2); text-decoration:none; }
    .recdash-panel { padding:14px 16px; border:1px solid var(--ag-line); background:rgba(8,12,17,.94); }
    .recdash-panel h2 {
        margin:0 0 12px;
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:1rem;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .recdash-panel h3 { margin:10px 0 6px; color:var(--ag-text-2); font-size:.62rem; letter-spacing:.16em; text-transform:uppercase; }
    .recdash-funnel { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
    .recdash-funnel li {
        position:relative;
        display:flex;
        justify-content:space-between;
        width:var(--w);
        min-width:150px;
        margin:0 auto;
        padding:8px 12px;
        background:linear-gradient(90deg,rgba(201,162,74,.35),rgba(201,162,74,.12));
        border:1px solid var(--ag-gold);
        color:#f0f3f5;
        font-size:.7rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .recdash-funnel li:last-child { border-color:var(--ag-green); background:linear-gradient(90deg,rgba(63,191,127,.35),rgba(63,191,127,.1)); }
    .recdash-funnel b { font-family:var(--ag-mono); }
    .recdash-note { margin:10px 0 0; color:var(--ag-muted); font-size:.64rem; }
    .recdash-bars { display:grid; gap:5px; margin:0; padding:0; list-style:none; }
    .recdash-bars li { display:grid; grid-template-columns:110px minmax(0,1fr) 34px; align-items:center; gap:8px; font-size:.66rem; color:var(--ag-text-2); }
    .recdash-bars i { display:block; width:var(--w); min-width:2px; height:10px; background:var(--ag-gold); }
    .recdash-bars i.is-open, .recdash-bars i.is-inv-accepted { background:var(--ag-green); }
    .recdash-bars i.is-closed, .recdash-bars i.is-inv-rejected { background:var(--ag-red-2); }
    .recdash-bars i.is-filled { background:var(--ag-cyan); }
    .recdash-bars i.is-draft, .recdash-bars i.is-inv-withdrawn { background:var(--ag-muted); }
    .recdash-bars b { color:#f0f3f5; font-family:var(--ag-mono); text-align:right; }
    .recdash-table { width:100%; border-collapse:collapse; font-size:.7rem; }
    .recdash-table th {
        padding:6px 8px;
        border-bottom:1px solid var(--ag-line-2);
        color:var(--ag-muted);
        font-size:.56rem;
        font-weight:600;
        letter-spacing:.14em;
        text-align:left;
        text-transform:uppercase;
    }
    .recdash-table td { padding:7px 8px; border-bottom:1px solid var(--ag-line); color:var(--ag-text); font-family:var(--ag-mono); }
    .recdash-table td a { color:#e8edf1; font-family:var(--ag-body,inherit); text-decoration:none; }
    .recdash-table td a:hover { color:var(--ag-gold-2); }
    .recdash-recent ul { display:grid; gap:0; margin:0; padding:0; list-style:none; }
    .recdash-recent li {
        display:grid;
        grid-template-columns:92px minmax(0,1fr) auto auto;
        align-items:center;
        gap:10px;
        padding:7px 0;
        border-bottom:1px solid var(--ag-line);
        font-size:.7rem;
    }
    .recdash-kind { padding:2px 6px; border:1px solid currentColor; font-size:.54rem; letter-spacing:.12em; text-align:center; text-transform:uppercase; }
    .recdash-kind.is-application { color:var(--ag-gold-2); }
    .recdash-kind.is-invitation { color:var(--ag-cyan); }
    .recdash-kind.is-vacancy { color:var(--ag-green); }
    .recdash-text { display:flex; flex-direction:column; min-width:0; }
    .recdash-text strong { overflow:hidden; color:#e8edf1; text-overflow:ellipsis; white-space:nowrap; }
    .recdash-text small, .recdash-recent time { color:var(--ag-muted); font-size:.6rem; }
    .recdash-state { color:var(--ag-text-2); font-size:.62rem; letter-spacing:.08em; text-transform:uppercase; }
    @media (max-width:1100px) {
        .recdash { grid-template-columns:minmax(0,1fr); }
        .recdash-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }

    /* ---- Affiliations between units (administration workflow) ---- */
    .affadm { flex:1; min-height:0; overflow:auto; display:grid; grid-template-columns:minmax(300px,380px) minmax(0,1fr); gap:12px; align-content:start; }
    .affadm-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin-bottom:10px; }
    .affadm-grid label { display:flex; flex-direction:column; gap:3px; }
    .affadm-grid label > span { color:var(--ag-muted); font-size:.56rem; letter-spacing:.16em; text-transform:uppercase; }
    .recdash-panel .affadm-second { margin-top:22px; }
    .affadm-filters { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:10px; }
    .affadm-filters input { flex:1; min-width:160px; }
    .affadm-filter {
        padding:3px 10px;
        border:1px solid var(--ag-line-2);
        background:transparent;
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.1em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .affadm-filter.is-active { border-color:var(--ag-gold); color:var(--ag-gold-2); }
    .affadm-items { display:flex; flex-direction:column; gap:8px; margin:0; padding:0; list-style:none; }
    .affadm-items li { display:flex; flex-direction:column; gap:4px; padding:10px 12px; border:1px solid var(--ag-line-2); background:#0c131b; }
    .affadm-items li.is-pending { border-color:rgba(227,192,107,.6); box-shadow:inset 3px 0 0 var(--ag-gold); }
    .affadm-items p { margin:0; color:var(--ag-text-2); font-size:.7rem; }
    .affadm-items small { color:var(--ag-muted); font-size:.6rem; }
    .affadm-head { display:flex; justify-content:space-between; gap:10px; }
    .affadm-head strong { color:#e8edf1; font-size:.78rem; }
    .affadm-link { font-size:.7rem; }
    .affadm-link a { color:var(--ag-gold-2); }
    .affadm-link span { color:var(--ag-muted); }
    .affadm-status { padding:1px 8px; border:1px solid currentColor; font-size:.55rem; letter-spacing:.12em; text-transform:uppercase; white-space:nowrap; }
    .affadm-status.is-pending { color:var(--ag-gold-2); }
    .affadm-status.is-accepted { color:var(--ag-green); }
    .affadm-status.is-rejected, .affadm-status.is-released { color:#e0705f; }
    .affadm-status.is-withdrawn, .affadm-status.is-obsolete { color:var(--ag-muted); }
    .affadm-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
    .affadm-actions input { flex:1; min-width:180px; }
    @media (max-width: 1100px) {
        .affadm { grid-template-columns:minmax(0,1fr); }
    }
} /* end of @layer shared */

/* ---- Forced layer: !important declarations ----------------------------------------------------------------------
   On the paper of a record panel the secondary texts take the paper ink and the framework's border and colour
   utilities (all !important) the paper look. For important declarations the first layer wins (tokens.css). */
@layer forced {
    .entity-details-panel p, .entity-details-panel .text-muted, .entity-details-panel small { color:var(--ink-muted) !important; }
    .entity-details-panel .border { border:1px dashed var(--paper-edge) !important; border-radius:0 !important; }
    .entity-details-panel .border-top { border-top:1px dotted var(--paper-edge) !important; }
    .entity-details-panel .text-danger { color:var(--stamp) !important; }
}


/* ==== geometry-editor.css ==== */
/* Geometry drawing modal (map editor). Uses the tactical console tokens (--ops-*, tokens.css). */
@layer shared {
    .geo-modal-backdrop { position:fixed; inset:0; z-index:1050; background:rgba(2,6,10,.8); backdrop-filter:blur(2px); }
    .geo-modal {
        position:fixed;
        inset:100px;
        z-index:1051;
        display:grid;
        grid-template-rows:auto auto minmax(0,1fr) auto;
        border:1px solid var(--ops-line-bright);
        background:var(--ops-panel);
        color:var(--ops-text);
        font-family:var(--ag-mono,Consolas,monospace);
        box-shadow:0 0 0 1px rgba(201,162,74,.12),0 24px 80px rgba(0,0,0,.65);
    }
    .geo-modal-header {
        display:flex;
        justify-content:space-between;
        align-items:center;
        min-height:48px;
        padding:0 14px;
        border-bottom:1px solid var(--ops-line);
        background:#09141d;
        color:#c5d4df;
        font-size:.78rem;
        font-weight:700;
        letter-spacing:.08em;
    }
    .geo-modal-header > span:first-letter { color:var(--ops-cyan); }
    .geo-header-meta { display:flex; align-items:center; gap:12px; }
    .geo-header-meta small { padding:4px 7px; border:1px solid #79600a; color:var(--ops-amber); font-size:.56rem; font-weight:400; }
    .geo-icon-button { width:30px; height:30px; border:1px solid #314a5c; background:#101d27; color:#9cafbd; }
    .geo-icon-button:hover { border-color:var(--ops-red); color:var(--ops-red); }

    .geo-toolbar {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:10px;
        padding:8px 12px;
        border-bottom:1px solid var(--ops-line);
        background:linear-gradient(110deg,#08121b,#060d14);
    }
    .geo-tool-group { display:flex; gap:2px; padding-right:10px; border-right:1px solid var(--ops-line); }
    .geo-tool { display:grid; place-items:center; width:34px; height:34px; border:1px solid transparent; background:transparent; color:#8fa6b7; }
    .geo-tool:hover:not(:disabled) { border-color:var(--ops-line-bright); background:rgba(201,162,74,.07); color:var(--ops-cyan); }
    .geo-tool.active {
        border-color:var(--ops-cyan-dim);
        background:rgba(201,162,74,.16);
        color:var(--ops-cyan);
        box-shadow:inset 0 0 12px rgba(201,162,74,.12);
    }
    .geo-tool:disabled { opacity:.35; cursor:not-allowed; }
    .geo-toolbar-status { flex:1; min-width:120px; color:var(--ops-muted); font-size:.64rem; letter-spacing:.08em; text-align:center; }
    .geo-toolbar-actions { display:flex; align-items:center; gap:6px; }
    .geo-text-button {
        display:inline-flex;
        align-items:center;
        min-height:30px;
        margin:0;
        padding:0 10px;
        border:1px solid #314a5c;
        background:#101d27;
        color:#9cafbd;
        font-family:inherit;
        font-size:.65rem;
        letter-spacing:.04em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .geo-text-button:hover:not(:disabled) { border-color:var(--ops-cyan-dim); color:var(--ops-cyan); }
    .geo-text-button:disabled { opacity:.4; cursor:not-allowed; }
    .geo-text-button.is-primary { border-color:var(--ag-gold); background:var(--ag-gold); color:#120e05; font-weight:600; }
    .geo-select {
        min-height:30px;
        padding:0 8px;
        border:1px solid var(--ops-line-bright);
        background:#050c12;
        color:var(--ops-text);
        font-family:inherit;
        font-size:.65rem;
    }

    .geo-body { display:grid; grid-template-columns:220px minmax(0,1fr) minmax(300px,26%); min-height:0; }
    .geo-side { min-height:0; overflow:auto; background:#07111a; }
    .geo-layers { padding:0 10px 12px; border-right:1px solid var(--ops-line); }
    .geo-data { display:flex; flex-direction:column; border-left:1px solid var(--ops-line); }
    .geo-panel-title {
        margin:0 -10px 8px;
        padding:10px;
        border-bottom:1px solid var(--ops-line);
        color:#829aac;
        font-size:.62rem;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    .geo-panel-title:not(:first-child) { margin-top:14px; border-top:1px solid var(--ops-line); }
    .geo-layer-item {
        display:flex;
        align-items:center;
        gap:10px;
        width:100%;
        margin-bottom:4px;
        padding:8px;
        border:0;
        border-left:2px solid transparent;
        background:transparent;
        color:var(--ops-text);
        text-align:left;
        font-family:inherit;
    }
    .geo-layer-item:hover:not(:disabled) { border-left-color:var(--ops-cyan); background:rgba(201,162,74,.07); }
    .geo-layer-item strong, .geo-layer-item small { display:block; }
    .geo-layer-item strong { font-size:.72rem; font-weight:600; }
    .geo-layer-item small { color:var(--ops-muted); font-size:.6rem; overflow-wrap:anywhere; }
    .geo-layer-item.is-empty { opacity:.55; }
    .geo-swatch { flex:none; width:14px; height:14px; }
    .geo-swatch-outline { border:2px solid #00e5f5; background:rgba(0,229,245,.2); }
    .geo-swatch-center { border:2px solid var(--ops-amber); border-radius:50%; }
    .geo-stats { display:grid; grid-template-columns:auto 1fr; gap:6px 10px; margin:0; font-size:.68rem; }
    .geo-stats dt { color:var(--ops-muted); font-weight:400; }
    .geo-stats dd { margin:0; color:#d6e2ea; text-align:right; }
    .geo-side-note { margin:14px 0 0; color:var(--ops-muted); font-size:.6rem; line-height:1.5; }
    .geo-amber { color:var(--ops-amber)!important; }
    .geo-red { color:var(--ops-red)!important; }
    .geo-link { padding:0 4px; border:0; background:transparent; color:var(--ops-cyan); font-family:inherit; }
    .geo-link:disabled { opacity:.3; }

    .geo-map-wrap { position:relative; min-width:0; min-height:0; }
    .geo-map { position:absolute; inset:0; background:#02060a; }
    .geo-map-error {
        position:absolute;
        inset:auto 12px 12px 12px;
        z-index:1000;
        padding:10px;
        border:1px solid var(--ops-red);
        background:#1a0710;
        color:var(--ops-red);
        font-size:.7rem;
    }
    .geo-search { position:absolute; top:12px; right:12px; z-index:1000; width:min(340px,calc(100% - 24px)); }
    .geo-search input {
        width:100%;
        height:38px;
        padding:0 70px 0 32px;
        border:1px solid var(--ops-line-bright);
        background:rgba(5,11,17,.94);
        color:var(--ops-text);
        font-family:inherit;
        font-size:.72rem;
    }
    .geo-search input:focus { outline:none; border-color:var(--ops-cyan-dim); box-shadow:0 0 0 1px rgba(201,162,74,.15); }
    .geo-search-icon { position:absolute; left:10px; top:8px; color:var(--ops-muted); }
    .geo-search kbd {
        position:absolute;
        right:8px;
        top:9px;
        padding:2px 5px;
        border:1px solid var(--ops-line-bright);
        background:transparent;
        color:var(--ops-muted);
        font-size:.58rem;
    }
    .geo-search-results { max-height:260px; overflow:auto; border:1px solid var(--ops-line-bright); border-top:0; background:rgba(5,11,17,.97); }
    .geo-search-results button {
        display:block;
        width:100%;
        padding:8px 10px;
        border:0;
        border-bottom:1px solid rgba(23,50,70,.65);
        background:transparent;
        color:var(--ops-text);
        font-family:inherit;
        font-size:.65rem;
        text-align:left;
    }
    .geo-search-results button:hover { background:rgba(201,162,74,.09); color:var(--ops-cyan); }
    .geo-search-empty { padding:10px; color:var(--ops-muted); font-size:.65rem; }

    .geo-tabs { display:grid; grid-template-columns:1fr 1fr; border-bottom:1px solid var(--ops-line); }
    .geo-tabs button {
        min-height:40px;
        border:0;
        border-bottom:2px solid transparent;
        background:#09141d;
        color:#8197a7;
        font-family:inherit;
        font-size:.68rem;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .geo-tabs button.active { border-bottom-color:var(--ops-cyan); background:rgba(201,162,74,.1); color:var(--ops-cyan); }
    .geo-json { display:flex; flex:1; flex-direction:column; min-height:0; padding:10px; gap:8px; }
    .geo-json textarea {
        flex:1;
        min-height:200px;
        padding:10px;
        border:1px solid var(--ops-line-bright);
        background:#050c12;
        color:#8fe9f2;
        font-family:inherit;
        font-size:.68rem;
        line-height:1.45;
        resize:none;
        white-space:pre;
    }
    .geo-json textarea:focus { outline:none; border-color:var(--ops-cyan-dim); }
    .geo-json-actions { display:flex; justify-content:flex-end; gap:6px; }
    .geo-json-error { color:var(--ops-red); font-size:.65rem; }
    .geo-table-wrap { flex:1; overflow:auto; padding:6px 10px 10px; }
    .geo-table { width:100%; border-collapse:collapse; font-size:.65rem; }
    .geo-table th {
        position:sticky;
        top:0;
        padding:6px 4px;
        border-bottom:1px solid var(--ops-line);
        background:#07111a;
        color:var(--ops-muted);
        font-weight:400;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .geo-table td { padding:3px 4px; border-bottom:1px solid rgba(23,50,70,.65); }
    .geo-table input {
        width:100%;
        min-width:0;
        height:28px;
        padding:0 6px;
        border:1px solid var(--ops-line);
        background:#050c12;
        color:var(--ops-text);
        font-family:inherit;
        font-size:.66rem;
    }
    .geo-table input:focus { outline:none; border-color:var(--ops-cyan-dim); }
    .geo-row-actions { white-space:nowrap; text-align:right; }

    .geo-footer {
        display:flex;
        align-items:center;
        gap:14px;
        min-height:52px;
        padding:8px 12px;
        border-top:1px solid var(--ops-line);
        background:#09141d;
        font-size:.65rem;
    }
    .geo-cursor { flex:none; min-width:270px; color:var(--ops-cyan); letter-spacing:.04em; }
    .geo-hint { flex:1; min-width:0; color:var(--ops-muted); }
    .geo-footer-actions { display:flex; gap:8px; }
    .geo-footer .btn { border-radius:0; font-family:inherit; font-size:.68rem; text-transform:uppercase; }
    .geo-footer .btn-primary { border:1px solid var(--ag-gold); background:var(--ag-gold); color:#120e05; font-weight:600; }
    .geo-footer .btn-primary:hover:not(:disabled) { border-color:var(--ag-gold-2); background:var(--ag-gold-2); color:#120e05; }
    .geo-footer .btn-secondary { border-color:#314a5c; background:#101d27; color:#9cafbd; }

    .geo-center-icon span {
        display:block;
        width:26px;
        height:26px;
        border:2px solid var(--ops-amber);
        border-radius:50%;
        background:radial-gradient(circle,var(--ops-amber) 0 3px,rgba(243,185,0,.15) 4px);
        box-shadow:0 0 0 2px rgba(0,0,0,.5),0 0 12px rgba(243,185,0,.6);
    }

    @media (max-width:1200px) {
        .geo-modal { inset:24px; }
        .geo-body { grid-template-columns:180px minmax(0,1fr) 280px; }
    }
    @media (max-width:850px) {
        .geo-modal { inset:8px; }
        .geo-body { grid-template-columns:1fr; grid-template-rows:minmax(320px,1fr) auto auto; overflow:auto; }
        .geo-layers, .geo-data { border:0; border-top:1px solid var(--ops-line); }
        .geo-data { max-height:320px; }
        .geo-cursor { display:none; }
    }
} /* end of @layer shared */

/* ---- Leaflet chrome in the console theme: unlayered, like the Leaflet and Geoman stylesheets (injected by
   js/geometry-editor.js), which a layered rule could never beat. */
.geo-map .leaflet-bar a { border-color:var(--ops-line)!important; background:#07111a; color:var(--ops-text); }
.geo-map .leaflet-bar a:hover { background:#0a1b26; color:var(--ops-cyan); }
.geo-map .leaflet-control-attribution { background:rgba(5,11,17,.75); color:#7590a3; font-family:inherit; font-size:.55rem; }
.geo-map .leaflet-control-attribution a { color:#9cc7d6; }
.geo-map .leaflet-control-scale-line { border-color:var(--ops-cyan-dim); background:rgba(5,11,17,.7); color:var(--ops-text); font-family:inherit; }
.geo-map .leaflet-tooltip { border-color:var(--ops-line-bright); background:#07111a; color:var(--ops-text); font-family:Consolas,monospace; font-size:.62rem; }
.geo-map .leaflet-tooltip.geo-measure-tooltip { border-color:var(--ops-amber); color:var(--ops-amber); }
.geo-map .marker-icon { border-color:var(--ops-cyan)!important; }


/* ==== unit-map.css ==== */
/* Tactical unit map (Pages/UnitMapPage.razor). Uses the agency tokens (tokens.css). */
@layer shared {
    .umap-shell { position:relative; flex:1; min-height:420px; border:1px solid var(--ag-line); background:#02060a; overflow:hidden; }
    .umap-map { position:absolute; inset:0; }

    /* Search (top left) with the "new unit" button, as in a map app */
    .umap-search { position:absolute; top:14px; left:14px; z-index:1000; width:min(380px,calc(100% - 28px)); font-family:var(--ag-mono); }
    .umap-search-box {
        display:flex;
        align-items:center;
        height:44px;
        border:1px solid var(--ag-line-2);
        background:#05090d;
        box-shadow:0 8px 24px rgba(0,0,0,.45);
    }
    .umap-search-icon { padding:0 6px 0 12px; color:var(--ag-muted); font-size:1.1rem; }
    .umap-search-box input { flex:1; min-width:0; height:100%; border:0; background:transparent; color:var(--ag-text); font:inherit; font-size:.76rem; }
    .umap-search-box input::placeholder { color:var(--ag-muted); }
    .umap-search-box input:focus { outline:none; }
    .umap-search-box:focus-within { border-color:var(--ag-gold); box-shadow:0 0 0 3px rgba(201,162,74,.15),0 8px 24px rgba(0,0,0,.45); }
    .umap-add {
        width:44px;
        height:100%;
        border:0;
        border-left:1px solid var(--ag-line-2);
        background:transparent;
        color:var(--ag-green);
        font-size:1.35rem;
        line-height:1;
    }
    .umap-add:hover { background:rgba(63,191,127,.12); }
    .umap-add:focus-visible { outline:2px solid var(--ag-gold-2); outline-offset:-2px; }
    .umap-results { max-height:min(420px,60vh); overflow:auto; border:1px solid var(--ag-line-2); border-top:0; background:rgba(5,9,13,.97); }
    .umap-results-title { padding:8px 12px 4px; color:var(--ag-gold); font-size:.56rem; letter-spacing:.2em; text-transform:uppercase; }
    .umap-results-empty { padding:6px 12px 10px; color:var(--ag-muted); font-size:.64rem; }
    .umap-results button {
        display:flex;
        align-items:center;
        gap:10px;
        width:100%;
        padding:7px 12px;
        border:0;
        border-bottom:1px solid rgba(27,38,50,.7);
        background:transparent;
        color:var(--ag-text);
        font-family:inherit;
        text-align:left;
    }
    .umap-results button:hover, .umap-results button:focus-visible { background:rgba(201,162,74,.09); outline:none; }
    .umap-results button strong, .umap-results button small { display:block; }
    .umap-results button strong { font-family:var(--ag-display); font-size:.95rem; font-weight:600; letter-spacing:.05em; text-transform:uppercase; }
    .umap-results button small { color:var(--ag-muted); font-size:.6rem; }
    .umap-results button.is-place { font-size:.64rem; }
    .umap-result-pin { color:var(--ag-gold); }
    .umap-result-face { flex:none; display:grid; place-items:center; width:32px; height:32px; overflow:hidden; background:transparent; }
    .umap-result-face img { display:block; width:100%; height:100%; object-fit:contain; }
    .umap-result-face svg { width:22px; height:22px; }

    /* Controls (top right) and legend (bottom left) */
    .umap-controls { position:absolute; top:14px; right:14px; z-index:1000; display:flex; gap:6px; }
    .umap-controls .geo-select, .umap-controls .geo-text-button {
        height:36px;
        border-color:var(--ag-line-2);
        background:rgba(5,9,13,.92);
        font-family:var(--ag-mono);
    }
    .umap-legend {
        position:absolute;
        left:14px;
        bottom:34px;
        z-index:1000;
        display:grid;
        gap:5px;
        min-width:220px;
        max-width:320px;
        padding:10px 12px;
        border:1px solid var(--ag-line-2);
        background:rgba(5,9,13,.9);
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .umap-legend > div { display:flex; align-items:center; gap:8px; }
    .umap-legend-title { color:var(--ag-gold); font-size:.56rem; letter-spacing:.2em; text-transform:uppercase; }
    .umap-dot { flex:none; width:12px; height:12px; border:2px solid; border-radius:50%; }
    .umap-dot.is-ok { border-color:var(--ag-green); }
    .umap-dot.is-bad { border-color:var(--ag-red-2); }
    .umap-dot.is-neutral { border-color:var(--ag-gold); }
    .umap-dot.is-group { border-color:var(--ag-gold-2); background:var(--ag-gold-dim); box-shadow:3px 0 0 -1px var(--ag-gold-2); }
    .umap-unplaced { margin-top:4px; padding-top:6px; border-top:1px solid var(--ag-line); }
    .umap-unplaced summary { cursor:pointer; color:var(--ag-gold-2); }
    .umap-unplaced small { display:block; margin:4px 0; color:var(--ag-muted); }
    .umap-unplaced a { display:flex; justify-content:space-between; gap:8px; padding:3px 0; color:var(--ag-text); text-decoration:none; }
    .umap-unplaced a:hover { color:var(--ag-gold-2); }
    .umap-unplaced a span { color:var(--ag-muted); }
    .umap-overlay { position:absolute; inset:0; z-index:999; display:grid; place-items:center; background:rgba(2,6,10,.55); pointer-events:none; }
    .umap-overlay.is-empty strong {
        padding:12px 16px;
        border:1px solid var(--ag-line-2);
        background:rgba(5,9,13,.92);
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.72rem;
        letter-spacing:.06em;
    }

    /* Markers: the unit picture as-is (transparent background, natural shape, no crop).
       A drop shadow keeps it readable on any base map; a small dot carries the status. */
    .umap-marker {
        position:relative;
        display:grid;
        place-items:center;
        background:transparent;
        cursor:pointer;
        transition:transform .15s;
        filter:drop-shadow(0 0 1px rgba(0,0,0,.85)) drop-shadow(0 4px 5px rgba(0,0,0,.5));
    }
    .umap-marker:hover, .umap-marker:focus-visible { transform:scale(1.15); outline:none; }
    .umap-marker::after {
        content:"";
        position:absolute;
        right:0;
        bottom:0;
        width:10px;
        height:10px;
        border:2px solid #05090d;
        border-radius:50%;
        background:var(--ag-gold);
    }
    .umap-marker.is-ok::after { background:var(--ag-green); }
    .umap-marker.is-bad::after { background:var(--ag-red-2); }
    .umap-marker { overflow:hidden; }
    .umap-marker img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
    .umap-generic { display:grid; place-items:center; width:100%; height:100%; }
    .umap-generic svg { width:100%; height:100%; }
    /* Groups of nearby units: stacked pictures + count */
    .umap-cluster { background:transparent; }
    .umap-cluster-stack { position:relative; width:58px; height:58px; filter:drop-shadow(0 0 1px rgba(0,0,0,.85)) drop-shadow(0 4px 5px rgba(0,0,0,.5)); }
    .umap-cluster-face { position:absolute; top:6px; display:grid; place-items:center; width:44px; height:44px; background:transparent; }
    .umap-cluster-face:nth-child(1) { left:0; z-index:3; }
    .umap-cluster-face:nth-child(2) { left:7px; z-index:2; }
    .umap-cluster-face:nth-child(3) { left:14px; z-index:1; }
    .umap-cluster-face { overflow:hidden; }
    .umap-cluster-face img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
    .umap-cluster b {
        position:absolute;
        right:-2px;
        top:-2px;
        z-index:4;
        min-width:22px;
        height:22px;
        padding:0 5px;
        border-radius:11px;
        background:var(--ag-gold-2);
        color:#120e05;
        font:700 .7rem/22px var(--ag-mono);
        text-align:center;
        box-shadow:0 0 0 2px #05090d;
    }
    .umap-tooltip {
        padding:6px 9px;
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background:#07111a;
        color:var(--ag-text);
        font-family:var(--ag-mono);
        box-shadow:0 6px 16px rgba(0,0,0,.5);
    }
    .umap-tooltip strong, .umap-tooltip span { display:block; }
    .umap-tooltip strong { font-family:var(--ag-display); font-size:.95rem; letter-spacing:.05em; text-transform:uppercase; }
    .umap-tooltip span { color:var(--ag-muted); font-size:.6rem; }
    /* Whether the territory is verified (only a verified one dominates). */
    .umap-tooltip .umap-verified { display:block; margin-top:3px; font-style:normal; font-family:var(--ag-mono); font-size:.58rem; letter-spacing:.08em; text-transform:uppercase; }
    .umap-tooltip .umap-verified.is-ok { color:var(--uc-green); }
    .umap-tooltip .umap-verified.is-no { color:var(--uc-amber); }

    /* Unit dossier modal (manila paper, like the detail panel) */
    /* PaperModal is a native modal <dialog> (FccDialog): its backdrop is the ::backdrop of the top layer. */
    .umap-modal::backdrop { background:rgba(2,6,10,.72); backdrop-filter:blur(2px); }
    .umap-modal {
        position:fixed;
        z-index:1051;
        top:50%;
        left:50%;
        display:flex;
        flex-direction:column;
        width:min(860px,calc(100vw - 32px));
        max-height:calc(100vh - 80px);
        transform:translate(-50%,-50%);
        color-scheme:light;
        color:var(--ink);
        font-family:var(--ag-mono);
        border:1px solid var(--paper-edge);
        background:
            radial-gradient(circle at 18% 12%,rgba(255,255,255,.35),transparent 40%),
            repeating-linear-gradient(0deg,rgba(90,70,30,.035) 0 1px,transparent 1px 26px),
            linear-gradient(180deg,var(--paper),var(--paper-2));
        box-shadow:inset 0 0 60px rgba(120,90,40,.22),0 24px 80px rgba(0,0,0,.65);
        outline:none;
    }
    .umap-modal-heading {
        flex:none;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        padding-left:22px;
        min-height:50px;
        padding-right:8px;
        border-bottom:1px solid var(--paper-edge);
        background:linear-gradient(180deg,#d8c79c,#cfbc8c);
        color:var(--ink-2);
        font-size:.64rem;
        font-weight:600;
        letter-spacing:.2em;
    }
    .umap-modal-close { width:32px; height:32px; border:1px dashed var(--ink-2); background:transparent; color:var(--ink); }
    .umap-modal-close:hover { border-style:solid; background:rgba(31,27,20,.08); }
    .umap-modal-body { flex:1; overflow:auto; padding:18px 22px; }
    .umap-modal-footer {
        flex:none;
        display:flex;
        flex-wrap:wrap;
        gap:8px;
        padding:12px 22px;
        border-top:1px solid var(--paper-edge);
        background:rgba(207,188,140,.35);
    }
    .umap-modal-footer .btn { border-radius:0; font-family:var(--ag-mono); font-size:.62rem; letter-spacing:.12em; text-transform:uppercase; }
    .umap-modal-footer .btn-primary { border:1px solid var(--ink); background:var(--ink); color:var(--paper); }
    .umap-modal-footer .btn-primary:hover { background:#000; color:#fff; }
    .umap-modal-footer .btn-outline-primary { border:1px solid var(--ink-2); background:rgba(255,253,245,.35); color:var(--ink); }
    .umap-modal-footer .btn-outline-primary:hover { background:var(--ink); color:var(--paper); }
    .umap-modal-footer .btn-secondary { margin-left:auto; border:1px dashed var(--ink-2); background:transparent; color:var(--ink-2); }
    .agency-nav-map .agency-nav-label::before { content:"◎ "; color:var(--ag-gold); }

    @media (max-width:700px) {
        /* At the bottom (the search takes the top), left of the zoom buttons so they never cover them. */
        .umap-controls { top:auto; bottom:24px; right:56px; flex-direction:column; align-items:flex-end; }
        .umap-legend { display:none; }
    }

    /* Operating areas by echelon: the swatch repeats the map style (semi-transparent border, lighter fill). */
    .umap-swatch {
        flex:none;
        display:inline-block;
        width:16px;
        height:12px;
        border:2px solid color-mix(in srgb,var(--swatch) 70%,transparent);
        background:color-mix(in srgb,var(--swatch) 16%,transparent);
        vertical-align:-1px;
    }
    .umap-legend-areas { margin-top:6px; padding-top:7px; border-top:1px solid var(--ag-line); }
    .umap-area-toggle { display:flex; align-items:center; gap:8px; margin:0; cursor:pointer; }
    .umap-area-toggle input { position:absolute; opacity:0; pointer-events:none; }
    .umap-area-toggle span { flex:1; }
    .umap-area-toggle b { color:var(--ag-muted); font-weight:400; }
    .umap-area-toggle:hover span { color:var(--ag-gold-2); }
    .umap-area-toggle:focus-within { outline:1px dashed var(--ag-gold); outline-offset:2px; }
    .umap-area-toggle.is-off { opacity:.4; }
    .umap-area-toggle.is-off span { text-decoration:line-through; }
    .umap-legend { max-height:calc(100% - 120px); overflow:auto; }
    .umap-swatch.is-dashed { border-style:dashed; }
    .umap-area-kind { color:var(--ag-muted); }
    .umap-level { display:flex; justify-content:space-between; gap:10px; padding:4px 6px; border:1px solid var(--ag-line); background:rgba(201,162,74,.06); }
    .umap-level span { color:var(--ag-muted); }
    .umap-level strong { color:var(--ag-gold-2); font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
    /* Legend swatches follow the map: thicker border over a dark halo; semi-continuous when administered by a superior. */
    .umap-legend .umap-swatch { width:20px; height:13px; border-width:2px; border-color:var(--swatch); box-shadow:0 0 0 1px rgba(5,9,13,.6); }
    .umap-legend .umap-swatch.is-dashed { border-style:dashed; }
    .umap-cluster.is-minor .umap-cluster-stack { width:40px; height:40px; }
    .umap-cluster.is-minor .umap-cluster-face { top:5px; width:28px; height:28px; }
    .umap-cluster.is-minor .umap-cluster-face:nth-child(2) { left:5px; }
    .umap-cluster.is-minor .umap-cluster-face:nth-child(3) { left:10px; }
    .umap-cluster.is-minor b { min-width:18px; height:18px; padding:0 4px; font-size:.6rem; line-height:18px; }
    /* Every marker has the normal size at any zoom (and so its status dot and its hover): the level of view only
       decides which units are grouped, see unit-map.js. */

    /* Other headquarters of a unit (training, logistics...): list in the card and secondary points on the map. */
    .umap-site {
        position:relative;
        display:grid;
        place-items:center;
        background:transparent;
        cursor:pointer;
        filter:drop-shadow(0 0 1px rgba(0,0,0,.85)) drop-shadow(0 2px 3px rgba(0,0,0,.45));
    }
    .umap-site img, .umap-site .umap-generic { display:block; width:100%; height:100%; object-fit:contain; }
    .umap-site::after {
        content:"";
        position:absolute;
        right:-3px;
        bottom:-3px;
        width:9px;
        height:9px;
        border:1.5px solid #05090d;
        background:var(--ag-gold-2);
        transform:rotate(45deg);
    }
    .umap-site:hover { transform:scale(1.25); }

    /* Right-click menu: create a unit, headquarters or mission at the point. */
    .umap-point-menu {
        position:absolute;
        z-index:1001;
        display:flex;
        flex-direction:column;
        min-width:230px;
        max-width:280px;
        padding:6px;
        border:1px solid var(--ag-line-2,var(--ag-line));
        background:rgba(8,13,18,.96);
        box-shadow:0 12px 30px rgba(0,0,0,.55);
        color:var(--ag-text);
        font-family:var(--ag-mono);
    }
    .umap-point-head { display:flex; flex-direction:column; gap:2px; padding:4px 8px 8px; border-bottom:1px solid var(--ag-line); }
    .umap-point-head span { color:var(--ag-gold); font-size:.56rem; font-weight:700; letter-spacing:.18em; text-transform:uppercase; }
    .umap-point-head strong { color:var(--ag-text-2,var(--ag-text)); font-size:.7rem; font-weight:400; }
    .umap-point-menu button {
        display:flex;
        align-items:center;
        gap:10px;
        padding:8px;
        border:0;
        background:none;
        color:var(--ag-text);
        font:inherit;
        font-size:.72rem;
        letter-spacing:.06em;
        text-align:left;
        cursor:pointer;
    }
    .umap-point-menu button span { width:16px; color:var(--ag-gold); text-align:center; }
    .umap-point-menu button:hover:not(:disabled), .umap-point-menu button:focus-visible {
        background:rgba(201,162,74,.12);
        color:var(--ag-gold-2);
        outline:none;
    }
    .umap-point-menu button:disabled { opacity:.5; cursor:progress; }
    .umap-point-menu small { padding:6px 8px 2px; border-top:1px solid var(--ag-line); color:var(--ag-muted); font-size:.58rem; line-height:1.4; }
    .umap-point-menu small.is-error { border-top:0; color:#ff6b6b; }

    /* "Show on map": pulsing ring around the unit found, until the user interacts with the map again. */
    .umap-spotlight { pointer-events: none; }
    .umap-spotlight span {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 3px solid #e3c06b;
        box-shadow: 0 0 0 2px rgba(5, 9, 13, .55), 0 0 18px 4px rgba(227, 192, 107, .55);
        animation: umap-spotlight-pulse 1.6s ease-out infinite;
    }
    .umap-spotlight span + span { animation-delay: .8s; }
    @keyframes umap-spotlight-pulse { 0% { transform: scale(.45); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
    @media (prefers-reduced-motion: reduce) {
        .umap-spotlight span { animation: none; transform: scale(.8); }
        .umap-spotlight span + span { display: none; }
    }

    /* Dominated territories: the flag in the tooltip, and the name and flag drawn inside the territory (strategic view). */
    .umap-tooltip .umap-dominion-flag { display:block; max-width:72px; max-height:44px; margin-bottom:5px; border:1px solid var(--ag-line-2); }
    .umap-dominion-label { background:none; border:0; }
    .umap-dominion-label > div {
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:4px;
        transform:translate(-50%, -50%);
        white-space:nowrap;
        pointer-events:none;
    }
    .umap-dominion-label img { max-width:64px; max-height:40px; border:1px solid rgba(5,9,13,.75); box-shadow:0 2px 8px rgba(0,0,0,.55); }
    .umap-dominion-label span {
        padding:2px 8px;
        background:rgba(5,9,13,.78);
        border-bottom:2px solid var(--dominion);
        color:#f2ead8;
        font-family:var(--ag-display, 'Barlow Condensed', sans-serif);
        font-weight:700;
        font-size:15px;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
} /* end of @layer shared */

/* ---- Leaflet chrome: unlayered, like Leaflet's own stylesheet (injected by js/unit-map.js), which a layered rule
   could never beat. The tooltip arrow takes the colour of the tooltip. */
.umap-map .leaflet-control-attribution { background:rgba(5,11,17,.78); color:#7590a3; font-family:var(--ag-mono); font-size:.55rem; }
.umap-map .leaflet-control-attribution a { color:#9cc7d6; }
.umap-map .leaflet-bar a { border-color:var(--ag-line)!important; background:#07111a; color:var(--ag-text); }
.umap-map .leaflet-bar a:hover { background:#0a1b26; color:var(--ag-gold-2); }
.umap-map .leaflet-control-scale-line { border-color:var(--ag-gold); background:rgba(5,11,17,.7); color:var(--ag-text); font-family:var(--ag-mono); }
.umap-tooltip::before { border-top-color:#07111a!important; }


/* ==== relations.css ==== */
/* Relational creation: linked-file cards, nested-file trail, postal locator and location studio.
   Everything sits on the manila "paper" of the dossier panel (tokens from tokens.css). */
@layer shared {
    /* ---- Trail of nested files (Headquarters › Postal address) ---- */
    .form-trail {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:6px;
        margin:0 0 14px;
        padding:8px 10px;
        border:1px solid var(--ink-2);
        background:repeating-linear-gradient(135deg,rgba(31,27,20,.05) 0 6px,transparent 6px 12px),rgba(255,253,245,.4);
        font-family:var(--ag-mono);
    }
    .form-trail-label { margin-right:4px; color:var(--stamp); font-size:.55rem; font-weight:700; letter-spacing:.2em; text-transform:uppercase; }
    .form-trail-step {
        max-width:260px;
        overflow:hidden;
        padding:3px 8px;
        border:1px dashed var(--ink-2);
        background:transparent;
        color:var(--ink-2);
        font-size:.66rem;
        text-overflow:ellipsis;
        white-space:nowrap;
        cursor:pointer;
    }
    .form-trail-step:hover { border-style:solid; background:var(--ink); color:var(--paper); }
    .form-trail i { color:var(--ink-muted); font-style:normal; }
    .form-trail strong { padding:3px 8px; background:var(--ink); color:var(--paper); font-size:.66rem; font-weight:600; }
    .form-link-note {
        display:flex;
        align-items:center;
        gap:8px;
        margin:-4px 0 14px;
        padding:6px 10px;
        border-left:3px solid var(--stamp);
        background:rgba(168,38,31,.06);
        color:var(--ink-2);
        font-family:var(--ag-type);
        font-size:.8rem;
    }
    .form-actions {
        position:sticky;
        bottom:0;
        z-index:5;
        display:flex;
        gap:8px;
        margin-top:18px;
        padding:10px 0 6px;
        border-top:1px dashed var(--paper-edge,#b9ab8c);
        background:var(--paper-2);
        box-shadow:0 -10px 14px -10px rgba(31,27,20,.35);
    }

    /* ---- Linked-file card / relation picker ---- */
    .rel-picker { position:relative; }
    /* Every block of the dossier panel is its own layer (agency.css: .entity-details-panel > * { z-index:1 }), so an
       open list would sit under the blocks after it: lift the block, and the picker within it, while a list is open. */
    .entity-details-panel > *:has(.rel-picker.is-open), .entity-details-panel > *:has(.locp-results) { z-index:30; }
    .rel-picker.is-open { z-index:45; }
    .rel-card {
        display:flex;
        align-items:center;
        gap:12px;
        min-height:58px;
        padding:8px 10px;
        border:1px solid var(--ink-2);
        background:linear-gradient(180deg,rgba(255,253,245,.75),rgba(255,253,245,.45));
        box-shadow:2px 2px 0 rgba(93,79,49,.25);
    }
    .rel-card.is-pending { border-style:dashed; opacity:.7; }
    .rel-card.is-compact { min-height:46px; padding:6px 8px; box-shadow:none; }
    .rel-badge {
        flex:none;
        display:grid;
        place-items:center;
        width:44px;
        height:44px;
        background:var(--ink);
        color:var(--ag-gold-2);
        box-shadow:inset 0 0 0 2px var(--paper),inset 0 0 0 3px var(--ink);
    }
    .rel-badge.is-small { width:34px; height:34px; }
    .rel-badge b { font-family:var(--ag-mono); font-size:.55rem; font-weight:700; letter-spacing:.04em; }
    .rel-badge svg { width:84%; height:84%; }
    .rel-badge img { display:block; width:100%; height:100%; object-fit:cover; }
    .rel-badge svg path { fill:rgba(227,192,107,.28); stroke:var(--ag-gold-2); stroke-width:1.6; stroke-linejoin:round; }
    .rel-card-text { display:flex; flex:1; flex-direction:column; min-width:0; padding:0; border:0; background:none; color:inherit; text-align:left; }
    .rel-card-text strong {
        overflow:hidden;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.92rem;
        font-weight:400;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .rel-card-text small { overflow:hidden; color:var(--ink-2); font-size:.66rem; text-overflow:ellipsis; white-space:nowrap; }
    .rel-card-text em { color:var(--stamp); font-size:.55rem; font-style:normal; letter-spacing:.12em; }
    .rel-card-open { cursor:pointer; }
    .rel-card-open:hover strong { text-decoration:underline dotted; text-underline-offset:3px; }
    .rel-card-actions { display:flex; flex:none; gap:4px; }
    .rel-icon {
        display:grid;
        place-items:center;
        width:30px;
        height:30px;
        border:1px solid var(--ink-2);
        background:transparent;
        color:var(--ink);
        font-size:.85rem;
        cursor:pointer;
    }
    .rel-icon:hover { background:var(--ink); color:var(--paper); }
    .rel-icon.is-danger { border-color:var(--stamp); color:var(--stamp); }
    .rel-icon.is-danger:hover { background:var(--stamp); color:#fff6ea; }

    .rel-search { position:relative; display:flex; gap:6px; }
    .rel-search .form-control { padding-left:30px; }
    .rel-search-icon { position:absolute; left:9px; top:50%; z-index:2; color:var(--ink-muted); transform:translateY(-52%); pointer-events:none; }
    .rel-create { flex:none; white-space:nowrap; }
    .rel-picker.is-empty .rel-search .form-control { border-bottom-style:dashed; }
    .rel-results {
        position:absolute;
        left:0;
        right:0;
        top:calc(100% + 4px);
        z-index:40;
        display:flex;
        flex-direction:column;
        max-height:340px;
        overflow:auto;
        border:1px solid var(--ink);
        background:linear-gradient(180deg,var(--paper),var(--paper-2));
        box-shadow:0 14px 30px rgba(20,14,4,.35);
    }
    .rel-results-head {
        position:sticky;
        top:0;
        z-index:1;
        display:flex;
        justify-content:space-between;
        gap:8px;
        padding:6px 10px;
        background:var(--ink);
        color:var(--paper);
        font-size:.58rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .rel-link {
        padding:0;
        border:0;
        background:none;
        color:var(--ag-gold-2);
        font-size:.58rem;
        letter-spacing:.14em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .rel-option {
        display:flex;
        align-items:center;
        gap:10px;
        padding:7px 10px;
        border:0;
        border-bottom:1px dotted var(--ink-muted);
        background:transparent;
        color:inherit;
        text-align:left;
        cursor:pointer;
    }
    .rel-option.is-active, .rel-option:hover { background:rgba(31,27,20,.09); }
    .rel-option.is-current .rel-card-text strong::after { content:" ✓"; color:var(--stamp); }
    .rel-option.is-create { border-bottom:0; background:rgba(168,38,31,.06); }
    .rel-option.is-create .rel-badge { background:var(--stamp); color:#fff6ea; }
    .rel-option.is-create:hover { background:rgba(168,38,31,.14); }
    .rel-empty { padding:10px; color:var(--ink-muted); font-family:var(--ag-type); font-size:.8rem; }
    .rel-picker.is-disabled { opacity:.65; }

    /* Child records inside a form */
    .rel-groups { display:grid; gap:10px; }
    .rel-group { padding:10px; border:1px dashed var(--ink-muted); background:rgba(255,253,245,.25); }
    .rel-group-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
    .rel-group-head strong { flex:1; font-family:var(--ag-display); font-size:.95rem; letter-spacing:.08em; text-transform:uppercase; }
    .rel-count { padding:1px 6px; background:var(--ink); color:var(--ag-gold-2); font-size:.6rem; font-weight:700; }
    .rel-group .rel-card + .rel-card { margin-top:6px; }
    /* In --ink-2: --ink-muted gave 4.01:1 on the darker parts of the paper. */
    .rel-group-empty { color:var(--ink-2); font-family:var(--ag-type); font-size:.8rem; }

    /* ---- Postal address locator ---- */
    .addr-locator {
        position:relative;
        margin:0 0 18px;
        padding:12px 14px 14px;
        border:1px solid var(--ink);
        background:repeating-linear-gradient(0deg,rgba(31,27,20,.035) 0 1px,transparent 1px 22px),rgba(255,253,245,.6);
        box-shadow:3px 3px 0 rgba(93,79,49,.28);
    }
    .addr-locator::before {
        content:"OSM";
        position:absolute;
        right:10px;
        top:-9px;
        padding:1px 6px;
        background:var(--stamp);
        color:#fff6ea;
        font-size:.55rem;
        font-weight:700;
        letter-spacing:.2em;
    }
    .addr-locator-head { display:flex; flex-direction:column; margin-bottom:8px; }
    .addr-locator-head strong { font-family:var(--ag-display); font-size:1rem; letter-spacing:.12em; text-transform:uppercase; }
    .addr-locator-head small { color:var(--ink-2); font-size:.66rem; }
    .addr-locator-search { position:relative; display:flex; gap:8px; }
    .addr-locator-search > span { position:absolute; left:9px; top:50%; z-index:2; color:var(--ink-muted); transform:translateY(-52%); }
    .addr-locator-search .form-control { padding-left:30px; }
    .addr-results { display:flex; flex-direction:column; margin-top:8px; border:1px solid var(--ink-2); background:var(--paper); }
    .addr-results button {
        display:flex;
        flex-direction:column;
        padding:7px 10px;
        border:0;
        border-bottom:1px dotted var(--ink-muted);
        background:transparent;
        text-align:left;
        cursor:pointer;
    }
    .addr-results button:last-child { border-bottom:0; }
    .addr-results button:hover { background:rgba(31,27,20,.08); }
    .addr-results strong { color:var(--ink); font-family:var(--ag-type); font-size:.88rem; font-weight:400; }
    .addr-results small { color:var(--ink-muted); font-size:.62rem; }
    .addr-status { margin-top:8px; font-size:.7rem; }
    .addr-status.is-ok { color:#2c6b46; }
    .addr-status.is-error { color:var(--stamp); }

    /* ---- Location studio ---- */
    .loc-studio { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:14px; margin:4px 0 14px; }
    .loc-studio-side { display:flex; flex-direction:column; gap:10px; min-width:0; }
    .loc-panel { padding:10px 12px; border:1px solid var(--ink-2); background:rgba(255,253,245,.45); }
    .loc-panel h3 { margin:0 0 6px; font-family:var(--ag-display); font-size:.9rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
    .loc-area-summary { margin:0 0 8px; color:var(--ink); font-family:var(--ag-type); font-size:.85rem; }
    .loc-radius { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:8px; }
    .loc-radius button {
        padding:3px 8px;
        border:1px solid var(--ink-2);
        background:transparent;
        color:var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.66rem;
        cursor:pointer;
    }
    .loc-radius button.is-active { background:var(--ink); color:var(--ag-gold-2); }
    .loc-area-actions { display:flex; flex-wrap:wrap; gap:6px; }
    .loc-hint { display:block; margin-top:6px; color:var(--ink-muted); font-size:.62rem; }
    .loc-from-address {
        display:flex;
        align-items:center;
        gap:10px;
        padding:9px 12px;
        border:1px solid var(--stamp);
        background:rgba(168,38,31,.07);
        color:var(--ink);
        text-align:left;
        cursor:pointer;
    }
    .loc-from-address > span:first-child { display:grid; place-items:center; width:32px; height:32px; background:var(--stamp); color:#fff6ea; }
    .loc-from-address strong { display:block; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; }
    .loc-from-address small { display:block; color:var(--ink-2); font-family:var(--ag-type); font-size:.8rem; }
    .loc-from-address:hover:not(:disabled) { background:rgba(168,38,31,.15); }
    .loc-notice { padding:6px 10px; border-left:3px solid #2c6b46; background:rgba(44,107,70,.08); color:#2c6b46; font-size:.7rem; }
    .loc-advanced { margin-bottom:14px; padding:8px 12px; border:1px dashed var(--ink-muted); }
    .loc-advanced summary { color:var(--ink-2); font-size:.7rem; letter-spacing:.1em; text-transform:uppercase; cursor:pointer; }
    .loc-advanced[open] summary { margin-bottom:10px; }

    /* Inline map */
    .locp { display:flex; flex-direction:column; min-width:0; border:1px solid var(--ink); background:#0b1219; box-shadow:3px 3px 0 rgba(93,79,49,.3); }
    .locp-toolbar { position:relative; display:flex; flex-wrap:wrap; gap:6px; padding:6px; background:var(--ink); }
    .locp-search { position:relative; display:flex; flex:1 1 220px; gap:4px; }
    .locp-search > span { position:absolute; left:8px; top:50%; z-index:2; color:var(--ink-muted); transform:translateY(-52%); }
    .entity-details-panel .locp-search .form-control { height:32px; padding:2px 8px 2px 26px; border:0; background:rgba(255,253,245,.92); font-size:.8rem; }
    .entity-details-panel .locp-search .btn {
        height:32px;
        padding:0 10px;
        border-color:var(--ag-gold);
        background:transparent;
        color:var(--ag-gold-2);
        font-size:.62rem;
    }
    .entity-details-panel .locp-search .btn:hover:not(:disabled) { background:var(--ag-gold); color:#120e05; }
    .locp-bases { display:flex; }
    .locp-bases button {
        padding:0 10px;
        border:1px solid var(--ag-gold);
        background:transparent;
        color:var(--ag-gold-2);
        font-size:.6rem;
        letter-spacing:.12em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .locp-bases button + button { border-left:0; }
    .locp-bases button.is-active { background:var(--ag-gold); color:#120e05; }
    .locp-results {
        position:absolute;
        left:6px;
        right:6px;
        top:calc(100% - 2px);
        z-index:1001;
        display:flex;
        flex-direction:column;
        max-height:240px;
        overflow:auto;
        border:1px solid var(--ink);
        background:var(--paper);
        box-shadow:0 12px 26px rgba(0,0,0,.45);
    }
    .locp-results button {
        padding:7px 10px;
        border:0;
        border-bottom:1px dotted var(--ink-muted);
        background:transparent;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.78rem;
        text-align:left;
        cursor:pointer;
    }
    .locp-results button:hover { background:rgba(31,27,20,.08); }
    .locp-results .locp-dismiss {
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.14em;
        text-align:right;
        text-transform:uppercase;
    }
    .locp-error { padding:7px 10px; color:var(--stamp); font-size:.72rem; }
    .locp-map { position:relative; z-index:0; isolation:isolate; height:360px; cursor:crosshair; }
    .locp-pin { background:transparent; border:0; filter:drop-shadow(0 0 2px rgba(255,255,255,.8)); }
    .locp-caption {
        display:flex;
        flex-wrap:wrap;
        justify-content:space-between;
        gap:4px 12px;
        padding:6px 10px;
        background:var(--ink);
        color:var(--paper);
        font-size:.66rem;
    }
    .locp-caption b { color:var(--ag-gold-2); font-weight:600; }
    .locp-caption .is-hint { color:var(--ag-gold-2); }
    .locp-caption small { color:rgba(233,224,200,.7); }

    /* Generating one record from the other (address ⇄ location centre) */
    .addr-generate { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; padding-top:10px; border-top:1px dotted var(--ink-muted); }
    .addr-generate small { color:var(--ink-muted); font-size:.62rem; }
    .loc-from-address.is-generate { border-color:var(--ink); background:rgba(31,27,20,.06); }
    .loc-from-address.is-generate > span:first-child { background:var(--ink); color:var(--ag-gold-2); }
    .loc-from-address.is-generate:hover:not(:disabled) { background:rgba(31,27,20,.14); }
    .loc-from-address:disabled { opacity:.55; cursor:default; }
    .loc-notice.is-error { border-left-color:var(--stamp); background:rgba(168,38,31,.08); color:var(--stamp); }

    /* ---------- Chain of command graph (UnitHierarchyTree): vertical, navigable, echelon colours ---------- */
    .ut { --ut-line:var(--ink-muted); font-family:var(--ag-mono); }
    .ut-head {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        margin-bottom:10px;
        color:var(--ink-muted);
        font-size:.62rem;
        letter-spacing:.06em;
    }
    .ut-head .btn { border-radius:0; font-size:.58rem; letter-spacing:.1em; text-transform:uppercase; }
    /* Top-down chart, centred: superiors stacked above the unit, subordinates below it, one row per level.
       Connectors: a stem from the parent, a horizontal bar across the siblings and an arrow down to each child. */
    .ut-chart { overflow-x:auto; padding:4px 2px 12px; }
    .ut-tree { display:flex; flex-direction:column; align-items:center; width:max-content; min-width:100%; margin:0 auto; }
    .ut-chain, .ut-level, .ut-group ul { list-style:none; margin:0; padding:0; }
    .ut-chain { display:flex; flex-direction:column; align-items:center; }
    .ut-chain > li { display:flex; flex-direction:column; align-items:center; }
    .ut-link, .ut-arrow { position:relative; display:block; width:0; height:22px; border-left:1.5px solid var(--ut-line); }
    .ut-link { border-left-style:dashed; }
    .ut-link::after, .ut-arrow::after {
        content:"";
        position:absolute;
        bottom:-1px;
        left:-5.75px;
        border:5px solid transparent;
        border-top:6px solid var(--ut-line);
        border-bottom:0;
    }
    .ut-level { position:relative; display:flex; justify-content:center; align-items:flex-start; padding-top:16px; }
    .ut-level::before { content:""; position:absolute; top:0; left:50%; height:16px; border-left:1.5px solid var(--ut-line); }
    .ut-level.is-root { padding-top:0; }
    .ut-level.is-root::before { display:none; }
    .ut-branch { position:relative; display:flex; flex-direction:column; align-items:center; padding:0 7px; }
    .ut-branch::before, .ut-branch::after { content:""; position:absolute; top:0; width:50%; border-top:1.5px solid var(--ut-line); }
    .ut-branch::before { right:50%; }
    .ut-branch::after { left:50%; }
    .ut-branch:first-child::before, .ut-branch:last-child::after, .ut-level.is-root > .ut-branch::before, .ut-level.is-root > .ut-branch::after {
        display:none;
    }
    .ut-branch > .ut-arrow { left:.75px; }
    .ut-node {
        position:relative;
        display:inline-flex;
        align-items:center;
        gap:9px;
        width:200px;
        min-height:44px;
        padding:5px 10px 5px 8px;
        border:1px solid var(--paper-edge);
        border-left:4px solid var(--echelon);
        background:rgba(255,253,245,.55);
        color:var(--ink);
        font:inherit;
        text-align:left;
        cursor:pointer;
        transition:background .12s,box-shadow .12s,transform .12s;
    }
    .ut-node:hover:not(:disabled), .ut-node:focus-visible {
        background:rgba(255,253,245,.95);
        box-shadow:2px 3px 0 rgba(93,79,49,.22);
        transform:translateY(-1px);
        outline:none;
    }
    .ut-node:disabled { cursor:default; opacity:1; }
    .ut-node.is-current {
        border-color:var(--ink);
        border-left-color:var(--echelon);
        background:var(--ink);
        color:var(--paper);
        box-shadow:2px 3px 0 rgba(93,79,49,.3);
    }
    .ut-node.is-ancestor { background:rgba(255,253,245,.3); }
    .ut-dot { flex:none; width:12px; height:12px; border:2px solid var(--echelon); background:color-mix(in srgb,var(--echelon) 25%,transparent); }
    .ut-text { min-width:0; }
    .ut-text strong, .ut-text small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .ut-text strong { font-family:var(--ag-type); font-size:.92rem; font-weight:400; }
    .ut-node .ut-text strong { white-space:normal; overflow-wrap:anywhere; line-height:1.15; }
    .ut-text small { color:var(--ink-muted); font-size:.56rem; letter-spacing:.08em; text-transform:uppercase; }
    .ut-node.is-current .ut-text small { color:inherit; opacity:.7; }
    .ut-count {
        margin-left:auto;
        min-width:22px;
        padding:1px 6px;
        border:1px solid currentColor;
        font-size:.6rem;
        font-weight:600;
        text-align:center;
        opacity:.75;
    }

    /* Linked records in a dossier: the field opens the linked record's dossier. */
    .dossier-link {
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        column-gap:8px;
        align-items:baseline;
        width:100%;
        padding:0;
        border:0;
        background:none;
        color:var(--ink);
        font:inherit;
        text-align:left;
        cursor:pointer;
    }
    .dossier-link strong { text-decoration:underline; text-decoration-style:dotted; text-underline-offset:3px; }
    .dossier-link strong { grid-column:1; grid-row:1; }
    .dossier-link em {
        grid-column:1;
        grid-row:2;
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
        font-style:normal;
        overflow-wrap:anywhere;
    }
    .dossier-link span { grid-column:2; grid-row:1; color:var(--ink-muted); }
    .dossier-link:hover strong, .dossier-link:focus-visible strong { text-decoration-style:solid; }
    .dossier-link:focus-visible { outline:1px dashed var(--ink); outline-offset:3px; }
    a.dossier-link { text-decoration:none; }
    /* A relation illustrated with the picture of the related record (emblem of a unit, photo of an operator). */
    .dossier-link.has-picture { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; }
    .dossier-link.has-picture > .dossier-link-picture { grid-column:1; grid-row:1; display:grid; place-items:center; color:inherit; }
    .dossier-link.has-picture > .dossier-link-text { grid-column:2; grid-row:1; display:flex; flex-direction:column; gap:1px; min-width:0; color:inherit; }
    .dossier-link.has-picture > .dossier-link-text strong, .dossier-link.has-picture > .dossier-link-text em { grid-column:auto; grid-row:auto; }
    .dossier-link.has-picture > span[aria-hidden] { grid-column:3; grid-row:1; }

    /* Unit dossier: "chain of command" and "operators" tabs. */
    .ut-tabs { display:flex; gap:0; margin-bottom:12px; border-bottom:1px solid var(--paper-edge); font-family:var(--ag-mono); }
    .ut-tabs button {
        display:inline-flex;
        align-items:center;
        gap:8px;
        margin-bottom:-1px;
        padding:7px 14px;
        border:1px solid transparent;
        border-bottom:0;
        background:none;
        color:var(--ink-muted);
        font:inherit;
        font-size:.62rem;
        font-weight:600;
        letter-spacing:.14em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .ut-tabs button:hover { color:var(--ink); }
    .ut-tabs button.is-active { border-color:var(--paper-edge); background:rgba(255,253,245,.55); color:var(--ink); box-shadow:inset 0 2px 0 var(--ink); }
    .ut-tabs .ut-count { margin-left:0; }
    /* Full screen of the command panel: the button sits at the right of the tabs; the panel then fills the screen
       (browser full screen, or covering the window where an element cannot go full screen) and its charts scroll freely. */
    .ut-tabs .ut-fullscreen { margin-left:auto; border:1px solid var(--paper-edge); border-bottom:0; letter-spacing:.1em; }
    .ut-tabs .ut-fullscreen span { font-size:.85rem; letter-spacing:0; }
    .ut-panel:fullscreen, .ut-panel.is-fullscreen {
        overflow:auto;
        padding:20px 24px;
        background:linear-gradient(180deg,var(--paper),var(--paper-2));
        color:var(--ink);
    }
    .ut-panel.is-fullscreen { position:fixed; inset:0; z-index:3000; }
    .ut-panel:fullscreen .ut-chart, .ut-panel.is-fullscreen .ut-chart { overflow:auto; max-height:none; }
    .ut-panel:fullscreen .ut-group ul, .ut-panel.is-fullscreen .ut-group ul { max-height:none; }

    /* Chain of command: a branch below the direct subordinates opens on demand. */
    .ut-more {
        display:block;
        margin:6px auto 0;
        padding:3px 9px;
        border:1px dashed var(--ink-muted);
        background:rgba(255,253,245,.6);
        color:var(--ink);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.08em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .ut-more:hover, .ut-more:focus-visible { border-style:solid; background:rgba(255,253,245,.95); outline:none; }
    .ut-note { color:var(--ink-muted); font-family:var(--ag-mono); font-size:.66rem; letter-spacing:.06em; }
    .ut-note.is-error { color:var(--stamp); }

    /* Operators graph (UnitOperatorsChart): commander, then one card per rank category. */
    .ut-node.is-commander { --echelon:var(--stamp); text-align:left; }
    .ut-text em { display:block; color:var(--stamp); font-size:.52rem; font-style:normal; font-weight:700; letter-spacing:.16em; text-transform:uppercase; }
    .ut-group {
        width:210px;
        border:1px solid var(--paper-edge);
        border-top:3px solid var(--ink-2);
        background:rgba(255,253,245,.45);
        font-family:var(--ag-mono);
    }
    .ut-group header {
        display:flex;
        align-items:center;
        gap:8px;
        padding:6px 9px;
        border-bottom:1px dotted var(--ink-muted);
        color:var(--ink);
        font-size:.58rem;
        font-weight:700;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .ut-group ul { max-height:290px; overflow-y:auto; }
    .ut-person {
        display:block;
        width:100%;
        padding:5px 9px;
        border:0;
        border-bottom:1px dotted rgba(122,110,85,.4);
        background:none;
        color:var(--ink);
        font:inherit;
        text-align:left;
        cursor:pointer;
    }
    .ut-group li:last-child .ut-person { border-bottom:0; }
    .ut-person:hover, .ut-person:focus-visible { background:rgba(255,253,245,.95); outline:none; }
    .ut-person .ut-text strong { font-size:.82rem; }
    .ut-person.is-inactive, .ut-node.is-inactive { opacity:.55; }

    /* Staff of a unit (second in command, chiefs of operations and intelligence): stamped like the commander. */
    .ut-group.is-staff { border-top-color:var(--stamp); }

    /* Unit record: a command post nobody holds. */
    .fact-vacant { color:var(--ink-muted); font-style:italic; }

    /* Unit form: the echelon is computed by the service and the command posts follow rules; the notes explain them. */
    .form-text.echelon-hint, .form-text.command-hint {
        display:block;
        margin-top:5px;
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
        line-height:1.45;
        letter-spacing:.03em;
    }

    /* A relation only shown (a person of another command): the same look, without link or arrow. */
    .dossier-link.is-static { cursor:default; }
    .dossier-link.is-static strong { text-decoration:none; }
    /* Graphs with pictures: the emblem of a unit in its node, the photo (or initials) of a person. */
    .ut-emblem { flex:none; width:26px; height:26px; object-fit:contain; }
    .ut-photo { flex:none; width:34px; height:34px; border:1px solid var(--paper-edge); border-radius:50%; object-fit:cover; background:rgba(93,79,49,.12); }
    .ut-photo.is-initials {
        display:grid;
        place-items:center;
        color:var(--ink);
        font-family:var(--ag-mono);
        font-size:.62rem;
        font-weight:700;
        letter-spacing:.04em;
    }
    .ut-person.has-photo { display:flex; align-items:center; gap:8px; }
    .ut-node.is-static, .ut-person.is-static, span.ut-node { cursor:default; }
    .ut-node.is-static:disabled { opacity:1; }
    span.ut-node:hover { transform:none; box-shadow:none; }
    span.ut-person:hover { background:none; }
    /* An inactive person or unit: fully legible, marked in italics, its photo in greys (no faded text). */
    .ut-person.is-inactive, .ut-node.is-inactive { opacity:1; }
    .ut-person.is-inactive .ut-text strong, .ut-node.is-inactive .ut-text strong { font-style:italic; }
    .is-inactive > .ut-photo { filter:grayscale(1); border-style:dashed; }
} /* end of @layer shared */

/* ---- Leaflet chrome: unlayered, like Leaflet's own stylesheet (injected by js/location-picker.js). */
.locp-map .leaflet-container { font-family:var(--ag-mono); }


/* ==== components.css ==== */
/* ==========================================================================
   Shared UI components (Components/Ui): one look for the same element wherever it appears —
   the unit map card, the administration records, the pickers and the related-record groups.
   ========================================================================== */
@layer shared {
    /* ---------- Record (DossierCover, DossierSection, FactGrid/Fact, DossierLink) ---------- */
    .dossier { display:flex; flex-direction:column; }
    .dossier-cover {
        position:relative;
        display:flex;
        gap:18px;
        align-items:center;
        padding:16px;
        border:1px solid var(--paper-edge);
        background:rgba(255,253,245,.38);
        box-shadow:2px 3px 0 rgba(93,79,49,.18);
    }
    .dossier-cover.has-edit { padding-right:120px; }
    .dossier-picture { flex:none; display:grid; place-items:center; width:120px; height:120px; overflow:hidden; background:transparent; }
    .dossier-picture img {
        display:block;
        width:100%;
        height:100%;
        min-width:0;
        min-height:0;
        object-fit:contain;
        filter:drop-shadow(2px 3px 2px rgba(93,79,49,.35));
    }
    .dossier-title { min-width:0; }
    .dossier-title h2 {
        margin:2px 0;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:1.6rem;
        font-weight:400;
        letter-spacing:0;
        text-transform:none;
        overflow-wrap:anywhere;
    }
    .dossier-title p { margin:0 0 6px; color:var(--ink-muted); font-size:.68rem; letter-spacing:.04em; overflow-wrap:anywhere; }
    .dossier-chips { display:flex; flex-wrap:wrap; gap:6px; }
    .dossier-edit.btn {
        position:absolute;
        top:14px;
        right:14px;
        border:1px solid var(--ink-2);
        border-radius:0;
        background:rgba(255,253,245,.35);
        color:var(--ink);
        font-family:var(--ag-mono);
        font-size:.62rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .dossier-edit.btn:hover, .dossier-edit.btn:focus-visible { border-color:var(--ink); background:var(--ink); color:var(--paper); }

    .dossier-section h3 {
        margin:20px 0 8px;
        padding-bottom:6px;
        border-bottom:1px solid var(--ink-2);
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }

    .dossier-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 22px; margin:0; }
    .dossier-facts > div { min-width:0; padding:8px 0 7px; border-bottom:1px dotted var(--ink-muted); }
    .dossier-facts > div.is-wide { grid-column:1/-1; }
    .dossier-facts dt { color:var(--ink-muted); font-size:.55rem; font-weight:600; letter-spacing:.18em; text-transform:uppercase; }
    .dossier-facts dd { margin:2px 0 0; overflow-wrap:anywhere; color:var(--ink); font-family:var(--ag-type); font-size:.9rem; }
    .dossier-facts dd .umap-swatch { margin-right:6px; }
    .dossier-fact-note {
        display:block;
        margin-top:2px;
        color:var(--ink-muted);
        font-family:inherit;
        font-size:.62rem;
        font-style:normal;
        letter-spacing:.06em;
    }
    .dossier-facts dd img.dossier-fact-image {
        display:block;
        width:220px;
        height:160px;
        max-width:100%;
        margin-top:4px;
        padding:4px;
        border:1px solid var(--paper-edge);
        background:rgba(255,253,245,.5);
        object-fit:contain;
    }

    /* A list of relations (other headquarters…), one DossierLink per row. */
    .dossier-list { display:grid; gap:0; margin:0; padding:0; list-style:none; }
    .dossier-list li { padding:8px 0 7px; border-bottom:1px dotted var(--ink-muted); }
    .dossier-list .dossier-link strong { font-family:var(--ag-type); font-size:.9rem; font-weight:400; }

    .dossier-raw { margin-top:18px; }

    @media (max-width:700px) {
        .dossier-facts { grid-template-columns:1fr; }
        .dossier-cover, .dossier-cover.has-edit { flex-direction:column; align-items:flex-start; padding-right:16px; }
        .dossier-edit.btn { position:static; }
    }

    /* ---------- Sign-in, change of password and access management ---------- */
    body:has(.auth-screen) { margin:0; color-scheme:dark; background:var(--ag-bg); color:var(--ag-text); font-family:var(--ag-mono); }
    .auth-screen {
        min-height:100vh;
        display:grid;
        place-items:center;
        padding:24px 16px;
        background:radial-gradient(ellipse at 50% 35%,#0d1620 0,#04070a 70%);
    }
    .auth-overlay { position:fixed; inset:0; z-index:1500; display:grid; place-items:center; padding:24px 16px; background:rgba(4,7,10,.72); }
    .auth-card {
        width:min(420px,100%);
        display:grid;
        gap:8px;
        padding:28px 28px 24px;
        background:#e9dfc4;
        color:#1d1d1b;
        border:1px solid #b9a77a;
        box-shadow:0 18px 50px rgba(0,0,0,.55);
        font-family:var(--ag-mono);
    }
    .auth-card h1 { margin:8px 0 0; font-family:var(--ag-type); font-size:1.35rem; letter-spacing:.04em; color:#2b2419; }
    .auth-card .form-label { margin:6px 0 0; font-size:.72rem; letter-spacing:.12em; text-transform:uppercase; color:#4a4031; }
    .auth-card .form-control { background:#f6f0de; border:1px solid #a8996f; color:#1d1d1b; font-family:var(--ag-mono); }
    .auth-card .form-control:focus { border-color:#7d1a1f; box-shadow:0 0 0 2px rgba(125,26,31,.2); }
    .auth-brand { display:flex; flex-direction:column; gap:2px; }
    .auth-brand strong { font-family:var(--ag-display); font-size:1.9rem; letter-spacing:.3em; color:#7d1a1f; }
    .auth-brand span { font-size:.66rem; letter-spacing:.32em; color:#6b5d44; }
    .auth-hint { margin:0; font-size:.78rem; color:#5a4e3a; }
    .auth-rules { font-size:.7rem; color:#6b5d44; }
    .auth-rules.is-ok { color:#2f7a4f; }
    .auth-error { padding:6px 8px; border-left:3px solid #a3262d; background:rgba(163,38,45,.1); color:#7d1a1f; font-size:.78rem; }
    .auth-notice { margin:0; padding:8px 10px; border-left:3px solid #8a6414; background:rgba(201,162,74,.18); color:#3b2f17; font-size:.8rem; line-height:1.45; }
    .auth-ok { padding:6px 8px; border-left:3px solid #2f7a4f; background:rgba(47,122,79,.12); color:#1f5a39; font-size:.78rem; }
    .auth-submit { margin-top:10px; }
    .auth-actions { display:flex; justify-content:space-between; gap:8px; margin-top:10px; }
    .auth-user { margin-top:auto; padding:12px 14px; border-top:1px solid var(--ag-line); display:grid; gap:8px; }
    .auth-user-name { display:grid; }
    .auth-user-name strong { color:var(--ag-text); font-size:.8rem; }
    .auth-user-name span { color:var(--ag-muted); font-size:.68rem; letter-spacing:.06em; }
    .auth-user-actions { display:flex; gap:6px; flex-wrap:wrap; }
    /* Own profile, password, sign-out: light ink on the dark sidebar (the framework grey #6c757d gave 4.22:1). */
    .auth-user-actions .btn { border-color:var(--ag-line-2); color:var(--uc-label-dark); }
    .auth-user-actions .btn:hover { border-color:var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .access-page { display:grid; grid-template-columns:minmax(260px,1fr) minmax(300px,1.3fr); gap:18px; padding:16px; }
    .access-users ul { list-style:none; margin:10px 0 0; padding:0; max-height:65vh; overflow:auto; }
    .access-users li button {
        width:100%;
        display:grid;
        text-align:left;
        gap:2px;
        padding:8px 10px;
        background:var(--ag-panel-2);
        border:1px solid var(--ag-line);
        color:var(--ag-text);
        margin-bottom:4px;
    }
    .access-users li button small { color:var(--ag-muted); }
    .access-users li.is-selected button { border-color:var(--ag-gold); background:var(--ag-gold-dim); }
    .access-form { padding:18px; background:#e9dfc4; color:#1d1d1b; border:1px solid #b9a77a; align-self:start; }
    .access-form form { display:grid; gap:6px; }
    .access-form h2 { font-family:var(--ag-type); font-size:1.15rem; margin:0 0 8px; }
    @media (max-width: 760px) {
        .access-page { grid-template-columns:1fr; }
    }

    /* Sign-up: a wider card with paired fields; the robot trap is out of sight (not display:none, which robots skip). */
    .auth-card-wide { width:min(620px,100%); }
    .auth-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; }
    .auth-grid > div { display:grid; gap:4px; }
    .auth-grid-phone { grid-template-columns:minmax(170px,40%) 1fr; }
    .auth-trap { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }
    .auth-switch { margin:6px 0 0; font-size:.74rem; color:#5a4e3a; text-align:center; }
    /* "Create an account" in the red ink of the paper (the framework blue gave 3.83:1 on the card). */
    .auth-switch .btn-link { padding:0 2px; font-size:inherit; vertical-align:baseline; }
    .auth-card .btn-link { color:var(--uc-red-paper); font-weight:600; }
    /* The language on the sign-in card: in ink, not the light grey of the dark sidebar (1.57:1). */
    .auth-card .agency-lang { color:var(--ink-2); }
    @media (max-width:560px) {
        .auth-grid { grid-template-columns:1fr; }
    }

    /* Own profile: the same paper card for a pending account (alone) and inside the administration. */
    .profile-screen { place-items:start center; }
    .profile-card {
        width:min(860px,100%);
        display:grid;
        gap:12px;
        padding:26px 28px;
        background:#e9dfc4;
        color:#1d1d1b;
        border:1px solid #b9a77a;
        box-shadow:0 18px 50px rgba(0,0,0,.55);
        font-family:var(--ag-mono);
    }
    .profile-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
    .profile-card h1 { margin:0; font-size:1.3rem; letter-spacing:.08em; text-transform:uppercase; }
    .profile-pending {
        display:grid;
        gap:2px;
        padding:8px 10px;
        border-left:3px solid #b07d1f;
        background:rgba(176,125,31,.12);
        color:#5c4310;
        font-size:.8rem;
    }
    .profile-page { max-width:900px; padding:18px; background:#e9dfc4; color:#1d1d1b; border:1px solid #b9a77a; font-family:var(--ag-mono); }
    .profile-form { display:grid; gap:14px; }
    .profile-head { display:grid; grid-template-columns:auto 1fr; gap:18px; align-items:start; }
    .profile-head h2 { margin:0 0 8px; font-size:1.15rem; }
    .profile-facts { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; margin:0; font-size:.78rem; }
    .profile-facts dt { color:#6b5d44; font-weight:600; text-transform:uppercase; letter-spacing:.08em; font-size:.62rem; align-self:center; }
    .profile-facts dd { margin:0; }
    .profile-form fieldset { display:grid; gap:6px; margin:0; padding:10px 12px 12px; border:1px solid #b9a77a; }
    .profile-form legend { width:auto; margin:0; padding:0 6px; font-size:.66rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
    .profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }
    .profile-grid label { display:grid; gap:3px; font-size:.62rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:#5a4e3a; }
    .profile-grid label .form-control, .profile-grid label .form-select { font-size:.85rem; letter-spacing:normal; text-transform:none; }
    .profile-grid .is-wide { grid-column:1 / -1; }
    @media (max-width:640px) {
        .profile-grid, .profile-head { grid-template-columns:1fr; }
    }

    /* Access: accounts created from the sign-up page that wait for approval. */
    .registrations { margin-bottom:18px; padding:14px 16px; background:#e9dfc4; color:#1d1d1b; border:1px solid #b9a77a; font-family:var(--ag-mono); }
    .registrations h2 { display:flex; align-items:center; gap:8px; margin:0 0 10px; font-size:.8rem; letter-spacing:.14em; text-transform:uppercase; }
    .registrations ul { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
    .registrations li {
        display:flex;
        justify-content:space-between;
        align-items:center;
        gap:12px;
        padding:8px 10px;
        border:1px solid rgba(122,110,85,.5);
        background:rgba(255,253,245,.5);
    }
    .registrations li > div:first-child { display:grid; gap:2px; min-width:0; }
    .registrations small { color:#5a4e3a; font-size:.7rem; overflow-wrap:anywhere; }
    .registrations-actions { display:flex; gap:6px; flex-shrink:0; }
    .profile-actions { display:flex; gap:8px; justify-content:flex-end; }

    /* Sign-up in numbered blocks, with problems under each field and what is still missing under the button. */
    .reg-card { gap:10px; }
    .reg-step { display:grid; gap:4px; margin:0; padding:10px 12px 12px; border:1px solid #b9a77a; }
    .reg-step legend {
        display:flex;
        align-items:center;
        gap:8px;
        width:auto;
        margin:0;
        padding:0 6px;
        font-size:.7rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .reg-step legend b {
        display:inline-grid;
        place-items:center;
        width:20px;
        height:20px;
        border-radius:50%;
        background:#1d1d1b;
        color:#e9dfc4;
        font-size:.65rem;
        letter-spacing:0;
    }
    .reg-missing { margin:4px 0 0; font-size:.7rem; color:#6b5d44; text-align:right; }
    .field-problem { display:block; color:#8f1d24; font-size:.7rem; line-height:1.35; }
    .auth-card .form-control.is-invalid, .auth-card .form-select.is-invalid, .profile-form .form-control.is-invalid, .profile-form .form-select.is-invalid {
        border-color:#a3262d;
        box-shadow:0 0 0 2px rgba(163,38,45,.15);
        background-image:none;
    }

    /* New password: show/hide, strength bar (four steps) and the checklist of its rules. */
    .pw-field { position:relative; }
    .pw-field .form-control { padding-right:84px; }
    .pw-toggle {
        position:absolute;
        top:50%;
        right:6px;
        transform:translateY(-50%);
        padding:2px 8px;
        border:1px solid #b9a77a;
        background:#f3ead2;
        color:#3b3326;
        font:inherit;
        font-size:.62rem;
        letter-spacing:.08em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .pw-meter { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:4px 10px; }
    .pw-bar { display:grid; grid-template-columns:repeat(4,22px); gap:3px; }
    .pw-bar i { height:6px; background:rgba(122,110,85,.25); }
    .pw-bar[data-score="1"] i.is-on { background:#a3262d; }
    .pw-bar[data-score="2"] i.is-on { background:#b07d1f; }
    .pw-bar[data-score="3"] i.is-on { background:#5f8a3a; }
    .pw-bar[data-score="4"] i.is-on { background:#2f7a4f; }
    .pw-label { font-size:.68rem; color:#5a4e3a; }
    .pw-checks {
        grid-column:1 / -1;
        display:flex;
        flex-wrap:wrap;
        gap:2px 14px;
        margin:0;
        padding:0;
        list-style:none;
        font-size:.66rem;
        color:var(--ink-muted);
    }
    .pw-checks li.is-ok { color:#1f5a39; }

    /* Pending account: welcome, the three steps and the automatic check. */
    .profile-card-tools { display:flex; align-items:center; gap:8px; }
    .profile-welcome {
        display:grid;
        gap:2px;
        padding:10px 12px;
        border-left:3px solid #2f7a4f;
        background:rgba(47,122,79,.12);
        color:#1f5a39;
        font-size:.8rem;
    }
    .account-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0; padding:0; list-style:none; counter-reset:none; }
    .account-steps li { display:flex; gap:10px; align-items:flex-start; padding:10px; border:1px solid #b9a77a; background:rgba(255,253,245,.45); }
    .account-steps b {
        flex:0 0 26px;
        display:grid;
        place-items:center;
        width:26px;
        height:26px;
        border-radius:50%;
        border:2px solid #7a6c52;
        color:#5a4e3a;
        font-size:.75rem;
    }
    .account-steps span { display:grid; gap:2px; }
    .account-steps strong { font-size:.74rem; letter-spacing:.06em; text-transform:uppercase; }
    .account-steps small { font-size:.68rem; color:#5a4e3a; line-height:1.35; }
    .account-steps .is-done b { border-color:#2f7a4f; background:#2f7a4f; color:#fff; }
    .account-steps .is-current { border-color:#1d1d1b; box-shadow:inset 0 3px 0 #1d1d1b; }
    .account-steps .is-current b { border-color:#1d1d1b; background:#1d1d1b; color:#e9dfc4; }
    .account-steps .is-waiting { opacity:.8; }
    .profile-pending { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
    .profile-pending small { color:#6b4f12; font-size:.68rem; }
    @media (max-width:720px) {
        .account-steps { grid-template-columns:1fr; }
    }

    /* Own profile: completeness meter with the missing items, and the unsaved-changes notice. */
    .profile-meter { display:grid; gap:6px; margin-top:12px; padding:10px 12px; border:1px solid #b9a77a; background:rgba(255,253,245,.45); }
    .profile-meter-head { display:flex; justify-content:space-between; font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; }
    .profile-meter-bar { height:8px; background:rgba(122,110,85,.25); }
    .profile-meter-bar i { display:block; height:100%; background:linear-gradient(90deg,#b07d1f,#2f7a4f); transition:width .3s; }
    .profile-missing { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; font-size:.68rem; color:#5a4e3a; }
    .profile-chip { padding:1px 8px; border:1px dashed #7a6c52; background:transparent; color:#3b3326; font:inherit; font-size:.66rem; cursor:pointer; }
    .profile-chip:hover, .profile-chip:focus-visible { border-style:solid; background:#f3ead2; outline:none; }
    .profile-complete { color:#1f5a39; font-size:.72rem; }
    .profile-actions { align-items:center; }
    .profile-actions .auth-ok { padding:4px 8px; }
    .profile-dirty { padding:4px 8px; border-left:3px solid #b07d1f; background:rgba(176,125,31,.12); color:#6b4f12; font-size:.74rem; }

    /* The address and its mail (own profile): verified or not, the link sent again, the inbox by mail. */
    .profile-mail { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; min-height:26px; font-size:.74rem; color:#3b3326; }
    .profile-mail:empty { display:none; }
    .profile-mail small { flex:1 1 220px; font-size:.72rem; color:#5a4e3a; }
    .profile-mail .btn { padding:2px 10px; font-size:.68rem; }
    .profile-mail-state { display:inline-grid; place-items:center; width:22px; height:22px; border:1px solid #b07d1f; color:#6b4f12; font-size:.8rem; }
    .profile-mail-result { flex-basis:100%; padding:3px 8px; border-left:3px solid #b07d1f; background:rgba(176,125,31,.12); color:#6b4f12; }
    .profile-mail-result.is-ok { border-left-color:#2f7a4f; background:rgba(47,122,79,.12); color:#1f5a39; }
    .profile-switch { display:flex; align-items:flex-start; gap:10px; margin:2px 0 0; padding:8px 10px; border:1px dashed #b9a77a; cursor:pointer; }
    .profile-switch .form-check-input { flex:none; margin-top:2px; }
    .profile-switch span { display:grid; gap:1px; }
    .profile-switch strong { font-size:.78rem; color:var(--ink); }
    .profile-switch small { font-size:.7rem; color:#5a4e3a; }
    .profile-welcome-mail { margin-top:2px; font-weight:600; }
    .profile-phone-steps { flex-basis:100%; display:grid; gap:6px; padding:8px 10px; border:1px dashed #b9a77a; background:rgba(255,253,245,.35); }
    .profile-phone-steps > .btn { justify-self:start; }
    .profile-phone-code { display:flex; gap:8px; max-width:320px; }
    .profile-phone-code .form-control { font-family:var(--ag-mono); font-size:1rem; letter-spacing:.3em; text-transform:uppercase; }

    /* FCC logo (light, transparent): on the dark sidebar, or as a dark band across the top of the paper cards. */
    .brand-logo { display:grid; justify-items:start; gap:4px; min-width:0; }
    .brand-logo img { display:block; width:140px; max-width:100%; height:auto; }
    .brand-logo span { display:block; margin:0; font-family:var(--ag-display); font-size:.62rem; font-weight:600; letter-spacing:.24em; color:var(--ag-gold); }
    .entity-brand .brand-logo img { width:124px; }
    .brand-logo.is-band { margin:-28px -28px 6px; padding:18px 28px 12px; background:linear-gradient(140deg,#0e1620,#070b10); border-bottom:2px solid #c9a24a; }
    .brand-logo.is-band img { width:180px; }
    .profile-card-head {
        margin:-26px -28px 4px;
        padding:16px 28px 12px;
        background:linear-gradient(140deg,#0e1620,#070b10);
        border-bottom:2px solid #c9a24a;
        align-items:center;
    }
    .profile-card-head .brand-logo img { width:170px; }
    .profile-card-head .btn-outline-secondary { border-color:#5b6875; color:#d7dde3; }
    .profile-card-head .btn-outline-secondary:hover { background:#1b2733; color:#fff; }
    .entity-brand .brand-logo span { white-space:nowrap; font-size:.54rem; letter-spacing:.16em; }

    /* Pages inside the administration shell (fixed to the window height): the content scrolls in its own panel,
       so the page header stays in place and nothing is cut off. */
    .profile-page { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
    .registrations { flex-shrink:0; max-height:40vh; overflow-y:auto; }
    .access-page { flex:1 1 auto; min-height:0; overflow-y:auto; }

    /* Optional colour field (#rrggbb): the picker, its code and a button to leave it unset. */
    .color-field { display:flex; align-items:center; gap:.6rem; }
    .color-field .form-control-color { width:3.2rem; flex:0 0 auto; }
    .color-field-code { font-family:var(--ag-mono, monospace); font-size:.85rem; color:var(--ag-muted, #9aa3ab); }

    /* ---------- Territory review (administrators, /territory-review) ---------- */
    .terrev { display:grid; grid-template-columns:minmax(260px,340px) 1fr; gap:12px; align-items:start; }
    @media (max-width:900px) { .terrev { grid-template-columns:1fr; } }
    .terrev-filters { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:8px; }
    .terrev-filters button { padding:2px 8px; border:1px solid var(--ag-line-2); background:transparent; color:var(--ag-text-2); font-family:var(--ag-mono); font-size:.62rem; letter-spacing:.1em; text-transform:uppercase; }
    .terrev-filters button.is-on { border-color:var(--ag-gold); color:var(--ag-gold-2); background:var(--ag-gold-dim); }
    .terrev-list { display:grid; gap:4px; margin:0; padding:0; list-style:none; max-height:70vh; overflow:auto; }
    .terrev-list button { display:grid; gap:1px; width:100%; padding:7px 9px; border:1px solid var(--ag-line); background:transparent; color:var(--ag-text); text-align:left; }
    .terrev-list button:hover, .terrev-list button.is-on { border-color:var(--ag-gold); background:var(--ag-gold-dim); }
    .terrev-list span, .terrev-list small { color:var(--ag-muted); font-size:.7rem; }
    .terrev-status { display:inline-block; padding:0 5px; border:1px solid currentColor; font-family:var(--ag-mono); font-size:.58rem; letter-spacing:.1em; text-transform:uppercase; }
    .terrev-status.is-pending { color:var(--uc-amber); }
    .terrev-status.is-approved { color:var(--uc-green); }
    .terrev-status.is-rejected { color:var(--uc-red); }
    .terrev-status.is-withdrawn { color:var(--uc-grey); }
    .terrev-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
    .terrev-head h2 small { color:var(--ag-muted); font-family:var(--ag-mono); font-size:.7rem; }
    .terrev-facts { display:grid; grid-template-columns:auto 1fr; gap:4px 14px; margin:10px 0; font-size:.8rem; }
    .terrev-facts dt { color:var(--ag-muted); font-family:var(--ag-mono); font-size:.62rem; letter-spacing:.1em; text-transform:uppercase; align-self:center; }
    .terrev-facts dd { margin:0; }
    .terrev-detail h3 { margin:14px 0 6px; color:var(--ag-gold); font-family:var(--ag-display); font-size:.9rem; letter-spacing:.14em; text-transform:uppercase; }
    .terrev-letter { padding:12px 14px; border:1px solid var(--paper-edge); background:var(--paper); color:var(--ink); font-family:var(--ag-type); font-size:.85rem; line-height:1.6; white-space:pre-wrap; }
    .terrev-docs { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:6px; }
    .terrev-doc { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--ag-line-2); background:transparent; color:var(--ag-text); text-align:left; }
    .terrev-doc:hover { border-color:var(--ag-gold); background:var(--ag-gold-dim); }
    .terrev-doc > span:nth-child(2) { display:grid; flex:1; min-width:0; }
    .terrev-doc strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.78rem; }
    .terrev-doc small { color:var(--ag-muted); font-size:.66rem; }
    .terrev-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
    .terrev-answer { display:grid; gap:2px; margin:0; font-size:.82rem; }
    .terrev-answer small { color:var(--ag-muted); font-size:.68rem; }

    /* The mark next to a name (NameMark): the insignia of a unit, the picture of an operator or a fallback, in a
       square of a fixed size so nothing moves while it loads; round for a person. */
    .name-mark { flex:none; display:inline-grid; place-items:center; width:var(--nm-size, 28px); height:var(--nm-size, 28px); vertical-align:middle; color:var(--ag-gold-2, #d9b45a); overflow:hidden; }
    .name-mark > img, .name-mark > svg { width:100%; height:100%; object-fit:contain; }
    .name-mark.is-person { border-radius:50%; background:var(--ag-panel-2); box-shadow:inset 0 0 0 1px var(--ag-line-2); }
    .name-mark.is-person > img { object-fit:cover; }
    .name-mark-initials { font:600 calc(var(--nm-size, 28px) * .4)/1 var(--ag-mono, monospace); letter-spacing:.02em; color:var(--ag-gold-2, #d9b45a); }
    .name-line { display:inline-flex; align-items:center; gap:8px; min-width:0; max-width:100%; vertical-align:middle; }
    .name-line > :last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    /* ---------- The modal window (FccDialog: a native <dialog> opened with showModal) ----------
       The browser's own dialog styles (border, padding, margin, inset, sizes, overflow, colours) are reset with zero
       specificity, so the classes of each window (umap-modal, rx-drawer) place and draw it exactly as the <div> it
       replaced; only the backdrop moves to ::backdrop. */
    :where(dialog.fcc-dialog) {
        inset:auto;
        width:auto;
        height:auto;
        max-width:none;
        max-height:none;
        margin:0;
        padding:0;
        overflow:visible;
        border:0;
        background:transparent;
        color:inherit;
    }
    :where(dialog.fcc-dialog):not([open]) { display:none; }
    :where(dialog.fcc-dialog):focus { outline:none; }
} /* end of @layer shared */



/* ==== posts.css ==== */
/* =====================================================================
   Publications (Components/Posts), shared by the administration panel and Unit Control: the editor laid out as a
   classic blog editor (main column, side boxes and a sticky action bar), the visual editor (Quill, restyled dark),
   the dialogs, the library of files, the lists, the reading cards and the article. Console colours of tokens.css.
   ===================================================================== */
@layer shared {
    /* The content scrolls by itself under the page header (as .ev-scroll): the header of the page never shrinks. */
    .pst-scroll { flex:1; min-height:0; overflow-y:auto; padding:0 4px 0 0; }
    .pst-head-actions { display:flex; flex:none; gap:8px; margin-left:auto; }
    .pst-hint { color:var(--ag-muted); font-size:.8rem; line-height:1.4; }
    .pst-warn { color:var(--ag-red-2); font-size:.78rem; }
    .pst-field-error { color:var(--ag-red-2); font-size:.8rem; line-height:1.4; }
    .pst-language { display:grid; gap:.3rem; }
    .pst-lang { display:inline-block; padding:.05rem .35rem; border:1px solid var(--ag-line); border-radius:3px; font:600 .66rem var(--ag-mono); letter-spacing:.06em; color:var(--ag-muted); vertical-align:middle; }
    .pst-count { color:var(--ag-muted); font:.78rem var(--ag-mono); margin-left:auto; }
    /* The tabs of the languages of a publication (original and versions) over the editor. */
    .pst-langbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:10px; }
    .pst-langtab { display:inline-flex; align-items:baseline; gap:6px; padding:5px 10px; border:1px solid var(--ag-line-2); border-radius:3px; background:transparent; color:var(--ag-text-2); font:600 .78rem var(--ag-mono); letter-spacing:.06em; }
    .pst-langtab small { font-weight:400; letter-spacing:0; color:var(--ag-muted); text-transform:none; }
    .pst-langtab.is-published small { color:var(--ag-green); }
    .pst-langtab.is-on { border-color:var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-text); }
    .pst-langtab.is-new { border-style:dashed; }
    .pst-langadd { width:auto; min-width:150px; }
    .pst-langbar > .pst-hint { flex-basis:100%; }
    .pst-shared-note { margin:0 0 10px; padding:8px 10px; border-left:3px solid var(--ag-gold); background:var(--ag-panel-3); color:var(--ag-text-2); font-size:.82rem; line-height:1.45; }
    .pst-side-fields { margin:0; padding:0; border:0; min-width:0; display:contents; }
    .pst-side-fields:disabled { display:block; opacity:.62; }
    .pst-langs { display:inline-flex; gap:3px; }
    .pst-langs .pst-lang.is-draft { border-style:dashed; opacity:.75; }
    .pst-label { color:var(--ag-muted); font:600 .7rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .pst-field { display:grid; gap:4px; margin:0 0 10px; }
    .pst-field > span { color:var(--ag-text-2); font:600 .72rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .pst-field small { color:var(--ag-muted); font-size:.76rem; }
    .pst-inline { display:inline-flex; align-items:center; gap:8px; color:var(--ag-text-2); font-size:.85rem; }
    .pst-link { color:var(--ag-gold-2); font-size:.85rem; }
    .pst-wide { width:100%; }
    .pst-empty { display:grid; justify-items:start; gap:10px; padding:28px; border:1px dashed var(--ag-line-2); border-radius:6px; color:var(--ag-text-2); }
    .pst-empty small { color:var(--ag-muted); }
    :is(.pst-editor, .pst-list, .pst-confirm-modal, .pst-preview-modal) :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline:2px solid var(--ag-gold-2); outline-offset:2px; }

    /* Status, visibility and taxonomy marks. */
    .pst-status { display:inline-block; padding:2px 8px; border:1px solid var(--ag-line-2); border-radius:3px; font:600 .7rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; color:var(--ag-text-2); white-space:nowrap; }
    .pst-status.is-published { border-color:rgba(63,191,127,.5); color:var(--ag-green); }
    .pst-status.is-scheduled { border-color:rgba(103,199,217,.5); color:var(--ag-cyan); }
    .pst-status.is-pending { border-color:rgba(201,162,74,.6); color:var(--ag-gold-2); }
    .pst-status.is-archived { color:var(--ag-muted); border-style:dashed; }
    .pst-visibility { display:inline-block; color:var(--ag-muted); font:.72rem var(--ag-mono); }
    .pst-visibility.is-private { color:var(--ag-red-2); }
    .pst-visibility.is-internal { color:var(--ag-cyan); }
    .pst-badge { display:inline-flex; align-items:center; gap:4px; padding:1px 8px; border-radius:999px; background:var(--ag-panel-3); color:var(--ag-text-2); font:.72rem var(--ag-mono); white-space:nowrap; }
    .pst-badge::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
    .pst-badge.is-public { color:var(--ag-green); }
    .pst-badge.is-internal { color:var(--ag-cyan); }
    .pst-badge.is-private { color:var(--ag-red-2); }
    .pst-cats { display:flex; flex-wrap:wrap; gap:6px; margin:0; }
    .pst-cats span { color:var(--ag-gold-2); font:600 .7rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .pst-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; margin:0; color:var(--ag-muted); font-size:.82rem; }
    .pst-owner { color:var(--ag-text); font-weight:600; }
    .pst-owner-mark { color:var(--ag-gold-2); }

    /* ---------- The editor ---------- */
    .pst-editor { display:grid; grid-template-columns:minmax(0,1fr) 320px; grid-template-areas:"main side" "bar bar"; gap:20px; align-items:start; }
    .pst-editor.is-side-hidden { grid-template-columns:minmax(0,1fr); grid-template-areas:"main" "bar"; }
    .pst-editor.is-side-hidden .pst-side { display:none; }
    .pst-main { grid-area:main; display:grid; gap:12px; min-width:0; }
    .pst-side { grid-area:side; display:grid; gap:14px; min-width:0; }
    .pst-side-toggle { display:none; }
    .pst-restore { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; border:1px solid var(--ag-gold); border-radius:6px; background:var(--ag-gold-dim); color:var(--ag-text); }
    .pst-restore p { margin:0; font-size:.86rem; }

    /* On whose behalf. */
    .pst-owner-picker { margin:0; padding:12px 14px; border:1px solid var(--ag-line-2); border-radius:6px; background:var(--ag-panel); min-width:0; }
    .pst-owner-picker legend { float:left; width:100%; margin:0 0 8px; padding:0; color:var(--ag-text-2); font:600 .72rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .pst-owner-options { clear:both; display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:8px; }
    .pst-owner-option { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--ag-line-2); border-radius:6px; background:var(--ag-panel-2); cursor:pointer; }
    .pst-owner-option input { flex:none; accent-color:var(--ag-gold); }
    .pst-owner-option span { display:grid; min-width:0; }
    .pst-owner-option strong { color:var(--ag-text); font-size:.88rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .pst-owner-option small { color:var(--ag-muted); font-size:.74rem; }
    .pst-owner-option.is-on { border-color:var(--ag-gold); background:var(--ag-gold-dim); }
    .pst-owner-hint { margin:10px 0 0; color:var(--ag-text-2); font-size:.82rem; }
    .pst-owner-fixed { display:flex; align-items:center; gap:10px; }
    .pst-owner-fixed > div { display:grid; gap:2px; min-width:0; }
    .pst-owner-fixed span { color:var(--ag-text-2); font-size:.86rem; }
    .pst-owner-fixed strong { color:var(--ag-text); }
    .pst-owner-fixed small { color:var(--ag-muted); font-size:.78rem; }

    .pst-title-input { width:100%; padding:10px 14px; border:1px solid var(--ag-line-2); border-radius:4px; background:var(--ag-panel); color:#fff; font:600 1.5rem var(--ag-display); letter-spacing:.02em; }
    .pst-title-input:focus { outline:2px solid var(--ag-gold); outline-offset:1px; }
    .pst-editor-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }

    /* Boxes; on a phone, accordions. */
    .pst-box { padding:14px 16px; border:1px solid var(--ag-line-2); border-radius:6px; background:var(--ag-panel); min-width:0; }
    .pst-box h2 { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 12px; padding-bottom:8px; border-bottom:1px solid var(--ag-line); color:#fff; font:700 1rem var(--ag-display); letter-spacing:.06em; text-transform:uppercase; }
    .pst-box h2 label { margin:0; }
    .pst-box-toggle { all:unset; flex:1; cursor:default; }
    .pst-box-body { display:grid; gap:12px; }
    .pst-box-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .pst-box-foot { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 8px; padding-top:10px; border-top:1px solid var(--ag-line); }
    .pst-delete, .pst-archive { color:var(--ag-red-2) !important; }
    .pst-side .agency-alert { margin:0; overflow-wrap:anywhere; }
    .pst-notice { margin:0; color:var(--ag-green); font-size:.85rem; }

    /* Publish: status apart from the audience, who sees it, when. */
    .pst-state { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:6px 10px; }
    .pst-state p { grid-column:1 / -1; margin:0; color:var(--ag-text-2); font-size:.82rem; }
    .pst-choices { display:grid; gap:6px; margin:0; padding:0; border:0; min-width:0; }
    .pst-choices legend { margin:0 0 4px; padding:0; }
    .pst-choice { display:flex; align-items:flex-start; gap:8px; padding:7px 10px; border:1px solid var(--ag-line); border-radius:5px; cursor:pointer; }
    .pst-choice input { margin-top:3px; accent-color:var(--ag-gold); }
    .pst-choice span { display:grid; gap:2px; }
    .pst-choice strong { color:var(--ag-text); font-size:.86rem; font-weight:600; }
    .pst-choice small { color:var(--ag-text-2); font-size:.76rem; line-height:1.35; }
    .pst-choice.is-on { border-color:var(--ag-gold); background:var(--ag-gold-dim); }
    .pst-segmented { display:inline-flex; flex-wrap:wrap; border:1px solid var(--ag-line-2); border-radius:5px; overflow:hidden; }
    .pst-segmented > label, .pst-segmented > button { display:flex; align-items:center; gap:6px; margin:0; padding:6px 12px; border:0; background:transparent; color:var(--ag-text-2); font-size:.82rem; cursor:pointer; }
    .pst-segmented > * + * { border-left:1px solid var(--ag-line-2) !important; }
    .pst-segmented input { position:absolute; opacity:0; pointer-events:none; }
    .pst-segmented .is-on { background:var(--ag-gold-dim); color:var(--ag-gold-2); font-weight:600; }
    .pst-segmented label:focus-within { outline:2px solid var(--ag-gold-2); outline-offset:-2px; }
    .pst-when-fields { display:grid; gap:4px; }
    .pst-when { display:grid; grid-template-columns:1fr auto; gap:6px; }
    .pst-fact { margin:0; color:var(--ag-text); font-size:.86rem; }
    .pst-review-hint { margin:0; padding:8px 10px; border-left:3px solid var(--ag-gold); background:var(--ag-panel-2); color:var(--ag-text-2); font-size:.82rem; }

    /* Featured picture, with the crops of the cards and of the page. */
    .pst-crops { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .pst-crops figure { margin:0; display:grid; gap:4px; }
    .pst-crops img { width:100%; object-fit:cover; border-radius:4px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); }
    .pst-crops img.is-card { aspect-ratio:16 / 9; }
    .pst-crops img.is-hero { aspect-ratio:2 / 1; }
    .pst-crops figcaption { color:var(--ag-muted); font-size:.72rem; }
    .pst-alt-ask { display:grid; gap:6px; padding:8px 10px; border:1px dashed var(--ag-gold); border-radius:5px; }
    .pst-alt-ask .pst-field { margin:0; }

    /* Categories and tags. */
    .pst-tree { display:grid; gap:4px; max-height:240px; overflow:auto; padding:8px; border:1px solid var(--ag-line); border-radius:4px; background:var(--ag-panel-2); }
    .pst-check { display:flex; align-items:center; gap:8px; padding-left:calc(var(--depth, 0) * 18px); color:var(--ag-text); font-size:.88rem; }
    .pst-add-category { display:grid; gap:6px; }
    .pst-chips { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; }
    .pst-chips li { display:inline-flex; align-items:center; gap:4px; padding:3px 4px 3px 10px; border:1px solid var(--ag-line-2); border-radius:999px; background:var(--ag-panel-2); color:var(--ag-text); font-size:.82rem; }
    .pst-chips button { border:0; border-radius:50%; background:transparent; color:var(--ag-muted); line-height:1; padding:3px 6px; }
    .pst-chips button:hover { color:var(--ag-red-2); background:var(--ag-panel-3); }
    .pst-suggestions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .pst-suggestions > small { width:100%; color:var(--ag-muted); font-size:.74rem; }
    .pst-suggestion { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border:1px dashed var(--ag-line-2); border-radius:999px; background:transparent; color:var(--ag-text-2); font-size:.8rem; }
    .pst-suggestion:hover { border-color:var(--ag-gold); color:var(--ag-gold-2); }
    .pst-suggestion small { color:var(--ag-muted); font-size:.7rem; }

    /* The action bar: always in reach at the bottom of the editor, above the tab bar of a phone. */
    .pst-actionbar { grid-area:bar; position:sticky; bottom:0; z-index:5; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px;
        margin:0 -4px; padding:10px 14px; border:1px solid var(--ag-line-2); border-radius:6px 6px 0 0; background:color-mix(in srgb, var(--ag-panel-3) 94%, transparent);
        box-shadow:0 -10px 24px rgba(0,0,0,.45); backdrop-filter:blur(6px); }
    .pst-actionbar-buttons { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; margin-left:auto; }
    .pst-savestate { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; color:var(--ag-muted); font:.78rem var(--ag-mono); }
    .pst-savestate::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--ag-line-2); }
    .pst-savestate.is-saved::before { background:var(--ag-green); }
    .pst-savestate.is-saving::before { background:var(--ag-cyan); animation:pst-pulse 1s infinite alternate; }
    .pst-savestate.is-dirty::before { background:var(--ag-gold); }
    .pst-savestate.is-unsaved { color:var(--ag-gold-2); }
    .pst-savestate.is-unsaved::before { background:var(--ag-gold-2); }
    .pst-savestate.is-failed { color:var(--ag-red-2); }
    .pst-savestate.is-failed::before { background:var(--ag-red-2); }
    .pst-savestate .btn-link { padding:0; font-size:.78rem; }
    @keyframes pst-pulse { to { opacity:.3; } }

    /* The visual editor (Quill snow), in the colours of the console: clear icons, groups apart, a visible focus. */
    .pst-quill { border:1px solid var(--ag-line-2); border-radius:4px; background:var(--ag-panel); }
    .pst-quill .ql-toolbar.ql-snow { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; gap:4px 0; border:0; border-bottom:1px solid var(--ag-line-2); background:var(--ag-panel-3); padding:6px 8px; }
    .pst-quill .ql-toolbar.ql-snow .ql-formats { display:inline-flex; align-items:center; margin:0; padding:0 8px; }
    .pst-quill .ql-toolbar.ql-snow .ql-formats + .ql-formats { border-left:1px solid var(--ag-line-2); }
    .pst-quill .ql-snow.ql-toolbar button { width:32px; height:30px; padding:5px 7px; border-radius:4px; }
    .pst-quill .ql-snow.ql-toolbar button:hover, .pst-quill .ql-snow.ql-toolbar button:focus-visible { background:var(--ag-panel-2); }
    .pst-quill .ql-snow.ql-toolbar button:focus-visible, .pst-quill .ql-snow .ql-picker-label:focus-visible { outline:2px solid var(--ag-gold-2); outline-offset:1px; }
    .pst-quill .ql-container.ql-snow { height:auto; border:0; min-height:360px; font:1rem/1.7 system-ui, "Segoe UI", Roboto, sans-serif; color:var(--ag-text); }
    .pst-quill .ql-editor { min-height:360px; padding:18px 22px; }
    .pst-quill .ql-editor:focus-visible { outline:2px solid var(--ag-gold); outline-offset:-2px; }
    .pst-quill .ql-editor.ql-blank::before { color:var(--ag-muted); font-style:normal; }
    .pst-quill .ql-snow .ql-stroke { stroke:var(--ag-text); stroke-width:2; }
    .pst-quill .ql-snow .ql-fill { fill:var(--ag-text); }
    .pst-quill .ql-snow .ql-picker { color:var(--ag-text); }
    .pst-quill .ql-snow button:hover .ql-stroke, .pst-quill .ql-snow .ql-active .ql-stroke, .pst-quill .ql-snow .ql-picker-label:hover .ql-stroke { stroke:var(--ag-gold-2); }
    .pst-quill .ql-snow button:hover .ql-fill, .pst-quill .ql-snow .ql-active .ql-fill { fill:var(--ag-gold-2); }
    .pst-quill .ql-snow button.ql-active { background:var(--ag-gold-dim); }
    .pst-quill .ql-snow .ql-picker-options { background:var(--ag-panel-2); border-color:var(--ag-line-2); }
    .pst-quill .ql-snow .ql-tooltip { z-index:3; background:var(--ag-panel-2); border-color:var(--ag-line-2); color:var(--ag-text); box-shadow:0 8px 24px rgba(0,0,0,.6); }
    .pst-quill .ql-snow .ql-tooltip input[type=text] { background:var(--ag-panel); color:var(--ag-text); border-color:var(--ag-line-2); }
    .pst-quill .ql-snow .ql-tooltip a { color:var(--ag-gold-2); }
    .pst-quill .ql-editor h2, .pst-quill .ql-editor h3, .pst-quill .ql-editor h4 { color:#fff; font-family:var(--ag-display); letter-spacing:.03em; }
    .pst-quill .ql-editor blockquote { border-left:3px solid var(--ag-gold); color:var(--ag-text-2); }
    .pst-quill .ql-editor a { color:var(--ag-gold-2); }
    .pst-quill .ql-editor img { max-width:100%; height:auto; }
    .pst-quill .ql-snow .ql-editor pre.ql-syntax, .pst-quill .ql-editor .ql-code-block-container { background:var(--ag-bg); color:var(--ag-text); border-radius:4px; }

    /* ---------- Dialogs ---------- */
    .pst-confirm-modal { width:min(560px, 94vw) !important; max-width:none !important; }
    .pst-confirm-modal .umap-modal-body { display:grid; gap:12px; background:var(--ag-panel); color:var(--ag-text); }
    .pst-confirm-modal .umap-modal-body p { margin:0; font-size:.9rem; }
    .pst-confirm-modal .umap-modal-footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
    .pst-confirm-facts { display:grid; grid-template-columns:auto 1fr; gap:8px 14px; margin:0; font-size:.88rem; }
    .pst-confirm-facts dt { color:var(--ag-muted); font:600 .7rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; padding-top:3px; }
    .pst-confirm-facts dd { margin:0; color:var(--ag-text); overflow-wrap:anywhere; }
    .pst-confirm-warning { padding:8px 12px; border-left:3px solid var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .pst-done-links { display:flex; flex-wrap:wrap; gap:8px; }

    /* ---------- The library ---------- */
    .pst-library { display:grid; gap:12px; }
    .pst-library-bar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
    .pst-drop { position:relative; flex:1 1 280px; display:grid; justify-items:center; gap:2px; padding:16px; border:2px dashed var(--ag-line-2); border-radius:6px; color:var(--ag-text-2); text-align:center; cursor:pointer; }
    .pst-drop input[type=file] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
    .pst-drop small { color:var(--ag-muted); font-size:.76rem; }
    .pst-drop:hover, .pst-drop.is-over { border-color:var(--ag-gold); color:var(--ag-gold-2); background:var(--ag-gold-dim); }
    .pst-uploading { margin:0; color:var(--ag-cyan); font-size:.85rem; }
    .pst-library-body { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:start; }
    .pst-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; margin:0; padding:0; list-style:none; }
    .pst-grid li button { display:block; width:100%; aspect-ratio:1; padding:0; overflow:hidden; border:2px solid var(--ag-line-2); border-radius:4px; background:var(--ag-panel-2); }
    .pst-grid li button:hover { border-color:var(--ag-gold); }
    .pst-grid li.is-selected button { border-color:var(--ag-gold-2); box-shadow:0 0 0 2px var(--ag-gold-dim); }
    .pst-grid img { width:100%; height:100%; object-fit:cover; }
    .pst-file { display:grid; place-content:center; gap:4px; height:100%; padding:8px; color:var(--ag-red-2); font:700 1.4rem var(--ag-display); }
    .pst-file small { color:var(--ag-muted); font:.7rem var(--ag-mono); word-break:break-all; }
    .pst-details { width:280px; display:grid; gap:10px; padding:12px; border:1px solid var(--ag-line-2); border-radius:6px; background:var(--ag-panel); }
    .pst-details img { width:100%; max-height:180px; object-fit:contain; background:var(--ag-panel-2); border-radius:4px; }
    .pst-details dl { display:grid; grid-template-columns:auto 1fr; gap:4px 10px; margin:0; font-size:.8rem; }
    .pst-details dt { color:var(--ag-muted); }
    .pst-details dd { margin:0; color:var(--ag-text); word-break:break-all; }
    .pst-details-actions { display:flex; flex-wrap:wrap; gap:8px; }
    .pst-library-modal { width:min(1100px, 96vw) !important; max-width:none !important; }
    .pst-library-modal .umap-modal-body { background:var(--ag-bg); color:var(--ag-text); }

    /* The preview: a banner that stays, and the width of a computer or a phone. */
    .pst-preview-modal { width:min(980px, 96vw) !important; max-width:none !important; }
    .pst-preview-modal .umap-modal-body { background:var(--ag-bg); padding-top:0 !important; }
    .pst-preview-modal .umap-modal-footer { display:flex; justify-content:flex-end; }
    .pst-preview-bar { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 14px; margin:0 -16px 16px; padding:10px 16px; border-bottom:1px solid var(--ag-gold); background:var(--ag-panel-3); }
    .pst-preview-banner { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin:0; color:var(--ag-text-2); font-size:.82rem; }
    .pst-preview-banner strong { color:var(--ag-gold-2); font:600 .76rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .pst-preview-frame { margin:0 auto; transition:max-width .2s; max-width:100%; }
    .pst-preview-frame.is-phone { max-width:390px; padding:14px; border:1px solid var(--ag-line-2); border-radius:22px; background:var(--ag-panel); }
    .pst-preview-frame.is-phone .pst-article-head h1 { font-size:1.7rem; }

    /* ---------- Lists ---------- */
    .pst-tabs { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:10px; border-bottom:1px solid var(--ag-line-2); }
    .pst-tabs button { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--ag-text-2); font:600 .76rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .pst-tabs button.is-on { border-bottom-color:var(--ag-gold); color:var(--ag-gold-2); }
    .pst-tab-count { min-width:20px; padding:0 6px; border-radius:999px; background:var(--ag-panel-3); color:var(--ag-text-2); font-size:.7rem; text-align:center; }
    .pst-tabs button.is-on .pst-tab-count { background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .pst-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; }
    .pst-filters input, .pst-filters select { width:auto; max-width:240px; }
    .pst-filters .pst-filter-search { flex:1 1 220px; max-width:360px; }
    .pst-table { width:100%; border-collapse:collapse; }
    .pst-table th { padding:8px 10px; border-bottom:1px solid var(--ag-line-2); color:var(--ag-muted); font:600 .7rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; text-align:left; white-space:nowrap; }
    .pst-table td { padding:10px; border-bottom:1px solid var(--ag-line); color:var(--ag-text); font-size:.88rem; vertical-align:top; }
    .pst-table td small { display:block; color:var(--ag-muted); font-size:.76rem; }
    .pst-table th:first-child { width:44%; }
    .pst-row-owner > div { min-width:150px; }
    .pst-table tbody tr:hover { background:var(--ag-panel-2); }
    .pst-row-title { display:flex; gap:12px; min-width:0; }
    .pst-row-title > div { display:grid; gap:3px; min-width:0; }
    .pst-row-title img, .pst-thumb-empty { flex:none; width:80px; aspect-ratio:16 / 9; height:auto; object-fit:cover; border-radius:3px; border:1px solid var(--ag-line-2); }
    .pst-thumb-empty { display:grid; place-items:center; color:var(--ag-muted); background:var(--ag-panel-2); }
    .pst-row-title a { color:#fff; font-weight:600; text-decoration:none; }
    .pst-row-title a:hover { color:var(--ag-gold-2); }
    .pst-row-excerpt { display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
    .pst-row-cats { color:var(--ag-gold-2) !important; }
    .pst-row-state { display:grid; justify-items:start; gap:6px; }
    .pst-row-owner { display:flex; align-items:center; gap:8px; }
    .pst-table td small.name-line { display:flex; align-items:center; gap:6px; margin-top:2px; }
    .pst-row-actions { text-align:right; white-space:nowrap; }
    .pst-row-actions > * { margin:0 0 4px 4px; }
    .pst-row-confirm { display:inline-flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px; }
    .pst-row-confirm small { display:inline !important; color:var(--ag-red-2) !important; }
    .pst-pager { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:14px; color:var(--ag-text-2); font-size:.85rem; }

    /* Reading cards. */
    .pst-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
    .pst-card { display:grid; grid-template-rows:auto 1fr; overflow:hidden; border:1px solid var(--ag-line-2); border-radius:6px; background:var(--ag-panel); color:var(--ag-text); text-decoration:none; transition:border-color .15s, transform .15s; }
    .pst-card:hover { border-color:var(--ag-gold); transform:translateY(-2px); color:var(--ag-text); }
    .pst-card > img, .pst-card-blank { width:100%; aspect-ratio:16 / 9; object-fit:cover; }
    .pst-card-blank { display:grid; place-items:center; background:linear-gradient(140deg, var(--ag-panel-3), var(--ag-panel-2)); color:var(--ag-line-2); font-size:2.4rem; }
    .pst-card-text { display:grid; gap:6px; align-content:start; padding:14px 16px; }
    .pst-card-text strong { color:#fff; font:700 1.25rem/1.15 var(--ag-display); letter-spacing:.02em; }
    .pst-card-text p { margin:0; color:var(--ag-text-2); font-size:.88rem; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
    .pst-more { display:flex; justify-content:center; margin-top:16px; }

    /* ---------- The article ---------- */
    .pst-article { max-width:820px; margin:0 auto 32px; color:var(--ag-text); }
    .pst-preview-mark { display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:8px 12px; border:1px dashed var(--ag-gold); border-radius:4px; color:var(--ag-gold-2); font-size:.85rem; }
    .pst-hero { display:block; width:100%; aspect-ratio:2 / 1; object-fit:cover; border-radius:6px; margin-bottom:18px; }
    .pst-article-head { display:grid; gap:10px; margin-bottom:20px; padding-bottom:14px; border-bottom:1px solid var(--ag-line-2); }
    .pst-article-head h1 { margin:0; color:#fff; font:700 clamp(1.8rem, 3.6vw, 2.6rem)/1.1 var(--ag-display); letter-spacing:.02em; overflow-wrap:anywhere; }
    .pst-lead { margin:0; color:var(--ag-text-2); font-size:1.08rem; line-height:1.5; }
    .pst-content { font:1.05rem/1.75 system-ui, "Segoe UI", Roboto, sans-serif; color:var(--ag-text); overflow-wrap:anywhere; }
    .pst-content h2, .pst-content h3, .pst-content h4 { margin:1.6em 0 .5em; color:#fff; font-family:var(--ag-display); letter-spacing:.03em; }
    .pst-content p { margin:0 0 1em; }
    .pst-content a { color:var(--ag-gold-2); }
    .pst-content img { max-width:100%; height:auto; border-radius:4px; }
    .pst-content blockquote { margin:1.2em 0; padding:.4em 1em; border-left:3px solid var(--ag-gold); color:var(--ag-text-2); }
    .pst-content pre { padding:12px; border-radius:4px; background:var(--ag-panel-2); overflow:auto; }
    .pst-content table { width:100%; border-collapse:collapse; margin:1em 0; }
    .pst-content th, .pst-content td { padding:6px 10px; border:1px solid var(--ag-line-2); }
    .pst-content .ql-align-center { text-align:center; }
    .pst-content .ql-align-right { text-align:right; }
    .pst-content .ql-align-justify { text-align:justify; }
    .pst-tags { display:flex; flex-wrap:wrap; gap:8px; margin-top:24px; padding-top:12px; border-top:1px solid var(--ag-line); color:var(--ag-cyan); font:.82rem var(--ag-mono); }

    /* ---------- Categories (administrators) ---------- */
    .pst-categories { display:grid; grid-template-columns:340px minmax(0,1fr); gap:18px; align-items:start; padding-bottom:32px; }
    .pst-category-list { display:grid; gap:2px; margin:0; padding:0; list-style:none; }
    .pst-category-list li { display:flex; justify-content:space-between; gap:10px; padding:8px 8px 8px calc(8px + var(--depth, 0) * 22px); border-bottom:1px solid var(--ag-line); color:var(--ag-text); }
    .pst-category-list code { color:var(--ag-muted); font-size:.74rem; }
    .pst-category-list small { display:block; color:var(--ag-muted); font-size:.78rem; }
    .pst-list, .pst-feed, .pst-library { padding-bottom:32px; }

    /* Medium screens: the side panel can be folded away to write wider. */
    @media (min-width: 1101px) and (max-width: 1440px) {
        .pst-side-toggle { display:inline-flex; }
        .pst-editor { grid-template-columns:minmax(0,1fr) 290px; }
    }
    @media (max-width: 1100px) {
        .pst-scroll { overflow:visible; padding-right:0; }
        .pst-editor { grid-template-columns:minmax(0,1fr); grid-template-areas:"main" "side" "bar"; }
        .pst-categories { grid-template-columns:1fr; }
        .pst-library-body { grid-template-columns:1fr; }
        .pst-details { width:auto; }
        .pst-actionbar { bottom:calc(var(--ux-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px)); }
    }
    @media (max-width: 640px) {
        .pst-hide-sm { display:none; }
        /* The list: tabs that scroll sideways, and each publication as a block (title, marks, actions) instead of a table row. */
        .pst-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
        .pst-tabs button { flex:none; }
        .pst-table thead { display:none; }
        .pst-table, .pst-table tbody, .pst-table tr, .pst-table td { display:block; width:100%; }
        .pst-table tr { display:grid; gap:8px; padding:12px 0; border-bottom:1px solid var(--ag-line); }
        .pst-table td { padding:0; border:0; }
        .pst-table td.pst-hide-sm { display:none; }
        .pst-row-state { display:flex; flex-wrap:wrap; align-items:center; }
        .pst-row-actions { text-align:left; white-space:normal; }
        .pst-row-actions > * { margin:0 4px 4px 0; }
        .pst-row-title img, .pst-thumb-empty { width:72px; }
        .pst-filters select, .pst-filters input { max-width:none; flex:1 1 140px; }
        .pst-owner-options { grid-template-columns:1fr; }
        /* The side boxes fold: their heading opens and closes them. */
        .pst-box-toggle { cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
        .pst-box-toggle::after { content:"▾"; color:var(--ag-gold-2); transition:transform .15s; }
        .pst-box.is-closed .pst-box-toggle::after { transform:rotate(-90deg); }
        .pst-side .pst-box.is-closed h2 { margin-bottom:0; padding-bottom:0; border-bottom:0; }
        .pst-side .pst-box.is-closed .pst-box-body { display:none; }
        .pst-actionbar { margin:0 -12px; border-radius:0; padding:8px 12px; }
        .pst-actionbar-buttons { width:100%; }
        .pst-actionbar-buttons .btn-primary { flex:1 1 100%; order:-1; }
        .pst-crops { grid-template-columns:1fr; }
    }
}


/* ==== federal-license.css ==== */
/* =====================================================================
   The federal license (LicenseCard.razor): an ID-1 card (85.60 × 53.98 mm), front and back.
   --mm is one millimetre of the card (the card is a container: 100cqw = 85.6 mm), so every piece is placed and sized
   in millimetres, exactly as in the PDF of the server (LicensePdf.cs): what one shows, the other prints. Printed, the
   card is 85.6 mm wide and --mm is a real millimetre. Nothing that must stay is closer than 3 mm to the edge.
   Also the rank symbols (RankInsignia.razor), the "Mi licencia" page and the "Adhesiones" page.
   ===================================================================== */
@font-face { font-family:"FCC Card"; src:url("fonts/Roboto-Regular.ttf") format("truetype"); font-weight:400; font-display:swap; }
@font-face { font-family:"FCC Card"; src:url("fonts/Roboto-Bold.ttf") format("truetype"); font-weight:700; font-display:swap; }

.flic { --flic-width:520px; display:flex; flex-wrap:wrap; align-items:flex-start; gap:20px; }
.flic-caption { flex-basis:100%; margin:0; color:#8fd8e6; font:600 .78rem var(--font-mono, monospace); letter-spacing:.08em; text-transform:uppercase; }
.flic-card {
    --mm:calc(100cqw / 85.6);
    position:relative; container-type:inline-size; overflow:hidden; flex:0 1 var(--flic-width); width:100%; max-width:var(--flic-width);
    aspect-ratio:85.6 / 53.98; border-radius:3.71% / 5.89%;
    background:linear-gradient(135deg, #3a3d42 0%, #26282c 55%, #17181a 100%);
    color:#f2f3f5; font-family:"FCC Card", Roboto, "Segoe UI", Arial, sans-serif; line-height:1.12;
    box-shadow:0 0 0 1px rgba(255,255,255,.18), 0 10px 30px rgba(0,0,0,.45);
}
.flic-card > * { position:absolute; margin:0; }
.flic-watermark { inset:0; width:100%; height:100%; color:#fff; opacity:.06; pointer-events:none; }
.flic-label { display:block; color:#b7bdc4; font-size:calc(var(--mm) * 1.52); font-weight:700; letter-spacing:.04em; text-transform:uppercase; line-height:1.25; }

/* Front */
.flic-logo { left:calc(var(--mm) * 3); top:calc(var(--mm) * 3); height:calc(var(--mm) * 5.6); width:auto; }
.flic-logo.is-small { height:calc(var(--mm) * 4.6); }
.flic-number {
    right:calc(var(--mm) * 3); top:calc(var(--mm) * 3.6); display:flex; align-items:center; gap:calc(var(--mm) * 1.2);
    font-size:calc(var(--mm) * 2.54); font-weight:700; letter-spacing:.02em; white-space:nowrap;
}
.flic-flag { width:calc(var(--mm) * 4.2); height:calc(var(--mm) * 2.8); flex:none; }
.flic-flag.is-code { display:inline-grid; place-items:center; width:auto; height:auto; padding:0 calc(var(--mm) * .7); border-radius:calc(var(--mm) * .4); background:#fff; color:#111; font-size:calc(var(--mm) * 1.9); }
.flic-photo {
    left:calc(var(--mm) * 3); top:calc(var(--mm) * 11); width:calc(var(--mm) * 18); height:calc(var(--mm) * 22.5); overflow:hidden;
    display:grid; place-items:center; border-radius:calc(var(--mm) * 1); background:#d9dde2; color:#55606b; font-size:calc(var(--mm) * 7); font-weight:700;
}
.flic-photo img { width:100%; height:100%; object-fit:cover; }
.flic-name { left:calc(var(--mm) * 24); top:calc(var(--mm) * 11); width:calc(var(--mm) * 58.6); }
.flic-name strong {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden;
    font-weight:700; line-height:1.12; overflow-wrap:break-word; hyphens:manual;
}
.flic-name .is-n1 { font-size:calc(var(--mm) * 3.35); }
.flic-name .is-n2 { font-size:calc(var(--mm) * 3.0); }
.flic-name .is-n3 { font-size:calc(var(--mm) * 2.65); }
.flic-name .is-n4 { font-size:calc(var(--mm) * 2.33); }
.flic-name .is-n5 { font-size:calc(var(--mm) * 2.0); }
.flic-fields { left:calc(var(--mm) * 24); top:calc(var(--mm) * 22); width:calc(var(--mm) * 34); display:grid; gap:calc(var(--mm) * 1); }
.flic-fields dd {
    margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:calc(var(--mm) * 2.3); font-weight:700;
}
.flic-fields dd.is-alias { font-size:calc(var(--mm) * 2.47); }
/* The rank: its symbol, then its code, the label and its name, all centred in the column (60 to 82.6 mm). */
.flic-rank { left:calc(var(--mm) * 60); top:calc(var(--mm) * 15); width:calc(var(--mm) * 22.6); height:calc(var(--mm) * 20.8); }
.flic-rank > * { position:absolute; left:0; width:100%; text-align:center; }
.flic-rank .rank-ins { left:calc(50% - var(--mm) * 5); top:0; width:calc(var(--mm) * 10); height:calc(var(--mm) * 10); }
.flic-rank-code { top:calc(var(--mm) * 10.4); font-size:calc(var(--mm) * 3.35); font-weight:700; white-space:nowrap; }
.flic-rank-label { top:calc(var(--mm) * 14.2); }
.flic-rank-name {
    top:calc(var(--mm) * 16.1); display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2;
    overflow:hidden; font-size:calc(var(--mm) * 2.12); font-weight:700;
}
.flic-barcode {
    left:calc(var(--mm) * 3); top:calc(var(--mm) * 42.3); width:calc(var(--mm) * 79.6); height:calc(var(--mm) * 8.68);
    padding:calc(var(--mm) * .8) 0; border-radius:calc(var(--mm) * 1); background:#fff; box-sizing:border-box;
}
.flic-barcode svg { display:block; width:100%; height:100%; }
/* The stamp of an expired or annulled card: over the photo (front) or the insignia (back), never over the data. */
.flic-stamp {
    left:calc(var(--mm) * 12); top:calc(var(--mm) * 22.25); padding:calc(var(--mm) * .7) calc(var(--mm) * 1.4); border:calc(var(--mm) * .42) solid #e5484d;
    border-radius:calc(var(--mm) * .8); color:#e5484d; background:rgba(24,25,27,.8); font-size:calc(var(--mm) * 3.1); font-weight:700; letter-spacing:.04em;
    text-transform:uppercase; transform:translate(-50%, -50%) rotate(-14deg); white-space:nowrap; line-height:1;
}
.flic-back .flic-stamp { left:calc(var(--mm) * 15); top:calc(var(--mm) * 22.5); }
.flic.is-expired .flic-photo img, .flic.is-annulled .flic-photo img { filter:grayscale(.7); }

/* Back */
.flic-title {
    right:calc(var(--mm) * 3); top:calc(var(--mm) * 3.8); max-width:calc(var(--mm) * 64.6); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    color:#e9ecef; font-family:inherit; font-size:calc(var(--mm) * 2.19); font-weight:700; letter-spacing:.02em; text-transform:none; line-height:1.12;
}
.flic-insignia {
    left:calc(var(--mm) * 3); top:calc(var(--mm) * 10.5); width:calc(var(--mm) * 24); height:calc(var(--mm) * 24);
    display:grid; place-items:center; box-sizing:border-box;
}
.flic-insignia img { width:100%; height:100%; object-fit:contain; }
/* An opaque insignia (white square or coloured background) sits on a deliberate light plate, its corners like the card's. */
.flic-insignia.is-plate { padding:calc(var(--mm) * 1.6); border-radius:calc(var(--mm) * 1.8); background:#fff; box-shadow:inset 0 0 0 calc(var(--mm) * .2) rgba(0,0,0,.08); }
.flic-insignia.is-none img { height:auto; }
.flic-back-fields { left:calc(var(--mm) * 30); top:calc(var(--mm) * 10.5); width:calc(var(--mm) * 27); }
.flic-back-fields dd { font-size:calc(var(--mm) * 2.12); }
.flic-back-fields dd.is-unit { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; font-size:calc(var(--mm) * 2.3); }
.flic-back-fields dd.flic-code { color:#b7bdc4; font-size:calc(var(--mm) * 1.76); font-weight:400; }
.flic-back-fields dd.is-number { font-size:calc(var(--mm) * 1.98); letter-spacing:.02em; }
.flic-qr { right:calc(var(--mm) * 3); top:calc(var(--mm) * 10.5); width:calc(var(--mm) * 19); height:calc(var(--mm) * 19); border-radius:calc(var(--mm) * .8); }
.flic-verify {
    right:calc(var(--mm) * 3); top:calc(var(--mm) * 30.3); width:calc(var(--mm) * 24.1); text-align:right;
    color:#b7bdc4; font-size:calc(var(--mm) * 1.62); line-height:1.15;
}
.flic-verify.is-pending { top:calc(var(--mm) * 10.5); }
/* Who issues it and what it is not: as far from the bottom edge as the logo is from the top (3 mm). */
.flic-foot { left:calc(var(--mm) * 3); bottom:calc(var(--mm) * 3); width:calc(var(--mm) * 79.6); }
.flic-foot > * { margin:0; }
.flic-org { font-size:calc(var(--mm) * 2.12); font-weight:700; margin-bottom:calc(var(--mm) * .5) !important; }
.flic-disclaimer { color:#b7bdc4; font-size:calc(var(--mm) * 1.62); line-height:1.15; }

/* One side on the screen when asked (the tabs of "Mi licencia"); both are printed. */
.flic.show-front .flic-back, .flic.show-back .flic-front { display:none; }

/* ---------- Rank symbols ---------- */
.rank-ins { display:block; flex:none; }
.rank-ins.is-aspirant path { fill:#9aa7b4; }
.rank-ins.is-troops path { fill:#cfd6dd; stroke:#5c6670; stroke-width:.8; }
.rank-ins.is-nco path, .rank-ins.is-officer path, .rank-ins.is-general path { fill:#e3c06b; stroke:#7a5c1c; stroke-width:.8; }
.flic .rank-ins path { stroke:none; }
.flic .rank-ins.is-troops path, .flic .rank-ins.is-aspirant path { fill:#d9dde2; }

/* ---------- Mi licencia (Unit Control) ---------- */
.lic-page { display:grid; grid-template-columns:minmax(0, 1fr); gap:20px; padding-bottom:40px; }
.lic-page > * { min-width:0; }
.lic-panel { padding:18px 20px; border:1px solid var(--line-2, #2a3a4a); border-radius:8px; background:var(--panel, #0a0f15); }
.lic-panel h2 { margin:0 0 12px; font-size:1.15rem; }
.lic-badge { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:4px; font:600 .74rem var(--font-mono, monospace); letter-spacing:.08em; text-transform:uppercase; }
.lic-badge.is-valid, .lic-badge.is-ok { background:rgba(63,191,127,.15); color:#3fbf7f; border:1px solid rgba(63,191,127,.4); }
.lic-badge.is-expiring, .lic-badge.is-warn { background:rgba(227,192,107,.15); color:#e3c06b; border:1px solid rgba(227,192,107,.4); }
.lic-badge.is-expired, .lic-badge.is-rejected, .lic-badge.is-annulled, .lic-badge.is-danger { background:rgba(229,72,77,.14); color:#ff8a90; border:1px solid rgba(229,72,77,.4); }
.lic-badge.is-pending, .lic-badge.is-info { background:rgba(103,199,217,.14); color:#8fd8e6; border:1px solid rgba(103,199,217,.4); }
.lic-badge.is-notfederated, .lic-badge.is-approved, .lic-badge.is-neutral { background:rgba(255,255,255,.06); color:#c8d0d8; border:1px solid rgba(255,255,255,.18); }

/* 1. Status: a coloured edge for its tone, the state, a title and what to do. */
.lic-status { display:grid; gap:8px; justify-items:start; border-left-width:4px; }
.lic-status h2 { margin:0; font-size:1.25rem; }
.lic-status p { margin:0; }
.lic-status.is-ok { border-left-color:#3fbf7f; }
.lic-status.is-warn { border-left-color:#e3c06b; }
.lic-status.is-danger { border-left-color:#e5484d; }
.lic-status.is-info { border-left-color:#67c7d9; }

/* 2. Preview: tabs front/back, zoom, the card at the chosen width (scrolls sideways when larger than the panel). */
.lic-preview-head { display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; margin-bottom:14px; }
.lic-preview-head h2 { margin:0; margin-right:auto; }
.lic-tabs { display:inline-flex; border:1px solid var(--line-2, #2a3a4a); border-radius:6px; overflow:hidden; }
.lic-tabs button { padding:6px 14px; border:0; background:transparent; color:inherit; font:600 .82rem var(--font-mono, monospace); letter-spacing:.06em; text-transform:uppercase; cursor:pointer; }
.lic-tabs button.is-active { background:var(--gold, #c9a24a); color:#0b0f14; }
.lic-tabs button:focus-visible { outline:2px solid #8fd8e6; outline-offset:-2px; }
.lic-zoom { display:inline-flex; align-items:center; gap:8px; font:600 .82rem var(--font-mono, monospace); }
.lic-zoom span { min-width:4.5ch; text-align:center; }
.lic-stage { overflow-x:auto; padding:6px 2px 10px; }
/* At the default size the card never gets wider than the panel; zoomed in, it may (the stage scrolls sideways). */
.lic-stage .flic-card { flex:none; width:min(var(--flic-width), 100%); }
.lic-stage.is-zoomed .flic-card { width:var(--flic-width); }

/* 3. Actions: each on its own row, the reason under one that cannot be used. */
.lic-actions-zone { display:grid; gap:14px; }
.lic-actions-zone h2 { margin-bottom:0; }
.lic-action { display:grid; gap:8px; padding-top:12px; border-top:1px solid var(--line, #1b2632); }
.lic-action:first-of-type { border-top:0; padding-top:0; }
.lic-action-main { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 14px; }
.lic-bleed { display:grid; gap:4px; }
.lic-bleed span { color:var(--muted, #9aa8b5); font-size:.82rem; }
.lic-bleed select { min-width:220px; }
.lic-howto summary { cursor:pointer; color:#8fd8e6; }
.lic-howto ol { margin:8px 0 0; padding-left:1.3rem; display:grid; gap:4px; }
.lic-why { color:#e3c06b; font-size:.9rem; }
.lic-action > .btn { justify-self:start; }
/* Two actions side by side with a line between them; one under the other on a phone. */
.lic-action-row { display:grid; grid-template-columns:1fr auto 1fr; gap:14px 24px; align-items:start; }
.lic-action-row > .lic-action { border-top:0; padding-top:0; }
.lic-action-sep { align-self:stretch; width:1px; background:var(--line, #1b2632); }
@media (max-width: 640px) {
    .lic-action-row { grid-template-columns:1fr; }
    .lic-action-sep { width:auto; height:1px; }
}

.lic-checks { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.lic-checks li { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.lic-checks .is-ok { color:#3fbf7f; }
.lic-checks .is-missing { color:#ff8a90; }
.lic-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:14px 18px; }
.lic-form label > span { display:block; margin-bottom:4px; color:var(--muted, #9aa8b5); font-size:.82rem; }
.lic-preview-number { font:700 1.1rem var(--font-mono, monospace); letter-spacing:.08em; color:#e3c06b; overflow-wrap:anywhere; }
.lic-buttons, .lic-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.lic-note { color:var(--muted, #9aa8b5); font-size:.9rem; margin:0; }

/* History: a table with its headers; on a phone each request is a card with its labels. */
.lic-table { width:100%; border-collapse:collapse; }
.lic-table th { padding:8px 10px; color:var(--muted, #9aa8b5); font:600 .74rem var(--font-mono, monospace); letter-spacing:.06em; text-transform:uppercase; text-align:left; border-bottom:1px solid var(--line-2, #2a3a4a); }
.lic-table td { padding:10px; border-bottom:1px solid var(--line, #1b2632); vertical-align:top; }
@media (max-width: 700px) {
    .lic-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
    .lic-table, .lic-table tbody, .lic-table tr, .lic-table td { display:block; width:100%; }
    .lic-table tr { margin-bottom:10px; padding:10px 12px; border:1px solid var(--line-2, #2a3a4a); border-radius:6px; }
    .lic-table td { display:grid; grid-template-columns:9rem minmax(0, 1fr); gap:8px; padding:4px 0; border:0; }
    .lic-table td::before { content:attr(data-label); color:var(--muted, #9aa8b5); font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; }
    .lic-bleed select { min-width:0; width:100%; }
    .lic-preview-head h2 { flex-basis:100%; }
}

/* ---------- Adhesiones (panel) ---------- */
.adh { display:grid; grid-template-columns:minmax(0, 420px) minmax(0, 1fr); gap:18px; align-items:start; }
.adh-items { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.adh-items button { display:grid; gap:2px; width:100%; padding:10px 12px; border:1px solid var(--line-2, #2a3a4a); border-radius:6px; background:transparent; color:inherit; text-align:left; cursor:pointer; }
.adh-items button.is-active, .adh-items button:hover { border-color:var(--gold, #c9a24a); }
.adh-items small { color:var(--muted, #9aa8b5); }
.adh-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.adh-detail { display:grid; gap:16px; }
.adh-detail .flic { --flic-width:420px; }
.adh-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:8px 18px; margin:0; }
.adh-facts dt { color:var(--muted, #9aa8b5); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; }
.adh-facts dd { margin:0; }
.adh-box { display:grid; gap:10px; padding:12px 14px; border:1px solid var(--line-2, #2a3a4a); border-radius:6px; }
.adh-box h3 { margin:0; font-size:.95rem; }
.adh-insignia { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.adh-insignia .flic-swatch { width:64px; height:64px; display:grid; place-items:center; border-radius:6px; background:linear-gradient(135deg, #3a3d42, #17181a); }
.adh-insignia .flic-swatch img { max-width:52px; max-height:52px; }
.adh-insignia .flic-swatch.is-plate span { display:grid; place-items:center; width:54px; height:54px; padding:5px; border-radius:6px; background:#fff; }
.adh-insignia .flic-swatch.is-plate img { max-width:100%; max-height:100%; }
@media (max-width: 900px) { .adh { grid-template-columns:1fr; } }


/* ==== cmd-core.css ==== */
/* Unit Control: what the command screens add to the administration panel's styles (agency.css and friends), split by
   screen into cmd-*.css (this file first: shared states, the sidebar, authority and echelon, the units tree, the unit
   form and the map list; then staff, graph, map-create, recruitment, dossier, affiliations, ux and territory).
   Everything is in the app layer (tokens.css declares the layers), so it wins over the shared styles whatever their
   specificity. The few !important declarations (forced layer) and the Leaflet chrome (unlayered) are in cmd-territory.css. */
@layer app {
    /* ---------- Shared states that the app rules below must not hide ----------
       These shared rules (agency.css) beat the app rules below by specificity before the layers existed; restated here so
       they still do: the focus of a button drops its shadow, a secondary or an outline button on paper keeps its hover,
       and the menu of an operator card inside a record panel keeps the paper focus and disabled look. */
    .entity-admin-shell .btn:focus-visible, .entity-admin-shell .btn:focus:not(:focus-visible) { box-shadow:none; }
    .entity-details-panel .btn-secondary:hover, .entity-details-panel .btn-outline-secondary:hover {
        border-style:solid;
        background:rgba(31,27,20,.08);
        color:var(--ink);
    }
    .entity-details-panel :where(.cmd-cards, .uc-inspector-actions, .agency-image-actions) .btn-outline-primary:hover:not(:disabled) {
        background:var(--ink);
        color:var(--paper);
    }
    .entity-details-panel :where(.cmd-card-menu) .form-select:focus {
        border-bottom-color:var(--stamp);
        background-color:rgba(255,253,245,.8);
    }
    .entity-details-panel :where(.cmd-card-menu) .form-select:disabled {
        border-bottom-style:dashed;
        background-color:rgba(120,100,60,.08);
        color:var(--ink-muted);
    }

    /* ---------- Sidebar: the operator's command ---------- */
    .cmd-card {
        margin:14px 12px 0;
        padding:10px 12px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,rgba(201,162,74,.08),transparent);
    }
    .cmd-card small {
        display:block;
        color:var(--ag-muted);
        font-size:.58rem;
        letter-spacing:.18em;
        text-transform:uppercase;
    }
    .cmd-card strong {
        display:block;
        margin:2px 0 8px;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.8rem;
        letter-spacing:.06em;
    }
    .cmd-card-figures {
        display:grid;
        grid-template-columns:repeat(3,1fr);
        gap:6px;
    }
    .cmd-card-figures span {
        display:flex;
        flex-direction:column;
        color:var(--ag-text-2);
        font-size:.56rem;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .cmd-card-figures b {
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:1.15rem;
        font-weight:600;
        letter-spacing:.02em;
    }

    /* ---------- Authority, posts and echelon ---------- */
    .cmd-authority {
        display:inline-block;
        padding:1px 6px;
        border:1px solid currentColor;
        font-size:.56rem;
        font-weight:600;
        letter-spacing:.14em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .cmd-owner-tag {
        display:inline-block;
        padding:1px 6px;
        border:1px solid var(--ag-green);
        color:var(--ag-green);
        font-size:.56rem;
        font-weight:600;
        letter-spacing:.12em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .entity-details-panel .cmd-owner-tag {
        border-color:#2f7d4f;
        color:#2f7d4f;
    }
    .cmd-note {
        flex:none;
        margin-bottom:10px;
        padding:8px 12px;
        border:1px solid var(--ag-line-2);
        background:rgba(201,162,74,.06);
        color:var(--ag-text-2);
        font-size:.7rem;
    }
    .cmd-inactive-tag {
        display:inline-block;
        margin-left:4px;
        padding:1px 6px;
        border:1px dashed currentColor;
        color:var(--uc-red);
        font-size:.54rem;
        letter-spacing:.1em;
        text-transform:uppercase;
    }

    .cmd-echelon {
        display:grid;
        gap:3px;
        min-width:0;
    }
    .cmd-echelon-head {
        display:flex;
        justify-content:space-between;
        gap:8px;
        font-size:.62rem;
        letter-spacing:.06em;
    }
    .cmd-echelon-now {
        display:inline-flex;
        align-items:center;
        gap:6px;
        color:var(--ag-text);
        text-transform:uppercase;
    }
    .cmd-echelon-now::before {
        content:"";
        width:8px;
        height:8px;
        border-radius:50%;
        background:var(--swatch,#888);
        box-shadow:0 0 6px var(--swatch,#888);
    }
    .cmd-echelon-count {
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
    }
    .cmd-echelon small {
        color:var(--ag-muted);
        font-size:.6rem;
    }
    .entity-details-panel .cmd-echelon-now { color:var(--ink-2); }

    /* ---------- My units: tree of the command ---------- */
    .cmd-tree-search {
        position:relative;
        display:flex;
        flex:none;
        align-items:center;
        gap:8px;
        padding:8px 12px;
        border-bottom:1px solid var(--ag-line);
    }
    .cmd-tree-search .form-control {
        flex:1;
        padding-left:30px;
        border:1px solid var(--ag-line-2);
        background:#070b10;
        color:#e8edf1;
    }
    .cmd-tree-row {
        position:relative;
        display:grid;
        grid-template-columns:18px 32px minmax(0,1fr) auto;
        grid-template-areas:"toggle emblem main tags" ". . meter meter";
        align-items:center;
        gap:3px 8px;
        width:100%;
        padding:8px 12px 8px calc(12px + var(--depth,0) * 20px);
        border:0;
        border-bottom:1px solid var(--ag-line);
        border-left:3px solid transparent;
        background:transparent;
        color:var(--ag-text);
        text-align:left;
        cursor:pointer;
        outline:none;
    }
    /* The depth is drawn by .cmd-tree-guides (below), not by a pseudo-element. */
    .cmd-tree-row::before { display:none; }
    .cmd-tree-row:hover { background:rgba(201,162,74,.06); }
    .cmd-tree-row.is-selected {
        border-left-color:var(--ag-gold);
        background:linear-gradient(90deg,rgba(201,162,74,.18),transparent);
    }
    .cmd-tree-row.is-inactive { opacity:.6; }
    .cmd-tree-main {
        grid-area:main;
        display:flex;
        flex-direction:column;
        min-width:0;
    }
    .cmd-tree-main strong {
        overflow:hidden;
        color:#e8edf1;
        font-size:.8rem;
        font-weight:600;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cmd-tree-main small {
        color:#a3b1be;
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .cmd-tree-tags {
        grid-area:tags;
        display:flex;
        align-items:center;
        gap:4px;
    }
    .cmd-tree-row .cmd-echelon { grid-area:meter; }



    /* ---------- Unit form ---------- */
    .cmd-form h2 { margin-bottom:12px; }

    /* ---------- Map: list of the units of the command ---------- */
    /* One column on the left for the list and the legend: they share its height and never overlap (nor the scale). */
    .cmd-map-side {
        position:absolute;
        z-index:1000;
        top:12px;
        left:12px;
        bottom:40px;
        display:flex;
        flex-direction:column;
        gap:8px;
        width:290px;
        pointer-events:none;
    }
    .cmd-map-side > * { pointer-events:auto; }
    /* Opaque panels, no backdrop blur: the map under them moves every frame and the blur was recomputed each time. */
    .cmd-map-list {
        flex:0 1 auto;
        min-height:0;
        display:flex;
        flex-direction:column;
        overflow-y:auto;
        border:1px solid var(--ag-line-2);
        background:#080c11;
    }
    .cmd-map-list.is-collapsed, .cmd-map-legend.is-collapsed { flex:none; }
    .cmd-map-list header {
        position:sticky;
        top:0;
        z-index:1;
        flex:none;
        border-bottom:1px solid var(--ag-line);
        background:rgba(8,12,17,.98);
    }
    .cmd-map-list.is-collapsed header { border-bottom:0; }
    .cmd-map-toggle {
        display:flex;
        align-items:center;
        gap:10px;
        width:100%;
        padding:8px 12px;
        border:0;
        background:transparent;
        color:#e8edf1;
        font-family:var(--ag-display);
        font-size:.9rem;
        letter-spacing:.12em;
        text-align:left;
        text-transform:uppercase;
        cursor:pointer;
    }
    .cmd-map-toggle span { flex:1; }
    .cmd-map-toggle b {
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.72rem;
        font-weight:400;
    }
    .cmd-map-toggle i {
        color:var(--ag-text-2);
        font-style:normal;
    }
    .cmd-map-toggle:hover, .cmd-map-toggle:hover i { color:var(--ag-gold-2); }
    .cmd-map-legend {
        flex:none;
        max-height:55%;
        min-height:0;
        display:flex;
        flex-direction:column;
        margin-top:auto;
        border:1px solid var(--ag-line-2);
        background:#05090d;
    }
    .cmd-map-legend:not(.is-collapsed) .cmd-map-toggle { border-bottom:1px solid var(--ag-line); }
    /* The shared legend, docked in the column: no position of its own and no second title. */
    .cmd-map-legend .umap-legend {
        position:static;
        min-width:0;
        max-width:none;
        max-height:none;
        min-height:0;
        overflow:auto;
        border:0;
        background:transparent;
    }
    .cmd-map-legend .umap-legend > .umap-legend-title:first-child { display:none; }
    .cmd-map-list > button:first-of-type { margin-top:2px; }

} /* end of @layer app */


/* ==== cmd-staff.css ==== */
/* Unit Control · staffing board
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---------- Staffing board ---------- */
    .cmd-staff {
        flex:1;
        min-height:0;
        display:flex;
        flex-direction:column;
        gap:10px;
    }
    .cmd-staff-toolbar .form-select, .cmd-staff-toolbar .form-control, .cmd-reserve .form-control, .cmd-card-menu .form-select {
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background-color:#070b10;
        color:var(--ag-text);
    }
    .cmd-staff-search { flex:1 1 220px; }
    .cmd-staff-help {
        flex:2 1 260px;
        color:var(--ag-text-2);
        font-size:.66rem;
    }
    .cmd-staff-body {
        flex:1;
        min-height:0;
        display:grid;
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:minmax(0,1fr);
        gap:10px;
    }
    .cmd-staff-body.has-reserve { grid-template-columns:minmax(0,1fr) 300px; }

    .cmd-board {
        min-height:0;
        display:flex;
        align-items:stretch;
        gap:10px;
        overflow-x:auto;
        overflow-y:hidden;
        padding-bottom:6px;
        scroll-snap-type:x proximity;
    }
    .cmd-column {
        flex:0 0 290px;
        display:flex;
        flex-direction:column;
        min-height:0;
        border:1px solid var(--ag-line);
        background:rgba(8,12,17,.94);
        scroll-snap-align:start;
        transition:border-color .15s,box-shadow .15s;
    }
    .cmd-column.is-drop {
        border-color:var(--ag-gold);
        box-shadow:0 0 0 1px var(--ag-gold),0 0 22px rgba(227,192,107,.25);
    }
    .cmd-column.is-locked { background:repeating-linear-gradient(135deg,rgba(255,255,255,.012) 0 8px,transparent 8px 16px),rgba(8,12,17,.94); }
    .cmd-column-head {
        flex:none;
        display:grid;
        gap:4px;
        padding:10px 12px;
        border-bottom:1px solid var(--ag-line);
        background:linear-gradient(180deg,#0f1720,#0b1118);
    }
    .cmd-column-parent {
        color:var(--ag-muted);
        font-size:.6rem;
    }
    .cmd-column-name {
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:1.1rem;
        font-weight:600;
        letter-spacing:.06em;
        text-decoration:none;
        text-transform:uppercase;
    }
    .cmd-column-name:hover { color:var(--ag-gold-2); }
    .cmd-column-tags {
        display:flex;
        align-items:center;
        gap:6px;
    }
    .cmd-column-tags small {
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
    }
    .cmd-column-tags .cmd-column-count {
        margin-left:auto;
        color:var(--ag-text-2);
    }

    .cmd-posts-strip {
        flex:none;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:4px;
        padding:8px 10px;
        border-bottom:1px dashed var(--ag-line-2);
    }
    .cmd-post-slot {
        position:relative;
        display:flex;
        align-items:center;
        gap:6px;
        min-width:0;
        padding:4px 22px 4px 6px;
        border:1px solid var(--ag-line-2);
        background:#0b121a;
        font-size:.66rem;
        transition:border-color .15s,background .15s;
    }
    .cmd-post-slot b {
        flex:none;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.58rem;
    }
    .cmd-post-slot span {
        overflow:hidden;
        color:var(--ag-text);
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cmd-post-slot.is-vacant { border-style:dashed; }
    .cmd-post-slot.is-vacant span {
        color:var(--ag-muted);
        font-style:italic;
    }
    .cmd-post-slot.is-drop {
        border-color:var(--ag-gold-2);
        background:rgba(201,162,74,.18);
    }
    .cmd-post-clear {
        position:absolute;
        right:3px;
        top:50%;
        padding:0 4px;
        border:0;
        background:transparent;
        color:var(--ag-muted);
        font-size:.62rem;
        transform:translateY(-50%);
        cursor:pointer;
    }
    .cmd-post-clear:hover { color:var(--ag-red-2); }

    .cmd-cards {
        flex:1;
        min-height:60px;
        display:flex;
        flex-direction:column;
        gap:6px;
        padding:8px 10px;
        overflow-y:auto;
    }
    /* End of a list still loading: when it comes into view the next part is read (js/scroll-loader.js). */
    .cmd-more {
        flex:none;
        padding:10px 8px;
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.08em;
        text-align:center;
    }
    .cmd-more::before {
        content:"";
        display:inline-block;
        width:8px;
        height:8px;
        margin-right:8px;
        border:1px solid var(--ag-gold);
        border-right-color:transparent;
        border-radius:50%;
        vertical-align:-1px;
        animation:cmd-spin .8s linear infinite;
    }
    .cmd-more-columns {
        flex:0 0 160px;
        align-self:center;
    }
    .cmd-board-empty {
        flex:1;
        align-self:flex-start;
    }
    @keyframes cmd-spin { to { transform:rotate(360deg); } }
    .cmd-column-empty {
        padding:16px 8px;
        border:1px dashed var(--ag-line-2);
        color:var(--ag-muted);
        font-size:.66rem;
        text-align:center;
    }
    .cmd-card-op {
        position:relative;
        display:grid;
        grid-template-columns:34px minmax(0,1fr) auto;
        align-items:center;
        gap:8px;
        padding:7px 30px 7px 8px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,#101922,#0c131b);
        transition:opacity .2s,border-color .15s,transform .15s;
    }
    .cmd-card-op[draggable="true"] { cursor:grab; }
    .cmd-card-op[draggable="true"]:hover {
        border-color:var(--ag-gold);
        transform:translateY(-1px);
    }
    .cmd-card-op[draggable="true"]:active { cursor:grabbing; }
    .cmd-card-op.is-dimmed { opacity:.25; }
    .cmd-card-op.is-match {
        border-color:var(--ag-gold-2);
        box-shadow:0 0 0 1px var(--ag-gold-2);
    }
    .cmd-card-op.is-busy {
        opacity:.5;
        pointer-events:none;
    }
    .cmd-avatar {
        display:grid;
        place-items:center;
        width:34px;
        height:34px;
        border:1px solid var(--ag-gold);
        background:radial-gradient(circle at 30% 30%,rgba(227,192,107,.3),rgba(201,162,74,.05));
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:.9rem;
        font-weight:700;
        letter-spacing:.04em;
    }
    .cmd-card-text {
        display:flex;
        flex-direction:column;
        min-width:0;
    }
    .cmd-card-text strong {
        overflow:hidden;
        color:#e8edf1;
        font-size:.74rem;
        font-weight:600;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cmd-card-text small {
        overflow:hidden;
        color:var(--ag-muted);
        font-size:.6rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cmd-card-text .cmd-post-tag {
        align-self:flex-start;
        margin-top:3px;
    }
    /* The menu opens inside the card (a floating layer would be cut by the scrolling column). */
    .cmd-card-menu { position:static; }
    .cmd-card-menu.is-open { grid-column:1 / -1; }
    .cmd-card-menu-toggle {
        position:absolute;
        right:4px;
        top:6px;
        padding:2px 6px;
        border:0;
        background:transparent;
        color:var(--uc-label-dark);
        line-height:1;
        cursor:pointer;
    }
    .cmd-card-menu > div {
        display:grid;
        gap:8px;
        margin-top:4px;
        padding:10px;
        border:1px solid var(--ag-gold);
        background:#0a1017;
    }
    .cmd-card-menu label {
        display:flex;
        flex-direction:column;
        gap:3px;
    }
    .cmd-card-menu label > span {
        color:var(--ag-muted);
        font-size:.56rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }

    .cmd-reserve {
        min-height:0;
        display:flex;
        flex-direction:column;
        gap:8px;
        padding:10px;
        border:1px solid var(--ag-line-2);
        background:repeating-linear-gradient(0deg,rgba(201,162,74,.03) 0 1px,transparent 1px 18px),rgba(8,12,17,.96);
        transition:border-color .15s;
    }
    .cmd-reserve.is-drop {
        border-color:var(--ag-gold-2);
        box-shadow:inset 0 0 30px rgba(227,192,107,.15);
    }
    .cmd-reserve header strong {
        display:block;
        color:#e8edf1;
        font-family:var(--ag-display);
        font-size:1rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-reserve header small {
        color:var(--ag-muted);
        font-size:.62rem;
    }
    .cmd-reserve .cmd-cards { padding:0; }

    @keyframes cmd-toast-in { from { opacity:0; transform:translate(-50%,8px); } }

    @media (max-width:1100px) {
        .cmd-staff-body.has-reserve { grid-template-columns:minmax(0,1fr); }
        .cmd-board {
            flex-direction:column;
            overflow:visible;
        }
        .cmd-column { flex:none; }
        .cmd-map-side { display:none; }
    }

} /* end of @layer app */


/* ==== cmd-graph.css ==== */
/* Unit Control · views, chain-of-command graph, graph nodes and the headquarters of a unit
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---------- Views of a page (list / chain of command, board / graph) ---------- */
    .cmd-view-tabs {
        flex:none;
        display:flex;
        gap:2px;
        border-bottom:1px solid var(--ag-line-2);
    }
    .cmd-view-tab {
        display:inline-flex;
        align-items:center;
        gap:8px;
        margin-bottom:-1px;
        padding:7px 16px;
        border:1px solid transparent;
        border-bottom-color:var(--ag-line-2);
        background:transparent;
        color:var(--ag-text-2);
        font-family:var(--ag-display);
        font-size:.86rem;
        font-weight:600;
        letter-spacing:.14em;
        text-transform:uppercase;
        cursor:pointer;
        transition:color .15s,background .15s;
    }
    .cmd-view-tab:hover {
        color:var(--ag-gold-2);
        background:rgba(201,162,74,.05);
    }
    .cmd-view-tab.is-active {
        border-color:var(--ag-line-2);
        border-bottom-color:var(--ag-bg);
        background:linear-gradient(180deg,#0f1720,var(--ag-bg));
        color:var(--ag-gold-2);
        box-shadow:inset 0 2px 0 var(--ag-gold);
    }
    .cmd-view-tab:focus-visible {
        outline:1px solid var(--ag-gold-2);
        outline-offset:-3px;
    }

    /* ---------- Graph view: the graph and, beside it, the chosen unit ---------- */
    .cmd-graph-workspace {
        flex:1;
        min-height:0;
        display:grid;
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:minmax(0,1fr);
        gap:12px;
    }
    .cmd-graph-workspace.has-details { grid-template-columns:minmax(0,1fr) minmax(380px,36%); }
    .cmd-staff-body .cmd-graph-workspace.has-details { grid-template-columns:minmax(0,1fr) minmax(320px,30%); }
    .entity-details-panel.is-side {
        position:relative;
        min-height:0;
        overflow:auto;
    }
    .cmd-side-close {
        position:absolute;
        z-index:2;
        top:8px;
        right:8px;
        width:28px;
        height:28px;
        border:1px solid var(--paper-edge,var(--ag-line-2));
        background:rgba(255,253,245,.7);
        color:var(--ink-2,var(--ag-text));
        line-height:1;
        cursor:pointer;
    }
    .cmd-side-close:hover { color:var(--stamp,var(--ag-red-2)); }
    .cmd-note.is-compact {
        margin:0 0 10px;
        padding:6px 10px;
        border-style:dashed;
        border-color:var(--paper-edge,var(--ag-line-2));
        background:rgba(45,111,124,.08);
        color:var(--ink-2,var(--ag-text-2));
    }

    /* The side panel of the staffing graph keeps the dark look of the board. */
    .cmd-graph-side {
        display:flex;
        flex-direction:column;
        padding:0;
        border:1px solid var(--ag-line);
        background:rgba(8,12,17,.96);
        color:var(--ag-text);
        transition:border-color .15s,box-shadow .15s;
    }
    .cmd-graph-side.is-drop {
        border-color:var(--ag-gold);
        box-shadow:0 0 0 1px var(--ag-gold),0 0 22px rgba(227,192,107,.25);
    }
    .cmd-graph-side .cmd-side-close {
        border-color:var(--ag-line-2);
        background:#0b121a;
        color:var(--ag-text-2);
    }
    .cmd-graph-side .cmd-side-close:hover { color:var(--ag-gold-2); }
    .cmd-graph-side .cmd-column-head { padding-right:44px; }
    .cmd-graph-side .cmd-echelon-now { color:var(--ag-text); }
    .cmd-graph-side .cmd-echelon-bar { background:#16202b; }
    .cmd-graph-side .cmd-owner-tag {
        border-color:var(--ag-green);
        color:var(--ag-green);
    }
    .cmd-graph-side .cmd-cards { min-height:120px; }

    /* ---------- Chain-of-command graph (Command/CommandGraph.razor) ---------- */
    .cg {
        min-width:0;
        min-height:0;
        display:flex;
        flex-direction:column;
        border:1px solid var(--ag-line);
        background:rgba(8,12,17,.94);
    }
    .cg-toolbar {
        flex:none;
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:8px 14px;
        padding:8px 10px;
        border-bottom:1px solid var(--ag-line);
        background:linear-gradient(180deg,#0f1720,#0b1118);
    }
    .cg-find {
        display:flex;
        align-items:center;
        gap:4px;
        flex:0 1 300px;
    }
    .cg-find .form-control {
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background:#070b10;
        color:var(--ag-text);
    }
    .cg-hits {
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.64rem;
        white-space:nowrap;
    }
    .cg-hits.is-none { color:var(--ag-muted); }
    .cg-count {
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.64rem;
        letter-spacing:.06em;
    }
    .cg-help {
        flex:1;
        text-align:right;
    }
    .cg-help-icon {
        display:inline-grid;
        place-items:center;
        width:22px;
        height:22px;
        border:1px solid var(--ag-line-2);
        border-radius:50%;
        color:var(--ag-text-2);
        font-size:.8rem;
        cursor:help;
    }
    .cg-help-icon:hover, .cg-help-icon:focus-visible {
        border-color:var(--ag-gold);
        color:var(--ag-gold-2);
        outline:none;
    }
    .cg-zoom {
        display:flex;
        align-items:center;
        gap:3px;
        margin-left:auto;
    }
    .cg-btn {
        min-width:28px;
        height:28px;
        padding:0 8px;
        border:1px solid var(--ag-line-2);
        background:#0b121a;
        color:var(--ag-text-2);
        font-size:.74rem;
        line-height:1;
        cursor:pointer;
    }
    .cg-btn:hover {
        border-color:var(--ag-gold);
        color:var(--ag-gold-2);
    }
    .cg-btn.is-wide {
        font-size:.62rem;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .cg-scale {
        min-width:44px;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.64rem;
        text-align:center;
    }
    .cg-legend {
        display:flex;
        gap:10px;
    }
    .cg-legend-item {
        display:inline-flex;
        align-items:center;
        gap:6px;
        color:var(--ag-text-2);
        font-size:.6rem;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    .cg-legend-item::before {
        content:"";
        width:18px;
        height:10px;
        border:1px solid var(--ag-gold-2);
        background:rgba(201,162,74,.12);
    }
    .cg-legend-item.is-view::before {
        border:1px dashed var(--ag-cyan);
        background:transparent;
    }

    .cg-viewport {
        position:relative;
        flex:1;
        min-height:0;
        overflow:hidden;
        cursor:grab;
        touch-action:none;
        user-select:none;
        background:radial-gradient(circle at 1px 1px,rgba(201,162,74,.10) 1px,transparent 0) 0 0/22px 22px,#05090d;
    }
    .cg-viewport.is-panning { cursor:grabbing; }
    .cg-stage {
        position:absolute;
        left:0;
        top:0;
        transform-origin:0 0;
        will-change:transform;
    }
    .cg-stage.is-gliding { transition:transform .3s ease; }
    .cg-canvas { position:relative; }
    .cg-edges {
        position:absolute;
        left:0;
        top:0;
        overflow:visible;
        pointer-events:none;
    }
    .cg-edge {
        fill:none;
        stroke:#3a4d60;
        stroke-width:1.4;
    }
    .cg-edge.is-chain {
        stroke:var(--ag-gold-2);
        stroke-width:2.6;
        filter:drop-shadow(0 0 4px rgba(227,192,107,.55));
    }
    .cg-node {
        position:absolute;
        cursor:pointer;
    }
    .cg-node > * { height:100%; }
    /* The chain, drop and selected states of a node are at the end of the containers section (they must follow the hover). */
    .cg-node.is-hit > * {
        outline:2px dashed var(--ag-cyan);
        outline-offset:3px;
    }
    .cg-node.is-current-hit > * { outline:3px solid var(--ag-cyan); }

    /* A unit of the chain of command. */
    .cg-unit, .cg-staff {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:6px;
        overflow:hidden;
        padding:9px 11px 9px 15px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,#111b25,#0b1219);
        transition:border-color .15s,transform .15s;
    }
    .cg-unit::before, .cg-staff::before {
        content:"";
        position:absolute;
        left:0;
        top:0;
        bottom:0;
        width:4px;
        background:var(--swatch,#555);
        box-shadow:0 0 10px var(--swatch,#555);
    }
    .cg-unit.is-command, .cg-staff.is-command {
        border-color:rgba(227,192,107,.75);
        background:linear-gradient(180deg,#1a1a12,#0e1218);
    }
    .cg-unit.is-view, .cg-staff.is-view { border-style:dashed; }
    .cg-unit.is-inactive, .cg-staff.is-inactive { opacity:.55; }
    .cg-node:hover .cg-unit, .cg-node:hover .cg-staff { border-color:var(--ag-gold); }
    .cg-unit header, .cg-staff header {
        display:flex;
        flex-wrap:wrap;
        align-items:baseline;
        gap:0 8px;
        min-width:0;
    }
    .cg-unit header strong, .cg-staff header strong {
        flex:1 1 100%;
        overflow:hidden;
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:1rem;
        font-weight:600;
        letter-spacing:.05em;
        text-overflow:ellipsis;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .cg-unit header small, .cg-staff header small {
        flex:1;
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
    }
    .cg-unit-tags {
        display:flex;
        flex-wrap:wrap;
        gap:4px;
        min-height:16px;
    }
    .cg-unit-posts {
        display:grid;
        gap:2px;
        margin:0;
        font-size:.64rem;
    }
    .cg-unit-posts div {
        display:flex;
        gap:6px;
        min-width:0;
    }
    .cg-unit-posts dt {
        flex:none;
        width:24px;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.58rem;
        font-weight:400;
    }
    .cg-unit-posts dd {
        margin:0;
        overflow:hidden;
        color:var(--ag-text);
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cg-unit .cmd-echelon, .cg-staff .cmd-echelon { margin-top:auto; }

    /* A unit of the staffing graph: strength and command posts. */
    .cg-staff .cmd-posts-strip {
        padding:0;
        border:0;
    }
    .cg-staff .cmd-post-slot {
        padding-top:3px;
        padding-bottom:3px;
    }
    .cg-staff-vacant {
        color:var(--ag-red-2);
        letter-spacing:.06em;
        text-transform:uppercase;
    }

    .cg-viewport[data-lod="mid"] .cg-unit-tags, .cg-viewport[data-lod="mid"] .cg-staff-foot { visibility:hidden; }

    @media (max-width:1100px) {
        .cmd-graph-workspace.has-details, .cmd-staff-body .cmd-graph-workspace.has-details {
            grid-template-columns:minmax(0,1fr);
            grid-template-rows:minmax(420px,1fr) auto;
        }
        .cg { min-height:420px; }
        .cg-help { display:none; }
    }

    /* ---------- Graph nodes: insignia, title, people ---------- */
    .cg-head {
        display:flex;
        align-items:center;
        gap:10px;
        min-width:0;
    }
    .cg-title {
        display:flex;
        flex-direction:column;
        min-width:0;
    }
    .cg-title strong {
        display:-webkit-box;
        overflow:hidden;
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:.98rem;
        font-weight:600;
        letter-spacing:.04em;
        line-height:1.1;
        text-transform:uppercase;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2;
    }
    .cg-title small {
        overflow:hidden;
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cg-insignia {
        flex:none;
        width:46px;
        height:46px;
        object-fit:contain;
        filter:drop-shadow(0 2px 4px rgba(0,0,0,.6));
    }
    .cg-insignia.is-empty {
        display:grid;
        place-items:center;
        border:1px solid var(--swatch,#555);
        clip-path:polygon(0 0,100% 0,100% 62%,50% 100%,0 62%);
        background:linear-gradient(180deg,color-mix(in srgb,var(--swatch,#555) 35%,transparent),transparent);
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:.9rem;
        font-weight:700;
        letter-spacing:.04em;
    }
    .cmd-graph-side .cg-head .cg-insignia {
        width:40px;
        height:40px;
    }

    /* Hierarchy of the operators. */
    .cg-op {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:7px;
        overflow:hidden;
        padding:9px 11px 9px 15px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,#111b25,#0b1219);
        transition:border-color .15s;
    }
    .cg-op::before {
        content:"";
        position:absolute;
        left:0;
        top:0;
        bottom:0;
        width:4px;
        background:var(--swatch,#555);
        box-shadow:0 0 10px var(--swatch,#555);
    }
    .cg-op.is-command { border-color:rgba(227,192,107,.75); }
    .cg-op.is-view { border-style:dashed; }
    .cg-op.is-head { background:linear-gradient(180deg,#1a1a12,#0e1218); }
    .cg-op.is-head.is-vacant .cg-person { opacity:.6; }
    .cg-op.is-member {
        justify-content:center;
        background:linear-gradient(180deg,#0f1720,#0a1016);
    }
    .cg-op.is-member[draggable="true"] { cursor:grab; }
    .cg-op.is-busy {
        opacity:.5;
        pointer-events:none;
    }
    .cg-node:hover .cg-op { border-color:var(--ag-gold); }
    .cg-person {
        display:flex;
        align-items:center;
        gap:10px;
        min-width:0;
    }
    .cg-photo {
        flex:none;
        width:42px;
        height:42px;
        border:1px solid var(--ag-gold);
        border-radius:50%;
        object-fit:cover;
        background:#0b121a;
    }
    .cg-photo.is-empty {
        display:grid;
        place-items:center;
        background:radial-gradient(circle at 30% 30%,rgba(227,192,107,.3),rgba(201,162,74,.05));
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:.95rem;
        font-weight:700;
    }
    .cg-person .cg-title strong {
        font-family:var(--ag-mono);
        font-size:.74rem;
        letter-spacing:0;
        text-transform:none;
    }
    .cg-person .cg-title small {
        color:var(--ag-gold-2);
        font-family:inherit;
        font-size:.6rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .cg-op-unit {
        overflow:hidden;
        color:var(--ag-muted);
        font-size:.58rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cg-op-foot {
        display:flex;
        align-items:center;
        gap:8px;
        margin-top:auto;
        font-size:.6rem;
    }
    .cg-expand {
        padding:2px 8px;
        border:1px solid var(--ag-line-2);
        background:#0b121a;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.64rem;
        cursor:pointer;
    }
    .cg-expand:hover:not(:disabled), .cg-expand.is-open {
        border-color:var(--ag-gold);
        background:rgba(201,162,74,.14);
    }
    .cg-expand:disabled {
        opacity:.4;
        cursor:default;
    }

    /* Far away: the insignia (or the photo) and the name, bigger. */
    .cg-viewport[data-lod="far"] .cg-node > * > :not(.cg-head):not(.cg-person) { visibility:hidden; }
    .cg-viewport[data-lod="far"] .cg-op.is-head > .cg-person { visibility:hidden; }
    .cg-viewport[data-lod="far"] .cg-insignia {
        width:96px;
        height:96px;
    }
    .cg-viewport[data-lod="far"] .cg-head .cg-title strong { font-size:1.7rem; }
    .cg-viewport[data-lod="far"] .cg-title small { display:none; }
    .cg-viewport[data-lod="far"] .cg-person .cg-title strong { font-size:1.4rem; }
    .cg-viewport[data-lod="far"] .cg-photo {
        width:72px;
        height:72px;
    }
    .cg-viewport[data-lod="mid"] .cg-op-unit, .cg-viewport[data-lod="mid"] .cg-op-foot .cg-staff-vacant { visibility:hidden; }

    /* ---------- Headquarters of a unit (Command/CommandHeadquarters.razor), inside the paper form ---------- */
    .cmd-hq {
        margin-top:22px;
        padding-top:16px;
        border-top:2px solid var(--paper-edge,#b9ab8c);
    }
    .cmd-hq-head {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        margin-bottom:10px;
    }
    .cmd-hq-head h3 {
        margin:0;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1.2rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-hq-head h3 span {
        margin-left:6px;
        padding:0 6px;
        border:1px solid var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.7rem;
        vertical-align:middle;
    }
    .cmd-hq-empty, .cmd-hq-later {
        margin:6px 0 0;
        padding:10px 12px;
        border:1px dashed var(--paper-edge,#b9ab8c);
        color:var(--ink-2);
        font-family:var(--ag-type);
        font-size:.78rem;
    }
    .cmd-hq-list {
        display:grid;
        gap:8px;
        margin:0;
        padding:0;
        list-style:none;
    }
    .cmd-hq-card {
        display:flex;
        justify-content:space-between;
        gap:12px;
        padding:10px 12px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.45);
    }
    .cmd-hq-card.is-inactive { opacity:.65; }
    .cmd-hq-card-main {
        display:flex;
        flex-direction:column;
        gap:2px;
        min-width:0;
    }
    .cmd-hq-card-title {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:8px;
    }
    .cmd-hq-card-title strong {
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.95rem;
    }
    .cmd-hq-purpose {
        padding:1px 6px;
        border:1px solid var(--ink-2);
        color:var(--ink-2);
        font-size:.56rem;
        font-weight:600;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-hq-purpose.is-principal {
        border-color:var(--stamp);
        color:var(--stamp);
    }
    .cmd-hq-code {
        color:var(--ink-muted,#7a6e57);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .cmd-hq-line {
        overflow:hidden;
        color:var(--ink-2);
        font-size:.72rem;
        text-overflow:ellipsis;
    }
    .cmd-hq-card-actions {
        flex:none;
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:6px;
    }
    .cmd-hq-form {
        padding:12px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.35);
    }
    .cmd-hq-form h4 {
        margin:0 0 10px;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-hq-section {
        margin-top:14px;
        padding:10px 12px 12px;
        border:1px dashed var(--paper-edge,#b9ab8c);
    }
    .cmd-hq-section legend {
        float:none;
        width:auto;
        margin:0 0 6px;
        padding:0 6px;
        color:var(--ink);
        font-size:.66rem;
        font-weight:700;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .cmd-hq-section .profile-grid { margin-top:10px; }
    .cmd-hq-section .locp-map { height:300px; }
    .cmd-hq-coords {
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr)) auto;
        align-items:end;
        gap:8px 14px;
        margin-top:10px;
    }
    .cmd-hq-coords label {
        display:grid;
        gap:3px;
        color:#5a4e3a;
        font-size:.62rem;
        font-weight:600;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    .cmd-hq-coords .form-control {
        font-family:var(--ag-mono);
        font-size:.85rem;
        letter-spacing:normal;
    }
    .cmd-hq-actions {
        display:flex;
        gap:8px;
        margin-top:14px;
    }
    @media (max-width:700px) {
        .cmd-hq-coords { grid-template-columns:1fr; }
        .cmd-hq-card { flex-direction:column; }
        .cmd-hq-card-actions { flex-direction:row; }
    }

} /* end of @layer app */


/* ==== cmd-map-create.css ==== */
/* Unit Control · map: right click to create at a point
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---------- Map: right click to create at a point ---------- */
    .umap-point-menu button:disabled .umap-point-soon {
        margin-left:auto;
        padding:1px 5px;
        border:1px dashed var(--ag-line-2);
        color:var(--ag-muted);
        font-size:.54rem;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    .umap-point-menu button[disabled]:not(.is-busy) { cursor:not-allowed; }
    .cmd-mapcreate-step {
        margin:0 0 10px;
        padding:8px 10px;
        border:1px dashed var(--stamp);
        color:var(--ink-2);
        font-family:var(--ag-type);
        font-size:.78rem;
    }
    /* Creating at a point of the map: the steps, the point, the units to choose (cards) and the unit chosen. */
    .cmd-mapcreate { display:grid; gap:12px; }
    .cmd-mapcreate-steps {
        display:flex;
        gap:6px;
        margin:0;
        padding:0;
        list-style:none;
        counter-reset:none;
    }
    .cmd-mapcreate-steps li {
        flex:1;
        display:flex;
        align-items:center;
        gap:8px;
        padding:6px 10px;
        border:1px solid var(--paper-edge);
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.62rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-mapcreate-steps b {
        display:grid;
        place-items:center;
        width:20px;
        height:20px;
        border:1px solid currentColor;
        border-radius:50%;
        font-size:.62rem;
    }
    .cmd-mapcreate-steps li.is-current { border-color:var(--ink); background:rgba(255,253,245,.6); color:var(--ink); }
    .cmd-mapcreate-steps li.is-current b { background:var(--ink); border-color:var(--ink); color:var(--paper); }
    .cmd-mapcreate-steps li.is-done { color:var(--ink-2); }
    .cmd-mapcreate-point {
        display:flex;
        align-items:center;
        gap:10px;
        padding:8px 12px;
        border-left:3px solid var(--stamp);
        background:rgba(168,38,31,.07);
    }
    .cmd-mapcreate-pin { color:var(--stamp); font-size:1.2rem; line-height:1; }
    .cmd-mapcreate-point span:last-child { display:flex; flex-direction:column; gap:1px; }
    .cmd-mapcreate-point small, .cmd-mapcreate-unit-text small {
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.58rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .cmd-mapcreate-point strong { color:var(--ink); font-family:var(--ag-mono); font-size:.8rem; }
    .cmd-mapcreate-pick { display:grid; gap:8px; }
    .cmd-mapcreate-pick-head { display:flex; flex-direction:column; gap:2px; }
    .cmd-mapcreate-pick-head strong {
        color:var(--ink);
        font-family:var(--ag-mono);
        font-size:.68rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .cmd-mapcreate-pick-head small { color:var(--ink-muted); font-size:.72rem; }
    .cmd-mapcreate-units {
        display:grid;
        grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
        gap:8px;
        max-height:min(48vh,420px);
        margin:0;
        padding:0;
        overflow:auto;
        list-style:none;
    }
    .cmd-mapcreate-unit, .cmd-mapcreate-chosen {
        display:flex;
        align-items:center;
        gap:10px;
        width:100%;
        padding:10px 12px;
        border:1px solid var(--paper-edge);
        background:rgba(255,253,245,.55);
        color:var(--ink);
        text-align:left;
    }
    .cmd-mapcreate-unit { cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; }
    .cmd-mapcreate-unit:hover, .cmd-mapcreate-unit:focus-visible {
        border-color:var(--ink);
        box-shadow:inset 3px 0 0 var(--stamp);
        transform:translateY(-1px);
    }
    .cmd-mapcreate-unit .cg-insignia, .cmd-mapcreate-chosen .cg-insignia { flex:none; width:34px; height:34px; }
    .cmd-mapcreate-unit-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
    .cmd-mapcreate-unit-text strong { overflow:hidden; font-size:.86rem; text-overflow:ellipsis; white-space:nowrap; }
    .cmd-mapcreate-unit-text em { color:var(--ink-muted); font-family:var(--ag-mono); font-size:.62rem; font-style:normal; }
    .cmd-mapcreate-unit-go { color:var(--ink-muted); font-size:1rem; }
    .cmd-mapcreate-unit:hover .cmd-mapcreate-unit-go { color:var(--stamp); }
    .cmd-mapcreate-chosen { border-color:var(--ink); }
    .cmd-mapcreate-none { margin:0; color:var(--ink-muted); font-size:.76rem; }
    .cmd-mapcreate .cmd-hq { margin-top:6px; }
    @media (max-width: 640px) {
        .cmd-mapcreate-steps { flex-direction:column; }
        .cmd-mapcreate-chosen { flex-wrap:wrap; }
    }

} /* end of @layer app */


/* ==== cmd-recruitment.css ==== */
/* Unit Control · recruitment: menu badges and search pages
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---------- Recruitment: menu badges ---------- */
    .entity-nav-item .cmd-nav-badge, .entity-nav-item .cmd-nav-count {
        margin-left:auto;
        min-width:20px;
        padding:1px 6px;
        border-radius:10px;
        font-family:var(--ag-mono);
        font-size:.6rem;
        font-weight:700;
        text-align:center;
    }
    .cmd-nav-badge {
        background:var(--ag-red);
        color:#fff;
        box-shadow:0 0 10px rgba(200,50,58,.55);
    }
    .cmd-nav-badge.is-new { animation:rec-pulse 1.4s ease-in-out 4; }
    .cmd-nav-count {
        border:1px solid var(--ag-line-2);
        color:var(--ag-text-2);
    }
    @keyframes rec-pulse { 50% { transform:scale(1.25); box-shadow:0 0 18px rgba(229,72,79,.9); } }

    /* ---------- Recruitment: search pages ---------- */
    .rec-filters, .rec-toolbar {
        flex:none;
        display:flex;
        flex-wrap:wrap;
        align-items:end;
        gap:10px 14px;
        padding:10px 12px;
        border:1px solid var(--ag-line);
        background:rgba(8,12,17,.94);
    }
    .rec-filters label, .rec-toolbar label, .rec-geo label {
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:150px;
    }
    .rec-filters label > span, .rec-toolbar label > span, .rec-geo label > span {
        color:var(--ag-muted);
        font-size:.58rem;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .rec-filters .form-control, .rec-filters .form-select, .rec-toolbar .form-select {
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background-color:#070b10;
        color:var(--ag-text);
    }
    .rec-filter-text { flex:1 1 220px; }
    /* label.rec-check: (0,1,1), it follows the generic label rule above and wins over it. */
    .rec-geo {
        display:flex;
        gap:10px;
    }
    .rec-geo-search {
        display:flex;
        gap:4px;
    }
    .rec-geo-chip {
        display:inline-flex;
        align-items:center;
        gap:8px;
        height:31px;
        padding:0 8px;
        border:1px solid var(--ag-gold);
        background:rgba(201,162,74,.12);
        color:var(--ag-gold-2);
        font-size:.7rem;
    }
    .rec-geo-chip button {
        border:0;
        background:transparent;
        color:var(--ag-text-2);
        cursor:pointer;
    }
    .rec-geo-error {
        color:var(--ag-red-2);
        font-size:.6rem;
    }
    .rec-results, .rec-page {
        flex:1;
        min-height:0;
        display:flex;
        flex-direction:column;
        gap:10px;
        overflow-y:auto;
        padding-right:2px;
    }

    /* A result: a vacancy, a unit, an invitation, an application. */
    .rec-card {
        flex:none;
        display:flex;
        gap:14px;
        padding:14px 16px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,#101922,#0b1219);
        transition:border-color .15s;
    }
    .rec-card:hover { border-color:var(--ag-gold); }
    /* Past or paused cards and inactive talent: legible text (no transparency), marked by a dashed border and muted colours. */
    .rec-card.is-paused, .rec-card.is-history { border-style:dashed; filter:saturate(.55); }
    .rec-card.is-pending {
        border-color:rgba(227,192,107,.6);
        box-shadow:inset 3px 0 0 var(--ag-gold);
    }
    .rec-card-main {
        flex:1;
        min-width:0;
        display:flex;
        flex-direction:column;
        gap:8px;
    }
    .rec-card-actions {
        flex:none;
        display:flex;
        flex-direction:column;
        align-items:stretch;
        justify-content:flex-start;
        gap:6px;
        min-width:170px;
    }
    .rec-card-actions .btn, .rec-actions-row .btn { border-radius:0; }
    .rec-vacancy-head {
        display:flex;
        flex-wrap:wrap;
        align-items:baseline;
        gap:8px 10px;
    }
    .rec-vacancy-head h3 {
        margin:0;
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:1.2rem;
        font-weight:600;
        letter-spacing:.04em;
    }
    .rec-description {
        margin:0;
        color:var(--ag-text-2);
        font-size:.74rem;
        white-space:pre-line;
    }
    .rec-age {
        margin-left:auto;
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
    }

    /* A unit or an operator in a line. */
    .rec-unit, .rec-talent {
        display:flex;
        align-items:center;
        gap:12px;
        min-width:0;
    }
    .rec-unit .cg-insignia {
        width:52px;
        height:52px;
    }
    .rec-talent .cg-photo {
        width:46px;
        height:46px;
    }
    .rec-talent.is-inactive { border-style:dashed; filter:saturate(.55); }
    .rec-unit-text {
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:0;
    }
    .rec-unit-text strong {
        overflow:hidden;
        color:#e8edf1;
        font-size:.86rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .rec-unit-text small {
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .rec-place {
        color:var(--ag-text-2);
        font-size:.66rem;
    }
    .rec-place b {
        margin-left:8px;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-weight:400;
    }
    .rec-tags {
        display:flex;
        flex-wrap:wrap;
        gap:4px;
        margin:0;
    }
    .rec-tag {
        display:inline-block;
        padding:1px 6px;
        border:1px solid var(--swatch,var(--ag-line-2));
        color:var(--ag-text-2);
        font-size:.56rem;
        letter-spacing:.1em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .rec-tag.is-plain { border-style:dashed; }
    .rec-tag.is-gold {
        border-color:var(--ag-gold);
        color:var(--ag-gold-2);
    }
    .rec-tag.is-cyan {
        border-color:var(--ag-cyan);
        color:var(--ag-cyan);
    }
    .rec-tag.is-green {
        border-color:var(--ag-green);
        color:var(--ag-green);
    }

    /* States. */
    .rec-status {
        padding:2px 8px;
        border:1px solid currentColor;
        font-size:.58rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .rec-status.is-open, .rec-status.is-app-accepted, .rec-status.is-inv-accepted { color:var(--ag-green); }
    .rec-status.is-paused, .rec-status.is-draft, .rec-status.is-pending, .rec-status.is-app-submitted { color:var(--ag-gold-2); }
    .rec-status.is-app-inreview { color:var(--ag-cyan); }
    .rec-status.is-app-shortlisted { color:#c58cff; }
    .rec-status.is-closed, .rec-status.is-app-rejected, .rec-status.is-inv-rejected { color:var(--ag-red-2); }
    .rec-status.is-filled { color:var(--ag-cyan); }
    .rec-status.is-app-withdrawn, .rec-status.is-inv-withdrawn { color:var(--ag-muted); }
    /* Who sees a vacancy: anyone (also the public site) or only people signed in. */

    /* Messages. */
    .rec-quote {
        margin:0;
        padding:8px 12px;
        border-left:3px solid var(--ag-gold);
        background:rgba(201,162,74,.07);
        color:var(--ag-text);
        font-size:.74rem;
    }
    .rec-quote p {
        margin:0;
        white-space:pre-line;
    }
    .rec-quote footer {
        margin-top:4px;
        color:var(--ag-muted);
        font-size:.62rem;
    }
    .rec-record.entity-details-panel.is-embedded {
        position:relative;
        max-height:520px;
        overflow:auto;
        border:1px solid var(--paper-edge,var(--ag-line-2));
        background:var(--paper,#e9dfc4);
        padding:12px;
    }
    .rec-empty {
        margin:0;
        color:var(--ag-muted);
        font-size:.7rem;
    }

    /* Pipeline of an application. */

    /* Manager workspace: list and detail. */
    .rec-letter h4, .rec-profile-section h4 {
        margin:0 0 6px;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:.95rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    /* The decision box is on paper: the shared paper field look (agency.css), on an opaque field while it is not focused. */

    /* The profile of a candidate (on paper). */
    .rec-profile {
        display:flex;
        flex-direction:column;
        gap:14px;
        color:var(--ink);
    }
    .rec-profile-head {
        display:flex;
        align-items:center;
        gap:16px;
    }
    .rec-profile-photo {
        flex:none;
        width:84px;
        height:84px;
        border:2px solid var(--ink-2);
        border-radius:50%;
        object-fit:cover;
    }
    .rec-profile-photo.is-empty {
        display:grid;
        place-items:center;
        background:rgba(70,63,48,.12);
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:1.8rem;
        font-weight:700;
    }
    .rec-profile-head h3 {
        margin:0;
        font-family:var(--ag-type);
        font-size:1.35rem;
    }
    .rec-profile-rank {
        margin:2px 0 6px;
        color:var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.72rem;
    }
    .rec-profile .rec-tag {
        border-color:var(--ink-2);
        color:var(--ink-2);
    }
    .rec-profile .rec-tag.is-gold {
        border-color:var(--stamp);
        color:var(--stamp);
    }
    .rec-profile .rec-tag.is-green {
        border-color:#2f7d4f;
        color:#2f7d4f;
    }
    .rec-profile-facts {
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px 18px;
        margin:0;
    }
    .rec-profile-facts dt {
        color:var(--ink-muted);
        font-size:.56rem;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .rec-profile-facts dd {
        display:flex;
        flex-wrap:wrap;
        gap:4px;
        margin:0;
        font-family:var(--ag-type);
        font-size:.84rem;
    }
    .rec-profile-section h4 span {
        margin-left:6px;
        padding:0 6px;
        border:1px solid var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .rec-timeline {
        position:relative;
        margin:0;
        padding:0 0 0 18px;
        list-style:none;
    }
    .rec-timeline::before {
        content:"";
        position:absolute;
        left:5px;
        top:4px;
        bottom:4px;
        border-left:2px solid var(--paper-edge);
    }
    .rec-timeline li {
        position:relative;
        display:flex;
        flex-direction:column;
        padding:3px 0 8px;
    }
    .rec-timeline li::before {
        content:"";
        position:absolute;
        left:-17px;
        top:7px;
        width:10px;
        height:10px;
        border:2px solid var(--ink-2);
        border-radius:50%;
        background:var(--paper,#e9dfc4);
    }
    .rec-timeline li.is-current::before {
        border-color:var(--stamp);
        background:var(--stamp);
    }
    .rec-timeline strong {
        font-family:var(--ag-type);
        font-size:.86rem;
    }
    .rec-timeline small {
        color:var(--ink-muted);
        font-size:.66rem;
    }
    .rec-list {
        display:grid;
        gap:6px;
        margin:0;
        padding:0;
        list-style:none;
    }
    .rec-list li {
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        gap:2px 10px;
        padding:6px 8px;
        border:1px dashed var(--paper-edge);
    }
    .rec-list li strong {
        font-family:var(--ag-type);
        font-size:.82rem;
    }
    .rec-list li small {
        grid-column:1;
        color:var(--ink-muted);
        font-size:.64rem;
    }
    .rec-list li .rec-tag {
        grid-column:2;
        grid-row:1 / span 2;
        align-self:center;
    }

    /* Forms in windows and on the page. */
    .rec-apply {
        display:flex;
        flex-direction:column;
        gap:8px;
    }
    .rec-apply .rec-unit-text strong { color:var(--ink); }
    .rec-apply .rec-unit-text small, .rec-apply .rec-place { color:var(--ink-muted); }
    .rec-apply .rec-tag {
        border-color:var(--ink-2);
        color:var(--ink-2);
    }

    @media (max-width:1100px) {
        .rec-card { flex-direction:column; }
        .rec-card-actions {
            flex-direction:row;
            flex-wrap:wrap;
            min-width:0;
        }
        .rec-geo { flex-wrap:wrap; }
    }

} /* end of @layer app */


/* ==== cmd-dossier.css ==== */
/* Unit Control · my dossier (record and service history)
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---- My dossier (record and service history) ---- */
    .dos-scroll {
        flex:1;
        min-height:0;
        overflow-y:auto;
        padding-right:2px;
    }
    .dos-layout {
        display:grid;
        grid-template-columns:minmax(0,1fr) 320px;
        gap:16px;
        align-items:start;
        padding:0 0 24px;
    }
    .dos-sheet.entity-details-panel.is-embedded {
        position:relative;
        overflow:visible;
        padding:18px 20px 22px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:var(--paper,#e9dfc4);
    }
    .dos-sheet .dossier-picture {
        width:112px;
        height:112px;
        border:2px solid var(--ink-2);
        border-radius:50%;
        background:rgba(255,253,245,.5);
    }
    .dos-sheet .dossier-picture img {
        object-fit:cover;
        filter:none;
    }
    .dos-initials {
        color:var(--ink-2);
        font-family:var(--ag-display);
        font-size:2.2rem;
        letter-spacing:.06em;
    }
    .dos-progress {
        margin:14px 0 4px;
        padding:10px 12px;
        border:1px dashed var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.35);
    }
    .dos-progress-head {
        display:flex;
        justify-content:space-between;
        align-items:baseline;
        margin-bottom:6px;
        color:var(--ink);
    }
    .dos-progress-head strong {
        font-family:var(--ag-display);
        font-size:.82rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .dos-progress-head span {
        font-family:var(--ag-mono);
        font-size:.9rem;
    }
    .dos-progress-bar {
        height:6px;
        border:1px solid var(--ink-2);
        background:rgba(31,27,20,.06);
    }
    .dos-progress-bar i {
        display:block;
        height:100%;
        background:linear-gradient(90deg,#8a6d2a,#c9a24a);
        transition:width .4s;
    }
    .dos-checks {
        display:flex;
        flex-wrap:wrap;
        gap:6px 14px;
        margin:8px 0 0;
        padding:0;
        list-style:none;
        font-size:.66rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .dos-checks li { color:var(--stamp); }
    .dos-checks li.is-done { color:#2c6b46; }
    .dos-checks a {
        color:inherit;
        text-decoration:underline dotted;
        text-underline-offset:3px;
    }
    .dos-alerts {
        margin:10px 0 0;
        padding:10px 12px;
        border:1px solid var(--stamp);
        background:rgba(168,38,31,.06);
        color:var(--ink);
    }
    .dos-alerts > strong {
        display:block;
        margin-bottom:6px;
        color:var(--stamp);
        font-size:.68rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .dos-alerts ul {
        display:grid;
        gap:4px;
        margin:0;
        padding:0;
        list-style:none;
    }
    .dos-alerts li {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:8px;
        font-family:var(--ag-type);
        font-size:.84rem;
    }
    .dos-alerts li em {
        margin-left:auto;
        color:var(--ink-2);
        font-size:.66rem;
        font-style:normal;
        letter-spacing:.06em;
    }
    .dos-alerts li.is-expired em {
        color:var(--stamp);
        font-weight:700;
    }
    .dos-sheet .rec-tag {
        border-color:var(--ink-2);
        color:var(--ink-2);
    }
    .dos-sheet .rec-tag.is-gold {
        border-color:#8a6d2a;
        color:#7a5d1a;
    }
    .dos-sheet .rec-tag.is-green {
        border-color:#2c6b46;
        color:#2c6b46;
    }
    .dos-group-note {
        margin:8px 0 0;
        color:var(--ink-muted);
        font-size:.64rem;
        letter-spacing:.04em;
    }
    .dos-readonly {
        color:var(--ink-muted);
        font-size:.6rem;
        letter-spacing:.12em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .dos-card .rel-card-text strong { white-space:normal; }
    .dos-card-icon {
        flex:none;
        display:grid;
        place-items:center;
        width:30px;
        height:30px;
        border:1px solid var(--ink-2);
        color:var(--ink-2);
        font-size:.9rem;
    }
    .dos-stamps {
        display:flex;
        flex-wrap:wrap;
        gap:4px;
        margin-top:3px;
    }
    .dos-card.is-warn {
        border-color:#b07a12;
        box-shadow:inset 3px 0 0 #b07a12;
    }
    .dos-card.is-danger {
        border-color:var(--stamp);
        box-shadow:inset 3px 0 0 var(--stamp);
    }
    .dos-sheet .rec-tag.dos-expiry.is-warn {
        border-color:#b07a12;
        color:#8a5d06;
    }
    .dos-sheet .rec-tag.dos-expiry.is-danger {
        border-color:var(--stamp);
        color:var(--stamp);
    }
    .dos-lock {
        color:var(--ink-muted);
        font-size:.85rem;
    }
    .dos-confirm {
        color:var(--stamp);
        font-size:.62rem;
        align-self:center;
    }

    .dos-side {
        display:flex;
        flex-direction:column;
        gap:12px;
        position:sticky;
        top:12px;
    }
    .dos-side-card {
        padding:12px 14px;
        border:1px solid var(--ag-line-2);
        border-top:3px solid var(--uc-amber);
        background:linear-gradient(180deg,#101922,#0c131b);
    }
    .dos-side-card h3 {
        margin:0 0 10px;
        padding-bottom:6px;
        border-bottom:1px solid var(--ag-line-2);
        color:var(--uc-amber-2);
        font-family:var(--ag-display);
        font-size:.82rem;
        font-weight:600;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .dos-side-empty {
        margin:0 0 8px;
        color:var(--ag-text-2);
        font-size:.72rem;
    }
    .dos-unit {
        display:flex;
        align-items:center;
        gap:12px;
    }
    .dos-unit img {
        width:64px;
        height:64px;
        object-fit:contain;
        filter:drop-shadow(1px 2px 2px rgba(0,0,0,.6));
    }
    .dos-unit-mark {
        display:grid;
        place-items:center;
        width:56px;
        height:56px;
        border:1px solid var(--ag-gold);
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.8rem;
    }
    .dos-unit strong {
        display:block;
        color:#eef2f5;
        font-family:var(--ag-display);
        font-size:1rem;
        letter-spacing:.04em;
    }
    .dos-unit small {
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .dos-side-facts {
        display:grid;
        gap:0;
        margin:10px 0 0;
    }
    .dos-side-facts > div {
        display:flex;
        justify-content:space-between;
        gap:10px;
        padding:5px 0;
        border-bottom:1px dotted var(--ag-line-2);
    }
    .dos-side-facts dt {
        color:var(--ag-muted);
        font-size:.56rem;
        font-weight:600;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .dos-side-facts dd {
        margin:0;
        color:#e8edf1;
        font-size:.72rem;
        font-weight:500;
        text-align:right;
    }
    .dos-commander {
        display:flex;
        align-items:center;
        gap:10px;
        width:100%;
        padding:6px;
        border:1px solid transparent;
        background:transparent;
        color:inherit;
        text-align:left;
    }
    button.dos-commander { cursor:pointer; }
    button.dos-commander:hover, button.dos-commander:focus-visible {
        border-color:var(--ag-gold);
        background:rgba(201,162,74,.06);
    }
    .dos-commander > span:last-child {
        display:flex;
        flex-direction:column;
        min-width:0;
    }
    .dos-commander strong {
        overflow:hidden;
        color:#eef2f5;
        font-size:.78rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .dos-commander small {
        color:var(--ag-muted);
        font-size:.62rem;
    }
    .dos-commander em {
        color:var(--ag-gold-2);
        font-size:.6rem;
        font-style:normal;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .dos-commander.is-superior {
        padding:8px;
        border-color:var(--ag-line-2);
    }
    .dos-avatar {
        flex:none;
        display:grid;
        place-items:center;
        width:42px;
        height:42px;
        border:1px solid var(--ag-gold);
        border-radius:50%;
        background:#0a1017;
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:.9rem;
        object-fit:cover;
    }
    .dos-chain {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:2px;
        margin:0;
        padding:0 0 0 14px;
        list-style:none;
    }
    .dos-chain::before {
        content:"";
        position:absolute;
        left:4px;
        top:18px;
        bottom:18px;
        border-left:1px dashed var(--ag-gold);
    }
    .dos-chain li { position:relative; }
    .dos-chain li::before {
        content:"";
        position:absolute;
        left:-13px;
        top:50%;
        width:8px;
        height:8px;
        border:1px solid var(--ag-gold);
        background:#0c131b;
        transform:translateY(-50%) rotate(45deg);
    }
    .dos-chain li.is-me::before { background:var(--ag-gold); }
    .dos-chain li.is-me .dos-commander strong { color:var(--ag-gold-2); }

    .dos-form {
        display:flex;
        flex-direction:column;
        gap:10px;
        min-width:min(520px,80vw);
    }
    .dos-form-grid {
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px;
    }
    .dos-form-row {
        display:flex;
        flex-direction:column;
    }
    .dos-form-note {
        margin:0;
        padding:7px 10px;
        border:1px dashed var(--paper-edge,#b9ab8c);
        background:rgba(45,111,124,.08);
        color:var(--ink-2);
        font-size:.7rem;
    }

    .dos-history {
        display:flex;
        flex-direction:column;
        gap:14px;
        padding-bottom:24px;
    }
    .dos-kpis {
        display:grid;
        grid-template-columns:repeat(5,minmax(0,1fr));
        gap:10px;
    }
    .dos-kpis > div {
        padding:10px 12px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,rgba(201,162,74,.08),transparent);
    }
    .dos-kpis small {
        display:block;
        color:var(--ag-muted);
        font-size:.56rem;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .dos-kpis strong {
        display:block;
        margin-top:4px;
        color:#f0f3f5;
        font-family:var(--ag-display);
        font-size:1.25rem;
        letter-spacing:.02em;
    }
    .dos-panel {
        padding:14px 16px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:var(--paper,#e9dfc4);
        color:var(--ink);
    }
    .dos-panel h3 {
        margin:0 0 10px;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:.95rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .dos-panel-head {
        display:flex;
        flex-wrap:wrap;
        justify-content:space-between;
        align-items:center;
        gap:8px;
        margin-bottom:6px;
    }
    .dos-panel-head h3 { margin:0; }
    .dos-strip {
        display:flex;
        height:22px;
        border:1px solid var(--ink-2);
        background:rgba(31,27,20,.05);
    }
    .dos-strip-part {
        min-width:4px;
        border-right:1px solid rgba(255,253,245,.7);
    }
    .dos-strip-part:last-child { border-right:0; }
    .dos-strip .is-c0, .dos-periods .is-c0 { background:#6b5a2e; }
    .dos-strip .is-c1, .dos-periods .is-c1 { background:#2d6f7c; }
    .dos-strip .is-c2, .dos-periods .is-c2 { background:#7a3b2e; }
    .dos-strip .is-c3, .dos-periods .is-c3 { background:#4b6b3a; }
    .dos-strip .is-c4, .dos-periods .is-c4 { background:#5a4a78; }
    .dos-strip .is-c5, .dos-periods .is-c5 { background:#8a6d2a; }
    .dos-strip .is-reserve, .dos-periods .is-reserve { background:repeating-linear-gradient(45deg,#b9ab8c 0 3px,#d8ccb0 3px 6px); }
    /* After the colours (same specificity): the current period keeps its colour under the stripes. */
    .dos-strip-part.is-current { background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.25) 0 4px,transparent 4px 8px); }
    .dos-periods {
        display:grid;
        grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
        gap:8px;
        margin:12px 0 0;
        padding:0;
        list-style:none;
    }
    .dos-periods li {
        display:flex;
        gap:8px;
        padding:6px 8px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.4);
    }
    .dos-periods li.is-current {
        border-color:var(--ink);
        box-shadow:2px 2px 0 rgba(93,79,49,.25);
    }
    .dos-periods li > i {
        flex:none;
        width:10px;
        align-self:stretch;
    }
    .dos-periods li > div {
        display:flex;
        flex-direction:column;
        gap:2px;
        min-width:0;
    }
    .dos-periods small {
        color:var(--ink-muted);
        font-size:.62rem;
    }
    .dos-panel .rec-tag {
        border-color:var(--ink-2);
        color:var(--ink-2);
    }
    .dos-unit-link {
        padding:0;
        border:0;
        background:none;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.9rem;
        text-align:left;
        text-decoration:underline dotted;
        text-underline-offset:3px;
        cursor:pointer;
    }
    .dos-unit-link.is-small {
        align-self:flex-start;
        margin-top:3px;
        color:var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .dos-filters {
        display:flex;
        flex-wrap:wrap;
        gap:4px;
    }
    .dos-filter {
        padding:3px 8px;
        border:1px solid var(--ink-2);
        background:transparent;
        color:var(--ink-2);
        font-family:var(--ag-mono);
        font-size:.6rem;
        letter-spacing:.08em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .dos-filter b {
        margin-left:4px;
        font-weight:700;
    }
    .dos-filter.is-active {
        background:var(--ink);
        color:var(--ag-gold-2);
    }
    .dos-year {
        margin:16px 0 6px;
        color:var(--ink-2);
        font-family:var(--ag-display);
        font-size:1.4rem;
        letter-spacing:.1em;
    }
    .dos-timeline {
        position:relative;
        margin:0;
        padding:0 0 0 34px;
        list-style:none;
    }
    .dos-timeline::before {
        content:"";
        position:absolute;
        left:13px;
        top:4px;
        bottom:4px;
        border-left:2px solid var(--ink-2);
    }
    .dos-timeline li {
        position:relative;
        padding:4px 0 10px;
    }
    .dos-dot {
        position:absolute;
        left:-34px;
        top:4px;
        display:grid;
        place-items:center;
        width:28px;
        height:28px;
        border:2px solid var(--ink-2);
        border-radius:50%;
        background:var(--paper,#e9dfc4);
        color:var(--ink);
        font-size:.8rem;
    }
    .dos-timeline li.is-good .dos-dot {
        border-color:#2c6b46;
        color:#2c6b46;
    }
    .dos-timeline li.is-bad .dos-dot {
        border-color:var(--stamp);
        color:var(--stamp);
    }
    .dos-timeline li.is-command .dos-dot {
        background:var(--ink);
        color:var(--ag-gold-2);
    }
    .dos-event {
        display:flex;
        flex-direction:column;
        padding:6px 10px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.45);
    }
    .dos-event small {
        color:var(--ink-2);
        font-size:.7rem;
    }
    .agency-stats > div.is-alert strong { color:#e0705f; }

    @media (max-width: 1100px) {
        .dos-layout { grid-template-columns:minmax(0,1fr); }
        .dos-side { position:static; }
        .dos-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
        .dos-form-grid { grid-template-columns:minmax(0,1fr); }
    }

    /* The dossier of an operator under the command, in a wide window over the staffing board. */
    .umap-modal.is-wide {
        width:min(1280px,calc(100vw - 32px));
        height:calc(100vh - 60px);
        max-height:none;
    }
    .umap-modal.is-wide .umap-modal-body {
        flex:1;
        min-height:0;
    }
    .dos-modal {
        display:flex;
        flex-direction:column;
        gap:10px;
    }
    .dos-modal .dos-side { position:static; }
    .dos-modal .dos-side-card { background:linear-gradient(180deg,#101922,#0c131b); }

    /* Choosing a node opens the side panel and narrows the graph: its toolbar keeps one line (it scrolls sideways if
       needed) so the graph does not jump under the pointer, and a double click lands on the node clicked first. */
    @media (min-width: 1101px) {
        .cg-toolbar {
            flex-wrap:nowrap;
            overflow-x:auto;
            scrollbar-width:none;
        }
        .cg-toolbar::-webkit-scrollbar { display:none; }
        .cg-toolbar > * { flex-shrink:0; }
        .cg-toolbar > .cg-find {
            flex:0 1 300px;
            min-width:160px;
        }
    }

} /* end of @layer app */

/* The dossier read by the chain above its direct command (PBI #175): without the personal data. */
.dossier-reduced { margin:0 0 12px; padding:10px 14px; border:1px solid var(--line, rgba(255,255,255,.15)); border-left:3px solid var(--gold, #c9a24a); border-radius:6px; font-size:.9rem; }


/* ==== cmd-affiliations.css ==== */
/* Unit Control · affiliations between units and notices
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ---- Affiliations between units and notices ---- */
    .aff-link {
        display:grid;
        grid-template-columns:minmax(0,1fr);
        gap:2px;
        padding:8px 10px;
        border:1px dashed var(--ag-line-2);
        background:rgba(201,162,74,.04);
    }
    .aff-link > div {
        display:flex;
        flex-direction:column;
        gap:2px;
    }
    .aff-link > div > small {
        color:var(--ag-muted);
        font-size:.55rem;
        letter-spacing:.16em;
        text-transform:uppercase;
    }
    .aff-link > span {
        align-self:center;
        justify-self:start;
        margin-left:18px;
        color:var(--ag-gold);
        font-size:.8rem;
    }
    .rec-status.is-aff-pending { color:var(--ag-gold-2); }
    .rec-status.is-aff-accepted { color:var(--ag-green); }
    .rec-status.is-aff-rejected, .rec-status.is-aff-released { color:#e0705f; }
    .rec-status.is-aff-withdrawn, .rec-status.is-aff-obsolete { color:var(--ag-muted); }
    /* The proposal form (manila window): numbered steps, direction cards with a small diagram, live search, preview. */
    .aff-modal { width:min(780px,calc(100vw - 32px)); }
    .aff-form {
        display:flex;
        flex-direction:column;
        gap:14px;
        min-width:0;
    }
    .aff-intro {
        margin:0;
        color:var(--ink-2);
        font-family:var(--ag-type);
        font-size:.8rem;
        line-height:1.45;
    }
    .aff-step {
        display:grid;
        grid-template-columns:28px minmax(0,1fr);
        gap:10px;
        align-items:start;
    }
    .aff-step-n {
        display:grid;
        place-items:center;
        width:26px;
        height:26px;
        border:1.5px solid var(--ink);
        border-radius:50%;
        color:var(--ink);
        font-family:var(--ag-display);
        font-size:.8rem;
        font-weight:700;
    }
    .aff-step-body {
        display:flex;
        flex-direction:column;
        gap:6px;
        min-width:0;
    }
    .aff-step-body > .form-label { margin:0; }
    .aff-step-hint, .aff-counter {
        color:var(--ink-muted);
        font-size:.66rem;
    }
    .aff-counter {
        align-self:flex-end;
        font-family:var(--ag-mono);
    }
    .aff-fixed {
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.95rem;
    }
    .aff-fixed small {
        margin-left:6px;
        color:var(--ink-muted);
        font-family:var(--ag-mono);
        font-size:.66rem;
    }
    .aff-direction {
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px;
    }
    .aff-choice {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:8px;
        padding:10px 12px 10px 34px;
        border:1px solid var(--paper-edge);
        background:rgba(255,253,245,.35);
        cursor:pointer;
        transition:border-color .12s, background .12s;
    }
    .aff-choice input {
        position:absolute;
        top:12px;
        left:12px;
        margin:0;
    }
    .aff-choice:hover:not(.is-disabled) { border-color:var(--ink-2); }
    .aff-choice.is-active {
        border-color:var(--ink);
        background:rgba(255,253,245,.75);
        box-shadow:3px 3px 0 rgba(93,79,49,.25);
    }
    .aff-choice.is-disabled {
        cursor:not-allowed;
        opacity:.62;
    }
    .aff-choice-text {
        display:flex;
        flex-direction:column;
        gap:2px;
    }
    .aff-choice-text strong {
        color:var(--ink);
        font-size:.8rem;
    }
    .aff-choice-text small {
        color:var(--ink-2);
        font-size:.68rem;
    }
    .aff-choice-why {
        color:var(--stamp);
        font-size:.64rem;
    }
    .aff-diagram {
        display:inline-flex;
        flex-direction:column;
        align-items:flex-start;
        gap:1px;
    }
    .aff-node {
        display:flex;
        flex-direction:column;
        min-width:150px;
        max-width:100%;
        padding:3px 8px;
        border:1px solid var(--ink-2);
        background:rgba(255,253,245,.8);
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.78rem;
        overflow-wrap:anywhere;
    }
    .aff-node small {
        color:var(--ink-muted);
        font-size:.52rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .aff-node.is-top { border-width:2px; }
    .aff-edge {
        margin-left:18px;
        color:var(--ink-2);
        font-size:.8rem;
        line-height:1;
    }
    .aff-diagram.is-compact .aff-node {
        min-width:0;
        padding:2px 6px;
        font-size:.68rem;
    }
    .aff-search { position:relative; }
    .aff-search-busy {
        position:absolute;
        top:50%;
        right:10px;
        transform:translateY(-50%);
        color:var(--ink-muted);
        font-size:.66rem;
    }
    .aff-results {
        display:flex;
        flex-direction:column;
        gap:6px;
        max-height:280px;
        overflow-y:auto;
        padding:2px;
    }
    .aff-result {
        display:flex;
        flex-direction:column;
        gap:4px;
        padding:6px 8px;
        border:1px solid var(--paper-edge);
        background:rgba(255,253,245,.55);
        text-align:left;
        cursor:pointer;
    }
    .aff-result:hover:not(:disabled), .aff-result:focus-visible {
        border-color:var(--ink);
        background:rgba(255,253,245,.9);
        outline:none;
    }
    .aff-result.is-unavailable {
        cursor:not-allowed;
        opacity:.6;
    }
    .aff-result-why {
        color:var(--stamp);
        font-size:.64rem;
    }
    .aff-empty {
        margin:4px 0;
        color:var(--ink-muted);
        font-size:.72rem;
    }
    .aff-chosen {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        padding:8px 10px;
        border:2px solid var(--ink);
        background:rgba(255,253,245,.8);
    }
    /* The unit lines are drawn for the dark pages: in the manila window they take the ink. */
    .aff-modal .rec-unit-text strong { color:var(--ink); }
    .aff-modal .rec-unit-text small, .aff-modal .rec-place { color:var(--ink-2); }
    .aff-modal .rec-tag {
        border-color:var(--swatch,var(--paper-edge));
        color:var(--ink-2);
    }
    .aff-preview {
        display:flex;
        flex-direction:column;
        gap:8px;
        margin-left:38px;
        padding:10px 12px;
        border:1px dashed var(--ink-2);
        background:rgba(255,253,245,.45);
    }
    .aff-preview > .form-label { margin:0; }
    .aff-summary {
        margin:0;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.84rem;
    }
    .aff-warning {
        margin:0;
        color:var(--stamp);
        font-size:.72rem;
    }
    .aff-modal .umap-modal-footer {
        align-items:center;
        justify-content:flex-end;
    }
    .aff-missing {
        margin-right:auto;
        color:var(--ink-muted);
        font-size:.68rem;
    }
    @media (max-width: 700px) {
        .aff-direction { grid-template-columns:minmax(0,1fr); }
        .aff-preview { margin-left:0; }
    }
    .cmd-nav-dot {
        width:8px;
        height:8px;
        margin-left:auto;
        border-radius:50%;
        background:var(--ag-gold-2);
        box-shadow:0 0 8px rgba(227,192,107,.7);
    }
    .notice-list {
        display:flex;
        flex-direction:column;
        gap:6px;
        margin:0 0 14px;
        padding:0;
        list-style:none;
    }
    .notice a {
        display:flex;
        align-items:center;
        gap:12px;
        padding:10px 12px;
        border:1px solid var(--ag-line-2);
        background:linear-gradient(180deg,#101922,#0b1219);
        color:inherit;
        text-decoration:none;
        transition:border-color .15s;
    }
    .notice a:hover { border-color:var(--ag-gold); }
    .notice.is-action a {
        border-color:rgba(227,192,107,.6);
        box-shadow:inset 3px 0 0 var(--ag-gold);
    }
    .notice.is-new a { background:linear-gradient(180deg,rgba(201,162,74,.12),#0b1219); }
    .notice-icon {
        flex:none;
        display:grid;
        place-items:center;
        width:34px;
        height:34px;
        border:1px solid var(--ag-gold);
        color:var(--ag-gold-2);
        font-size:1rem;
    }
    .notice-text {
        flex:1;
        min-width:0;
        display:flex;
        flex-direction:column;
        gap:2px;
    }
    .notice-text strong {
        color:#e8edf1;
        font-size:.78rem;
        font-weight:600;
    }
    .notice-text small {
        overflow:hidden;
        color:var(--ag-text-2);
        font-size:.66rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .notice-meta {
        flex:none;
        display:flex;
        flex-direction:column;
        align-items:flex-end;
        gap:2px;
    }
    .notice-meta time {
        color:var(--ag-muted);
        font-family:var(--ag-mono);
        font-size:.6rem;
    }
    .notice-meta em {
        color:var(--ag-gold-2);
        font-size:.58rem;
        font-style:normal;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    /* Critical: the chain of command changed. Red edge, red sign and a line with what it means. */
    .notice.is-critical a {
        border-color:rgba(200,50,58,.75);
        background:linear-gradient(180deg,rgba(200,50,58,.16),#0b1219);
        box-shadow:inset 4px 0 0 var(--ag-red);
    }
    .notice.is-critical a:hover { border-color:#e0565d; }
    .notice.is-critical .notice-icon { border-color:#e0565d; background:rgba(200,50,58,.18); color:#ff9a9f; }
    .notice.is-critical .notice-meta em { color:#ffb3b7; }
    .notice-impact { color:#ffc9cc; font-size:.68rem; line-height:1.4; }
    .notice-critical {
        padding:1px 6px;
        background:var(--ag-red);
        color:#fff;
        font-size:.55rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .agency-stats .is-critical { border-color:rgba(200,50,58,.75); }
    .agency-stats .is-critical strong { color:#ff9a9f; }
    .notice-new {
        padding:1px 6px;
        background:var(--ag-gold);
        color:#0a0a0a;
        font-size:.55rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    @media (max-width: 1100px) {
        .notice a { flex-wrap:wrap; }
    }

    /* The band "Chain of command" of a unit record (affiliations): where the unit stands, its pending proposals and
       what can be done, each action with its explanation; releasing is confirmed in a panel of its own. */
    .cmd-chain-band {
        display:flex;
        flex-direction:column;
        gap:10px;
        margin-bottom:12px;
        padding:10px 12px;
        border:1px dashed var(--paper-edge,#b9ab8c);
        background:rgba(201,162,74,.08);
        color:var(--ink);
    }
    .cmd-chain-band-head {
        display:flex;
        flex-wrap:wrap;
        align-items:baseline;
        gap:6px 12px;
    }
    .cmd-chain-band-head strong {
        font-family:var(--ag-display);
        font-size:.78rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .cmd-chain-pending {
        margin-left:auto;
        color:var(--stamp);
        font-size:.66rem;
        font-weight:700;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .cmd-chain-path {
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:0;
        margin:0;
        padding:0;
        list-style:none;
    }
    .cmd-chain-node {
        position:relative;
        display:flex;
        flex-direction:column;
        gap:2px;
        min-width:0;
        padding:6px 10px;
        border:1px solid var(--paper-edge,#b9ab8c);
        background:rgba(255,253,245,.45);
    }
    .cmd-chain-node + .cmd-chain-node { margin-left:22px; }
    .cmd-chain-node + .cmd-chain-node::before {
        content:"\2192\FE0E";
        position:absolute;
        top:50%;
        left:-18px;
        transform:translateY(-50%);
        color:var(--ink-2);
    }
    .cmd-chain-node small {
        color:var(--ink-muted,#7a6e55);
        font-size:.52rem;
        letter-spacing:.14em;
        text-transform:uppercase;
    }
    .cmd-chain-node > span, .cmd-chain-link {
        overflow:hidden;
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:.84rem;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .cmd-chain-node.is-self {
        border:2px solid var(--ink);
        background:rgba(255,253,245,.8);
    }
    .cmd-chain-node.is-none > span {
        color:var(--ink-muted,#7a6e55);
        font-style:italic;
        white-space:normal;
    }
    .cmd-chain-link {
        padding:0;
        border:0;
        background:none;
        text-align:left;
        text-decoration:underline dotted;
        cursor:pointer;
    }
    .cmd-chain-link:hover { text-decoration:underline; }
    .cmd-chain-node > .cmd-chain-children {
        display:flex;
        flex-wrap:wrap;
        gap:2px 10px;
        white-space:normal;
    }
    .cmd-chain-more {
        color:var(--ink-muted,#7a6e55);
        font-family:var(--ag-mono);
        font-size:.66rem;
    }
    .cmd-chain-proposals {
        display:flex;
        flex-direction:column;
        gap:4px;
        margin:0;
        padding:0;
        list-style:none;
    }
    .cmd-chain-proposals li {
        display:flex;
        flex-wrap:wrap;
        align-items:baseline;
        gap:4px 10px;
        padding:4px 8px;
        border-left:3px solid var(--ag-gold,#c9a24a);
        background:rgba(255,253,245,.4);
        font-size:.74rem;
    }
    .cmd-chain-proposals a {
        margin-left:auto;
        color:var(--stamp);
        font-size:.64rem;
        font-weight:700;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .cmd-chain-proposal-dir {
        color:var(--ink-2);
        font-size:.6rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-chain-actions {
        display:grid;
        grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
        gap:8px;
    }
    .cmd-chain-action {
        display:flex;
        flex-direction:column;
        gap:3px;
        padding:8px 10px;
        border:1px solid var(--ink-2);
        background:rgba(255,253,245,.55);
        color:var(--ink);
        text-align:left;
        cursor:pointer;
    }
    .cmd-chain-action strong {
        font-size:.7rem;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    .cmd-chain-action small {
        color:var(--ink-2);
        font-size:.68rem;
        line-height:1.35;
    }
    .cmd-chain-action:hover:not(:disabled) {
        border-color:var(--ink);
        background:rgba(255,253,245,.9);
        box-shadow:2px 2px 0 rgba(93,79,49,.25);
    }
    .cmd-chain-action:disabled {
        cursor:not-allowed;
        opacity:.65;
    }
    .cmd-chain-action:disabled small { color:var(--stamp); }
    /* Dangerous actions on paper: a deep red on a light card. */
    .cmd-chain-action.is-danger {
        border-color:rgba(168,38,31,.55);
        background:rgba(255,253,245,.75);
    }
    .cmd-chain-action.is-danger strong { color:var(--uc-red-paper); }
    @media (max-width: 700px) {
        .cmd-chain-path {
            grid-template-columns:minmax(0,1fr);
            gap:18px;
        }
        .cmd-chain-node + .cmd-chain-node { margin-left:0; }
        .cmd-chain-node + .cmd-chain-node::before {
            content:"";
            top:-13px;
            left:14px;
            width:7px;
            height:7px;
            border:solid var(--ink-2);
            border-width:0 1.5px 1.5px 0;
            transform:rotate(45deg);
        }
    }

    /* The command could not be read (the API restarting, the network back from sleep): it is read again by itself. */
    .cmd-offline {
        flex:none;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        padding:8px 12px;
        border:1px solid #b07a12;
        background:rgba(176,122,18,.12);
        color:#f0d9a0;
        font-size:.72rem;
        letter-spacing:.04em;
    }

} /* end of @layer app */


/* ==== cmd-ux.css ==== */
/* Unit Control · design system passes (labels, states, containers, actions, inspector, contrast, icons, tree, map views, timeline)
   Part of the former command.css, split by screen (cmd-*.css, linked in this order: core, staff, graph,
   map-create, recruitment, dossier, affiliations, ux, territory). In the app layer (tokens.css declares the layers). */
@layer app {
    /* ==================================================================================================================
       Unit Control design system. One visual language for every module (units, dossier, history, chain of command,
       staffing): the tokens first, then what uses them. Loaded last, so it wins over the shared styles; the
       administration panel does not load this file.
       ================================================================================================================== */

    /* ---- Phase 1 · Tokens: in tokens.css (shared with the administration panel, loaded first). -------------------- */

    /* ---- Phase 1 · Labels -------------------------------------------------------------------------------------- */
    .agency-stats small, .agency-nav-title, .cmd-staff-toolbar label > span, .dos-side-facts dt, .cmd-card small, .cmd-card-figures small, .cg-legend,
    .cmd-column-parent {
        color:var(--uc-label-dark);
        font-size:var(--uc-label-size);
        font-weight:var(--uc-label-weight);
        letter-spacing:var(--uc-label-tracking);
    }
    /* (.cmd-chain-node small and .aff-node small take the same ink in the forced layer, at the end: they are small texts of the paper.) */
    .entity-details-panel .form-label, .entity-details-panel .dossier-facts dt, .umap-modal .form-label, .cmd-chain-node small, .aff-node small,
    .cmd-hq-coords label, .uc-inspector-metrics dt, .dos-sheet .dossier-facts dt {
        color:var(--uc-label-paper);
        font-size:var(--uc-label-size);
        font-weight:var(--uc-label-weight);
        letter-spacing:var(--uc-label-tracking);
    }
    .entity-details-panel .form-text, .entity-details-panel .command-hint, .umap-modal .form-text {
        color:var(--uc-label-paper);
        font-size:.7rem;
        font-weight:500;
    }
    .entity-details-panel .dossier-facts dd, .dos-sheet .dossier-facts dd { color:var(--ink); }

    /* ---- Phase 1 · States (dots, tags, bars) ---------------------------------------------------------------------- */
    .agency-status-tag, .cmd-authority, .cmd-owner-tag, .cmd-post-tag, .uc-state {
        display:inline-flex;
        align-items:center;
        gap:4px;
        padding:2px 7px;
        border:var(--uc-border) solid currentColor;
        border-radius:var(--uc-radius);
        font-size:.6rem;
        font-style:normal;
        font-weight:700;
        letter-spacing:.1em;
        line-height:1.35;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .agency-status-tag.is-ok, .uc-state.is-ok, .cmd-owner-tag {
        border-color:currentColor;
        background:var(--uc-green-bg);
        color:var(--uc-green);
    }
    .agency-status-tag.is-neutral, .uc-state.is-idle {
        border-color:currentColor;
        background:var(--uc-grey-bg);
        color:var(--uc-grey);
    }
    .agency-status-tag.is-bad {
        border-color:currentColor;
        background:var(--uc-red-bg);
        color:var(--uc-red);
    }
    .cmd-authority.is-command {
        background:var(--uc-amber-bg);
        color:var(--uc-amber);
    }
    .cmd-authority.is-staff {
        border-style:dashed;
        background:var(--uc-grey-bg);
        color:var(--uc-grey);
    }
    .cmd-post-tag {
        border-color:transparent;
        background:var(--uc-amber-bg);
        color:var(--uc-amber-2);
    }
    /* On paper the same states take their darker inks (the bright ones are for the dark panels). */
    .entity-details-panel .agency-status-tag.is-ok, .entity-details-panel .uc-state.is-ok, .entity-details-panel .cmd-owner-tag { color:var(--uc-green-paper); }
    .entity-details-panel .agency-status-tag.is-neutral, .entity-details-panel .uc-state.is-idle { color:var(--uc-grey-paper); }
    .entity-details-panel .agency-status-tag.is-bad { color:var(--uc-red-paper); }
    .entity-details-panel .cmd-authority.is-command {
        background:rgba(168,118,24,.14);
        color:#7a5410;
    }
    .entity-details-panel .cmd-authority.is-staff { color:var(--uc-grey-paper); }
    .entity-details-panel .cmd-post-tag {
        background:rgba(168,118,24,.14);
        color:#7a5410;
    }
    .cmd-graph-side .cmd-authority.is-command {
        background:var(--uc-amber-bg);
        color:var(--uc-amber);
    }
    .cmd-graph-side .cmd-owner-tag, .cmd-graph-side .uc-state.is-ok { color:var(--uc-green); }
    .cmd-graph-side .uc-state.is-idle, .cmd-graph-side .cmd-authority.is-staff { color:var(--uc-grey); }
    /* Vacant posts: low-intensity grey everywhere. */
    .cmd-post-slot.is-vacant span, .fact-vacant { color:var(--uc-grey); }
    .entity-details-panel .fact-vacant { color:var(--uc-grey-paper); }
    /* Progress towards the next echelon: one amber bar on a neutral track. */
    .cmd-echelon-bar {
        height:5px;
        overflow:hidden;
        border-radius:var(--uc-radius);
        background:rgba(151,163,174,.18);
    }
    .cmd-echelon-bar i {
        display:block;
        height:100%;
        border-radius:var(--uc-radius);
        background:linear-gradient(90deg,var(--uc-amber),var(--uc-amber-2));
        transition:width .4s ease;
    }
    .entity-details-panel .cmd-echelon-bar { background:rgba(70,63,48,.18); }
    .entity-details-panel .cmd-echelon-count {
        color:#7a5410;
        font-weight:700;
    }

    /* ---- Phase 1 · Containers and cards --------------------------------------------------------------------------- */
    .cmd-column, .cmd-card, .dos-side-card, .cg-unit, .cg-staff, .cmd-hq-card, .cmd-hq-form, .cmd-chain-band, .cmd-chain-node, .cmd-chain-action,
    .cmd-chain-release, .aff-choice, .aff-result, .aff-chosen, .aff-preview, .uc-inspector-head, .entity-details-panel, .entity-record-list, .rec-card,
    .notice a {
        border-radius:var(--uc-radius);
    }
    .cmd-column, .dos-side-card, .cg-unit, .cg-staff, .entity-record-list { box-shadow:var(--uc-shadow-dark); }
    .cmd-hq-card, .uc-inspector-head, .cmd-chain-action, .aff-choice.is-active { box-shadow:var(--uc-shadow-paper); }
    /* The active selection: amber, the same glow wherever something is selected. */
    .cmd-tree-row.is-selected, .rec-row.is-selected {
        border-left-color:var(--uc-amber);
        background:linear-gradient(90deg,var(--uc-amber-bg),transparent);
    }
    .cg-node.is-selected .cg-title strong { color:var(--uc-amber-2); }
    /* States of a graph node, after its hover (same specificity, .cg first): chain < drop < selected. */
    .cg .cg-node.is-chain > * { border-color:var(--ag-gold); }
    .cg .cg-staff.is-drop, .cg .cg-op.is-drop {
        border-color:var(--ag-gold);
        box-shadow:0 0 0 2px var(--ag-gold),0 0 22px rgba(227,192,107,.35);
    }
    .cg .cg-node.is-selected > * {
        border-color:var(--uc-amber);
        box-shadow:var(--uc-glow);
    }

    /* ---- Phase 2 · Calls to action -------------------------------------------------------------------------------- */
    .entity-details-panel .btn-primary, .umap-modal-footer .btn-primary, .cmd-graph-side .btn-primary {
        border:var(--uc-border) solid var(--uc-cta-border);
        border-radius:var(--uc-radius);
        background:var(--uc-cta);
        color:var(--uc-cta-text);
        font-weight:700;
        box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 2px 6px rgba(93,79,49,.25);
    }
    .entity-details-panel .btn-primary:hover:not(:disabled), .umap-modal-footer .btn-primary:hover:not(:disabled), .cmd-graph-side .btn-primary:hover {
        border-color:var(--uc-cta-border);
        background:var(--uc-cta-hover);
        color:var(--uc-cta-text);
    }
    .entity-details-panel .btn-primary:disabled, .umap-modal-footer .btn-primary:disabled {
        opacity:.55;
        box-shadow:none;
    }
    .entity-details-panel .btn-secondary, .entity-details-panel .btn-outline-secondary, .umap-modal-footer .btn-secondary,
    .umap-modal-footer .btn-outline-secondary {
        border:var(--uc-border) solid var(--ink-2);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ink-2);
        font-weight:600;
    }
    .entity-details-panel .btn-outline-primary, .entity-details-panel .btn-outline-danger, .cmd-graph-side .btn-outline-primary {
        border-radius:var(--uc-radius);
    }

    /* ---- Phase 2 · Unit form -------------------------------------------------------------------------------------- */
    .cmd-form-unit { position:relative; }
    /* Identity: the insignia (or the flag) in a header block of its own, the data beside it. */
    .cmd-form-identity {
        display:grid;
        grid-template-columns:172px minmax(0,1fr);
        gap:6px 18px;
        align-items:start;
        margin-bottom:6px;
        padding:12px 14px 4px;
        border:var(--uc-border) solid var(--paper-edge);
        border-radius:var(--uc-radius);
        background:rgba(255,253,245,.45);
    }
    .cmd-form-seal {
        display:flex;
        flex-direction:column;
        gap:6px;
        padding-bottom:10px;
    }
    .cmd-form-identity-fields { margin:0; }
    .agency-image-field.is-compact {
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:6px;
    }
    .agency-image-field.is-compact .agency-image-preview {
        width:148px;
        height:148px;
        border-radius:var(--uc-radius);
    }
    .agency-image-field.is-compact .agency-image-preview img {
        width:100%;
        height:100%;
        object-fit:contain;
    }
    .agency-image-tools {
        display:flex;
        justify-content:center;
        gap:6px;
    }
    .agency-image-tool {
        display:inline-grid;
        place-items:center;
        width:34px;
        height:30px;
        padding:0;
        border-radius:var(--uc-radius);
        line-height:1;
    }
    .agency-image-tool svg {
        width:16px;
        height:16px;
    }
    .agency-image-meta {
        color:var(--uc-label-paper);
        font-family:var(--ag-mono);
        font-size:.62rem;
        font-weight:500;
        text-align:center;
    }
    /* Command posts: two columns, each with its sign on the left. */
    .cmd-posts-grid {
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:2px 18px;
    }
    .cmd-post-field {
        display:grid;
        grid-template-columns:30px minmax(0,1fr);
        gap:8px;
        align-items:start;
        min-width:0;
    }
    /* .cmd-post-field > .mb-3 (beats the framework's !important utility): forced layer, at the end. */
    .cmd-post-icon {
        display:grid;
        place-items:center;
        width:30px;
        height:30px;
        margin-top:21px;
        border:var(--uc-border) solid currentColor;
        border-radius:var(--uc-radius);
        background:rgba(255,253,245,.7);
    }
    .cmd-post-icon.is-firstincommand {
        color:#8a5f0d;
        background:rgba(232,176,64,.22);
    }
    .cmd-post-icon.is-secondincommand { color:#8a5f0d; }
    .cmd-post-icon.is-operationschief { color:var(--uc-green-paper); }
    .cmd-post-icon.is-intelligencechief { color:#245f6c; }
    .cmd-posts-hint { margin:-2px 0 4px 38px; }
    .cmd-form .cmd-form-section {
        margin:16px 0 8px;
        padding-top:12px;
        border-top:1px solid rgba(70,63,48,.28);
        color:var(--ink);
        font-size:.95rem;
        font-weight:700;
        letter-spacing:.12em;
        text-transform:uppercase;
    }
    /* The action bar: opaque and sticky at the bottom of the unit's part (it never covers a field nor the headquarters). */
    .cmd-form .form-actions {
        position:sticky;
        bottom:0;
        z-index:6;
        display:flex;
        justify-content:flex-end;
        align-items:center;
        gap:10px;
        margin:18px 0 0;
        padding:12px 14px;
        border:var(--uc-border) solid var(--paper-edge);
        border-radius:var(--uc-radius);
        background:#dccfae;
        box-shadow:0 -8px 16px rgba(93,79,49,.18);
    }
    .cmd-form .form-actions .btn { min-width:120px; }
    @media (max-width: 860px) {
        .cmd-form-identity { grid-template-columns:minmax(0,1fr); }
        .cmd-posts-grid { grid-template-columns:minmax(0,1fr); }
    }

    /* ---- Phase 3 · Inspector of a unit (identity · metrics · actions) --------------------------------------------- */
    .uc-inspector-head {
        --uc-surface:rgba(255,253,245,.72);
        --uc-ink:var(--ink);
        --uc-ink-2:var(--ink-2);
        --uc-line:rgba(70,63,48,.26);
        display:flex;
        flex-direction:column;
        gap:12px;
        margin-bottom:14px;
        padding:14px 16px;
        border:var(--uc-border) solid var(--paper-edge);
        border-top:3px solid var(--uc-amber);
        background:var(--uc-surface);
        color:var(--uc-ink);
    }
    .uc-inspector-identity {
        display:grid;
        grid-template-columns:64px minmax(0,1fr);
        gap:14px;
        align-items:center;
    }
    .uc-inspector-identity .cg-insignia {
        width:64px;
        height:64px;
    }
    .uc-inspector-identity .umap-generic {
        display:grid;
        place-items:center;
        width:64px;
        height:64px;
    }
    .uc-inspector-title {
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:0;
    }
    .uc-inspector-title h2 {
        margin:0;
        overflow:hidden;
        color:var(--uc-ink);
        font-family:var(--ag-type);
        font-size:1.45rem;
        font-weight:400;
        letter-spacing:0;
        text-overflow:ellipsis;
        text-transform:none;
        white-space:nowrap;
    }
    .uc-inspector-code {
        color:var(--uc-ink-2);
        font-family:var(--ag-mono);
        font-size:.72rem;
        font-weight:500;
    }
    .uc-inspector-chips {
        display:flex;
        flex-wrap:wrap;
        gap:6px;
        margin-top:3px;
    }
    .uc-inspector-metrics {
        display:grid;
        grid-template-columns:repeat(4,minmax(0,1fr));
        gap:0;
        margin:0;
        border-top:1px solid var(--uc-line);
    }
    .uc-inspector-metrics > div {
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:0;
        padding:8px 10px 8px 0;
        border-bottom:1px solid var(--uc-line);
    }
    .uc-inspector-metrics > div.is-wide { grid-column:1 / -1; }
    .uc-inspector-metrics dt {
        font-family:var(--ag-mono);
        text-transform:uppercase;
    }
    .uc-inspector-metrics dd {
        margin:0;
        color:var(--uc-ink);
        font-family:var(--ag-type);
        font-size:.92rem;
        overflow-wrap:anywhere;
    }
    .uc-inspector-metrics dd small {
        display:block;
        color:var(--uc-ink-2);
        font-family:var(--ag-mono);
        font-size:.62rem;
    }
    .uc-inspector-link {
        padding:0;
        border:0;
        background:none;
        color:var(--uc-ink);
        text-decoration:underline dotted;
        cursor:pointer;
    }
    .uc-inspector-link:hover { text-decoration:underline; }
    .uc-muted {
        color:var(--uc-ink-2);
        font-style:italic;
    }
    .uc-inspector-actions {
        display:flex;
        flex-wrap:wrap;
        gap:8px;
        padding-top:2px;
    }
    .uc-inspector-actions .btn-primary { margin-left:auto; }
    /* The same head on the dark side panel of the staffing graph. */
    .cmd-graph-side .uc-inspector-head {
        --uc-surface:linear-gradient(180deg,#121b25,#0c131b);
        --uc-ink:#e8edf1;
        --uc-ink-2:var(--uc-label-dark);
        --uc-line:var(--ag-line-2);
        margin:0;
        border:0;
        border-top:3px solid var(--uc-amber);
        border-bottom:var(--uc-border) solid var(--ag-line-2);
        border-radius:0;
        box-shadow:none;
        padding-right:48px;
    }
    .cmd-graph-side .uc-inspector-metrics dt { color:var(--uc-label-dark); }
    .cmd-graph-side .uc-inspector-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cmd-graph-side .uc-inspector-actions .btn-outline-primary {
        border:var(--uc-border) solid rgba(232,176,64,.6);
        background:transparent;
        color:var(--uc-amber-2);
        font-weight:600;
    }
    .cmd-graph-side .uc-inspector-actions .btn-outline-primary:hover { background:var(--uc-amber-bg); }
    /* Beside a graph the inspector belongs to the selected node: the same amber as its frame. */
    .cmd-graph-workspace.has-details .entity-details-panel.is-side {
        border-color:rgba(232,176,64,.55);
        box-shadow:-2px 0 0 var(--uc-amber), var(--uc-shadow-dark);
    }
    @media (max-width: 1100px) {
        .uc-inspector-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }

    /* ---- Buttons on the dark panels: the system accent, never the framework blue ------------------------------------ */
    .dos-side .btn-primary, .cmd-staff-toolbar .btn-primary, .rec-toolbar .btn-primary {
        border:var(--uc-border) solid var(--uc-cta-border);
        border-radius:var(--uc-radius);
        background:var(--uc-cta);
        color:var(--uc-cta-text);
        font-weight:700;
    }
    .dos-side .btn-primary:hover, .cmd-staff-toolbar .btn-primary:hover, .rec-toolbar .btn-primary:hover {
        background:var(--uc-cta-hover);
        color:var(--uc-cta-text);
    }
    .dos-side .btn-outline-primary, .cmd-staff-toolbar .btn-outline-primary, .rec-toolbar .btn-outline-primary,
    .cmd-graph-side .cmd-cards .btn-outline-primary {
        border:var(--uc-border) solid rgba(232,176,64,.6);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--uc-amber-2);
        font-weight:600;
    }
    .dos-side .btn-outline-primary:hover, .cmd-staff-toolbar .btn-outline-primary:hover, .rec-toolbar .btn-outline-primary:hover {
        border-color:var(--uc-amber);
        background:var(--uc-amber-bg);
        color:var(--uc-amber-2);
    }

    /* ---- Narrow screens: the navigation wraps in columns instead of being cut ----------------------------------------- */
    @media (max-width: 700px) {
        .entity-sidebar {
            display:grid;
            grid-template-columns:repeat(2,minmax(0,1fr));
            gap:4px 12px;
            overflow:visible;
        }
        .entity-sidebar .agency-nav-group { min-width:0; }
        .entity-sidebar .entity-nav-item {
            overflow:hidden;
            text-overflow:ellipsis;
            white-space:nowrap;
        }
    }

    /* ---- Icons (Lucide) ----------------------------------------------------------------------------------------------- */
    .uc-icon {
        flex:none;
        display:inline-block;
        vertical-align:-0.15em;
    }
    .entity-nav-item {
        display:flex;
        align-items:center;
    }
    .cmd-nav-icon {
        width:16px;
        height:16px;
        margin-right:10px;
        color:var(--uc-label-dark);
    }
    .entity-nav-item.active .cmd-nav-icon, .entity-nav-item:hover .cmd-nav-icon { color:var(--uc-amber-2); }
    .entity-list-header h2 .uc-icon { color:var(--uc-amber-2); }
    .btn .uc-icon { margin-right:4px; }

    /* ---- Units tree (ARIA tree) ------------------------------------------------------------------------------------- */
    .cmd-tree-search-icon {
        position:absolute;
        left:22px;
        display:flex;
        color:var(--uc-label-dark);
        pointer-events:none;
    }
    .cmd-tree-search .form-control::placeholder { color:#8d9aa6; }
    .cmd-tree-tools {
        display:flex;
        gap:4px;
    }
    .cmd-tree-tool {
        display:grid;
        place-items:center;
        width:30px;
        height:30px;
        padding:0;
        border:var(--uc-border) solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:#0b121a;
        color:var(--uc-label-dark);
    }
    .cmd-tree-tool:hover:not(:disabled), .cmd-tree-tool:focus-visible {
        border-color:rgba(232,176,64,.6);
        color:var(--uc-amber-2);
        outline:none;
    }
    .cmd-tree-tool:disabled { opacity:.4; }
    .cmd-tree-view {
        display:flex;
        flex-direction:column;
    }
    .cmd-tree-guides {
        position:absolute;
        top:0;
        bottom:0;
        left:12px;
        width:calc(var(--depth,0) * 20px);
        pointer-events:none;
        background:repeating-linear-gradient(90deg, transparent 0 8px, rgba(151,163,174,.3) 8px 9px, transparent 9px 20px);
    }
    .cmd-tree-toggle {
        grid-area:toggle;
        display:grid;
        place-items:center;
        width:18px;
        height:18px;
        border-radius:var(--uc-radius);
        color:var(--uc-label-dark);
        transition:transform .15s ease, color .15s;
    }
    .cmd-tree-toggle.is-open { transform:rotate(90deg); }
    .cmd-tree-toggle:not(.is-leaf):hover {
        background:rgba(232,176,64,.14);
        color:var(--uc-amber-2);
    }
    .cmd-tree-toggle.is-leaf::before {
        content:"";
        width:5px;
        height:5px;
        border-radius:50%;
        background:rgba(151,163,174,.5);
    }
    .cmd-tree-emblem {
        grid-area:emblem;
        display:grid;
        place-items:center;
    }
    .cmd-tree-emblem .cg-insignia {
        width:30px;
        height:30px;
    }
    .cmd-tree-emblem .cg-insignia.is-empty { font-size:.6rem; }
    .cmd-tree-hidden {
        margin-left:6px;
        padding:0 6px;
        border:var(--uc-border) solid rgba(151,163,174,.45);
        border-radius:999px;
        color:var(--uc-label-dark);
        font-weight:600;
    }
    .cmd-tree-row:focus-visible { box-shadow:inset 0 0 0 2px var(--uc-amber); }
    .cmd-tree-row.is-match .cmd-tree-main strong { color:var(--uc-amber-2); }
    .cmd-tree-row.is-context { opacity:.72; }

    /* ---- Detail records: the data stands out, the relations are illustrated ------------------------------------------- */
    .entity-details-panel .dossier-facts dd, .dos-sheet .dossier-facts dd, .umap-modal .dossier-facts dd {
        color:#14110b;
        font-size:1rem;
        line-height:1.35;
    }
    .entity-details-panel .dossier-facts > div, .dos-sheet .dossier-facts > div { border-bottom-color:rgba(70,63,48,.32); }
    .entity-details-panel .dossier-section > h3, .dos-sheet .dossier-section > h3, .umap-modal .dossier-section > h3 {
        color:var(--ink);
        font-weight:700;
        letter-spacing:.14em;
    }
    .dossier-link.has-picture {
        padding:6px 10px 6px 6px;
        border:var(--uc-border) solid rgba(70,63,48,.35);
        border-radius:var(--uc-radius);
        background:rgba(255,253,245,.62);
        box-shadow:var(--uc-shadow-paper);
    }
    .dossier-link.has-picture:hover {
        border-color:var(--ink-2);
        background:rgba(255,253,245,.92);
    }
    .dossier-link.has-picture strong {
        color:var(--ink);
        font-size:.95rem;
    }
    .dossier-link.has-picture em {
        color:var(--uc-label-paper);
        font-size:.64rem;
        font-weight:500;
    }
    .dossier-link-image, .dossier-link-initials, .dossier-link-picture .dos-avatar {
        width:38px;
        height:38px;
    }
    .dossier-link-image.is-emblem {
        object-fit:contain;
        filter:drop-shadow(0 1px 2px rgba(0,0,0,.35));
    }
    .dossier-link-image.is-photo {
        border:2px solid rgba(70,63,48,.45);
        border-radius:50%;
        object-fit:cover;
    }
    .dossier-link-initials {
        display:grid;
        place-items:center;
        border:var(--uc-border) solid var(--ink-2);
        background:rgba(232,176,64,.18);
        color:#5c400c;
        font-family:var(--ag-mono);
        font-size:.72rem;
        font-weight:700;
    }
    .dossier-link-initials.is-photo { border-radius:50%; }
    .dossier-link-initials.is-emblem { clip-path:polygon(0 0,100% 0,100% 62%,50% 100%,0 62%); }
    .dossier-link-picture .dos-avatar {
        display:grid;
        place-items:center;
        border-radius:50%;
        font-size:.72rem;
        object-fit:cover;
    }

    /* ---- Contrast pass (WCAG AA, measured on every page with an automated audit of the pixels under each text) ---------
       The two secondary greys are the root of most failures, so they are corrected as tokens: everything that uses them
       (codes, dates, notes, hints, legends) reaches at least 4.5:1 on its own surface. Those two tokens (--ag-muted,
       --ink-muted) are in tokens.css, so the administration panel has them too. */
    /* User block of the sidebar. */
    .auth-user-name span, .auth-user-actions .btn { color:var(--uc-label-dark); }
    .auth-user-actions .btn { border-color:var(--ag-line-2); }
    .auth-user-actions .btn:hover {
        color:var(--uc-amber-2);
        border-color:rgba(232,176,64,.6);
    }
    /* Sign-in card (paper): the language and the "create an account" link in ink. */
    .auth-card .agency-lang { color:var(--ink-2); }
    .auth-card .btn-link {
        color:var(--uc-red-paper);
        font-weight:600;
    }
    /* Inactive operators: readable, marked by a dashed border and their tag instead of fading away. */
    .cmd-card-op.is-inactive {
        opacity:1;
        border-style:dashed;
    }
    .cmd-card-op.is-inactive .cmd-card-text strong { color:#c3ccd4; }
    .cmd-card-op.is-inactive .cmd-card-text small { color:var(--uc-grey); }
    .cg-photo.is-empty, .cmd-avatar, .cg-person .cg-title small { color:var(--uc-amber-2); }
    /* Dark side panel of the staffing graph: its figures in light inks, not the paper ones. */
    .cmd-graph-side .cmd-echelon-count { color:var(--uc-amber-2); }
    /* (.cmd-graph-side .uc-inspector-head small and .uc-inspector-code: small texts, in the forced layer at the end.) */
    /* The dossier window is paper: its tabs and the figures of the history in ink. */
    .dos-modal .cmd-view-tab { color:var(--ink-2); }
    .dos-modal .cmd-view-tab:hover {
        color:var(--ink);
        background:rgba(70,63,48,.08);
    }
    .dos-modal .dos-kpis > div, .entity-details-panel .dos-kpis > div {
        border-color:rgba(70,63,48,.35);
        background:rgba(255,253,245,.6);
    }
    .dos-modal .dos-kpis small, .entity-details-panel .dos-kpis small {
        color:var(--uc-label-paper);
        font-size:var(--uc-label-size);
        font-weight:var(--uc-label-weight);
    }
    .dos-modal .dos-kpis strong, .entity-details-panel .dos-kpis strong { color:var(--ink); }
    /* States outside the record panels (profile, windows) also take their paper inks. */
    :is(.profile-page, .umap-modal, .auth-card) .agency-status-tag.is-ok { color:var(--uc-green-paper); }
    :is(.profile-page, .umap-modal, .auth-card) .agency-status-tag.is-neutral { color:var(--uc-grey-paper); }
    :is(.profile-page, .umap-modal, .auth-card) .agency-status-tag.is-bad { color:var(--uc-red-paper); }
    /* Outline buttons on paper in ink (never the framework blue); on the dark pages in amber. */
    .agency-image-actions .btn-outline-primary, .profile-page .btn-outline-primary {
        border-color:var(--ink-2);
        background:transparent;
        color:var(--ink);
    }
    .rec-page .btn-outline-primary {
        border:var(--uc-border) solid rgba(232,176,64,.6);
        background:transparent;
        color:var(--uc-amber-2);
    }
    .rec-page .btn-primary {
        border:var(--uc-border) solid var(--uc-cta-border);
        background:var(--uc-cta);
        color:var(--uc-cta-text);
        font-weight:700;
    }
    .cmd-form .form-actions .btn-secondary {
        border-color:var(--ink-2);
        color:var(--ink);
    }
    /* Map attribution: legible on any base layer (unlayered, with the Leaflet chrome, at the end). */
    /* The paper keeps its look, but its vignette no longer darkens the text in the corners (it brought data under 4.5:1). */
    /* Not inside another window (.is-embedded): there the window is already the paper, a second one shows as a shaded block. */
    .entity-details-panel:not(.cmd-graph-side, .is-embedded) {
        background:
            radial-gradient(circle at 18% 12%,rgba(255,255,255,.35),transparent 40%),
            radial-gradient(circle at 85% 90%,rgba(140,110,50,.07),transparent 45%),
            repeating-linear-gradient(0deg,rgba(90,70,30,.03) 0 1px,transparent 1px 26px),
            linear-gradient(180deg,var(--paper),var(--paper-2));
        box-shadow:inset 0 0 28px rgba(120,90,40,.1),0 10px 30px rgba(0,0,0,.5);
    }
    /* The active tab of the dossier window: amber on ink, like the pages' tabs. */
    .dos-modal .cmd-view-tab.is-active {
        border-color:var(--ink);
        background:var(--ink);
        color:var(--uc-amber-2);
    }
    /* (.cmd-graph-side small and p: the shared paper rule colours them with !important, so this is in the forced layer.) */
    /* A deep red on paper; the shared hover (relations.css) still fills it with the stamp red and light text. */
    .rel-icon.is-danger:not(:hover) { color:#86191a; }
    /* The screen vignette (over the whole application) darkened the data near the edges by up to 45%: now a light touch. */
    .entity-admin-shell::after {
        background:
            repeating-linear-gradient(0deg,rgba(255,255,255,.012) 0 1px,transparent 1px 3px),
            radial-gradient(ellipse at center,transparent 72%,rgba(0,0,0,.14) 100%);
    }
    /* Vacant and inactive in the staffing graph: the grey of the palette and a dashed outline, not transparency. */
    .cg-op.is-head.is-vacant .cg-person, .cg-op.is-inactive { opacity:1; }
    /* .cg prefix: (0,3,1), after the selected node title (same specificity), which it overrides. */
    .cg-op.is-head.is-vacant .cg-person strong, .cg .cg-op.is-inactive strong { color:var(--uc-grey); }
    .cg-op.is-head.is-vacant .cg-photo, .cg-op.is-inactive .cg-photo {
        border-style:dashed;
        border-color:var(--uc-grey);
    }
    .cg-op.is-head.is-vacant .cg-photo.is-empty {
        background:transparent;
        color:var(--uc-grey);
    }
    .cg-op.is-inactive { border-style:dashed; }
    /* Empty states of the career pages: their link to act in amber on the dark page. */

    /* ---- Map: the two views (my command / whole world) ----------------------------------------------------------------- */
    .cmd-map-scope {
        display:flex;
        height:36px;
        border:var(--uc-border) solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:rgba(5,9,13,.92);
        overflow:hidden;
    }
    .cmd-map-scope button {
        display:inline-flex;
        align-items:center;
        gap:6px;
        padding:0 12px;
        border:0;
        background:transparent;
        color:var(--uc-label-dark);
        font-family:var(--ag-mono);
        font-size:.66rem;
        font-weight:600;
        letter-spacing:.08em;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .cmd-map-scope button + button { border-left:var(--uc-border) solid var(--ag-line-2); }
    .cmd-map-scope button:hover { color:var(--uc-amber-2); }
    .cmd-map-scope button.is-active {
        background:var(--uc-amber);
        color:var(--uc-cta-text);
    }
    .cmd-map-scope button:focus-visible {
        outline:2px solid var(--uc-amber-2);
        outline-offset:-2px;
    }
    .cmd-map-world-note {
        position:absolute;
        left:50%;
        bottom:18px;
        z-index:1000;
        transform:translateX(-50%);
        max-width:min(640px,calc(100% - 140px));
        padding:7px 14px;
        border:var(--uc-border) solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:rgba(5,9,13,.92);
        box-shadow:var(--uc-shadow-dark);
        color:#e8edf1;
        font-size:.7rem;
        text-align:center;
        pointer-events:none;
    }
    .cmd-map-world-note.is-busy {
        border-color:rgba(232,176,64,.6);
        color:var(--uc-amber-2);
    }
    .cmd-map-mine {
        margin-left:6px;
        color:var(--uc-amber-2);
    }
    .cmd-map-foreign {
        display:flex;
        align-items:center;
        gap:8px;
        margin:0 0 12px;
        padding:8px 10px;
        border:var(--uc-border) dashed var(--ink-2);
        border-radius:var(--uc-radius);
        background:rgba(255,253,245,.6);
        color:var(--ink-2);
        font-size:.74rem;
    }
    @media (max-width: 760px) {
        .cmd-map-scope button { padding:0 8px; }
        .cmd-map-world-note {
            bottom:84px;
            max-width:calc(100% - 32px);
        }
    }
    /* Vacant posts in the windows (paper) take the paper grey too. */
    .umap-modal .fact-vacant, .dos-modal .fact-vacant { color:var(--uc-grey-paper); }

    /* Map: the chain of command of a unit of another command (in its record), a proposal sent, nothing to propose. */
    .cmd-map-chain-sent {
        margin:0;
        padding:5px 9px;
        border-left:3px solid #3f7a4a;
        background:rgba(63,122,74,.1);
        color:var(--ink);
        font-size:.74rem;
    }
    .cmd-map-chain-note {
        margin:0;
        color:var(--ink-2);
        font-size:.72rem;
        font-style:italic;
    }

    /* ---- History timeline ---------------------------------------------------------------------------------------
       A dark panel; every fact a node with its icon in the colour of what happened (--tone), joined to the next by a
       line of that colour, and a paper card: the fact, its detail and the unit drawn as in a record on the left, when
       and where it was recorded on the right. */
    .dos-panel.is-timeline {
        border-color:var(--ag-line-2,#2a3440);
        background:linear-gradient(180deg,#10161c,#0b1015);
        color:#e8edf1;
    }
    .dos-panel.is-timeline h3 { color:#f0f3f5; }
    .dos-panel.is-timeline .dos-filter {
        border-color:#5d6b78;
        color:var(--uc-label-dark);
    }
    .dos-panel.is-timeline .dos-filter:hover {
        border-color:var(--uc-label-dark);
        color:#f0f3f5;
    }
    .dos-panel.is-timeline .dos-filter.is-active {
        border-color:var(--uc-amber);
        background:var(--uc-amber);
        color:var(--uc-cta-text);
    }
    .dos-panel.is-timeline .dos-year {
        margin:18px 0 10px;
        color:var(--uc-amber-2);
    }
    .dos-panel.is-timeline .rec-empty, .dos-panel.is-timeline .dos-group-note { color:var(--uc-label-dark); }
    .dos-panel.is-timeline .dos-timeline {
        --node:40px;
        --gap:16px;
        padding:0 0 0 calc(var(--node) + var(--gap));
    }
    .dos-panel.is-timeline .dos-timeline::before { display:none; }
    .dos-panel.is-timeline .dos-timeline li {
        --tone:#97a3ae;
        position:relative;
        padding:0 0 12px;
    }
    .dos-panel.is-timeline .dos-timeline li.is-good { --tone:var(--uc-green); }
    .dos-panel.is-timeline .dos-timeline li.is-bad { --tone:var(--uc-red); }
    .dos-panel.is-timeline .dos-timeline li.is-gold { --tone:var(--uc-amber); }
    .dos-panel.is-timeline .dos-timeline li.is-copper { --tone:#e08a52; }
    .dos-panel.is-timeline .dos-timeline li.is-steel { --tone:#5fa8d3; }
    .dos-panel.is-timeline .dos-timeline li.is-violet { --tone:#a98be0; }
    .dos-panel.is-timeline .dos-timeline li.is-teal { --tone:#4fb3a9; }
    .dos-panel.is-timeline .dos-timeline li::before {
        content:"";
        position:absolute;
        left:calc(var(--node) / 2 - var(--node) - var(--gap) - 1px);
        top:calc(8px + var(--node));
        bottom:-8px;
        width:2px;
        background:linear-gradient(180deg,var(--tone),color-mix(in srgb,var(--tone) 30%,transparent));
    }
    .dos-panel.is-timeline .dos-timeline li:last-child::before { display:none; }
    .dos-panel.is-timeline .dos-timeline .dos-dot {
        left:calc(-1 * (var(--node) + var(--gap)));
        top:8px;
        width:var(--node);
        height:var(--node);
        border:2px solid var(--tone);
        border-radius:50%;
        background:color-mix(in srgb,var(--tone) 20%,#0d1217);
        color:var(--tone);
        box-shadow:0 0 0 3px #0d1217, 0 0 16px color-mix(in srgb,var(--tone) 45%,transparent);
    }
    .dos-panel.is-timeline .dos-event {
        flex-direction:row;
        justify-content:space-between;
        align-items:flex-start;
        gap:14px;
        padding:10px 14px;
        border:1px solid var(--paper-edge,#b9ab8c);
        border-left:4px solid var(--tone);
        background:linear-gradient(180deg,#f3ead2,var(--paper,#e9dfc4));
        box-shadow:var(--uc-shadow-paper);
        color:var(--ink);
    }
    .dos-event-body {
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:0;
    }
    .dos-event-body > strong {
        color:var(--ink);
        font-family:var(--ag-type);
        font-size:1rem;
        font-weight:400;
        line-height:1.25;
    }
    .dos-event-body > small {
        color:var(--uc-label-paper);
        font-size:.72rem;
    }
    .dos-event-unit {
        align-self:flex-start;
        min-width:min(300px,100%);
        max-width:100%;
        margin-top:6px;
    }
    .dos-event-unit .dossier-link-image, .dos-event-unit .dossier-link-initials {
        width:32px;
        height:32px;
    }
    .dos-event-when {
        display:flex;
        flex:none;
        flex-direction:column;
        align-items:flex-end;
        gap:4px;
        text-align:right;
    }
    .dos-event-when time {
        color:var(--ink);
        font-family:var(--ag-mono);
        font-size:.74rem;
        white-space:nowrap;
    }
    .dos-event-when small {
        padding-bottom:1px;
        border-bottom:1px dotted currentColor;
        color:var(--uc-label-paper);
        font-family:var(--ag-mono);
        font-size:.58rem;
        font-weight:600;
        letter-spacing:.1em;
        text-transform:uppercase;
    }
    @media (max-width: 640px) {
        .dos-panel.is-timeline .dos-timeline {
            --node:32px;
            --gap:10px;
        }
        .dos-panel.is-timeline .dos-event { flex-direction:column; }
        .dos-event-when {
            align-items:flex-start;
            text-align:left;
        }
    }
} /* end of @layer app */


/* ==== cmd-territory.css ==== */
/* Unit Control · the territory verification of the headquarters (app layer), the remaining !important declarations
   (forced layer) and the Leaflet chrome (unlayered). Last of the cmd-*.css files (formerly the end of command.css). */

/* ---- Forced layer: the !important declarations that remain -------------------------------------------------------
   For important declarations the first layer wins, so these compare by specificity with the shared paper rule
   (agency.css: every small text of a record panel in --ink-muted) and with the framework's !important utilities. */
@layer forced {
    /* The small texts of the echelon meter, of the chain of command band and of the proposal diagram, on paper. */
    .entity-details-panel .cmd-echelon small { color:var(--ink-2) !important; }
    .cmd-graph-side .cmd-echelon small { color:var(--ag-text) !important; }
    .cmd-chain-node small, .aff-node small { color:var(--uc-label-paper) !important; }
    /* Beats the framework's .mb-3 utility. */
    .cmd-post-field > .mb-3 { margin-bottom:.6rem !important; }
    /* The dark side panel of the staffing graph is not paper. */
    .cmd-graph-side .uc-inspector-head small, .cmd-graph-side .uc-inspector-code { color:var(--uc-label-dark) !important; }
    .cmd-graph-side small, .cmd-graph-side p { color:var(--ag-muted) !important; }
}

/* ---- Leaflet chrome: unlayered, like Leaflet's own stylesheet (injected by the map scripts) --------------------- */
/* Map attribution: legible on any base layer. */
.leaflet-control-attribution {
    background:rgba(255,255,255,.9) !important;
    color:#33414d !important;
}
.leaflet-control-attribution a { color:#1d4f73 !important; }

/* ---------- Territory verification of the headquarters (CommandTerritory) ----------
   On the manila paper of the unit form: a seal per headquarters (green verified, amber requested or moved, red
   disputed or refused), the request form in three steps and the history with the answers of the moderators. */
@layer app {
    .cmd-ter { margin-top:22px; padding-top:16px; border-top:2px solid var(--paper-edge,#b9ab8c); }
    .cmd-ter-intro { margin:0 0 10px; color:var(--ink-2); font-family:var(--ag-type); font-size:.78rem; line-height:1.5; }
    .cmd-ter-list, .cmd-ter-history { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
    .cmd-ter-item { --ter-tone:#5f5747; border:1px solid var(--paper-edge,#b9ab8c); border-left:4px solid var(--ter-tone); background:rgba(255,253,245,.45); }
    .cmd-ter-item.is-verified { --ter-tone:var(--uc-green-paper,#23683f); }
    .cmd-ter-item.is-requested, .cmd-ter-item.is-moved { --ter-tone:#8a6414; }
    .cmd-ter-item.is-disputed, .cmd-ter-item.is-rejected { --ter-tone:var(--uc-red-paper,#9c231d); }
    .cmd-ter-row { display:flex; align-items:flex-start; gap:12px; padding:10px 12px; }
    .cmd-ter-seal {
        flex:none; display:grid; place-items:center; width:38px; height:38px; border:2px solid var(--ter-tone); border-radius:50%;
        color:var(--ter-tone); font-size:1.05rem; transform:rotate(-8deg);
    }
    .cmd-ter-main { display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
    .cmd-ter-main strong { color:var(--ink); font-family:var(--ag-type); font-size:.95rem; }
    .cmd-ter-main small { color:var(--ink-muted,#5a503f); font-size:.72rem; }
    .cmd-ter-standing {
        align-self:flex-start; margin-top:3px; padding:1px 8px; border:1.5px solid var(--ter-tone); color:var(--ter-tone);
        font-family:var(--ag-mono); font-size:.62rem; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
    }
    .cmd-ter-explain { font-family:var(--ag-type); }
    .cmd-ter-note { margin:6px 0 0; padding:2px 0 2px 10px; border-left:2px solid var(--paper-edge,#b9ab8c); color:var(--ink-2); font-family:var(--ag-type); font-size:.78rem; }
    .cmd-ter-form { display:grid; gap:10px; margin:0 12px 12px; padding:12px; border:1px dashed var(--paper-edge,#b9ab8c); background:rgba(255,253,245,.55); }
    .cmd-ter-form fieldset { display:grid; gap:6px; margin:0; padding:0; border:0; }
    .cmd-ter-form fieldset > small { color:var(--ink-muted,#5a503f); font-family:inherit; font-size:.7rem; line-height:1.4; }
    .cmd-ter-form legend { margin:0; color:var(--uc-label-paper,#463d2c); font-size:var(--uc-label-size); font-weight:var(--uc-label-weight); letter-spacing:var(--uc-label-tracking); text-transform:uppercase; }
    .cmd-ter-steps { display:flex; flex-wrap:wrap; gap:6px 16px; margin:0; padding:0; list-style:none; color:var(--ink-2); font-size:.72rem; }
    .cmd-ter-steps b { display:inline-grid; place-items:center; width:18px; height:18px; margin-right:4px; border:1px solid var(--ink-2); font-family:var(--ag-mono); font-size:.62rem; }
    .cmd-ter-bases { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:6px; }
    .cmd-ter-basis { position:relative; display:grid; gap:2px; padding:8px 10px; border:1px solid var(--paper-edge,#b9ab8c); background:rgba(255,253,245,.5); cursor:pointer; }
    .cmd-ter-basis input { position:absolute; opacity:0; pointer-events:none; }
    .cmd-ter-basis strong { color:var(--ink); font-size:.82rem; }
    .cmd-ter-basis small { color:var(--ink-muted,#5a503f); font-size:.68rem; line-height:1.35; }
    .cmd-ter-basis.is-on { border-color:#7c5d17; box-shadow:inset 0 0 0 1px #7c5d17; background:rgba(201,162,74,.16); }
    .cmd-ter-basis:focus-within { outline:2px solid #7c5d17; outline-offset:1px; }
    .cmd-ter-letter-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; }
    .cmd-ter-letter-tools small { flex:1 1 260px; color:var(--ink-muted,#5a503f); font-size:.7rem; }
    .cmd-ter-textarea { font-family:var(--ag-type); font-size:.86rem; line-height:1.55; background:#fbf7ea; }
    .cmd-ter-count { justify-self:end; color:var(--uc-red-paper,#9c231d); font-family:var(--ag-mono); font-size:.66rem; }
    .cmd-ter-count.is-ok { color:var(--uc-green-paper,#23683f); }
    .cmd-ter-drop { position:relative; display:grid; place-items:center; padding:14px; border:2px dashed var(--paper-edge,#b9ab8c); color:var(--ink-2); font-size:.8rem; cursor:pointer; }
    .cmd-ter-drop:hover { border-color:#7c5d17; background:rgba(201,162,74,.08); }
    .cmd-ter-drop input { position:absolute; inset:0; opacity:0; cursor:pointer; }
    .cmd-ter-files { display:grid; gap:4px; margin:0; padding:0; list-style:none; }
    .cmd-ter-files li { min-width:0; display:flex; align-items:center; gap:8px; padding:4px 6px; border:1px solid var(--paper-edge,#b9ab8c); background:#fbf7ea; }
    .cmd-ter-files .form-select { flex:0 1 190px; width:auto; min-width:0; }
    .cmd-ter-file-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.8rem; }
    .cmd-ter-file-name small { color:var(--ink-muted,#5a503f); }
    .cmd-ter-privacy { margin:0; color:var(--ink-muted,#5a503f); font-size:.68rem; }
    .cmd-ter-subtitle { margin:16px 0 8px; color:var(--uc-label-paper,#463d2c); font-size:var(--uc-label-size); font-weight:var(--uc-label-weight); letter-spacing:var(--uc-label-tracking); text-transform:uppercase; }
    .cmd-ter-history li { display:grid; gap:4px; padding:8px 10px; border:1px solid var(--paper-edge,#b9ab8c); background:rgba(255,253,245,.35); }
    .cmd-ter-history-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
    .cmd-ter-history-head small { color:var(--ink-muted,#5a503f); font-size:.7rem; }
    .cmd-ter-status { padding:0 6px; border:1px solid currentColor; font-family:var(--ag-mono); font-size:.6rem; letter-spacing:.12em; text-transform:uppercase; }
    .cmd-ter-history li.is-approved .cmd-ter-status { color:var(--uc-green-paper,#23683f); }
    .cmd-ter-history li.is-rejected .cmd-ter-status { color:var(--uc-red-paper,#9c231d); }
    .cmd-ter-history li.is-pending .cmd-ter-status { color:#8a6414; }
    .cmd-ter-history li.is-withdrawn .cmd-ter-status { color:var(--uc-grey-paper,#5f5747); }
    .cmd-ter-history details summary { cursor:pointer; color:var(--ink-2); font-size:.74rem; }
    .cmd-ter-letter { margin:4px 0 0; white-space:pre-wrap; font-family:var(--ag-type); font-size:.8rem; line-height:1.5; }
    .cmd-ter-docs { display:flex; flex-wrap:wrap; gap:6px; }
    .cmd-ter-doc { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border:1px solid var(--paper-edge,#b9ab8c); background:#fbf7ea; color:var(--ink); font-size:.74rem; }
    .cmd-ter-doc:hover { border-color:#7c5d17; }
    .cmd-ter-doc small { color:var(--ink-muted,#5a503f); }
    .cmd-ter-history li > .btn { justify-self:start; }
}


/* ==== ux-shared.css ==== */
/* Unit Control: patterns shared by every segment (Mapa, Mando, Carrera) from the experience pass (2026-11): page
   heads, action bars, empty states, feedback. Loaded after command.css, before the segment files.
   Owned by the command segment; the other segments use these classes and never restyle them in their own file.
   Contents: 1 tokens · 2 buttons · 3 focus and placeholders · 4 page head · 5 action bars · 6 confirmation · 7 toast ·
   8 states · 9 section head · 10 toolbar · 11 cross links · 12 list/detail · 13 chips · 14 mobile shell. */
@layer app {
    /* ---- 1 · Tokens of the pass ------------------------------------------------------------------------------------ */
    :root {
        /* Height of the fixed bars of the mobile shell (0 on desktop): the map, the toasts and the modals keep clear of them. */
        --ux-topbar-h:0px;
        --ux-tabbar-h:0px;
        --ux-gap:8px;
        --ux-tap:36px;
    }
    @media (max-width: 720px) {
        :root { --ux-tap:44px; }
    }

    /* ---- 2 · Buttons: one theme, the gold of the system, never the framework blue --------------------------------------
       One rule per role replaces the per-container patches of command.css. On paper the outline turns to ink. */
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-primary, .auth-submit, .auth-submit.btn-primary {
        border:var(--uc-border) solid var(--ag-gold);
        border-radius:var(--uc-radius);
        background:var(--ag-gold);
        color:var(--ink);
        font-weight:700;
        box-shadow:none;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-primary:hover:not(:disabled), .auth-submit:hover:not(:disabled) {
        border-color:var(--ag-gold-2);
        background:var(--ag-gold-2);
        color:var(--ink);
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-primary:disabled, .auth-submit:disabled {
        border-color:var(--ag-gold);
        background:var(--ag-gold);
        color:var(--ink);
        opacity:.5;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-primary {
        border:var(--uc-border) solid var(--ag-gold-2);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-gold-2);
        font-weight:600;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-primary:hover:not(:disabled) {
        border-color:var(--ag-gold-2);
        background:var(--ag-gold-dim);
        color:var(--ag-gold-2);
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) :is(.btn-danger) {
        border:var(--uc-border) solid var(--uc-red);
        border-radius:var(--uc-radius);
        background:var(--uc-red);
        color:#140405;
        font-weight:700;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-danger:hover:not(:disabled) { background:#ff7a7f; border-color:#ff7a7f; color:#140405; }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-danger {
        border:var(--uc-border) solid var(--uc-red);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--uc-red);
        font-weight:600;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-danger:hover:not(:disabled) { background:var(--uc-red-bg); color:var(--uc-red); }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-secondary {
        border:var(--uc-border) solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-text-2);
        font-weight:600;
    }
    :is(.entity-main-panel, .umap-modal, .entity-admin-shell) .btn-outline-secondary:hover:not(:disabled) {
        border-color:var(--ag-muted);
        background:rgba(255,255,255,.04);
        color:var(--ag-text);
    }
    /* On paper (the records, the modals of the map, the recruitment detail, the dossier sheet). The dark side panel of
       the staffing graph is an .entity-details-panel too but keeps the dark buttons (:not(.cmd-graph-side)). */
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-outline-primary,
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-outline-secondary {
        border-color:var(--ink-2);
        color:var(--ink);
    }
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) :is(.btn-outline-primary, .btn-outline-secondary):hover:not(:disabled) {
        border-color:var(--ink);
        background:var(--ink);
        color:var(--paper);
    }
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-primary {
        border-color:#7c5d17;
        color:var(--ink);
    }
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-outline-danger { border-color:var(--uc-red-paper); color:var(--uc-red-paper); }
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-outline-danger:hover:not(:disabled) { background:var(--uc-red-paper); color:var(--paper); }
    .entity-admin-shell :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .btn-danger { border-color:var(--uc-red-paper); background:var(--uc-red-paper); color:#fff7f2; }
    /* The button with an icon and its text keep them together. */
    .entity-admin-shell .btn:has(> .uc-icon) { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
    /* A square button with only an icon (an aria-label is mandatory). */
    .ux-btn-icon {
        display:inline-flex;
        align-items:center;
        justify-content:center;
        flex:none;
        width:var(--ux-tap);
        height:var(--ux-tap);
        padding:0;
        border:var(--uc-border) solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-text-2);
        cursor:pointer;
        line-height:1;
    }
    .ux-btn-icon:hover:not(:disabled) { border-color:var(--ag-gold-2); color:var(--ag-gold-2); }
    .ux-btn-icon:disabled { opacity:.45; cursor:not-allowed; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-btn-icon { border-color:var(--paper-edge); color:var(--ink-2); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-btn-icon:hover:not(:disabled) { border-color:var(--ink); color:var(--ink); }
    /* A secondary step written as a link (inside a page, not a destination): underlined, no frame. */
    .entity-admin-shell .btn.ux-inline-link, .ux-inline-link {
        padding:0 2px;
        border:0;
        background:none;
        color:var(--ag-gold-2);
        text-decoration:underline;
        text-underline-offset:3px;
        letter-spacing:.06em;
    }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-inline-link { color:var(--ink); }
    /* The card or row a link points at (?item=, ?app=, ?inv=): a gold edge so the eye finds it. */
    .ux-target { border-color:var(--ag-gold); box-shadow:0 0 0 2px rgba(227,192,107,.45), inset 3px 0 0 var(--ag-gold); }
    /* The operator application has no use for the console of the API. */
    .entity-main-panel .agency-api-link { display:none; }

    /* ---- 3 · Focus, placeholders and touch targets ------------------------------------------------------------------ */
    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline:2px solid var(--uc-amber);
        outline-offset:2px;
    }
    .entity-admin-shell :is(.btn, .entity-nav-item, .entity-filter):focus-visible { outline:2px solid var(--uc-amber); outline-offset:2px; box-shadow:none; }
    /* The router focuses the title of a new page (tabindex -1) for screen readers: no ring for that programmatic focus. */
    :is(h1, h2, [role="tabpanel"], article, section)[tabindex="-1"]:focus-visible { outline:none; }
    ::placeholder { color:var(--ag-muted); opacity:1; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) ::placeholder { color:var(--ink-muted); }
    @media (max-width: 720px) {
        .cmd-card-menu-toggle, .ux-chip > button, .rec-geo-toggle, .geo-filter-toggle, .cmd-side-close { min-width:44px; min-height:44px; }
    }

    /* ---- 4 · Page head: breadcrumb, title, figures and at most one main action on the right ------------------------- */
    .entity-main-panel .entity-page-header {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:12px 18px;
    }
    .entity-main-panel .entity-page-header > .agency-header-main { flex:1 1 220px; min-width:0; }
    .entity-main-panel .entity-page-header > .agency-stats { margin-left:auto; }
    .ux-head-actions {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        align-self:center;
        gap:var(--ux-gap);
        margin-left:auto;
    }
    .agency-stats + .ux-head-actions { margin-left:0; }
    .ux-head-actions .btn { min-height:36px; }
    @media (max-width: 720px) {
        .entity-main-panel .entity-page-header > .agency-stats { width:100%; margin-left:0; }
        .ux-head-actions { width:100%; margin-left:0; }
        .ux-head-actions .btn { flex:1 1 auto; min-height:44px; }
    }

    /* ---- 5 · Action bars: navigation and tertiary on the left, then Cancel, the primary or destructive last ---------- */
    .ux-actions {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        justify-content:flex-end;
        gap:var(--ux-gap);
    }
    .ux-actions-gap { margin-right:auto; }
    .ux-actions.is-start { justify-content:flex-start; }
    .ux-actions.is-stacked { flex-direction:column-reverse; align-items:stretch; }
    .ux-actions.is-stacked .ux-actions-gap { display:none; }
    @media (max-width: 720px) {
        :is(.rec-card-actions, .umap-modal-footer).ux-actions, :is(.rec-card-actions, .umap-modal-footer) > .ux-actions, .ux-confirm .ux-actions {
            flex-direction:column-reverse;
            align-items:stretch;
        }
        :is(.rec-card-actions, .umap-modal-footer, .ux-confirm) .ux-actions-gap { display:none; }
        .ux-actions .btn { min-height:44px; }
    }

    /* ---- 6 · Inline confirmation of what cannot be undone (Command/ConfirmPanel.razor) ------------------------------ */
    .ux-confirm {
        display:flex;
        flex-direction:column;
        gap:8px;
        margin:10px 0;
        padding:12px 14px;
        border:var(--uc-border) solid var(--ag-line-2);
        border-left:3px solid var(--ag-gold);
        border-radius:var(--uc-radius);
        background:rgba(10,15,21,.92);
        color:var(--ag-text);
        animation:ux-rise .16s ease-out;
    }
    .ux-confirm.is-danger { border-left-color:var(--uc-red); }
    .ux-confirm-title {
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:1rem;
        font-weight:600;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .ux-confirm.is-danger .ux-confirm-title { color:var(--uc-red); }
    .ux-confirm-text { margin:0; color:var(--ag-text-2); font-size:.76rem; line-height:1.5; }
    .ux-confirm-blockers:empty { display:none; }
    .ux-confirm-blockers {
        padding:8px 10px;
        border:1px dashed var(--uc-red);
        background:var(--uc-red-bg);
        font-size:.72rem;
    }
    .ux-confirm-blockers ul { margin:4px 0 0; padding-left:18px; }
    .ux-confirm-blockers li + li { margin-top:4px; }
    .ux-confirm-blockers a { color:inherit; font-weight:600; }
    .ux-confirm .form-label { margin-bottom:2px; font-size:.7rem; }
    .ux-confirm .alert { margin:0; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm {
        border-color:var(--paper-edge);
        background:rgba(255,253,245,.7);
        color:var(--ink);
    }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm { border-left-color:#7c5d17; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm.is-danger { border-left-color:var(--uc-red-paper); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm-title { color:var(--ink); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm.is-danger .ux-confirm-title { color:var(--uc-red-paper); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm-text { color:var(--ink-2); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-confirm-blockers { border-color:var(--uc-red-paper); background:rgba(156,35,29,.07); color:var(--ink); }
    @keyframes ux-rise { from { opacity:0; transform:translateY(4px); } }

    /* ---- 7 · Toast: the one feedback of an action, with its next step or undo (Command/UxToast.razor) -------------- */
    .ux-toast, .cmd-toast {
        position:fixed;
        z-index:1400;
        right:16px;
        left:auto;
        bottom:calc(16px + var(--ux-tabbar-h, 0px));
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:8px 10px;
        max-width:min(520px, calc(100vw - 32px));
        padding:10px 10px 10px 14px;
        border:var(--uc-border) solid var(--ag-gold);
        border-left-width:3px;
        border-radius:var(--uc-radius);
        background:#0b1118;
        color:var(--ag-text);
        box-shadow:0 14px 40px rgba(0,0,0,.6);
        font-size:.76rem;
        transform:none;
        animation:ux-rise .2s ease-out;
    }
    .ux-toast.is-error, .cmd-toast.is-error { border-color:var(--uc-red); }
    .ux-toast > .uc-icon { color:var(--uc-green); }
    .ux-toast.is-error > .uc-icon { color:var(--uc-red); }
    .ux-toast-text { flex:1 1 200px; min-width:0; line-height:1.4; }
    .ux-toast-links { display:flex; flex-wrap:wrap; gap:6px; }
    .ux-toast .btn { min-height:30px; }
    .ux-toast .ux-btn-icon, .ux-toast-close { width:30px; height:30px; border-color:transparent; }
    @media (max-width: 720px) {
        .ux-toast, .cmd-toast { left:16px; right:16px; max-width:none; }
        .ux-toast .btn { min-height:40px; }
        .ux-toast .ux-btn-icon, .ux-toast-close { width:44px; height:44px; }
    }
    @media (prefers-reduced-motion: reduce) {
        .ux-toast, .cmd-toast, .ux-confirm { animation:none; }
    }

    /* ---- 8 · States: empty, filtered, error, locked (Command/StateBlock.razor) ---------------------------------------
       The old empty classes take the same look while their pages migrate. */
    .ux-state, .cmd-empty-state, .rec-empty-state, .entity-empty-detail, .cmd-column-empty {
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:8px;
        max-width:640px;
        margin:24px auto;
        padding:28px 22px;
        border:1px dashed var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:rgba(10,15,21,.6);
        color:var(--ag-text-2);
        text-align:center;
    }
    .ux-state.is-compact, .cmd-column-empty { margin:10px auto; padding:14px 12px; gap:6px; }
    .ux-state-icon {
        display:inline-flex;
        align-items:center;
        justify-content:center;
        width:44px;
        height:44px;
        border:1px solid currentColor;
        border-radius:50%;
        color:var(--ag-gold);
        opacity:.85;
    }
    .ux-state.is-compact .ux-state-icon { width:32px; height:32px; }
    .ux-state-title, .cmd-empty-state strong, .rec-empty-state strong, .entity-empty-detail strong {
        display:block;
        margin:0;
        color:var(--ag-gold-2);
        font-family:var(--ag-display);
        font-size:1.15rem;
        font-weight:600;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .ux-state.is-compact .ux-state-title { font-size:.95rem; }
    .ux-state-text { max-width:46ch; margin:0; font-size:.76rem; line-height:1.5; }
    .ux-state .ux-actions { justify-content:center; margin-top:4px; }
    .ux-state.is-error { border-color:rgba(239,90,96,.55); }
    .ux-state.is-error .ux-state-icon, .ux-state.is-error .ux-state-title { color:var(--uc-red); }
    .ux-state.is-locked .ux-state-icon { color:var(--uc-grey); }
    .ux-state.is-filtered .ux-state-icon { color:var(--ag-cyan); }
    /* On paper (or inside a record panel). */
    .ux-state.is-paper, :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) :is(.ux-state, .entity-empty-detail, .rec-empty-state, .cmd-empty-state) {
        border-color:var(--paper-edge);
        background:rgba(255,253,245,.35);
        color:var(--ink-2);
    }
    .ux-state.is-paper .ux-state-icon, :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-state-icon { color:var(--ink-2); }
    .ux-state.is-paper .ux-state-title,
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) :is(.ux-state-title, .entity-empty-detail strong, .rec-empty-state strong, .cmd-empty-state strong) { color:var(--ink); }

    /* ---- 9 · Section head: the title of a block or list with its count and tools ------------------------------------ */
    .ux-section-head {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        gap:8px 12px;
        margin:0 0 10px;
        padding-bottom:8px;
        border-bottom:1px solid var(--ag-line-2);
    }
    .ux-section-head h2, .ux-section-head h3 {
        display:flex;
        align-items:center;
        gap:8px;
        margin:0;
        color:var(--ag-text);
        font-family:var(--ag-display);
        font-size:1.05rem;
        font-weight:600;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .ux-section-tools { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-left:auto; }
    .ux-count {
        display:inline-flex;
        align-items:center;
        min-width:22px;
        height:20px;
        padding:0 6px;
        border:1px solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.66rem;
        letter-spacing:.04em;
    }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-section-head { border-bottom-color:var(--paper-edge); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-section-head :is(h2, h3) { color:var(--ink); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-count { border-color:var(--paper-edge); color:var(--ink); }

    /* ---- 10 · Filters: labels on top, active count, Clear, folded on mobile ----------------------------------------- */
    .ux-toolbar {
        display:flex;
        flex-wrap:wrap;
        align-items:flex-end;
        gap:10px 12px;
        padding:10px 12px;
        border:1px solid var(--ag-line);
        border-radius:var(--uc-radius);
        background:rgba(8,12,17,.85);
    }
    .ux-toolbar-toggle { display:none; }
    .ux-toolbar-fields {
        flex:1 1 480px;
        display:grid;
        grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
        gap:10px 12px;
        min-width:0;
    }
    .ux-toolbar-fields > :is(label, .ux-toolbar-field) { display:flex; flex-direction:column; gap:4px; min-width:0; margin:0; }
    .ux-toolbar-fields > :is(label, .ux-toolbar-field) > span:first-child {
        color:var(--uc-label-dark);
        font-size:var(--uc-label-size);
        font-weight:var(--uc-label-weight);
        letter-spacing:var(--uc-label-tracking);
        text-transform:uppercase;
    }
    .ux-toolbar-end { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .ux-toolbar-end:empty { display:none; }
    /* The fields of every toolbar are dark like the bar (the framework draws them white): one rule for all the pages. */
    .ux-toolbar :is(.form-control, .form-select) {
        border:1px solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background-color:#070c12;
        color:var(--ag-text);
    }
    .ux-toolbar .form-control::placeholder { color:#7d8b98; opacity:1; }
    .ux-toolbar :is(.form-control, .form-select):focus { border-color:var(--ag-gold); box-shadow:0 0 0 2px rgba(201,162,74,.25); }
    /* The arrow of a dark select, light (the framework's is dark grey, invisible on the dark field). */
    :is(.ux-toolbar, .rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) .form-select {
        --bs-form-select-bg-img:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b3bfca' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    }
    @media (max-width: 720px) {
        .ux-toolbar { padding:6px 8px; }
        .ux-toolbar-toggle {
            display:inline-flex;
            align-items:center;
            gap:8px;
            min-height:44px;
            padding:0 12px;
            border:1px solid var(--ag-line-2);
            border-radius:var(--uc-radius);
            background:transparent;
            color:var(--ag-text);
            font-family:var(--ag-mono);
            font-size:.7rem;
            letter-spacing:.1em;
            text-transform:uppercase;
        }
        .ux-toolbar-toggle b { color:var(--ag-gold-2); }
        .ux-toolbar-toggle[aria-expanded="true"] { border-color:var(--ag-gold); }
        .ux-toolbar:not([data-open="true"]) .ux-toolbar-fields { display:none; }
        .ux-toolbar-fields { flex-basis:100%; grid-template-columns:minmax(0,1fr); }
        .ux-toolbar-fields :is(.form-control, .form-select) { min-height:44px; }
    }

    /* ---- 11 · Cross links of a unit to the other segments (Command/UnitXLinks.razor) -------------------------------- */
    .ux-xlinks { display:flex; flex-wrap:wrap; gap:6px; }
    .ux-xlink {
        display:inline-flex;
        align-items:center;
        gap:6px;
        min-height:32px;
        padding:0 10px;
        border:1px solid rgba(201,162,74,.45);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.64rem;
        font-weight:600;
        letter-spacing:.1em;
        text-decoration:none;
        text-transform:uppercase;
        transition:border-color .15s, background .15s;
    }
    .ux-xlink:hover { border-color:var(--ag-gold-2); background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    .ux-xlink .ux-count { height:18px; min-width:18px; margin-left:2px; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-xlink { border-color:rgba(70,63,48,.45); color:var(--ink); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-xlink:hover { border-color:var(--ink); background:rgba(31,27,20,.08); color:var(--ink); }
    @media (max-width: 720px) {
        .ux-xlink { min-height:40px; }
    }

    /* ---- 12 · List and detail: the same behaviour on mobile everywhere ---------------------------------------------- */
    .ux-split-back { display:none; }
    @media (max-width: 900px) {
        .ux-split { grid-template-columns:minmax(0,1fr); }
        .ux-split.has-detail > .ux-split-list { display:none; }
        .ux-split:not(.has-detail) > .ux-split-detail { display:none; }
        .ux-split-back {
            position:sticky;
            top:calc(var(--ux-topbar-h, 0px) + 4px);
            z-index:5;
            display:inline-flex;
            align-items:center;
            gap:6px;
            align-self:flex-start;
            min-height:44px;
            margin:0 0 10px;
            padding:0 14px;
            border:1px solid var(--paper-edge);
            border-radius:var(--uc-radius);
            background:var(--paper);
            color:var(--ink);
            font-family:var(--ag-mono);
            font-size:.7rem;
            font-weight:600;
            letter-spacing:.1em;
            text-transform:uppercase;
            box-shadow:var(--uc-shadow-paper);
        }
    }

    /* ---- 13 · Chips: states and tags with one language -------------------------------------------------------------- */
    .ux-chip {
        display:inline-flex;
        align-items:center;
        gap:4px;
        height:22px;
        padding:0 7px;
        border:1px solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.66rem;
        font-weight:600;
        letter-spacing:.08em;
        line-height:1;
        text-transform:uppercase;
        white-space:nowrap;
    }
    .ux-chip > button { margin-right:-4px; padding:0 4px; border:0; background:transparent; color:inherit; cursor:pointer; }
    .ux-chip.is-ok { border-color:var(--uc-green); background:var(--uc-green-bg); color:var(--uc-green); }
    .ux-chip.is-warn { border-color:var(--uc-amber); background:var(--uc-amber-bg); color:var(--uc-amber-2); }
    .ux-chip.is-danger { border-color:var(--uc-red); background:var(--uc-red-bg); color:var(--uc-red); }
    .ux-chip.is-info { border-color:var(--ag-cyan); background:rgba(103,199,217,.12); color:var(--ag-cyan); }
    .ux-chip.is-idle { border-color:var(--uc-grey); background:var(--uc-grey-bg); color:var(--uc-grey); }
    .ux-chip.is-gold { border-color:var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-gold-2); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip { border-color:var(--ink-2); background:rgba(255,253,245,.5); color:var(--ink-2); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-ok { border-color:var(--uc-green-paper); color:var(--uc-green-paper); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-warn { border-color:#7c5d17; color:#6a4c0c; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-danger { border-color:var(--uc-red-paper); color:var(--uc-red-paper); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-info { border-color:#2d6f7c; color:#235a65; }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-idle { border-color:var(--uc-grey-paper); color:var(--uc-grey-paper); }
    :is(.ux-paper, .entity-details-panel:not(.cmd-graph-side), .umap-modal, .rec-detail, .dos-sheet) .ux-chip.is-gold { border-color:#7c5d17; color:#5b420a; }

    /* ---- 14 · The shell: desktop sidebar that never cuts, mobile top bar + drawer + bottom tab bar ------------------- */
    .ux-topbar, .ux-tabbar, .ux-drawer-backdrop, .ux-drawer-close { display:none; }
    /* Desktop: the navigation scrolls by itself; the operator card and the user stay whole below it. */
    .entity-sidebar-panel > .cmd-card { flex:none; margin:0; padding:8px 12px; }
    .entity-sidebar-panel > .cmd-card strong { margin-bottom:4px; }
    .entity-sidebar-panel > .cmd-card .cmd-card-figures b { font-size:1rem; }
    /* Below 1100 px the sidebar is a drawer behind the menu button (it used to stack above every page). */
    @media (max-width: 1100px) {
        :root { --ux-topbar-h:52px; }
        /* auto 1fr: a short page no longer stretches the top bar row (the shell is at least 100vh tall). */
        .entity-admin-shell { grid-template-rows:auto 1fr; align-content:start; }
        .ux-topbar {
            position:sticky;
            top:0;
            z-index:1100;
            grid-row:1;
            display:flex;
            align-items:center;
            gap:10px;
            height:var(--ux-topbar-h);
            margin:0 -12px;
            padding:0 12px;
            border-bottom:1px solid var(--ag-line-2);
            background:rgba(4,7,10,.96);
        }
        .ux-topbar .ux-btn-icon { width:44px; height:44px; }
        .ux-topbar .entity-brand-logo, .ux-topbar img { max-height:34px; width:auto; }
        .ux-topbar-brand { display:flex; align-items:center; min-width:0; }
        .ux-topbar-title {
            min-width:0;
            margin-left:auto;
            overflow:hidden;
            color:var(--ag-gold-2);
            font-family:var(--ag-display);
            font-size:1rem;
            font-weight:600;
            letter-spacing:.12em;
            text-overflow:ellipsis;
            text-transform:uppercase;
            white-space:nowrap;
        }
        .entity-admin-shell > .entity-main-panel { grid-row:2; }
        .entity-admin-shell > .entity-sidebar-panel {
            position:fixed;
            z-index:1300;
            top:0;
            bottom:0;
            left:0;
            width:min(320px, 86vw);
            padding:12px;
            overflow-y:auto;
            overscroll-behavior:contain;
            border-right:1px solid var(--ag-line-2);
            background:var(--ag-bg);
            box-shadow:12px 0 40px rgba(0,0,0,.6);
            transform:translateX(-105%);
            visibility:hidden;
            transition:transform .2s ease-out, visibility 0s linear .2s;
        }
        .entity-admin-shell > .entity-sidebar-panel.is-open {
            transform:none;
            visibility:visible;
            transition:transform .2s ease-out;
        }
        .entity-admin-shell > .entity-sidebar-panel .entity-sidebar {
            display:flex;
            flex:none;
            flex-direction:column;
            flex-wrap:nowrap;
            overflow:visible;
            padding:12px 0;
        }
        .entity-admin-shell > .entity-sidebar-panel .entity-nav-item { min-height:44px; }
        .ux-drawer-close { display:inline-flex; }
        .ux-drawer-backdrop {
            position:fixed;
            z-index:1290;
            inset:0;
            display:block;
            border:0;
            background:rgba(0,0,0,.6);
        }
    }
    @media (max-width: 1100px) and (prefers-reduced-motion: reduce) {
        .entity-admin-shell > .entity-sidebar-panel, .entity-admin-shell > .entity-sidebar-panel.is-open { transition:none; }
    }
    /* In the drawer nothing shrinks (the brand was cut): the drawer scrolls instead. */
    @media (max-width: 1100px) {
        .entity-admin-shell > .entity-sidebar-panel > * { flex-shrink:0; }
    }
    /* Tabs (ViewTabs) on a narrow screen: one row that scrolls sideways, never two-line labels. */
    @media (max-width: 720px) {
        .cmd-view-tabs { overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
        .cmd-view-tabs::-webkit-scrollbar { display:none; }
        .cmd-view-tab { flex:none; min-height:44px; white-space:nowrap; }
    }
    /* List and detail: on a narrow screen the detail scrolls with the page, so "← List" sticks under the top bar. */
    @media (max-width: 900px) {
        .ux-split.has-detail > .ux-split-detail { overflow:visible; max-height:none; }
    }
    /* Below 900 px a bottom bar carries the five destinations. */
    @media (max-width: 900px) {
        :root { --ux-tabbar-h:64px; }
        .entity-admin-shell { padding-bottom:calc(var(--ux-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
        .ux-tabbar {
            position:fixed;
            z-index:1200;
            right:0;
            bottom:0;
            left:0;
            display:grid;
            grid-auto-columns:minmax(0,1fr);
            grid-auto-flow:column;
            height:calc(var(--ux-tabbar-h) + env(safe-area-inset-bottom, 0px));
            padding-bottom:env(safe-area-inset-bottom, 0px);
            border-top:1px solid var(--ag-line-2);
            background:rgba(4,7,10,.97);
        }
        .ux-tab {
            position:relative;
            display:flex;
            flex-direction:column;
            align-items:center;
            justify-content:center;
            gap:4px;
            min-width:0;
            border-top:2px solid transparent;
            color:var(--ag-text-2);
            font-family:var(--ag-mono);
            font-size:.6rem;
            letter-spacing:.08em;
            text-decoration:none;
            text-transform:uppercase;
        }
        .ux-tab > span:last-child { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .ux-tab:hover { color:#f0f3f5; }
        .ux-tab.is-active { border-top-color:var(--ag-gold); background:linear-gradient(180deg,rgba(201,162,74,.16),transparent); color:var(--ag-gold-2); }
        .ux-tab .cmd-nav-badge, .ux-tab .cmd-nav-dot { position:absolute; top:6px; left:calc(50% + 6px); margin:0; }
    }
}


/* ==== ux-map.css ==== */
/* Unit Control, segment Mapa: the experience pass (2026-11). Loaded after command.css, in the same app layer, so it
   refines it. Only this segment's screens; shared patterns go in ux-shared.css.
   unit-map.css (shared with the administration panel) lives in the "shared" layer, so every rule here wins over it
   without touching the panel. Leaflet's own stylesheet is unlayered: the few rules that move its controls need
   !important (an important layered rule beats an unlayered normal one).
   Contents: 1 head figures · 2 controls (views, layers) · 3 list (search, rows) · 4 floating pieces (create button,
   states, note) · 5 window of a unit · 6 creation window · 7 point menu · 8 below 1100 px: bottom sheet ·
   9 below 720 px: compact controls. */
@layer app {
    /* ---- 1 · Head: the figure that needs action ("Not placed") filters the list ------------------------------------ */
    .ux-map-stat-link {
        display:block;
        padding:0;
        border:0;
        border-bottom:1px dashed var(--uc-amber);
        background:none;
        color:inherit;
        font:inherit;
        cursor:pointer;
    }
    .ux-map-stat-link strong { color:var(--uc-amber-2); }
    .ux-map-stat-link:hover, .ux-map-stat-link[aria-pressed="true"] { border-bottom-style:solid; }

    /* ---- 2 · Controls: the views carry their figure; base map and "Fit all" are the layers ---------------------------- */
    .ux-map-scope-count {
        margin-left:2px;
        padding:0 5px;
        border:1px solid currentColor;
        border-radius:var(--uc-radius);
        font-size:.58rem;
        line-height:16px;
        opacity:.85;
    }
    .ux-map-layers { position:relative; display:flex; gap:6px; }
    .ux-map-layers-toggle { display:none; }
    .ux-map-layers-body { display:flex; gap:6px; }
    .ux-map-layers-body .geo-text-button { display:inline-flex; align-items:center; gap:6px; }

    /* ---- 3 · The list: wider for the chips, a search, the same row in every view -------------------------------------- */
    .cmd-map-side { width:320px; }
    .cmd-map-list header { display:flex; flex-wrap:wrap; align-items:center; }
    .cmd-map-list header .cmd-map-toggle { flex:1; width:auto; }
    .ux-map-legend-head { display:flex; align-items:center; }
    .ux-map-legend-head .cmd-map-toggle { flex:1; }
    .cmd-map-legend:not(.is-collapsed) .ux-map-legend-head { border-bottom:1px solid var(--ag-line); }
    .cmd-map-legend:not(.is-collapsed) .ux-map-legend-head .cmd-map-toggle { border-bottom:0; }
    .ux-map-sheet-close { display:none; }
    .ux-map-search { position:relative; flex:1 0 100%; padding:0 10px 8px; }
    .ux-map-search .uc-icon {
        position:absolute;
        top:50%;
        left:20px;
        margin-top:-4px;
        transform:translateY(-50%);
        color:var(--ag-text-2);
        pointer-events:none;
    }
    .ux-map-search input {
        height:34px;
        padding-left:30px;
        border:1px solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:#05090d;
        color:var(--ag-text);
        font-family:var(--ag-mono);
        font-size:.72rem;
    }
    .ux-map-search input:focus { border-color:var(--ag-gold); background:#05090d; color:var(--ag-text); box-shadow:none; }
    .ux-map-filters { flex:1 0 100%; display:flex; gap:6px; padding:0 10px 8px; }
    .cmd-map-list .ux-state { margin:10px; }

    .ux-map-rows { margin:0; padding:2px 0 4px; list-style:none; }
    .ux-map-row {
        display:flex;
        align-items:center;
        gap:4px;
        padding-left:calc(var(--depth,0) * 12px);
    }
    /* In the branch and the world, the units of the user's command keep their gold edge. */
    .ux-map-row.is-mine { box-shadow:inset 3px 0 0 var(--uc-amber); }
    .ux-map-row-main {
        flex:1;
        min-width:0;
        display:grid;
        grid-template-columns:24px minmax(0,1fr) auto;
        align-items:center;
        gap:8px;
        min-height:40px;
        padding:4px 10px;
        border:0;
        background:transparent;
        color:var(--ag-text);
        text-align:left;
        cursor:pointer;
    }
    .ux-map-row-main .cg-insignia { width:24px; height:24px; font-size:.5rem; }
    .ux-map-swatch { justify-self:center; width:10px; height:10px; border-radius:50%; background:var(--swatch); }
    .ux-map-row-text { min-width:0; display:flex; flex-direction:column; gap:1px; }
    .ux-map-row-text strong, .ux-map-row-text small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .ux-map-row-text strong { font-size:.74rem; font-weight:500; }
    .ux-map-row-text small {
        color:var(--ag-text-2);
        font-family:var(--ag-mono);
        font-size:.58rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .ux-map-row .ux-chip { height:18px; padding:0 5px; font-size:.56rem; }
    .ux-map-row-main:hover, .ux-map-row.is-selected .ux-map-row-main { background:rgba(201,162,74,.12); }
    .ux-map-row.is-selected .ux-map-row-main { box-shadow:inset 0 0 0 1px var(--ag-gold); }
    .ux-map-row-main:focus-visible { outline-offset:-2px; }
    .ux-map-row.is-unplaced .ux-map-row-text strong { color:var(--ag-text-2); }
    .ux-map-row-place {
        flex:none;
        display:inline-flex;
        align-items:center;
        gap:4px;
        height:28px;
        margin-right:8px;
        padding:0 8px;
        border:1px solid var(--ag-gold);
        border-radius:var(--uc-radius);
        background:transparent;
        color:var(--ag-gold-2);
        font-family:var(--ag-mono);
        font-size:.6rem;
        font-weight:600;
        letter-spacing:.08em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .ux-map-row-place:hover { background:var(--ag-gold-dim); }

    /* ---- 4 · Floating pieces: "Create here", the states and the note of the view ------------------------------------- */
    /* Above Leaflet's zoom buttons (bottom right), never on them. */
    .ux-map-fab {
        position:absolute;
        z-index:1000;
        right:12px;
        bottom:104px;
        display:inline-flex;
        align-items:center;
        gap:6px;
        min-height:40px;
        box-shadow:0 8px 24px rgba(0,0,0,.55);
    }
    /* The overlay lets the map be moved; only its card takes clicks. */
    .ux-map-overlay { background:rgba(2,6,10,.45); }
    .ux-map-overlay .ux-state {
        max-width:min(480px, calc(100% - 32px));
        border-style:solid;
        background:rgba(5,9,13,.96);
        box-shadow:var(--uc-shadow-dark);
        pointer-events:auto;
    }
    /* One floating chip for what the view shows (reading, truncated, empty, how many), centred over the free map
       (right of the list on desktop), below the controls. */
    .ux-map-note {
        position:absolute;
        z-index:1000;
        top:62px;
        left:calc(50% + 166px);
        transform:translateX(-50%);
        display:flex;
        align-items:center;
        gap:10px;
        max-width:min(520px, calc(100% - 380px));
        padding:6px 12px;
        border:1px solid var(--ag-line-2);
        border-radius:var(--uc-radius);
        background:rgba(5,9,13,.95);
        box-shadow:var(--uc-shadow-dark);
        color:#e8edf1;
        font-size:.7rem;
        text-align:center;
    }
    .ux-map-note.is-busy { border-color:rgba(232,176,64,.6); color:var(--uc-amber-2); }
    .ux-map-note .btn { flex:none; }
    /* The old note of the views is not drawn any more; kept hidden in case a cached page still has it. */
    .cmd-map-world-note { display:none; }

    /* ---- 5 · The window of a unit: the inspector of My units on top, one action bar below ----------------------------- */
    /* A proposal sent from the chain of a unit of another command: the sentence and where to follow it. */
    .cmd-map-chain-sent { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .cmd-map-chain-sent > span { flex:1 1 220px; }
    .ux-map-window .uc-inspector-head { margin-bottom:14px; }
    .ux-map-window .uc-inspector-actions { align-items:center; }
    .ux-map-window .uc-inspector-actions .ux-xlinks { flex:1 1 auto; }
    .ux-map-window .ux-map-edit { flex:none; margin-left:auto; }
    .ux-map-window .umap-modal-footer > .ux-actions { flex:1; }

    /* ---- 6 · The creation window: one way out, the steps in view, nothing under the action bar ------------------------ */
    /* The unit form's own title and "Close" repeat the window's title and ✕. */
    .ux-map-create .cmd-form > .d-flex:first-child { display:none; }
    /* The question "leave without placing?" stays in view while the body scrolls. */
    .ux-map-create-leave { position:sticky; top:-18px; z-index:7; margin:0 0 4px; }
    /* Fields reached with Tab scroll clear of the sticky action bar of the form. */
    .ux-map-create .umap-modal-body { padding-bottom:28px; scroll-padding-bottom:96px; }
    .cmd-mapcreate-pin { display:inline-grid; place-items:center; }

    /* ---- 7 · The point menu: icons of the set, room for a finger ---------------------------------------------------- */
    .umap-point-menu { outline:none; }
    .umap-point-menu button .uc-icon { flex:none; color:var(--ag-gold); }
    .umap-point-menu button:focus-visible { outline:2px solid var(--uc-amber); outline-offset:-2px; }

    /* ---- 8 · Below 1100 px: the list and the legend in a bottom sheet behind two buttons ----------------------------- */
    .ux-map-sheet-tabs { display:none; }
    @media (max-width: 1100px) {
        .cmd-map-side.ux-map-sheet {
            position:absolute;
            z-index:1002;
            top:auto;
            right:0;
            bottom:0;
            left:0;
            display:flex;
            width:auto;
            height:min(55%, 460px);
            gap:0;
            border-top:1px solid var(--ag-gold);
            background:#05090d;
            box-shadow:0 -12px 30px rgba(0,0,0,.6);
            pointer-events:auto;
            transform:translateY(100%);
            visibility:hidden;
            transition:transform .2s ease, visibility 0s linear .2s;
        }
        .cmd-map-side.ux-map-sheet:is([data-sheet="list"], [data-sheet="legend"]) {
            transform:none;
            visibility:visible;
            transition:transform .2s ease;
        }
        .ux-map-sheet[data-sheet="list"] > .cmd-map-legend, .ux-map-sheet[data-sheet="legend"] > .cmd-map-list { display:none; }
        .ux-map-sheet > :is(.cmd-map-list, .cmd-map-legend) { flex:1 1 auto; max-height:none; margin:0; border:0; }
        .ux-map-sheet > .cmd-map-legend { overflow:auto; }
        /* Folding means nothing in the sheet: its heading is a title, closed by ✕. */
        .ux-map-sheet .cmd-map-toggle { pointer-events:none; }
        .ux-map-sheet .cmd-map-toggle i { display:none; }
        .ux-map-sheet .ux-map-sheet-close { display:inline-grid; place-items:center; margin-right:6px; }
        .ux-map-sheet .umap-legend { display:grid; }
        .ux-map-sheet-tabs {
            position:absolute;
            z-index:1000;
            left:10px;
            bottom:40px;
            display:flex;
            gap:6px;
        }
        .ux-map-sheet-tabs button {
            display:inline-flex;
            align-items:center;
            gap:6px;
            min-height:44px;
            padding:0 12px;
            border:1px solid var(--ag-line-2);
            border-radius:var(--uc-radius);
            background:rgba(5,9,13,.95);
            box-shadow:var(--uc-shadow-dark);
            color:#e8edf1;
            font-family:var(--ag-mono);
            font-size:.66rem;
            font-weight:600;
            letter-spacing:.08em;
            text-transform:uppercase;
        }
        .ux-map-sheet-tabs button b { color:var(--ag-gold-2); font-weight:600; }
        .ux-map-sheet-tabs button.is-active { border-color:var(--ag-gold); color:var(--ag-gold-2); }
        /* With the sheet open its buttons and "Create here" give way; the zoom rises above the sheet. */
        .ux-map-shell.has-sheet :is(.ux-map-sheet-tabs, .ux-map-fab) { display:none; }
        .ux-map-shell.has-sheet .leaflet-bottom { bottom:min(55%, 460px) !important; }
        .ux-map-note { left:50%; max-width:calc(100% - 24px); }
    }

    /* ---- 9 · Below 720 px: the map fills the screen between the bars; icons only on the controls --------------------- */
    @media (max-width: 720px) {
        .ux-map-shell {
            flex:none;
            height:max(380px, calc(100dvh - var(--ux-topbar-h, 0px) - var(--ux-tabbar-h, 0px) - 150px));
            min-height:0;
        }
        /* unit-map.css sends the controls to the bottom on phones; here they stay on top, in one row. */
        .umap-controls.ux-map-controls {
            top:10px;
            right:10px;
            bottom:auto;
            left:10px;
            flex-direction:row;
            align-items:flex-start;
            justify-content:space-between;
        }
        .ux-map-controls .cmd-map-scope { height:44px; }
        .ux-map-controls .cmd-map-scope button { gap:4px; padding:0 10px; }
        .ux-map-scope-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
        .ux-map-layers-toggle {
            display:inline-grid;
            place-items:center;
            width:44px;
            height:44px;
            border:1px solid var(--ag-line-2);
            border-radius:var(--uc-radius);
            background:rgba(5,9,13,.95);
            color:#e8edf1;
        }
        .ux-map-layers-toggle[aria-expanded="true"] { border-color:var(--ag-gold); color:var(--ag-gold-2); }
        .ux-map-layers-body {
            position:absolute;
            top:calc(100% + 6px);
            right:0;
            display:none;
            flex-direction:column;
            min-width:210px;
            padding:8px;
            border:1px solid var(--ag-line-2);
            background:rgba(5,9,13,.98);
            box-shadow:var(--uc-shadow-dark);
        }
        .ux-map-layers[data-open="true"] .ux-map-layers-body { display:flex; }
        .ux-map-layers-body :is(.geo-select, .geo-text-button) { width:100%; height:44px; }
        .ux-map-note { top:62px; font-size:.66rem; }
        .ux-map-fab { min-height:44px; }
        .ux-map-row-main { min-height:44px; }
        .ux-map-row-place { height:36px; }
        .umap-point-menu button { min-height:44px; }
        .ux-map-sheet-close { width:44px; height:44px; }
    }

    @media (prefers-reduced-motion: reduce) {
        .cmd-map-side.ux-map-sheet { transition:none; }
    }
}


/* ==== ux-command.css ==== */
/* Unit Control, segment Mando: the experience pass (2026-11). Loaded after command.css, in the same app layer, so it
   refines it. Only this segment's screens; shared patterns go in ux-shared.css.
   Contents: 1 inspector · 2 unit form · 3 My units · 4 Affiliations and recruitment cards · 5 recruitment lists ·
   6 staffing board. */
@layer app {
    /* ---- 1 · Inspector of a unit: the canonical links on the left, the page's own actions (Edit last) on the right -- */
    .uc-inspector-actions.ux-actions { padding-top:4px; }
    .uc-inspector-actions .btn-primary { margin-left:0; }
    .uc-inspector-actions > .ux-xlinks { flex:1 1 auto; }
    /* Above a foreign record (a superior of another command): the one way on, to the map. */
    .ux-xlinks-top { margin-bottom:12px; }
    /* The board switch in the staffing graph's inspector: a quiet internal link, not a destination. */
    .cmd-graph-side .ux-inline-link { color:var(--uc-amber-2); }

    /* ---- 2 · Unit form: a title that names it, the fields in one column when the panel is narrow ------------------ */
    .cmd-form { container-type:inline-size; }
    .cmd-form-title {
        margin:0 0 12px;
        overflow-wrap:anywhere;
        font-family:var(--ag-display);
        font-size:1.3rem;
        letter-spacing:.06em;
        text-transform:uppercase;
    }
    .cmd-form .form-actions.ux-actions { justify-content:flex-end; }
    /* The side panel of My units is about 560 px wide: two columns of selects cut their texts ("Desconocid…"). */
    @container (max-width: 640px) {
        .cmd-form .row > .col-md-6 { flex:0 0 100%; max-width:100%; }
        .cmd-form-identity { grid-template-columns:minmax(0,1fr); }
        .cmd-posts-grid { grid-template-columns:minmax(0,1fr); }
    }

    /* ---- 3 · My units ------------------------------------------------------------------------------------------- */
    /* The list keeps its full height inside the split; the head of the tree is a section head. */
    .cmd-tree .entity-list-header.ux-section-head { margin:0; padding:10px 14px; }
    .cmd-tree .ux-state { margin:16px 12px; }
    /* The confirmations of the chain band take the place of its buttons, full width. */
    .cmd-chain-band .ux-confirm { margin:10px 0 0; }
    @media (max-width: 900px) {
        /* On a narrow screen the record opens over the list: the list has room to breathe. */
        .entity-workspace.ux-split > .cmd-tree { max-height:none; }
        .entity-workspace.ux-split > .cmd-tree .agency-record-scroll { max-height:none; }
    }

    /* ---- 4 · Cards of Affiliations and Recruitment: the actions in one row below the card, in the canonical order --- */
    .aff-card, .rec-vacancy, .rec-sent { flex-wrap:wrap; }
    :is(.aff-card, .rec-vacancy, .rec-sent) > .rec-card-main { flex:1 1 320px; }
    :is(.aff-card, .rec-vacancy, .rec-sent, .rec-card) > .rec-card-actions.ux-actions {
        flex:1 1 100%;
        flex-direction:row;
        flex-wrap:wrap;
        align-items:center;
        justify-content:flex-end;
        min-width:0;
        padding-top:10px;
        border-top:1px solid var(--ag-line);
    }
    .rec-card > .ux-confirm { flex:1 1 100%; margin:0; }
    .rec-card-main > .ux-confirm { margin:4px 0 0; }
    .aff-card.is-target, .rec-card.is-target {
        border-color:var(--ag-gold);
        box-shadow:0 0 0 2px rgba(227,192,107,.45), inset 3px 0 0 var(--ag-gold);
    }
    .aff-card:focus, .rec-card[tabindex="-1"]:focus { outline:none; }
    .aff-filter { margin:-2px 0 2px; }
    @media (max-width: 720px) {
        :is(.aff-card, .rec-vacancy, .rec-sent) > .rec-card-actions.ux-actions { flex-direction:column-reverse; align-items:stretch; }
        :is(.aff-card, .rec-vacancy, .rec-sent) > .rec-card-actions .ux-actions-gap { display:none; }
        :is(.aff-card, .rec-vacancy, .rec-sent) > .rec-card-actions .ux-xlinks { order:-1; }
    }

    /* ---- 5 · Recruitment lists --------------------------------------------------------------------------------- */
    .rec-blocked { margin:-4px 0 10px; color:var(--ink-muted); font-style:italic; }
    .rec-checks { display:flex; flex-direction:column; justify-content:flex-end; gap:6px; }
    /* The place filter carries its own two labels (around, radius): it takes two cells of the toolbar. */
    .rec-talent-toolbar .ux-toolbar-field.is-wide { grid-column:span 2; }
    .rec-talent-toolbar .rec-geo { display:flex; flex-wrap:wrap; gap:10px 12px; }
    .rec-talent-toolbar .rec-geo > label { flex:1 1 160px; min-width:0; }
    @media (max-width: 720px) {
        .rec-talent-toolbar .ux-toolbar-field.is-wide { grid-column:auto; }
    }
    /* A found operator: the row opens the profile, the envelope invites without opening it. */
    .rec-row-wrap {
        display:flex;
        align-items:center;
        gap:6px;
        padding-right:10px;
        border-bottom:1px solid var(--ag-line);
    }
    .rec-row-wrap.is-selected { background:linear-gradient(90deg,rgba(201,162,74,.18),transparent); }
    .rec-row-invite { color:var(--ag-gold-2); border-color:rgba(201,162,74,.45); }

    /* ---- 6 · Staffing board -------------------------------------------------------------------------------------- */
    .cmd-staff-filters { flex:none; }
    .cmd-staff-filters .ux-toolbar-fields { grid-template-columns:minmax(200px, 320px) minmax(220px, 1fr); }
    /* The help folded under "How does it work?": one line until it is asked for. */
    details.cmd-staff-help {
        flex:none;
        margin:0;
        color:var(--ag-text-2);
        font-size:.7rem;
    }
    details.cmd-staff-help > summary {
        display:inline-flex;
        align-items:center;
        gap:6px;
        min-height:32px;
        color:var(--ag-gold-2);
        cursor:pointer;
        list-style:none;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    details.cmd-staff-help > summary::-webkit-details-marker { display:none; }
    details.cmd-staff-help > p { max-width:90ch; margin:4px 0 0; line-height:1.5; }
    .cmd-board-empty.ux-state { align-self:flex-start; min-width:280px; }
    /* The name of an operator opens its dossier. */
    .cmd-card-name {
        display:block;
        max-width:100%;
        padding:0;
        overflow:hidden;
        border:0;
        background:none;
        color:#e8edf1;
        font-size:.74rem;
        font-weight:600;
        text-align:left;
        text-overflow:ellipsis;
        white-space:nowrap;
        cursor:pointer;
    }
    .cmd-card-name:hover { color:var(--ag-gold-2); text-decoration:underline; }
    .cmd-card-op.is-inactive .cmd-card-name { color:#c3ccd4; }
    .cmd-card-dossier { align-self:flex-start; }
    .cmd-card-menu .form-control {
        border:1px solid var(--ag-line-2);
        border-radius:0;
        background-color:#070b10;
        color:var(--ag-text);
    }
    .cmd-reserve > .ux-section-head { flex-direction:column; align-items:flex-start; gap:2px; margin:0 0 8px; }
    .cmd-reserve > .ux-section-head h2 { font-size:.95rem; }
    .cmd-reserve-hint { color:var(--ag-muted); font-size:.62rem; }
    @media (max-width: 720px) {
        .cmd-staff-filters .ux-toolbar-fields { grid-template-columns:minmax(0,1fr); }
        .cmd-card-menu-toggle { width:44px; height:44px; }
    }
}


/* ==== ux-career.css ==== */
/* Unit Control, segment Carrera: the experience pass (2026-11). Loaded after command.css, in the same app layer, so it
   refines it. Only this segment's screens; shared patterns go in ux-shared.css. */
@layer app {
    /* ---- Offers: the filter bar (ux-toolbar on top of the old rec-filters) --------------------------------------- */
    /* The text and the place need room: two columns of the grid on a wide screen, one on a phone (the grid is one
       column there). */
    .rec-search .ux-toolbar-fields .rec-filter-text,

    /* Placeholders and borders that can be read on the dark inputs (they were far below 4.5:1). */
    :is(.rec-search, .rec-filters) :is(.form-control, .form-select) { border-color:var(--ag-line-2); }
    :is(.rec-search, .rec-filters) ::placeholder { color:var(--ag-muted); opacity:1; }

    /* The "find" button of the place, as tall as the input; a 44 px target on a phone. */

    /* ---- Cards of Carrera (offers, invitations, applications): one anatomy ---------------------------------------- */
    /* Head (title, state, date on the right), body, and the actions in a row at the foot, the way out on the left and
       the decision on the right, as in every action bar of the app. */
    .rec-card.ux-card { flex-direction:column; gap:10px; }
    .rec-card.ux-card > .rec-card-actions.ux-actions {
        flex-direction:row;
        align-items:center;
        min-width:0;
        padding-top:10px;
        border-top:1px solid var(--ag-line);
    }
    .ux-card-head h3 { margin:0; }
    .ux-card-head .rec-age { margin-left:auto; color:var(--ag-text-2); font-size:.66rem; white-space:nowrap; }
    .rec-card.ux-card > .ux-confirm { margin:0; }

    /* Why an action is off, in words under it (a title never shows on a touch screen). */
    .ux-hint {
        display:block;
        color:var(--ag-text-2);
        font-size:.68rem;
        line-height:1.35;
    }
    .rec-card-actions.ux-actions > .ux-hint { flex:1 1 100%; text-align:right; }
    .umap-modal-footer .ux-hint { margin-top:6px; color:var(--ink-muted, #5b4c33); text-align:right; }

    /* The card a notice points at (?inv=, ?app=): a gold border that fades, so the eye finds it and then rests. */
    .rec-card.is-target {
        border-color:var(--ag-gold);
        animation:ux-career-target 2.4s ease-out 1 both;
    }
    .rec-card.is-target:focus { outline:none; }
    .rec-card.is-target:focus-visible { outline:2px solid var(--uc-amber, var(--ag-gold)); outline-offset:2px; }
    @keyframes ux-career-target {
        0%, 40% { box-shadow:0 0 0 3px rgba(227,192,107,.55), inset 3px 0 0 var(--ag-gold); }
        100% { box-shadow:0 0 0 0 rgba(227,192,107,0), inset 3px 0 0 var(--ag-gold); }
    }
    @media (prefers-reduced-motion: reduce) {
        .rec-card.is-target { animation:none; box-shadow:inset 3px 0 0 var(--ag-gold); }
    }

    /* Lists of Carrera: the sections breathe the same in Invitations, Applications and Notices. */
    .ux-career-list > .ux-section-head { margin-top:6px; }
    .ux-career-list > .ux-section-head:first-child { margin-top:0; }
    .ux-section-head.is-critical h2 { color:var(--ag-red-2); }

    /* ---- Applications: the pipeline, readable on a phone (vertical under 520 px) ---------------------------------- */
    @media (max-width: 520px) {
        .rec-pipeline li:is(.is-done, .is-current, .is-end)::before { background:currentColor; }
        .ux-card-head .rec-age { margin-left:0; flex-basis:100%; }
    }

    /* ---- Notices: the verb of each notice as a button -------------------------------------------------------------- */
    .notice-meta .notice-verb { pointer-events:none; white-space:nowrap; }
    .notice a:hover .notice-verb, .notice a:focus-visible .notice-verb {
        border-color:var(--ag-gold-2);
        background:rgba(201,162,74,.14);
        color:var(--ag-gold-2);
    }

    /* ---- Dossier: checklist and side column ----------------------------------------------------------------------- */
    /* Done: green stamps. Missing: buttons that open what completes them. */
    .dos-checks.ux-checks { gap:6px; font-size:inherit; letter-spacing:0; text-transform:none; }
    .dos-checks.ux-checks li { color:inherit; }
    .ux-check-todo {
        display:inline-flex;
        align-items:center;
        gap:6px;
        min-height:28px;
        padding:0 10px;
        border:1px dashed var(--stamp, var(--stamp));
        border-radius:var(--uc-radius, 0);
        background:rgba(168,38,31,.05);
        color:var(--stamp, var(--stamp));
        font-family:var(--ag-mono);
        font-size:.64rem;
        letter-spacing:.06em;
        text-transform:uppercase;
        cursor:pointer;
    }
    .ux-check-todo:hover { border-style:solid; background:rgba(168,38,31,.1); }
    .dos-progress > .ux-hint { margin-top:6px; color:var(--ink-muted, #5b4c33); }
    .dos-side-card > .ux-xlinks, .dos-side-card > .ux-actions { margin-top:10px; justify-content:flex-start; }
    .dos-side-card > .ux-actions .btn { flex:none; }
    /* In the dossier window of another operator the side cards stay dark inside the paper window: their links and
       buttons keep the dark variant (the kit would turn them to ink, unreadable on the dark card). */
    .entity-admin-shell .umap-modal .dos-modal .dos-side-card .btn-outline-primary {
        border-color:var(--ag-gold-2);
        background:transparent;
        color:var(--ag-gold-2);
    }
    .entity-admin-shell .umap-modal .dos-modal .dos-side-card .btn-outline-primary:hover:not(:disabled) {
        border-color:var(--ag-gold-2);
        background:var(--ag-gold-dim, rgba(201,162,74,.14));
        color:var(--ag-gold-2);
    }
    .umap-modal .dos-modal .dos-side-card .ux-xlink { border-color:rgba(201,162,74,.45); color:var(--ag-gold-2); }
    .umap-modal .dos-modal .dos-side-card .ux-xlink:hover { border-color:var(--ag-gold-2); background:var(--ag-gold-dim, rgba(201,162,74,.14)); color:var(--ag-gold-2); }

    /* ---- History: dates above the event on a phone ---------------------------------------------------------------- */
    @media (max-width: 520px) {
        .dos-panel.is-timeline .dos-event { flex-direction:column-reverse; align-items:stretch; gap:4px; padding:8px 10px; }
        .dos-panel.is-timeline .dos-event-when { flex-direction:row; align-items:baseline; gap:8px; text-align:left; }
        .dos-periods small { display:block; }
        .dos-kpis { grid-template-columns:repeat(2, minmax(0,1fr)); }
    }

    /* ---- Profile: one line that says what it is and where the service record lives -------------------------------- */
    .ux-page-intro {
        margin:0 0 12px;
        color:var(--ag-text-2);
        font-size:.74rem;
    }
    .ux-page-intro a { color:var(--ag-gold-2); margin-left:4px; }

    /* ---- Phone ------------------------------------------------------------------------------------------------------ */
    @media (max-width: 720px) {
        .rec-search .ux-toolbar-fields .rec-filter-text,
        /* Stacked in reverse (primary on top): the reason sits right under the button it explains. */
        .rec-card-actions.ux-actions > .btn-primary { order:2; }
        .rec-card-actions.ux-actions > .ux-hint { order:1; text-align:left; }
        .umap-modal-footer .ux-hint { text-align:left; }
        .ux-check-todo { min-height:44px; }
    }
}


/* ==== aspirant.css ==== */
/* Unit Control, aspirants: the step where a person whose account waits for approval looks for units and applies to
   them (on the paper card of the pending account), and what the managers read of it in Recruitment (the pitch and the
   person, on the dark workspace). Loaded last, in the app layer. The pieces shared by both places take their colours
   from --asp-* variables: dark by default, paper inside the card. */
@layer app {
    :root {
        --asp-ink:var(--ag-text);
        --asp-ink-2:var(--ag-text-2);
        --asp-line:var(--ag-line-2);
        --asp-soft:rgba(255,255,255,.03);
        --asp-accent:var(--ag-gold);
        --asp-stamp:var(--ag-red-2);
        --asp-ok:var(--ag-green);
    }
    .profile-card, .rec-detail, .paper-modal {
        --asp-ink:var(--ink);
        --asp-ink-2:var(--ink-muted);
        --asp-line:var(--paper-edge);
        --asp-soft:rgba(255,253,245,.45);
        --asp-accent:#8a6414;
        --asp-stamp:var(--stamp);
        --asp-ok:#2f7a4f;
    }

    /* ---- The pending card: four steps, two parts, and the way from the profile to the units -------------------- */
    .profile-card:has(.asp-stage) { width:min(1080px,100%); }
    .account-steps.has-four { grid-template-columns:repeat(4,minmax(0,1fr)); }
    @media (max-width:860px) { .account-steps.has-four { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:520px) { .account-steps.has-four { grid-template-columns:1fr; } }

    .account-parts { display:flex; gap:0; border-bottom:2px solid var(--ink); }
    .account-part {
        display:flex; align-items:center; gap:8px;
        min-height:44px; padding:8px 16px;
        border:1px solid var(--paper-edge); border-bottom:0;
        background:transparent; color:var(--ink-muted);
        font:600 .74rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase;
    }
    .account-part + .account-part { margin-left:-1px; }
    .account-part b { display:grid; place-items:center; width:22px; height:22px; border:1px solid currentColor; border-radius:50%; font-size:.7rem; }
    .account-part small { font-weight:500; letter-spacing:0; text-transform:none; opacity:.8; }
    .account-part.is-active { background:var(--ink); color:var(--paper); border-color:var(--ink); }
    .account-part:focus-visible { outline:2px solid var(--stamp); outline-offset:2px; }
    .account-next {
        display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px;
        margin-top:14px; padding:12px 14px;
        border:1px dashed var(--ink-2); background:rgba(255,253,245,.45);
        font-size:.8rem;
    }

    /* ---- The stage ------------------------------------------------------------------------------------------- */
    .asp-stage { display:grid; gap:12px; padding-top:12px; color:var(--asp-ink); }
    .asp-intro p { margin:0; font-size:.8rem; line-height:1.5; color:var(--ink-2); }
    .asp-help { margin:0; font-size:.72rem; color:var(--asp-ink-2); line-height:1.45; }
    .asp-from { display:flex; align-items:flex-start; gap:8px; margin:0; padding:10px 12px; border-left:3px solid var(--asp-accent); background:var(--asp-soft); color:var(--asp-ink); font-size:.8rem; line-height:1.45; }
    .asp-hint { display:block; font-size:.66rem; color:var(--asp-ink-2); }
    .asp-warn { display:block; font-size:.68rem; color:var(--asp-stamp); }

    .asp-views { display:flex; flex-wrap:wrap; gap:6px; }
    .asp-views button {
        display:inline-flex; align-items:center; gap:6px;
        min-height:38px; padding:6px 12px;
        border:1px solid var(--paper-edge); background:var(--asp-soft); color:var(--ink-2);
        font:600 .72rem var(--ag-mono); letter-spacing:.06em; text-transform:uppercase;
    }
    .asp-views button b { min-width:20px; padding:0 5px; border-radius:10px; background:var(--ink-2); color:var(--paper); font-size:.66rem; text-align:center; }
    .asp-views button.is-active { border-color:var(--ink); background:var(--ink); color:var(--paper); }
    .asp-views button.is-active b { background:var(--paper); color:var(--ink); }
    .asp-views button:disabled { opacity:.5; }

    /* The selection: a strip that stays in view while scrolling the results. */
    .asp-tray {
        position:sticky; top:0; z-index:3;
        display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
        padding:10px 12px;
        border:1px solid var(--ink); background:#efe6cd;
        box-shadow:0 6px 14px rgba(29,29,27,.12);
    }
    .asp-tray.is-empty { position:static; border-style:dashed; box-shadow:none; background:transparent; }
    .asp-tray-label { font:700 .7rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .asp-tray-hint { font-size:.72rem; color:var(--ink-muted); }
    .asp-tray-units { display:flex; flex-wrap:wrap; gap:6px; flex:1 1 auto; }
    .asp-tray .btn { margin-left:auto; }
    .asp-chip {
        display:inline-flex; align-items:center; gap:4px;
        padding:2px 4px 2px 8px; border:1px solid var(--ink-2); background:rgba(255,253,245,.7);
        font-size:.72rem;
    }
    .asp-chip button { min-width:24px; min-height:24px; border:0; background:transparent; color:var(--stamp); }

    /* Filters: the fields of the profile, in a grid. */
    .asp-filters {
        display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 12px; align-items:end;
        padding:12px; border:1px solid var(--asp-line); background:var(--asp-soft);
    }
    .asp-field { display:grid; gap:3px; min-width:0; margin:0; font-size:.62rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--asp-ink-2); }
    .asp-field small { font-weight:500; letter-spacing:0; text-transform:none; }
    .asp-field .form-control, .asp-field .form-select { font-size:.85rem; letter-spacing:normal; text-transform:none; }
    .asp-field.is-wide { grid-column:span 2; }
    .asp-filters .asp-geo { grid-column:span 2; }
    .asp-filters .asp-geo .rec-geo { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:8px 12px; }
    .asp-filters .asp-geo .rec-geo label { display:grid; gap:3px; margin:0; }
    .asp-filters .asp-geo .rec-geo-search { display:flex; gap:4px; }
    .asp-filters .asp-geo .rec-geo-search .btn { min-width:34px; }
    .asp-filters .asp-geo .rec-geo-chip { display:inline-flex; align-items:center; gap:6px; min-height:31px; padding:2px 6px; border:1px solid var(--ink-2); font-size:.78rem; text-transform:none; letter-spacing:0; }
    .asp-filters .asp-geo .rec-geo-chip button { min-width:26px; min-height:26px; border:0; background:transparent; color:var(--stamp); }
    .asp-filters .rec-geo-error { color:var(--stamp); text-transform:none; letter-spacing:0; }
    .asp-check { display:flex; align-items:center; gap:8px; min-height:38px; margin:0; font-size:.76rem; color:var(--asp-ink); }
    .asp-check input { width:18px; height:18px; accent-color:var(--ink); }
    .asp-clear { justify-self:end; }
    @media (max-width:860px) { .asp-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:520px) {
        .asp-filters { grid-template-columns:1fr; }
        .asp-field.is-wide, .asp-filters .asp-geo { grid-column:auto; }
        .asp-filters .asp-geo .rec-geo { grid-template-columns:1fr; }
    }

    .asp-count { margin:0; font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-muted); }
    .asp-results, .asp-mine { display:grid; gap:8px; }
    .asp-more { justify-self:center; }

    /* A unit of the results: the line of the unit, and on its right what can be done. */
    .asp-unit, .asp-app {
        display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 14px; align-items:center;
        padding:10px 12px; border:1px solid var(--paper-edge); background:rgba(255,253,245,.55);
    }
    .asp-unit.is-chosen { border-color:var(--ink); box-shadow:inset 4px 0 0 var(--ink); }
    .asp-unit-side { display:grid; justify-items:end; gap:6px; }
    .asp-unit-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
    .profile-card :is(.asp-unit, .asp-app, .asp-apply-unit) .rec-unit-text strong { color:var(--ink); }
    .profile-card :is(.asp-unit, .asp-app, .asp-apply-unit) :is(.rec-unit-text small, .rec-place) { color:var(--ink-muted); }
    .profile-card :is(.asp-unit, .asp-app, .asp-apply-unit) .rec-tag { border-color:var(--ink-2); color:var(--ink-2); }
    .profile-card .asp-stage .rec-place b { color:var(--ink); }
    @media (max-width:620px) {
        .asp-unit, .asp-app { grid-template-columns:1fr; }
        .asp-unit-side { justify-items:start; }
        .asp-unit-actions { justify-content:flex-start; }
    }

    .asp-tag {
        display:inline-block; padding:1px 7px;
        border:1px solid var(--asp-line); color:var(--asp-ink-2);
        font-size:.58rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase; white-space:nowrap;
    }
    .asp-tag.is-plain { border-style:dashed; }
    .asp-tag.is-gold { border-color:var(--asp-accent); color:var(--asp-accent); }
    .asp-tag.is-stamp { border:2px solid var(--asp-stamp); color:var(--asp-stamp); transform:rotate(-2deg); }
    .asp-tags { display:flex; flex-wrap:wrap; gap:4px; }

    /* ---- Apply: the form on the left, the meter, the preview and Send on the right -------------------------- */
    .asp-apply { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr); gap:16px; align-items:start; }
    .asp-apply-main { display:grid; gap:14px; }
    .asp-apply-side { position:sticky; top:64px; display:grid; gap:12px; }
    @media (max-width:860px) {
        .asp-apply { grid-template-columns:1fr; }
        .asp-apply-side { position:static; }
    }
    .asp-block { display:grid; gap:8px; padding:12px; border:1px solid var(--paper-edge); background:rgba(255,253,245,.35); }
    .asp-block h3 { margin:0; font:700 .78rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .asp-apply-unit {
        position:relative; display:grid; gap:6px;
        padding:10px 40px 10px 10px; border:1px solid var(--paper-edge); background:rgba(255,253,245,.6);
    }
    .asp-apply-unit.has-error { border-color:var(--stamp); }
    .asp-apply-remove { position:absolute; top:6px; right:6px; min-width:32px; min-height:32px; border:0; background:transparent; color:var(--stamp); }
    .asp-letter { min-height:150px; font-family:var(--ag-type); font-size:.9rem; line-height:1.55; background:#fbf7ea; }
    .asp-counter { justify-self:end; font-size:.66rem; color:var(--ink-muted); }
    .asp-counter.is-short { color:var(--stamp); }

    /* The pitch form: four lettered blocks. */
    .asp-form { display:grid; gap:12px; }
    .asp-form fieldset { display:grid; gap:8px; margin:0; padding:10px 12px 12px; border:1px solid var(--paper-edge); }
    .asp-form legend { display:flex; align-items:center; gap:8px; width:auto; margin:0; padding:0 6px; font:700 .66rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .asp-form legend b { display:grid; place-items:center; width:20px; height:20px; background:var(--ink); color:var(--paper); font-size:.62rem; }
    .asp-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; align-items:end; }
    .asp-grid .is-wide { grid-column:1 / -1; }
    .asp-narrow { max-width:220px; }
    @media (max-width:520px) { .asp-grid { grid-template-columns:1fr; } }
    .asp-toggles { display:flex; flex-wrap:wrap; gap:6px; }
    .asp-toggle {
        min-height:36px; padding:4px 12px;
        border:1px solid var(--ink-2); border-radius:18px; background:rgba(255,253,245,.6); color:var(--ink-2);
        font-size:.76rem;
    }
    .asp-toggle.is-on { border-color:var(--ink); background:var(--ink); color:var(--paper); }
    .asp-toggle:focus-visible, .asp-segment button:focus-visible { outline:2px solid var(--stamp); outline-offset:2px; }
    .asp-segment { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
    .asp-segment button {
        display:grid; gap:2px; justify-items:start; text-align:left;
        min-height:52px; padding:6px 10px;
        border:1px solid var(--ink-2); background:rgba(255,253,245,.6); color:var(--ink);
        letter-spacing:normal; text-transform:none;
    }
    .asp-segment button strong { font-size:.78rem; }
    .asp-segment button small { font-size:.66rem; color:var(--ink-muted); font-weight:400; }
    .asp-segment button.is-on { border-color:var(--ink); box-shadow:inset 0 0 0 2px var(--ink); background:#fbf7ea; }
    @media (max-width:520px) { .asp-segment { grid-template-columns:1fr; } }

    /* The strength meter, the colour of how convincing it is. */
    .asp-strength { display:grid; gap:6px; padding:12px; border:1px solid var(--ink); background:#fbf7ea; }
    .asp-strength-head { display:flex; justify-content:space-between; align-items:baseline; font:700 .7rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .asp-strength-head b { font-size:1rem; }
    .asp-strength-bar { height:8px; background:rgba(29,29,27,.12); }
    .asp-strength-bar i { display:block; height:100%; background:linear-gradient(90deg,#a8261f,#b07d1f 45%,#2f7a4f); transition:width .25s ease; }
    .asp-strength small { font-size:.72rem; color:var(--ink-2); }
    .asp-strength ul { margin:0; padding-left:18px; font-size:.72rem; color:var(--ink-2); display:grid; gap:2px; }
    @media (prefers-reduced-motion:reduce) { .asp-strength-bar i { transition:none; } }

    .asp-preview { display:grid; gap:10px; padding:12px; border:1px dashed var(--ink-2); background:rgba(255,253,245,.5); }
    .asp-preview h4 { margin:0; font:700 .66rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; color:var(--ink-muted); }
    .asp-preview-letter {
        margin:0; padding:8px 10px; border-left:3px solid var(--ink-2);
        font-family:var(--ag-type); font-size:.8rem; line-height:1.5; white-space:pre-line;
        max-height:180px; overflow:auto;
    }
    .asp-send { display:grid; gap:6px; }
    .asp-send .btn { min-height:44px; }

    /* ---- My applications ------------------------------------------------------------------------------------ */
    .asp-app-state { display:grid; justify-items:end; gap:3px; text-align:right; font-size:.7rem; color:var(--ink-muted); max-width:300px; }
    .asp-app.is-accepted, .asp-app.is-reserved { border-color:#2f7a4f; box-shadow:inset 4px 0 0 #2f7a4f; }
    .asp-app.is-accepted .asp-tag.is-stamp, .asp-app.is-reserved .asp-tag.is-stamp { border-color:#2f7a4f; color:#2f7a4f; }
    .asp-app.is-rejected { opacity:.8; }
    .asp-app .asp-reply, .asp-app .asp-app-actions { grid-column:1 / -1; }
    .asp-reply { margin:0; padding:6px 10px; border-left:3px solid var(--ink-2); font-family:var(--ag-type); font-size:.78rem; }
    .asp-app-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; font-size:.74rem; }
    @media (max-width:620px) { .asp-app-state { justify-items:start; text-align:left; } }

    .asp-notice {
        position:sticky; bottom:12px; z-index:4;
        display:flex; align-items:center; justify-content:space-between; gap:10px;
        padding:10px 12px; border-left:4px solid #2f7a4f; background:#f3ecd6; box-shadow:0 8px 24px rgba(0,0,0,.25);
        font-size:.8rem;
    }
    .asp-notice.is-error { border-left-color:var(--stamp); }
    .asp-notice button { min-width:32px; min-height:32px; border:0; background:transparent; }

    /* ---- Shared with Recruitment: the person and the pitch --------------------------------------------------- */
    .asp-person {
        display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center;
        padding:10px 12px; border:1px solid var(--asp-line); background:var(--asp-soft); color:var(--asp-ink);
    }
    .asp-person-photo { width:56px; height:56px; object-fit:cover; border:1px solid var(--asp-line); }
    .asp-person-photo.is-empty { display:grid; place-items:center; font:700 1rem var(--ag-mono); color:var(--asp-ink-2); }
    .asp-person-text { display:grid; gap:2px; font-size:.76rem; color:var(--asp-ink-2); min-width:0; }
    .asp-person-text strong { font-size:.95rem; color:var(--asp-ink); }
    .asp-stamp {
        padding:3px 8px; border:2px solid var(--asp-stamp); color:var(--asp-stamp);
        font:700 .66rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; transform:rotate(-4deg);
    }
    .asp-stamp.is-ok { border-color:var(--asp-ok); color:var(--asp-ok); }
    @media (max-width:520px) { .asp-person { grid-template-columns:auto minmax(0,1fr); } .asp-stamp { grid-column:1 / -1; justify-self:start; } }

    .asp-pitch { display:grid; gap:8px; color:var(--asp-ink); }
    .asp-pitch h4 { margin:0; font:700 .66rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; color:var(--asp-ink-2); }
    .asp-pitch-headline { margin:0; font-family:var(--ag-type); font-size:.95rem; line-height:1.4; }
    .asp-pitch-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0; }
    .asp-pitch-facts div { padding:6px 8px; border:1px solid var(--asp-line); }
    .asp-pitch-facts dt { font-size:.58rem; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--asp-ink-2); }
    .asp-pitch-facts dd { margin:0; font-size:.8rem; }
    .asp-pitch-row { display:grid; grid-template-columns:120px minmax(0,1fr); gap:8px; align-items:baseline; font-size:.76rem; }
    .asp-pitch-row > span:first-child { font-size:.58rem; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--asp-ink-2); }
    .asp-pitch-row a { color:var(--asp-accent); overflow-wrap:anywhere; }
    @media (max-width:520px) { .asp-pitch-row { grid-template-columns:1fr; gap:2px; } }
    /* Sent to the reserve: a positive end, like accepted (the account was validated). */

    /* ---------- Join link of a unit ----------
       The public page (/join/{code}): the manila card of the unit with a big gold "Join"; the sign-up through it (the
       unit named above the form); the waiting screen of who came through it (the unit and the steps email, phone,
       unit); and, for the managers, the button top right of the inspector and its window. */
    .join-screen .join-card { gap:12px; }
    .join-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .join-kicker { margin:6px 0 0; color:#7d1a1f; font-size:.68rem; font-weight:700; letter-spacing:.28em; text-transform:uppercase; }
    .join-identity { display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:center; }
    .join-identity .join-insignia { width:96px; height:96px; object-fit:contain; filter:drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
    .join-identity .umap-generic.join-insignia { display:grid; place-items:center; }
    .join-identity .umap-generic.join-insignia svg { width:80px; height:80px; }
    .join-identity h1 { margin:0; font-size:1.9rem; line-height:1.1; overflow-wrap:anywhere; }
    .join-code { color:#5a4e3a; font-size:.74rem; letter-spacing:.14em; }
    .join-designation { margin:4px 0 0; color:#4a4031; font-family:var(--ag-type); font-size:.9rem; font-style:italic; }
    .join-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; margin:0; padding:10px 0; border-top:1px solid #b9a77a; border-bottom:1px solid #b9a77a; }
    .join-facts div { display:grid; gap:1px; min-width:0; }
    .join-facts dt { color:#6b5d44; font-size:.62rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase; }
    .join-facts dd { margin:0; color:#1d1d1b; font-family:var(--ag-type); font-size:.95rem; overflow-wrap:anywhere; }
    .join-description { margin:0; color:#2b2419; font-family:var(--ag-type); font-size:.86rem; line-height:1.55; white-space:pre-line; }
    .join-cta.btn {
        width:100%;
        padding:14px 18px;
        border:2px solid #7c5d17;
        background:linear-gradient(180deg,#d9b25a,#b98a2c);
        color:#1d1609;
        font-family:var(--ag-display);
        font-size:1.35rem;
        letter-spacing:.32em;
        text-transform:uppercase;
        box-shadow:0 6px 18px rgba(124,93,23,.35), inset 0 1px 0 rgba(255,255,255,.35);
    }
    .join-cta.btn:hover:not(:disabled), .join-cta.btn:focus-visible { background:linear-gradient(180deg,#e4c06b,#c49533); color:#1d1609; border-color:#5e4610; }
    .join-cta.btn:disabled { opacity:.7; }
    a.join-cta.btn { display:block; text-align:center; font-size:1rem; }
    .join-explain { margin:0; color:#4a4031; font-size:.76rem; text-align:center; }
    .join-card .auth-switch { margin:0; text-align:center; }
    .join-card.is-gone { text-align:left; }
    .join-login { position:relative; }
    .join-login-back.btn { position:absolute; top:12px; left:12px; color:var(--ag-gold-2); }
    @media (max-width:520px) {
        .join-identity { grid-template-columns:64px minmax(0,1fr); gap:12px; }
        .join-identity .join-insignia { width:64px; height:64px; }
        .join-identity h1 { font-size:1.45rem; }
        .join-cta.btn { font-size:1.1rem; letter-spacing:.24em; }
    }

    /* The unit named above the sign-up form. */
    .reg-join { display:grid; gap:2px; margin:0; padding:8px 10px; border-left:3px solid #b98a2c; background:rgba(201,162,74,.16); font-size:.78rem; color:#4a4031; }
    .reg-join strong { color:#2b2419; font-size:.86rem; }

    /* The waiting screen of who came through the link. */
    .join-pending { display:flex; align-items:center; gap:12px; padding:10px 12px; border-left:3px solid #b98a2c; background:rgba(201,162,74,.16); }
    .join-pending img { width:48px; height:48px; object-fit:contain; }
    .join-pending span { display:grid; gap:2px; }
    .join-pending strong { color:#2b2419; font-family:var(--ag-type); font-size:1rem; }
    .join-pending small { color:#4a4031; font-size:.76rem; }

    /* Managers: the button top right of the inspector and its window. */
    /* Pinned to the corner of the card, outside the grid: the name keeps its width (on two lines when needed) and the
       chips under it the whole width. */
    .uc-inspector-head:has(.uc-inspector-corner) { position:relative; }
    .uc-inspector-corner { position:absolute; top:12px; right:14px; display:flex; }
    .uc-inspector-identity:has(.uc-inspector-corner) .uc-inspector-title h2 { padding-right:210px; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.15; }
    .uc-join-link-btn.btn { display:inline-flex; align-items:center; gap:6px; border:1px solid #7c5d17; background:transparent; color:#5e4610; font-family:var(--ag-mono); font-size:.66rem; letter-spacing:.14em; text-transform:uppercase; }
    .uc-join-link-btn.btn:hover, .uc-join-link-btn.btn.is-on { background:rgba(201,162,74,.22); color:#3d2d09; border-color:#7c5d17; }
    @media (max-width:640px) {
        .uc-inspector-corner { position:static; grid-column:1 / -1; }
        .uc-inspector-identity:has(.uc-inspector-corner) .uc-inspector-title h2 { padding-right:0; }
    }
    .joinlink { display:grid; gap:10px; }
    .joinlink-intro, .joinlink-note, .joinlink-empty { margin:0; color:var(--ink-2); font-size:.8rem; line-height:1.5; }
    .joinlink-note { padding-left:10px; border-left:2px solid #b98a2c; font-size:.74rem; }
    .joinlink-url { display:flex; gap:6px; }
    .joinlink-url .form-control { flex:1; min-width:0; font-family:var(--ag-mono); font-size:.8rem; background:#fbf7ea; }
    .joinlink-url .btn { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
    .joinlink-facts { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); gap:8px; margin:0; }
    .joinlink-facts div { display:grid; gap:1px; }
    .joinlink-facts dt { color:var(--uc-label-paper,#463d2c); font-size:.62rem; letter-spacing:.12em; text-transform:uppercase; }
    .joinlink-facts dd { margin:0; font-family:var(--ag-type); font-size:.9rem; }
    .joinlink-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .joinlink-actions .btn { display:inline-flex; align-items:center; gap:6px; }
    @media (max-width:520px) {
        .joinlink-url { flex-direction:column; }
        .joinlink-facts { grid-template-columns:1fr 1fr; }
    }

    /* Recruitment: the applications that came through the link. */

    /* Inbox: how the notices reach the person (live channel, browser notifications, mail and Telegram in the profile). */
    .notice-channels { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; margin:0 0 14px; padding:8px 12px; border:1px solid var(--ag-line); background:rgba(255,255,255,.02); font-size:.74rem; }
    .notice-live { display:inline-flex; align-items:center; gap:6px; color:var(--ag-text-2); font-family:var(--ag-mono); font-size:.66rem; letter-spacing:.14em; text-transform:uppercase; }
    .notice-live > span { color:var(--uc-amber); font-size:.7rem; }
    .notice-live.is-on > span { color:var(--ag-green); text-shadow:0 0 6px var(--ag-green); }
    .notice-browser { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px 8px; color:var(--ag-text-2); }
    .notice-browser small { font-size:.72rem; }
    .notice-browser small.is-ok { color:var(--ag-green); }
    .notice-other { display:inline-flex; align-items:center; gap:6px; margin-left:auto; color:var(--ag-gold-2); font-size:.72rem; }
    @media (max-width:640px) { .notice-other { margin-left:0; } }

    /* ---------- Notice centre (the bell at the right of every page head) and the pop-up of each notice ---------- */
    .entity-page-header > .notice-center { position:relative; margin-left:auto; align-self:center; }
    .entity-page-header > :is(.agency-stats, .ux-head-actions) + .notice-center { margin-left:0; }
    .notice-bell {
        position:relative; display:grid; place-items:center; width:42px; height:42px; padding:0;
        border:1px solid var(--ag-line-2); background:rgba(255,255,255,.03); color:var(--ag-text-2); cursor:pointer;
        transition:border-color .15s, color .15s, background .15s;
    }
    .notice-bell:hover, .notice-center.is-open .notice-bell { border-color:var(--ag-gold); color:var(--ag-gold-2); background:var(--ag-gold-dim); }
    .notice-bell.has-news { color:var(--ag-gold-2); }
    .notice-bell.has-news svg { animation:notice-ring 2.4s ease-in-out 1; transform-origin:50% 10%; }
    @keyframes notice-ring { 0%, 60%, 100% { transform:rotate(0); } 10%, 30%, 50% { transform:rotate(14deg); } 20%, 40% { transform:rotate(-14deg); } }
    @media (prefers-reduced-motion: reduce) { .notice-bell.has-news svg { animation:none; } }
    .notice-bell-count {
        position:absolute; top:-7px; right:-7px; min-width:19px; height:19px; padding:0 5px; border-radius:10px;
        background:var(--ag-red-2); color:#fff; font-family:var(--ag-mono); font-size:.62rem; font-weight:700; line-height:19px; text-align:center;
        box-shadow:0 0 0 2px var(--ag-bg);
    }
    .notice-center-backdrop { position:fixed; inset:0; z-index:1190; border:0; background:transparent; cursor:default; }
    .notice-center-panel {
        /* Fixed: the head of the page clips what leaves it. Below the bell, at the right of the page. */
        position:fixed; top:86px; right:24px; z-index:1200; display:flex; flex-direction:column;
        width:min(420px, calc(100vw - 24px)); max-height:min(70vh, 620px);
        border:1px solid var(--ag-line-2); border-top:2px solid var(--ag-gold); background:var(--ag-panel-2);
        box-shadow:0 18px 50px rgba(0,0,0,.55); color:var(--ag-text);
    }
    .notice-center-panel > header { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:10px 12px; border-bottom:1px solid var(--ag-line); }
    .notice-center-panel > header strong { font-family:var(--ag-display); font-size:.95rem; letter-spacing:.14em; text-transform:uppercase; }
    .notice-center-panel > header small { color:var(--ag-gold-2); font-family:var(--ag-mono); font-size:.64rem; letter-spacing:.08em; }
    .notice-center-panel > header .btn-link { margin-left:auto; padding:0; color:var(--ag-text-2); font-size:.7rem; }
    .notice-center-panel > header .btn-link:disabled { opacity:.45; }
    .notice-center-x { width:28px; height:28px; display:grid; place-items:center; border:0; background:transparent; color:var(--ag-text-2); }
    .notice-center-list { flex:1; min-height:0; overflow:auto; margin:0; padding:0; list-style:none; }
    .notice-center-list li + li { border-top:1px solid var(--ag-line); }
    .notice-center-list a { position:relative; display:flex; gap:10px; padding:10px 12px; color:var(--ag-text); text-decoration:none; }
    .notice-center-list a:hover, .notice-center-list a:focus-visible { background:var(--ag-gold-dim); }
    .notice-center-list li.is-unread a { background:rgba(227,192,107,.05); }
    .notice-center-list li.is-critical a { box-shadow:inset 3px 0 0 var(--uc-red); }
    .notice-center-list li.is-action a { box-shadow:inset 3px 0 0 var(--ag-gold); }
    .notice-center-list .notice-icon { flex:none; display:grid; place-items:center; width:30px; height:30px; border:1px solid var(--ag-line-2); color:var(--ag-gold-2); }
    .notice-center-text { display:grid; gap:3px; min-width:0; font-size:.78rem; line-height:1.4; }
    .notice-center-text small { color:var(--ag-text-2); font-size:.72rem; overflow:hidden; text-overflow:ellipsis; }
    .notice-center-impact { color:#e07a6e !important; }
    .notice-center-text time { color:var(--ag-muted); font-family:var(--ag-mono); font-size:.62rem; letter-spacing:.06em; }
    .notice-center-dot { flex:none; align-self:center; width:8px; height:8px; margin-left:auto; border-radius:50%; background:var(--ag-gold-2); box-shadow:0 0 6px var(--ag-gold); }
    .notice-center-empty { display:flex; align-items:center; gap:8px; margin:0; padding:22px 14px; color:var(--ag-text-2); font-size:.8rem; }
    .notice-center-panel > footer { padding:10px 12px; border-top:1px solid var(--ag-line); }
    .notice-center-panel > footer .btn { width:100%; }
    @media (max-width: 720px) {
        /* The bell beside the title; the figures and actions go below. */
        .entity-main-panel .entity-page-header > .notice-center { order:1; margin-left:auto; }
        .entity-main-panel .entity-page-header > :is(.agency-stats, .ux-head-actions) { order:2; }
        .notice-center-panel { position:fixed; top:64px; right:12px; left:12px; width:auto; }
    }

    /* Pop-ups: one window per notice, stacked at the bottom right, the newest on top. */
    .notice-popups { position:fixed; right:18px; bottom:18px; z-index:1300; display:flex; flex-direction:column; align-items:flex-end; gap:8px; width:min(380px, calc(100vw - 24px)); pointer-events:none; }
    .notice-popup, .notice-popups-clear { pointer-events:auto; }
    .notice-popups { font-family:var(--ag-mono); }
    .notice-popups .btn { border-radius:0; font-family:var(--ag-mono); font-size:.66rem; letter-spacing:.12em; text-transform:uppercase; }
    .notice-popups .btn-primary { border-color:var(--ag-gold); background:var(--ag-gold); color:#1d1609; }
    .notice-popups .btn-primary:hover { border-color:var(--ag-gold-2); background:var(--ag-gold-2); color:#1d1609; }
    .notice-popups-clear.btn { border-color:var(--ag-line-2); background:var(--ag-panel-2); color:var(--ag-text-2); }
    .notice-popups-clear.btn:hover { border-color:var(--ag-gold); color:var(--ag-gold-2); background:var(--ag-panel-2); }
    .notice-popup {
        position:relative; display:flex; gap:10px; width:100%; padding:12px 34px 14px 12px; overflow:hidden;
        border:1px solid var(--ag-line-2); border-left:3px solid var(--ag-gold); background:var(--ag-panel-2); color:var(--ag-text);
        box-shadow:0 12px 34px rgba(0,0,0,.5); animation:notice-pop-in .28s cubic-bezier(.2,.9,.3,1.2);
    }
    .notice-popup.is-critical { border-left-color:var(--uc-red); }
    .notice-popup.is-action { border-left-color:var(--ag-gold-2); }
    @keyframes notice-pop-in { from { opacity:0; transform:translateX(30px) scale(.97); } to { opacity:1; transform:none; } }
    @media (prefers-reduced-motion: reduce) { .notice-popup { animation:none; } }
    .notice-popup .notice-icon { flex:none; display:grid; place-items:center; width:34px; height:34px; border:1px solid var(--ag-line-2); color:var(--ag-gold-2); font-size:1rem; }
    .notice-popup.is-critical .notice-icon { color:#e07a6e; border-color:#e07a6e; }
    .notice-popup-body { display:grid; gap:4px; min-width:0; font-size:.8rem; line-height:1.4; }
    .notice-popup-kicker { color:var(--ag-gold-2); font-family:var(--ag-mono); font-size:.6rem; letter-spacing:.16em; text-transform:uppercase; }
    .notice-popup.is-critical .notice-popup-kicker { color:#e07a6e; }
    .notice-popup-body strong { font-weight:600; }
    .notice-popup-body small { color:var(--ag-text-2); font-size:.72rem; }
    .notice-popup-body .btn { justify-self:start; margin-top:4px; }
    .notice-popup-close { position:absolute; top:6px; right:6px; display:grid; place-items:center; width:26px; height:26px; border:0; background:transparent; color:var(--ag-text-2); cursor:pointer; }
    .notice-popup-close:hover { color:var(--ag-text); }
    .notice-popup-life { position:absolute; left:0; bottom:0; height:2px; width:100%; background:var(--ag-gold); transform-origin:left; animation:notice-life var(--popup-life) linear forwards; }
    .notice-popup.is-paused .notice-popup-life { animation:none; opacity:.35; }
    @keyframes notice-life { from { transform:scaleX(1); } to { transform:scaleX(0); } }
    @media (max-width: 900px) { .notice-popups { right:12px; left:12px; bottom:76px; width:auto; } }

    /* ---------- Echelon: the military symbol (NATO APP-6) instead of the coloured dot ---------- */
    .echelon-symbol { flex:none; display:block; overflow:visible; color:currentColor; }
    .echelon-symbol-frame { fill:#80e0ff; stroke:currentColor; stroke-width:2.2; }
    .echelon-symbol-function { fill:none; stroke:currentColor; stroke-width:1.6; }
    .echelon-symbol-line { fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:square; }
    .echelon-symbol-dot { fill:currentColor; }
    .cmd-echelon-now::before { content:none; }
    .cmd-echelon-head { align-items:center; }
    .cmd-echelon-now { gap:10px; color:var(--ink); }
    .cmd-echelon-now .echelon-symbol { color:#1b1712; }
    .cmd-echelon-name { display:grid; gap:1px; line-height:1.1; }
    .cmd-echelon-name strong { font-family:var(--ag-display); font-size:1.05rem; font-weight:700; letter-spacing:.12em; }
    .cmd-echelon-mark { color:var(--ink-2) !important; font-family:var(--ag-mono); font-size:.72rem !important; letter-spacing:.2em; }
    .cmd-echelon:not(.is-compact) .cmd-echelon-count { font-size:.82rem; }
    /* On the dark workspace (graphs, side panels, lists) the lines are light, the frame keeps its blue. */
    :is(.cmd-graph-side, .cmd-tree-row, .cg-unit, .cg-staff) .cmd-echelon-now,
    :is(.cmd-graph-side, .cmd-tree-row, .cg-unit, .cg-staff) .cmd-echelon-now .echelon-symbol { color:var(--ag-text); }
    :is(.cmd-graph-side, .cmd-tree-row, .cg-unit, .cg-staff) .echelon-symbol-frame { stroke:#0b1118; }
    :is(.cmd-graph-side, .cmd-tree-row, .cg-unit, .cg-staff) .echelon-symbol-function { stroke:#0b1118; }
    .cmd-echelon.is-compact .cmd-echelon-now { gap:7px; }
    .cmd-echelon.is-compact .cmd-echelon-name strong { font-family:inherit; font-size:.66rem; font-weight:600; letter-spacing:.08em; }
    .join-echelon { display:flex; align-items:center; gap:8px; }
    .join-echelon .echelon-symbol { color:#1b1712; }

    /* ---------- Join links: the manager (several per unit), the form and the A5 poster ---------- */
    .umap-modal.joinlink-modal { width:min(860px, calc(100vw - 24px)); max-width:min(860px, calc(100vw - 24px)); }
    .joinlink-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .joinlink-bar small { color:var(--ink-2); font-family:var(--ag-mono); font-size:.7rem; letter-spacing:.08em; }
    .joinlink-bar .btn, .joinlink-actions .btn, .joinlink-card .btn { display:inline-flex; align-items:center; gap:6px; }
    .joinlink-list { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
    .joinlink-card { display:grid; gap:8px; padding:10px 12px; border:1px solid var(--paper-edge,#b9ab8c); border-left:4px solid #23683f; background:rgba(255,253,245,.55); }
    .joinlink-card.is-approval { border-left-color:#8a6414; }
    .joinlink-card > header { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
    .joinlink-card > header strong { color:var(--ink); font-family:var(--ag-type); font-size:1.02rem; }
    .joinlink-card > header small { margin-left:auto; color:var(--ink-muted,#5a503f); font-size:.68rem; }
    .joinlink-mode { padding:0 6px; border:1px solid currentColor; color:#23683f; font-family:var(--ag-mono); font-size:.6rem; letter-spacing:.12em; text-transform:uppercase; }
    .joinlink-card.is-approval .joinlink-mode { color:#8a6414; }
    .joinlink-card .joinlink-facts { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .joinlink-meter { height:4px; background:rgba(70,63,48,.18); }
    .joinlink-meter i { display:block; height:100%; background:#8a6414; }
    .joinlink-empty { margin:0; padding:12px; border:1px dashed var(--paper-edge,#b9ab8c); color:var(--ink-2); font-size:.8rem; }
    .joinlink-ended { border:1px solid var(--paper-edge,#b9ab8c); padding:6px 10px; background:rgba(255,253,245,.35); }
    .joinlink-ended summary { cursor:pointer; color:var(--ink-2); font-size:.76rem; }
    .joinlink-ended ul { display:grid; gap:4px; margin:8px 0 0; padding:0; list-style:none; }
    .joinlink-ended li { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; font-size:.78rem; }
    .joinlink-ended small { color:var(--ink-muted,#5a503f); }
    .joinlink-state { padding:0 6px; border:1px solid currentColor; font-family:var(--ag-mono); font-size:.58rem; letter-spacing:.12em; text-transform:uppercase; color:#5f5747; }
    .joinlink-state.is-expired, .joinlink-state.is-full { color:#8a6414; }
    .joinlink-state.is-revoked { color:#9c231d; }
    .joinlink-back.btn { justify-self:start; padding:0; }
    .joinlink-form { display:grid; gap:8px; }
    .joinlink-form h3 { margin:0; color:var(--uc-label-paper,#463d2c); font-family:var(--ag-display); font-size:1rem; letter-spacing:.14em; text-transform:uppercase; }
    .joinlink-modes { margin:4px 0 0; padding:0; border:0; }
    .joinlink-mode-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .joinlink-modes legend { margin:0 0 4px; color:var(--uc-label-paper,#463d2c); font-size:var(--uc-label-size); font-weight:var(--uc-label-weight); letter-spacing:var(--uc-label-tracking); text-transform:uppercase; }
    .joinlink-mode-card { position:relative; display:grid; gap:2px; padding:8px 10px; border:1px solid var(--paper-edge,#b9ab8c); background:rgba(255,253,245,.5); cursor:pointer; }
    .joinlink-mode-card input { position:absolute; opacity:0; pointer-events:none; }
    .joinlink-mode-card strong { color:var(--ink); font-size:.84rem; }
    .joinlink-mode-card small { color:var(--ink-muted,#5a503f); font-size:.7rem; line-height:1.35; }
    .joinlink-mode-card.is-on { border-color:#7c5d17; box-shadow:inset 0 0 0 1px #7c5d17; background:rgba(201,162,74,.16); }
    .joinlink-mode-card:focus-within { outline:2px solid #7c5d17; outline-offset:1px; }
    .joinlink-limits { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .joinlink-quick { display:flex; flex-wrap:wrap; gap:2px 8px; }
    .joinlink-quick .btn-link { padding:0; font-size:.72rem; }
    .joinlink-summary { margin:0; padding:8px 10px; border-left:3px solid #8a6414; background:rgba(201,162,74,.12); color:var(--ink-2); font-size:.78rem; }
    .join-poster-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .join-poster-tools .btn { display:inline-flex; align-items:center; gap:6px; }
    .join-poster-message { color:#9c231d; font-size:.74rem; }
    .joinlink .fcc-poster-frame { max-width:400px; margin:4px auto 0; box-shadow:0 10px 30px rgba(0,0,0,.25); }
    .join-mode-note { display:flex; align-items:center; justify-content:center; gap:6px; margin:0; color:#4a4031; font-size:.76rem; }
    @media (max-width:640px) {
        .joinlink-card .joinlink-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
        .joinlink-mode-cards, .joinlink-limits { grid-template-columns:1fr; }
        .joinlink-card > header small { margin-left:0; width:100%; }
    }

    /* Printing the poster of a join link: only its copy (#fcc-print-root), at its real size, on the A5 page set while it
       prints; the application is out of the page (display:none), so it is one page. */
    #fcc-print-root { display:none; }
    @media print {
        body.fcc-printing-poster > *:not(#fcc-print-root) { display:none !important; }
        body.fcc-printing-poster { margin:0 !important; padding:0 !important; background:#fff !important; }
        body.fcc-printing-poster #fcc-print-root { display:block; }
        #fcc-print-root .fcc-poster-frame { width:148mm !important; max-width:none !important; margin:0 !important; box-shadow:none !important; }
    }
    .joinlink-datetime { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:6px; }
}


/* ==== events.css ==== */
/* Unit Control, events: the list (cards with the date block), the event sheet (a dossier page beside the reservation
   panel), the form of the commanders (paper), the management of the reservations (dark list) and the Markdown editor and
   view. Loaded last, in the app layer. The Markdown view takes the colours of where it is (currentColor). */
@layer app {
    /* ---------- Tabs and filters ---------- */
    .ev-tabs { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin:0 0 12px; border-bottom:1px solid var(--ag-line-2); }
    .ev-tabs > button {
        display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:6px 14px;
        border:0; border-bottom:2px solid transparent; background:transparent; color:var(--ag-text-2);
        font:600 .72rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; cursor:pointer;
    }
    .ev-tabs > button:hover { color:var(--ag-text); }
    .ev-tabs > button.is-on { border-bottom-color:var(--ag-gold); color:var(--ag-gold-2); }
    .ev-tabs > button:focus-visible { outline:2px solid var(--ag-gold); outline-offset:-2px; }
    .ev-filters { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) auto; align-items:center; gap:8px; margin:0 0 14px; }
    .ev-past { display:inline-flex; align-items:center; gap:6px; color:var(--ag-text-2); font-size:.78rem; white-space:nowrap; }

    /* ---------- Cards ---------- */
    .ev-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(330px,1fr)); gap:12px; }
    .ev-card { position:relative; display:grid; border:1px solid var(--ag-line-2); border-left:3px solid var(--ag-gold); background:var(--ag-panel); transition:border-color .15s, transform .15s; }
    .ev-card:hover { border-color:var(--ag-gold); transform:translateY(-1px); }
    .ev-card.is-private { border-left-color:#8e7cc3; }
    .ev-card:is(.is-finished, .is-cancelled) { opacity:.72; border-left-color:var(--ag-line-2); }
    .ev-card.is-ongoing { border-left-color:var(--ag-green); }
    .ev-card-link { display:grid; grid-template-columns:64px minmax(0,1fr); gap:12px; padding:12px 12px 12px 10px; color:inherit; text-decoration:none; }
    .ev-card-link:focus-visible { outline:2px solid var(--ag-gold); outline-offset:-2px; }
    .ev-date { display:grid; align-content:start; justify-items:center; gap:0; padding:6px 0; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); text-align:center; }
    .ev-date b { color:var(--ag-gold-2); font:700 1.7rem/1 var(--ag-display); }
    .ev-date span { color:var(--ag-text); font:600 .7rem var(--ag-mono); letter-spacing:.14em; }
    .ev-date small { margin-top:4px; color:var(--ag-text-2); font:.64rem var(--ag-mono); }
    .ev-card-body { display:grid; align-content:start; gap:5px; min-width:0; }
    .ev-card-body h3 { margin:0; color:var(--ag-text); font:600 1.12rem/1.2 var(--ag-display); letter-spacing:.04em; overflow-wrap:anywhere; }
    .ev-card-body p { margin:0; }
    .ev-card-tags { display:flex; flex-wrap:wrap; gap:4px; }
    .ev-type, .ev-access, .ev-state, .ev-status, .ev-pay, .ev-mine, .ev-checked {
        display:inline-flex; align-items:center; gap:4px; padding:1px 6px; border:1px solid currentColor;
        font:600 .58rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; white-space:nowrap;
    }
    .ev-type { color:var(--ag-gold-2); }
    .ev-access { color:var(--ag-text-2); }
    .ev-access.is-private { color:#b9a8ee; }
    .ev-access.is-reservation { color:var(--ag-cyan); }
    .ev-state { color:var(--ag-text-2); }
    .ev-state.is-ongoing { color:var(--ag-green); }
    .ev-state.is-cancelled { color:#ef7f77; }
    .ev-unit { display:flex; align-items:center; gap:6px; color:var(--ag-text-2); font-size:.78rem; }
    .ev-unit small { color:var(--ag-muted); font-family:var(--ag-mono); font-size:.66rem; }
    .ev-insignia { flex:none; width:20px; height:20px; }
    .ev-place { display:flex; align-items:flex-start; gap:5px; color:var(--ag-text-2); font-size:.76rem; line-height:1.35; overflow-wrap:anywhere; }
    .ev-place svg { flex:none; margin-top:2px; }
    .ev-facts { display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:2px !important; color:var(--ag-text); font:.7rem var(--ag-mono); }
    .ev-manage.btn { position:absolute; top:10px; right:10px; display:inline-flex; align-items:center; gap:5px; padding:2px 8px; font-size:.7rem; }
    .ev-card:has(.ev-manage) .ev-card-tags { padding-right:118px; }
    .ev-badge { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--ag-red); color:#fff; font:700 .62rem var(--ag-mono); }

    /* Status colours: the reservation and its payment */
    :is(.ev-status, .ev-mine).is-requested { color:var(--ag-gold-2); }
    :is(.ev-status, .ev-mine).is-confirmed { color:var(--ag-green); }
    :is(.ev-status, .ev-mine).is-waitlisted { color:var(--ag-cyan); }
    :is(.ev-status, .ev-mine).is-rejected { color:#ef7f77; }
    :is(.ev-status, .ev-mine).is-cancelled { color:var(--ag-muted); }
    .ev-pay.is-pending { color:var(--ag-gold-2); }
    .ev-pay.is-paid { color:var(--ag-green); }
    .ev-pay.is-refunded { color:var(--ag-muted); }
    .ev-checked { color:var(--ag-green); border-style:dashed; }

    /* ---------- The event: dossier sheet + reservation panel ---------- */
    .ev-cancelled { margin:0 0 12px; padding:10px 14px; border:1px solid #ef7f77; border-left-width:4px; background:rgba(200,50,58,.12); color:var(--ag-text); font-size:.86rem; }
    .ev-cancelled strong { color:#ef7f77; font-family:var(--ag-mono); font-size:.74rem; letter-spacing:.1em; text-transform:uppercase; }
    /* Three areas: the key facts and the description on the left, the player's reservation on the right (under the key
       facts on a phone, before the long text). Dark panels, as the rest of the console. */
    .ev-detail {
        display:grid; grid-template-columns:minmax(0,1fr) 340px; grid-template-areas:"sheet side" "about side";
        grid-template-rows:auto 1fr; align-items:start; gap:14px;
    }
    .ev-sheet, .ev-about { display:grid; gap:14px; min-width:0; padding:18px 20px; border:1px solid var(--ag-line-2); background:var(--ag-panel); color:var(--ag-text); }
    .ev-sheet { grid-area:sheet; border-top:3px solid var(--ag-gold); }
    .ev-about { grid-area:about; gap:10px; }
    .ev-type-hint { margin:0; color:var(--ag-text-2); font-size:.84rem; line-height:1.45; }
    .ev-facts-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 22px; margin:0; padding:14px 0 0; border-top:1px solid var(--ag-line-2); }
    .ev-facts-list > div { display:grid; align-content:start; gap:4px; min-width:0; }
    .ev-facts-list dt { display:flex; align-items:center; gap:6px; color:var(--ag-text-2); font:600 .66rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-facts-list dd { display:grid; gap:4px; margin:0; color:var(--ag-text); font-size:.92rem; overflow-wrap:anywhere; }
    .ev-fact-main { color:var(--ag-text); font:600 1rem/1.35 var(--ag-mono); }
    .ev-zone, .ev-fact-sub { display:inline-flex; align-items:center; gap:4px; color:var(--ag-text-2); font:.74rem var(--ag-mono); }
    .ev-fact-links { display:flex; flex-wrap:wrap; gap:4px 14px; }
    .ev-facts-list dd.ev-unit { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .ev-facts-list dd.ev-unit small { color:var(--ag-muted); font:.7rem var(--ag-mono); }
    .ev-map { display:inline-flex; align-items:center; gap:4px; min-height:28px; color:var(--ag-gold-2); font-size:.78rem; white-space:nowrap; }
    .ev-map:hover { color:var(--ag-gold); }
    .ev-map:focus-visible, .ev-link-button:focus-visible { outline:2px solid var(--ag-gold); outline-offset:2px; }
    :is(.ev-sheet, .ev-about) h3 { margin:8px 0 0; color:var(--ag-gold-2); font:600 .78rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-about h3:first-child { margin-top:0; }
    .ev-pre { margin:0; white-space:pre-line; font-size:.88rem; overflow-wrap:anywhere; }
    .ev-side {
        grid-area:side; position:sticky; top:12px; display:grid; gap:10px; padding:16px;
        border:1px solid var(--ag-line-2); border-top:3px solid var(--ag-cyan); background:var(--ag-panel); color:var(--ag-text);
    }
    .ev-side h2 { margin:0; color:var(--ag-gold-2); font:600 1rem var(--ag-display); letter-spacing:.14em; text-transform:uppercase; }
    .ev-side p { margin:0; color:var(--ag-text-2); font-size:.84rem; line-height:1.45; }
    .ev-side .form-label { margin:0; }
    .ev-side .btn { justify-self:stretch; }
    .ev-mine-box { display:grid; gap:4px; padding:10px 12px; border:1px solid var(--ag-line-2); border-left:4px solid currentColor; background:rgba(255,255,255,.03); color:var(--ag-gold-2); }
    .ev-mine-box.is-confirmed { color:var(--ag-green); }
    .ev-mine-box.is-waitlisted { color:var(--ag-cyan); }
    .ev-mine-box:is(.is-rejected, .is-cancelled) { color:#ef7f77; }
    .ev-mine-box strong { font:600 .78rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-mine-box > span:not([class]) { color:var(--ag-text); font-size:.82rem; }
    .ev-mine-box :is(.ev-pay, .ev-checked) { justify-self:start; }
    .ev-mine-box blockquote { margin:2px 0 0; padding-left:8px; border-left:2px solid var(--ag-line-2); color:var(--ag-text-2); font-size:.8rem; font-style:italic; }
    .ev-closed { padding:8px 10px; border:1px dashed var(--ag-line-2); color:var(--ag-text-2) !important; }

    /* ---------- Form (paper) ---------- */
    .ev-form, .ev-danger {
        --asp-ink:var(--ink);
        display:grid; gap:16px; max-width:980px; margin:0 0 14px; padding:20px 22px;
        border:1px solid var(--paper-edge); background:var(--paper); color:var(--ink); box-shadow:0 8px 26px rgba(0,0,0,.28);
    }
    .ev-form fieldset { display:grid; gap:6px; min-width:0; margin:0; padding:0 0 14px; border:0; border-bottom:1px dashed var(--paper-edge); }
    .ev-form fieldset:last-of-type { border-bottom:0; }
    .ev-form legend { display:flex; align-items:center; gap:8px; margin:0 0 6px; color:var(--ink); font:600 1.02rem var(--ag-display); letter-spacing:.14em; text-transform:uppercase; }
    .ev-form legend b { display:grid; place-items:center; width:24px; height:24px; border:1px solid var(--ink); border-radius:50%; font:600 .72rem var(--ag-mono); }
    .ev-form .form-label { margin:6px 0 0; color:var(--uc-label-paper,#463d2c); }
    .ev-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 14px; }
    .ev-grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px 14px; }
    .ev-grid-2 > div, .ev-grid-3 > div { display:grid; gap:4px; align-content:start; min-width:0; }
    .ev-types { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px; }
    .ev-choice { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:4px; }
    .ev-type-card { position:relative; display:grid; align-content:start; gap:3px; padding:9px 11px; border:1px solid var(--paper-edge); background:rgba(255,253,245,.5); cursor:pointer; }
    .ev-type-card input { position:absolute; opacity:0; pointer-events:none; }
    .ev-type-card strong { color:var(--ink); font-size:.86rem; }
    .ev-type-card small { color:var(--ink-muted); font-size:.7rem; line-height:1.35; }
    .ev-type-card:hover { border-color:#7c5d17; }
    .ev-type-card.is-on { border-color:#7c5d17; box-shadow:inset 0 0 0 1px #7c5d17; background:rgba(201,162,74,.18); }
    .ev-type-card.is-on strong::before { content:"✔ "; color:#7c5d17; }
    .ev-type-card:focus-within { outline:2px solid #7c5d17; outline-offset:1px; }
    .ev-switch { display:flex; align-items:flex-start; gap:8px; margin-top:8px; color:var(--ink); font-size:.84rem; cursor:pointer; }
    .ev-switch small { display:block; color:var(--ink-muted); font-size:.72rem; }
    .ev-form-actions { display:flex; align-items:center; gap:8px; }
    .ev-form-actions .ux-actions-gap { flex:1; }
    .ev-danger { gap:8px; border-left:4px solid var(--stamp); }
    .ev-danger h3 { margin:0; color:var(--stamp); font:600 .92rem var(--ag-display); letter-spacing:.14em; text-transform:uppercase; }
    .ev-danger p { margin:0; color:var(--ink-2); font-size:.82rem; }
    .ev-danger .btn { justify-self:start; }

    /* Date and time in two inputs */
    .dt-field { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:6px; }

    /* ---------- Reservations (dark list) ---------- */
    .ev-res-initials { flex:none; width:38px; height:38px; border:1px solid var(--ag-line-2); object-fit:cover; }
    .ev-res-initials { display:grid; place-items:center; background:var(--ag-panel-2); color:var(--ag-gold-2); font:600 .8rem var(--ag-mono); }

    /* ---------- Markdown: view and editor ---------- */
    .md-view { color:inherit; font-size:.92rem; line-height:1.6; overflow-wrap:anywhere; }
    .md-view > :first-child { margin-top:0; }
    .md-view > :last-child { margin-bottom:0; }
    .md-view :is(h1, h2, h3, h4) { margin:1em 0 .4em; font-family:var(--ag-display); font-weight:700; letter-spacing:.06em; line-height:1.2; }
    .md-view h1 { font-size:1.4rem; }
    .md-view h2 { font-size:1.22rem; }
    .md-view h3 { font-size:1.06rem; text-transform:none; }
    .md-view p, .md-view ul, .md-view ol, .md-view blockquote, .md-view table { margin:0 0 .7em; }
    .md-view ul, .md-view ol { padding-left:1.4em; }
    .md-view li.task-list-item { list-style:none; margin-left:-1.2em; }
    .md-view li.task-list-item input { appearance:none; display:inline-grid; place-items:center; width:13px; height:13px; margin:0 7px 0 0; vertical-align:-1px; border:1.5px solid currentColor; background:transparent; opacity:.8; }
    .md-view li.task-list-item input:checked::after { content:"✔"; font-size:10px; line-height:1; }
    .md-view blockquote { padding:2px 0 2px 12px; border-left:3px solid currentColor; opacity:.85; font-style:italic; }
    .md-view a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
    .md-view code { padding:0 4px; background:rgba(127,127,127,.18); font-family:var(--ag-mono); font-size:.85em; }
    .md-view pre { padding:8px 10px; background:rgba(127,127,127,.14); overflow:auto; }
    .md-view hr { margin:1em 0; border:0; border-top:1px solid currentColor; opacity:.35; }
    .md-view table { border-collapse:collapse; font-size:.86rem; display:block; overflow-x:auto; }
    .md-view :is(th, td) { padding:4px 10px; border:1px solid rgba(127,127,127,.45); text-align:left; }
    .md-view th { font-weight:600; background:rgba(127,127,127,.12); }
    /* The description of an event: a readable text face and measure for long paragraphs, lists and headings. */
    .ev-about .md-view {
        max-width:72ch; color:var(--ag-text); font-family:system-ui,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
        font-size:.98rem; line-height:1.65; letter-spacing:0;
    }
    .ev-about .md-view :is(h1, h2, h3, h4) { color:var(--ag-gold-2); }
    .ev-about .md-view a { color:var(--ag-gold-2); }
    .ev-about .md-view strong { color:#fff; }

    .md-editor { display:grid; gap:0; }
    .md-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:2px; padding:4px; border:1px solid var(--paper-edge); border-bottom:0; background:rgba(255,253,245,.55); }
    .md-tool { display:grid; place-items:center; min-width:32px; height:30px; padding:0 6px; border:1px solid transparent; background:transparent; color:var(--ink); font:600 .82rem var(--ag-mono); cursor:pointer; }
    .md-tool:hover:not(:disabled) { border-color:var(--paper-edge); background:rgba(201,162,74,.18); }
    .md-tool:focus-visible { outline:2px solid #7c5d17; outline-offset:-1px; }
    .md-toolbar-gap { flex:1; }
    .md-preview-toggle { display:inline-flex; align-items:center; gap:5px; padding:0 6px; color:var(--ink-2); font:600 .66rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; cursor:pointer; }
    .md-panes { display:grid; grid-template-columns:minmax(0,1fr); }
    .md-editor.has-preview .md-panes { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .md-input.form-control { min-height:220px; border-radius:0; font-family:var(--ag-mono); font-size:.84rem; line-height:1.55; resize:vertical; }
    .md-preview { max-height:520px; padding:10px 14px; border:1px solid var(--paper-edge); border-left:0; background:rgba(255,253,245,.7); color:var(--ink); overflow:auto; }
    .md-empty { margin:0; color:var(--ink-muted); font-size:.8rem; font-style:italic; }
    .md-help { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; margin-top:4px; color:var(--ink-muted); font-size:.7rem; }
    .md-count { font-family:var(--ag-mono); }
    .md-count.is-near { color:var(--stamp); font-weight:600; }

    /* ---------- Narrow screens ---------- */
    @media (max-width:760px) {
        .ev-filters { grid-template-columns:1fr 1fr; }
        .ev-filters > input[type=search] { grid-column:1 / -1; }
        .ev-grid { grid-template-columns:1fr; }
        .ev-facts-list, .ev-grid-2, .ev-grid-3, .ev-choice { grid-template-columns:1fr; }
        .md-editor.has-preview .md-panes { grid-template-columns:1fr; }
        .md-preview { border-left:1px solid var(--paper-edge); border-top:0; }
        .ev-form, .ev-danger, .ev-sheet, .ev-about { padding:14px; }
    }

    /* ---------- Scroll and layout of the event pages ---------- */
    /* The shell is one screen high (overflow hidden): each page scrolls inside it, as the other pages do. */
    .ev-scroll { flex:1; min-height:0; overflow-y:auto; padding-right:4px; }
    .ev-edit-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; align-items:start; gap:14px; max-width:1320px; }
    .ev-edit-main { min-width:0; }
    .ev-edit-main .ev-form, .ev-edit-main .ev-danger { max-width:none; }
    .ev-form .rel-picker { margin-bottom:2px; }
    .ev-unit-preview {
        position:sticky; top:0; display:grid; gap:12px; padding:16px;
        border:1px solid var(--ag-line-2); border-top:3px solid var(--ag-gold); background:var(--ag-panel); color:var(--ag-text);
    }
    .ev-unit-preview h2 { margin:0; color:var(--ag-gold-2); font:600 .9rem var(--ag-display); letter-spacing:.16em; text-transform:uppercase; }
    .ev-unit-preview-head { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:12px; }
    .ev-unit-preview-seal { width:72px; height:72px; object-fit:contain; }
    .ev-unit-preview-head span.ev-unit-preview-seal svg { width:100%; height:100%; }
    .ev-unit-preview-head > div { display:grid; gap:2px; min-width:0; }
    .ev-unit-preview-head strong { font:700 1.2rem/1.15 var(--ag-display); letter-spacing:.04em; overflow-wrap:anywhere; }
    .ev-unit-preview-head small { color:var(--ag-gold-2); font:.7rem var(--ag-mono); letter-spacing:.08em; }
    .ev-unit-preview-echelon { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); color:var(--ag-text); font:600 .74rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-unit-preview-echelon .echelon-symbol-frame { stroke:#0b1118; }
    .ev-unit-preview-echelon .echelon-symbol-function { stroke:#0b1118; }
    .ev-unit-preview-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
    .ev-unit-preview-facts > div { display:grid; gap:2px; min-width:0; }
    .ev-unit-preview-facts dt { color:var(--ag-muted); font:600 .58rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-unit-preview-facts dd { margin:0; color:var(--ag-text); font-size:.84rem; overflow-wrap:anywhere; }
    .ev-unit-preview-note { margin:0; padding:8px 10px; border-left:3px solid var(--ag-gold); background:var(--ag-gold-dim); color:var(--ag-text-2); font-size:.76rem; line-height:1.45; }
    .ev-unit-preview-empty { margin:0; padding:10px; border:1px dashed var(--ag-line-2); color:var(--ag-text-2); font-size:.8rem; }
    @media (max-width:1100px) {
        .ev-edit-layout { grid-template-columns:1fr; }
        .ev-unit-preview { position:static; grid-row:1; }
    }
    @media (max-width:1100px) { .ev-scroll { overflow:visible; padding-right:0; } }

    /* ---------- Picture and banner of the event ---------- */
    .ev-media { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 18px; align-items:start; margin-top:2px; }
    .ev-media > div { display:grid; gap:4px; min-width:0; align-content:start; }
    .ev-hint { color:var(--ink-muted); font-size:.7rem; line-height:1.35; }
    .ev-media-banner .agency-image-field { flex-direction:column; align-items:stretch; gap:8px; }
    .ev-media-banner .agency-image-preview { width:100%; height:auto; aspect-ratio:4 / 1; }
    .ev-media-banner .agency-image-preview img { object-fit:cover; }
    .ev-media-banner .agency-image-actions { flex-direction:row; flex-wrap:wrap; align-items:center; }

    /* Point of the place, from the address locator */
    .ev-form .addr-locator { margin:2px 0 4px; }
    .ev-geo { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; padding:6px 10px; border:1px solid var(--paper-edge); border-left:3px solid #23683f; background:rgba(35,104,63,.07); color:var(--ink); font-size:.78rem; }
    .ev-geo code { color:var(--ink); font-size:.74rem; }
    .ev-geo a { color:#7c5d17; }
    .ev-geo .btn-link { margin-left:auto; padding:0; color:var(--stamp); font-size:.74rem; }
    .ev-subhead { margin:10px 0 0; color:var(--ink-2); font:600 .76rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-form .form-label .uc-icon { vertical-align:-1px; }

    /* ---------- Tags (requirements) ---------- */
    .tag-input { display:grid; gap:4px; }
    .tag-input-box {
        display:flex; flex-wrap:wrap; align-items:center; gap:5px; min-height:40px; padding:5px 8px;
        border:1px solid var(--paper-edge); background:#fffdf6; cursor:text;
    }
    .tag-input-box:focus-within { border-color:#7c5d17; box-shadow:0 0 0 .2rem rgba(124,93,23,.18); }
    .tag-input-box input { flex:1 1 160px; min-width:120px; padding:3px 2px; border:0; outline:0; background:transparent; color:var(--ink); font-size:.88rem; }
    .tag-chip { display:inline-flex; align-items:center; gap:5px; max-width:100%; padding:2px 4px 2px 8px; border:1px solid #c2a25a; background:#f3e6c4; color:#4a3810; font-size:.8rem; }
    .tag-chip > span { overflow-wrap:anywhere; }
    .tag-chip button { display:grid; place-items:center; width:18px; height:18px; padding:0; border:0; background:transparent; color:#7c5d17; font-size:1rem; line-height:1; cursor:pointer; }
    .tag-chip button:hover { background:rgba(124,93,23,.16); color:var(--stamp); }
    .tag-input-meta { display:flex; justify-content:space-between; gap:10px; color:var(--ink-muted); font-size:.7rem; }
    .tag-input-meta .is-full { color:var(--stamp); font-weight:600; }
    .tag-suggest { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
    .tag-suggest > span { color:var(--ink-muted); font:600 .6rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .tag-suggest button { padding:2px 8px; border:1px dashed #b39a64; background:transparent; color:var(--ink-2); font-size:.74rem; cursor:pointer; }
    .tag-suggest button:hover { border-style:solid; background:#f3e6c4; color:#4a3810; }
    .tag-input.is-disabled { opacity:.65; }

    /* ---------- The event sheet: banner, picture, tags and contact ---------- */
    /* The banner heads the sheet, low: a mood, not the page. */
    .ev-banner { height:clamp(72px, 9vw, 140px); margin:-18px -20px 0; overflow:hidden; border-bottom:1px solid var(--ag-line-2); background:var(--ag-panel-2); }
    .ev-banner img { display:block; width:100%; height:100%; object-fit:cover; }
    .ev-sheet-head { display:flex; align-items:flex-start; gap:14px; }
    .ev-sheet-head > div { display:grid; gap:6px; min-width:0; }
    .ev-banner + .ev-sheet-head .ev-poster { margin-top:-46px; }
    @media (max-width:760px) {
        .ev-banner { margin:-14px -14px 0; }
        .ev-banner + .ev-sheet-head .ev-poster { margin-top:-34px; width:80px; height:80px; }
    }
    .ev-poster { flex:none; width:104px; height:104px; object-fit:contain; padding:4px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); box-shadow:0 4px 14px rgba(0,0,0,.4); }
    .ev-req-tags { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; }
    .ev-req-tags li { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); color:var(--ag-text); font-size:.82rem; }
    .ev-req-tags li .uc-icon { color:var(--ag-gold-2); }
    .ev-contacts { display:grid; gap:4px; margin:0; padding:0; list-style:none; }
    .ev-contacts li { display:grid; grid-template-columns:18px 150px minmax(0,1fr); align-items:center; gap:8px; min-height:30px; font-size:.88rem; }
    .ev-contacts li > .uc-icon { color:var(--ag-text-2); }
    .ev-contacts li > span { color:var(--ag-text-2); font:600 .64rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-contacts a { color:var(--ag-gold-2); overflow-wrap:anywhere; }

    /* The picture on the cards */
    .ev-card-link.has-image { grid-template-columns:64px minmax(0,1fr) 72px; }
    .ev-card-image { align-self:end; width:72px; height:72px; object-fit:contain; padding:3px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); }

    /* How the event will look, at the top of the form's side panel */
    .ev-look { display:grid; overflow:hidden; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); }
    .ev-look-banner { display:grid; place-items:center; aspect-ratio:4 / 1; overflow:hidden; background:repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 8px, transparent 8px 16px); }
    .ev-look-banner img { width:100%; height:100%; object-fit:cover; }
    .ev-look-banner span { color:var(--ag-muted); font:.62rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-look-body { display:flex; align-items:center; gap:10px; padding:8px 10px; }
    .ev-look-image { flex:none; width:48px; height:48px; margin-top:-26px; object-fit:contain; padding:2px; border:1px solid var(--ag-line-2); background:var(--ag-panel); }
    .ev-look-body strong { min-width:0; color:var(--ag-text); font:600 .95rem/1.2 var(--ag-display); letter-spacing:.04em; overflow-wrap:anywhere; }

    @media (max-width:700px) {
        .ev-media { grid-template-columns:1fr; }
        .ev-contacts li { grid-template-columns:18px minmax(0,1fr); }
        .ev-contacts li > a { grid-column:2; }
        .ev-sheet-head { flex-direction:column; }
    }

    /* ---------- Attendance pass (operator) ---------- */
    .ev-pass { display:grid; gap:8px; padding:12px; border:1px solid var(--ag-line-2); border-top:3px solid var(--ag-green); background:rgba(255,255,255,.03); }
    .ev-pass header { display:flex; align-items:center; gap:6px; color:var(--ag-green); font:600 .74rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-pass-qr { display:block; width:100%; max-width:240px; justify-self:center; padding:8px; border:0; border-radius:4px; background:#fff; cursor:zoom-in; }
    .ev-pass-qr svg { display:block; width:100%; height:auto; }
    .ev-pass p { margin:0; color:var(--ag-text) !important; font-size:.8rem !important; }
    .ev-pass small { color:var(--ag-text-2); font-size:.7rem; line-height:1.4; }
    .ev-pass-in { display:grid; justify-items:center; gap:4px; padding:14px 8px; border:1px solid var(--ag-green); background:rgba(56,161,105,.16); text-align:center; }
    .ev-pass-in > span { display:grid; place-items:center; width:46px; height:46px; border-radius:50%; background:var(--ag-green); color:#0b1118; font:700 1.5rem/1 var(--ag-display); }
    .ev-pass-in strong { color:var(--ag-green); font:600 .9rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-pass-full { position:fixed; inset:0; z-index:2000; display:grid; place-items:center; padding:16px; background:rgba(0,0,0,.86); cursor:zoom-out; }
    .ev-pass-full-card { display:grid; justify-items:center; gap:10px; width:min(92vw, 520px); padding:18px; border-radius:6px; background:#fff; color:#111; text-align:center; }
    .ev-pass-full-card strong { font:700 1.1rem/1.2 var(--ag-display); letter-spacing:.04em; }
    .ev-pass-full-qr { width:100%; }
    .ev-pass-full-qr svg { display:block; width:100%; height:auto; }
    .ev-pass-full-card span { font:600 .9rem var(--ag-mono); }
    .ev-pass-full-card small { color:#555; font-size:.72rem; }

    /* ---------- Attendance control (commanders): the scanner ---------- */
    .ev-scan { position:fixed; inset:0; z-index:2000; display:grid; grid-template-rows:auto minmax(0,1fr); background:#070b10; color:var(--ag-text); }
    .ev-scan-head { display:flex; align-items:center; gap:12px; padding:10px 14px; border-bottom:1px solid var(--ag-line-2); background:var(--ag-panel); }
    .ev-scan-head > div:first-child { display:grid; flex:1; min-width:0; }
    .ev-scan-head small { color:var(--ag-text-2); font:600 .6rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-scan-head strong { overflow:hidden; color:var(--ag-gold-2); font:600 1.05rem var(--ag-display); letter-spacing:.06em; text-overflow:ellipsis; white-space:nowrap; }
    .ev-scan-count { display:grid; justify-items:end; }
    .ev-scan-count b { color:var(--ag-green); font:700 1.3rem/1 var(--ag-mono); }
    .ev-scan-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,420px); grid-template-rows:auto minmax(0,1fr); align-content:start; gap:12px; padding:12px; overflow:auto; }
    .ev-scan-camera { position:relative; grid-row:span 2; min-height:260px; overflow:hidden; border:1px solid var(--ag-line-2); background:#000; }
    .ev-scan-camera video { display:block; width:100%; height:100%; max-height:calc(100vh - 110px); object-fit:cover; }
    .ev-scan-frame { position:absolute; top:50%; left:50%; width:min(62%, 360px); aspect-ratio:1; transform:translate(-50%,-50%); border:3px solid rgba(255,255,255,.85); border-radius:12px; box-shadow:0 0 0 9999px rgba(0,0,0,.35); pointer-events:none; }
    .ev-scan-camera-state { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:10px; padding:20px; background:rgba(7,11,16,.88); text-align:center; }
    .ev-scan-camera-state p { max-width:420px; margin:0; color:var(--ag-text); font-size:.9rem; }
    .ev-scan-result { display:grid; align-content:start; gap:12px; padding:16px; border:1px solid var(--ag-line-2); border-left:6px solid var(--ag-line-2); background:var(--ag-panel); transition:background .2s, border-color .2s; }
    .ev-scan-result.is-ok { border-color:#38a169; background:#0f3d24; }
    .ev-scan-result.is-warn { border-color:#d69e2e; background:#4a3608; }
    .ev-scan-result.is-error { border-color:#e53e3e; background:#4a1414; }
    .ev-scan-ready { margin:0; color:var(--ag-text-2); font-size:.9rem; }
    .ev-scan-verdict { display:flex; align-items:center; gap:12px; }
    .ev-scan-verdict > span { display:grid; flex:none; place-items:center; width:56px; height:56px; border-radius:50%; background:#fff; color:#111; font:700 1.8rem/1 var(--ag-display); }
    .is-ok .ev-scan-verdict > span { background:#38a169; color:#fff; }
    .is-warn .ev-scan-verdict > span { background:#d69e2e; color:#1b1300; }
    .is-error .ev-scan-verdict > span { background:#e53e3e; color:#fff; }
    .ev-scan-verdict > div { display:grid; gap:2px; }
    .ev-scan-verdict strong { color:#fff; font:700 1.3rem/1.15 var(--ag-display); letter-spacing:.06em; text-transform:uppercase; }
    .ev-scan-verdict small { color:rgba(255,255,255,.82); font-size:.84rem; }
    .ev-scan-who { display:flex; align-items:center; gap:12px; padding-top:10px; border-top:1px solid rgba(255,255,255,.18); }
    .ev-scan-who img, .ev-scan-who .ev-res-initials { flex:none; width:72px; height:72px; border-radius:4px; object-fit:cover; }
    .ev-scan-who > div { display:grid; gap:3px; min-width:0; }
    .ev-scan-who strong { color:#fff; font-size:1.1rem; overflow-wrap:anywhere; }
    .ev-scan-who small { color:rgba(255,255,255,.8); font:.76rem var(--ag-mono); }
    .ev-scan-who .ev-pay { justify-self:start; }
    .ev-scan-history { display:grid; align-content:start; gap:4px; margin:0; padding:0; list-style:none; }
    .ev-scan-history li { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; padding:5px 8px; border-left:3px solid var(--ag-line-2); background:var(--ag-panel); font-size:.78rem; }
    .ev-scan-history li.is-ok { border-left-color:#38a169; }
    .ev-scan-history li.is-warn { border-left-color:#d69e2e; }
    .ev-scan-history li.is-error { border-left-color:#e53e3e; }
    .ev-scan-history time { color:var(--ag-text-2); font-family:var(--ag-mono); }
    .ev-scan-history span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .ev-scan-history b { color:var(--ag-text-2); font:600 .62rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    @media (max-width:900px) {
        .ev-scan-body { grid-template-columns:1fr; grid-template-rows:auto; }
        .ev-scan-camera { grid-row:auto; min-height:0; aspect-ratio:1; max-height:52vh; }
        .ev-scan-head .btn { padding:4px 8px; }
    }

    /* ---------- UX of the event flow: countdown, capacity, steps, commanders' summary, months, batch ---------- */
    .ev-countdown { margin:0; color:var(--ag-gold-2); font:600 .74rem var(--ag-mono); letter-spacing:.06em; }
    .ev-countdown.is-ongoing { color:var(--ag-green); }
    .ev-sheet .ev-countdown { font-size:.9rem; }
    .ev-link-button { padding:0; border:0; background:none; text-decoration:underline; cursor:pointer; }

    .ev-cap { display:grid; gap:4px; min-width:0; }
    .ev-cap-bar { position:relative; height:6px; overflow:hidden; border-radius:3px; background:rgba(255,255,255,.1); }
    .ev-cap-bar > span { position:absolute; inset:0 auto 0 0; border-radius:3px; background:var(--ag-green); transition:width .3s; }
    .ev-cap.is-last .ev-cap-bar > span { background:#d69e2e; }
    .ev-cap.is-full .ev-cap-bar > span { background:#e53e3e; }
    .ev-cap-bar.is-att > span { background:var(--ag-cyan); }
    .ev-cap small { color:var(--ag-text-2); font:.68rem var(--ag-mono); }
    .ev-cap small b { margin-left:4px; color:var(--ag-text); font-weight:600; }
    .ev-cap.is-last small b { color:#f6ad55; }
    .ev-cap.is-full small b { color:#fc8181; }
    .ev-card-body .ev-cap { max-width:260px; }

    .ev-steps { display:grid; gap:0; margin:0; padding:0; list-style:none; }
    .ev-steps li { position:relative; display:grid; grid-template-columns:22px minmax(0,1fr); gap:10px; padding:0 0 12px; }
    .ev-steps li:not(:last-child)::before { content:""; position:absolute; top:22px; bottom:0; left:10px; width:2px; background:var(--ag-line-2); }
    .ev-steps li.is-done:not(:last-child)::before { background:var(--ag-green); }
    .ev-step-dot { display:grid; place-items:center; width:22px; height:22px; border:2px solid var(--ag-line-2); border-radius:50%; background:var(--ag-panel); color:#0b1118; font:700 .7rem/1 var(--ag-mono); }
    .ev-steps .is-done .ev-step-dot { border-color:var(--ag-green); background:var(--ag-green); }
    .ev-steps .is-now .ev-step-dot { border-color:var(--ag-gold); box-shadow:0 0 0 3px rgba(201,162,74,.25); }
    .ev-steps .is-stop .ev-step-dot { border-color:#e53e3e; background:#e53e3e; color:#fff; }
    .ev-step-text { display:grid; gap:1px; padding-top:1px; }
    .ev-step-text strong { color:var(--ag-text); font:600 .76rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .ev-steps .is-next .ev-step-text strong { color:var(--ag-muted); }
    .ev-steps .is-now .ev-step-text strong { color:var(--ag-gold-2); }
    .ev-steps .is-stop .ev-step-text strong { color:#fc8181; }
    .ev-step-text small { color:var(--ag-text-2); font-size:.72rem; }
    .ev-mine-box blockquote small { display:block; font-style:normal; color:var(--ag-muted); font:600 .6rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .ev-pass-tools { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
    .ev-pass-tools .btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:6px 8px; font-size:.7rem; }
    .ev-pass-mail { margin:0; padding:6px 10px; border-left:3px solid var(--ag-green); background:rgba(56,161,105,.1); font-size:.76rem !important; }
    .ev-pass-mail.is-noEmail, .ev-pass-mail.is-tooSoon { border-left-color:#d69e2e; background:rgba(214,158,46,.1); }
    .ev-cancel-link.btn { justify-self:center !important; padding:2px 0; color:#fc8181; font-size:.74rem; text-decoration:underline; }
    .ev-side .ux-confirm { margin:0; }
    .ev-reserve-how { padding:8px 10px; border-left:3px solid var(--ag-gold); background:var(--ag-gold-dim); }
    .ev-reserve.btn { padding:10px; font-size:.9rem; letter-spacing:.12em; }
    .ev-reserve-pay { justify-self:center; color:var(--ag-text-2); font:.7rem var(--ag-mono); }
    .ev-side .form-label small { color:var(--ag-muted); font-size:.68rem; }

    /* The commanders' strip above the sheet: name, how full, what waits, the two tasks. One line wide, stacked narrow. */
    .ev-cmd-bar {
        display:grid; grid-template-columns:auto minmax(180px,1fr) auto auto; align-items:center; gap:12px 18px;
        margin:0 0 14px; padding:12px 16px; border:1px solid var(--ag-line-2); border-left:4px solid var(--ag-gold);
        background:linear-gradient(90deg, rgba(201,162,74,.1), var(--ag-panel) 40%);
    }
    .ev-cmd-name { display:grid; gap:2px; }
    .ev-cmd-name h2 { display:flex; align-items:center; gap:6px; margin:0; color:var(--ag-gold-2); font:600 .86rem var(--ag-display); letter-spacing:.16em; text-transform:uppercase; }
    .ev-cmd-name small { color:var(--ag-text-2); font:.66rem var(--ag-mono); }
    .ev-cmd-note { grid-column:2 / -1; margin:0; color:var(--ag-text-2); font-size:.84rem; }
    .ev-cmd-stats { display:grid; grid-template-columns:repeat(3,minmax(84px,1fr)); gap:6px; }
    .ev-cmd-stats a { display:grid; justify-items:center; gap:2px; padding:6px 8px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); color:var(--ag-text); text-decoration:none; }
    .ev-cmd-stats a:hover { border-color:var(--ag-gold); }
    .ev-cmd-stats a:focus-visible { outline:2px solid var(--ag-gold); outline-offset:1px; }
    .ev-cmd-stats b { font:700 1.2rem/1 var(--ag-mono); }
    .ev-cmd-stats small { color:var(--ag-text-2); font:.58rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; text-align:center; }
    .ev-cmd-stats a.is-due { border-color:#d69e2e; }
    .ev-cmd-stats a.is-due b { color:#f6ad55; }
    .ev-cmd-actions { display:flex; flex-wrap:wrap; gap:6px; }
    .ev-cmd-actions .btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; }
    @media (max-width:1100px) {
        .ev-cmd-bar { grid-template-columns:auto minmax(0,1fr); }
        .ev-cmd-stats, .ev-cmd-actions { grid-column:1 / -1; }
        .ev-cmd-actions .btn { flex:1 1 180px; }
    }
    @media (max-width:560px) {
        .ev-cmd-bar { grid-template-columns:1fr; }
        .ev-cmd-note { grid-column:auto; }
    }

    .ev-month { display:grid; gap:10px; margin-bottom:18px; }
    .ev-month-head { display:flex; align-items:center; gap:8px; margin:0; padding-bottom:6px; border-bottom:1px solid var(--ag-line-2); color:var(--ag-gold-2); font:600 .9rem var(--ag-display); letter-spacing:.16em; text-transform:uppercase; }
    .ev-card-mine { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .ev-card-pass { display:inline-flex; align-items:center; gap:4px; color:var(--ag-green); font:.66rem var(--ag-mono); }

    .ev-today { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 0 12px; padding:12px 14px; border:1px solid var(--ag-gold); background:rgba(201,162,74,.12); color:var(--ag-gold-2); }
    .ev-today > div { display:grid; flex:1; min-width:200px; }
    .ev-today strong { color:var(--ag-text); font:600 .9rem var(--ag-display); letter-spacing:.1em; text-transform:uppercase; }
    .ev-today span { color:var(--ag-text-2); font-size:.8rem; }
    .ev-batch { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 12px; padding:8px 12px; border:1px dashed #d69e2e; color:var(--ag-text-2); font-size:.8rem; }
    .ev-batch .ux-confirm { flex:1; margin:0; }

    @media (max-width:1100px) {
        /* Narrow: the key facts (when, where, places, price), then the reservation or the pass, then the long text. */
        .ev-detail { grid-template-columns:minmax(0,1fr); grid-template-areas:"sheet" "side" "about"; grid-template-rows:none; }
        .ev-detail .ev-side { position:static; }
    }

    /* ---------- Record of the entry control: scanner history and the management tab ---------- */
    .ev-scan-history-box { display:grid; align-content:start; gap:6px; min-height:0; }
    .ev-scan-history-box header { display:grid; gap:1px; }
    .ev-scan-history-box header strong { color:var(--ag-gold-2); font:600 .7rem var(--ag-mono); letter-spacing:.14em; text-transform:uppercase; }
    .ev-scan-history-box header small { color:var(--ag-muted); font-size:.68rem; }
    .ev-scan-history-empty { margin:0; color:var(--ag-text-2); font-size:.78rem; }
    .ev-scan-history li { display:block; padding:0; background:none; }
    .ev-scan-history li > button { display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"time name result" "time by by"; gap:2px 10px; align-items:center; width:100%; padding:6px 8px; border:0; border-left:3px solid var(--ag-line-2); background:var(--ag-panel); color:var(--ag-text); font-size:.78rem; text-align:left; cursor:pointer; }
    .ev-scan-history li > button:hover, .ev-scan-history li.is-viewing > button { background:var(--ag-panel-2); outline:1px solid var(--ag-gold); }
    .ev-scan-history li.is-ok > button { border-left-color:#38a169; }
    .ev-scan-history li.is-warn > button { border-left-color:#d69e2e; }
    .ev-scan-history li.is-error > button { border-left-color:#e53e3e; }
    .ev-scan-history li.is-undone > button { border-left-color:var(--ag-muted); }
    .ev-scan-history li > button time { grid-area:time; color:var(--ag-text-2); font-family:var(--ag-mono); }
    .ev-scan-history li > button span { grid-area:name; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .ev-scan-history li > button b { grid-area:result; color:var(--ag-text-2); font:600 .6rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .ev-scan-history li > button small { grid-area:by; display:inline-flex; align-items:center; gap:4px; color:var(--ag-muted); font-size:.68rem; }
    .ev-scan-more { justify-self:start; }
    .ev-scan-result.is-undone { border-color:var(--ag-muted); background:var(--ag-panel-2); }
    .is-undone .ev-scan-verdict > span { background:var(--ag-muted); color:#0b1118; }
    .ev-scan-result.is-recalled { box-shadow:inset 0 0 0 1px rgba(255,255,255,.12); }
    .ev-scan-nav { display:flex; align-items:center; gap:8px; padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,.15); }
    .ev-scan-nav small { color:rgba(255,255,255,.75); font:.7rem var(--ag-mono); }
    .ev-scan-nav .btn-link { margin-left:auto; padding:0; color:#fff; font-size:.72rem; }
    .ev-scan-by { display:flex; align-items:center; gap:6px; margin:0; padding-top:8px; border-top:1px solid rgba(255,255,255,.15); color:rgba(255,255,255,.8); font-size:.8rem; }
    .ev-scan-by b { color:#fff; }

    .ev-tab-log { display:inline-flex; align-items:center; gap:6px; }
    .ev-log { display:grid; gap:10px; }
    .ev-log-filters { display:flex; flex-wrap:wrap; align-items:end; gap:10px; }
    .ev-log-chips { display:flex; flex-wrap:wrap; gap:6px; }
    .ev-log-chips button { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--ag-line-2); background:var(--ag-panel); color:var(--ag-text-2); font:600 .66rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; cursor:pointer; }
    .ev-log-chips button.is-on { border-color:var(--ag-gold); color:var(--ag-text); background:var(--ag-panel-2); }
    .ev-log-chips button.is-ok.is-on { border-color:#38a169; }
    .ev-log-chips button.is-warn.is-on { border-color:#d69e2e; }
    .ev-log-chips button.is-error.is-on { border-color:#e53e3e; }
    .ev-log-scanner { display:grid; gap:2px; min-width:200px; }
    .ev-log-scanner span { color:var(--ag-text-2); font:600 .6rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-log-filters > .btn { margin-left:auto; display:inline-flex; align-items:center; gap:5px; }
    .ev-log-list { display:grid; gap:4px; margin:0; padding:0; list-style:none; }
    .ev-log-day { margin-top:8px; padding-bottom:4px; border-bottom:1px solid var(--ag-line-2); color:var(--ag-gold-2); font:600 .7rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .ev-log-row { display:grid; grid-template-columns:76px minmax(0,1fr) 170px 200px; align-items:center; gap:12px; padding:6px 10px; border:1px solid var(--ag-line-2); border-left:4px solid var(--ag-line-2); background:var(--ag-panel); }
    .ev-log-row.is-ok { border-left-color:#38a169; }
    .ev-log-row.is-warn { border-left-color:#d69e2e; }
    .ev-log-row.is-error { border-left-color:#e53e3e; }
    .ev-log-row.is-undone { border-left-color:var(--ag-muted); opacity:.85; }
    .ev-log-row time { color:var(--ag-text-2); font:.76rem var(--ag-mono); }
    .ev-log-who { display:flex; align-items:center; gap:10px; min-width:0; }
    .ev-log-who img, .ev-log-who .ev-res-initials { flex:none; width:34px; height:34px; border-radius:3px; object-fit:cover; }
    .ev-log-who > span { display:grid; min-width:0; }
    .ev-log-who strong { overflow:hidden; color:var(--ag-text); font-size:.84rem; text-overflow:ellipsis; white-space:nowrap; }
    .ev-log-who small { color:var(--ag-text-2); font:.68rem var(--ag-mono); }
    .ev-log-result { color:var(--ag-text-2); font:600 .62rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .is-ok .ev-log-result { color:var(--ag-green); }
    .is-warn .ev-log-result { color:#f6ad55; }
    .is-error .ev-log-result { color:#fc8181; }
    .ev-log-by { display:inline-flex; align-items:center; gap:5px; overflow:hidden; color:var(--ag-text); font-size:.78rem; text-overflow:ellipsis; white-space:nowrap; }
    .ev-log-more { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--ag-text-2); font:.7rem var(--ag-mono); }
    @media (max-width:800px) {
        .ev-log-row { grid-template-columns:64px minmax(0,1fr); grid-template-areas:"time who" "result by"; }
        .ev-log-row time { grid-area:time; }
        .ev-log-who { grid-area:who; }
        .ev-log-result { grid-area:result; }
        .ev-log-by { grid-area:by; }
    }

    /* ---------- Reservations management (redesign): summary, figures, tools, cards, menu ---------- */
    .ev-mh { display:grid; gap:14px; margin:0 0 14px; padding:16px 18px; border:1px solid var(--ag-line-2); border-top:3px solid var(--ag-gold); background:var(--ag-panel); }
    .ev-mh-id { display:grid; gap:8px; }
    .ev-mh-tags { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .ev-state-pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; background:rgba(201,162,74,.16); color:var(--ag-gold-2); font:600 .72rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .ev-state-pill.is-ongoing { background:rgba(56,161,105,.18); color:#68d391; }
    .ev-state-pill.is-finished { background:rgba(255,255,255,.08); color:var(--ag-text-2); }
    .ev-state-pill.is-cancelled { background:rgba(229,62,62,.18); color:#fc8181; }
    .ev-mh .ev-countdown { font-size:.78rem; }
    .ev-mh-meta { display:flex; flex-wrap:wrap; gap:6px 22px; margin:0; color:var(--ag-text); font-size:.86rem; }
    .ev-mh-meta > span { display:inline-flex; align-items:center; gap:7px; }
    .ev-mh-meta .uc-icon { color:var(--ag-gold-2); flex:none; }
    .ev-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; margin:0; }
    .ev-kpi { display:grid; align-content:start; gap:6px; padding:12px 14px; border:1px solid var(--ag-line-2); background:var(--ag-panel-2); }
    .ev-kpi dt { color:var(--ag-text-2); font:600 .7rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .ev-kpi dd { display:flex; align-items:baseline; gap:6px; margin:0; }
    .ev-kpi dd b { color:var(--ag-text); font:700 1.7rem/1 var(--ag-mono); }
    .ev-kpi dd span { color:var(--ag-text-2); font-size:.8rem; }
    .ev-kpi > small { color:var(--ag-text-2); font-size:.76rem; line-height:1.35; }
    .ev-kpi.is-due { border-color:#d69e2e; background:rgba(214,158,46,.1); }
    .ev-kpi.is-due dd b { color:#f6ad55; }
    .ev-kpi .ev-cap small { font-size:.74rem; }
    .ev-kpi-link.btn { justify-self:start; padding:0; color:#f6ad55; font-size:.76rem; text-decoration:underline; }
    .ev-mh-actions .btn { display:inline-flex; align-items:center; gap:7px; min-height:38px; }

    .ev-tabs button.is-due .ux-count { background:#d69e2e; color:#1b1300; }
    .ev-tools { display:flex; flex-wrap:wrap; align-items:end; gap:10px 12px; margin:0 0 12px; padding:10px 12px; border:1px solid var(--ag-line-2); background:var(--ag-panel); }
    .ev-tool { display:grid; justify-items:stretch; gap:4px; margin:0; min-width:150px; text-align:left; }
    .ev-tool > span { color:var(--ag-text-2); font:600 .68rem var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .ev-tool .form-control, .ev-tool .form-select { width:100%; min-height:38px; font-size:.86rem; }
    .ev-tool-search { flex:1 1 260px; }
    .ev-tool-export.btn { margin-left:auto; display:inline-flex; align-items:center; gap:7px; min-height:38px; }

    .ev-rc-list { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
    .ev-rc { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(220px,1fr) auto; gap:10px 18px; align-items:start; padding:14px 16px;
        border:1px solid var(--ag-line-2); border-left:4px solid var(--ag-line-2); background:var(--ag-panel); }
    .ev-rc.is-requested { border-left-color:#d69e2e; }
    .ev-rc.is-confirmed { border-left-color:#38a169; }
    .ev-rc.is-waitlisted { border-left-color:var(--ag-cyan); }
    .ev-rc:is(.is-rejected, .is-cancelled) { border-left-color:#e53e3e; }
    .ev-rc-who { display:grid; grid-template-columns:52px minmax(0,1fr); gap:12px; align-items:start; }
    .ev-rc-who img, .ev-rc-who .ev-res-initials { width:52px; height:52px; border-radius:4px; object-fit:cover; }
    .ev-rc-who > div { display:grid; gap:3px; min-width:0; }
    .ev-rc-who strong { color:var(--ag-text); font-size:1rem; overflow-wrap:anywhere; }
    .ev-rc-who small { color:var(--ag-text-2); font:.76rem var(--ag-mono); }
    .ev-rc-note { margin:4px 0 0; padding:6px 10px; border-left:2px solid var(--ag-line-2); background:rgba(255,255,255,.03); color:var(--ag-text); font-size:.84rem; font-style:italic; overflow-wrap:anywhere; }
    .ev-rc-note span { display:block; color:var(--ag-text-2); font:600 .66rem var(--ag-mono); font-style:normal; letter-spacing:.08em; text-transform:uppercase; }
    .ev-rc-note.is-answer { border-left-color:var(--ag-gold); font-style:normal; }
    .ev-rc-state { display:flex; flex-wrap:wrap; align-items:center; align-content:start; gap:6px; }
    .ev-rc-state > small { flex-basis:100%; color:var(--ag-text-2); font:.74rem var(--ag-mono); }
    .ev-badge-status { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border:1px solid currentColor; border-radius:3px; font:600 .72rem var(--ag-mono); letter-spacing:.06em; }
    .ev-badge-status > span { font-weight:700; }
    .ev-badge-status.is-requested { color:#f6ad55; }
    .ev-badge-status.is-confirmed { color:#68d391; }
    .ev-badge-status.is-waitlisted { color:#76e4f7; }
    .ev-badge-status:is(.is-rejected, .is-cancelled) { color:#fc8181; }
    .ev-badge-status.is-pay-paid { color:#68d391; }
    .ev-badge-status.is-pay-pending { color:#f6ad55; }
    .ev-badge-status.is-pay-refunded { color:var(--ag-text-2); }
    .ev-badge-status.is-present { background:rgba(56,161,105,.14); color:#9ae6b4; }
    .ev-badge-status.is-absent { border-style:dashed; color:var(--ag-text-2); }
    .ev-rc-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
    .ev-rc-actions .btn { min-height:38px; padding:6px 14px; font-size:.78rem; letter-spacing:.08em; }
    .ev-rc-confirm { grid-column:1 / -1; }
    .ev-rc-confirm .ux-confirm { margin:0; }
    .ev-rc-notefield { display:grid; gap:4px; margin:6px 0 8px; }
    .ev-rc-notefield span { color:var(--ag-text-2); font-size:.78rem; }

    .ev-menu { position:relative; }
    .ev-menu-toggle { display:inline-flex; align-items:center; gap:6px; }
    .ev-menu-backdrop { position:fixed; inset:0; z-index:40; padding:0; border:0; background:transparent; cursor:default; }
    .ev-menu-list { position:absolute; top:calc(100% + 4px); right:0; z-index:41; display:grid; min-width:240px; margin:0; padding:4px; list-style:none;
        border:1px solid var(--ag-line-2); background:var(--ag-panel-2); box-shadow:0 12px 28px rgba(0,0,0,.45); }
    .ev-menu-list button { display:flex; align-items:baseline; justify-content:space-between; gap:12px; width:100%; min-height:40px; padding:8px 12px; border:0; background:transparent;
        color:var(--ag-text); font-size:.86rem; text-align:left; cursor:pointer; }
    .ev-menu-list button:hover, .ev-menu-list button:focus-visible { background:rgba(201,162,74,.14); }
    .ev-menu-list button.is-danger { color:#fc8181; }
    .ev-menu-list button small { color:var(--ag-text-2); font-size:.7rem; }

    /* Accessibility: a visible keyboard focus everywhere in the flow, and no motion for those who ask for none. */
    :is(.ev-mh, .ev-tools, .ev-rc, .ev-tabs, .ev-log, .ev-scan, .ev-side, .ev-card) :is(a, button, input, select, textarea):focus-visible {
        outline:2px solid var(--ag-gold-2); outline-offset:2px; box-shadow:none;
    }
    @media (prefers-reduced-motion: reduce) {
        .ev-card, .ev-cap-bar > span, .ev-scan-result { transition:none !important; }
        .ev-card:hover { transform:none; }
    }

    @media (max-width:1100px) {
        .ev-rc { grid-template-columns:minmax(0,1fr) auto; }
        .ev-rc-state { grid-column:1 / -1; grid-row:2; }
        .ev-rc-actions { grid-column:1 / -1; justify-content:flex-start; }
    }
    @media (max-width:700px) {
        .ev-mh { padding:12px; }
        .ev-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
        .ev-kpi dd b { font-size:1.4rem; }
        .ev-tools { display:grid; grid-template-columns:1fr 1fr; }
        .ev-tool { min-width:0; }
        .ev-tool-search { grid-column:1 / -1; }
        .ev-tool-export.btn { grid-column:1 / -1; margin-left:0; justify-content:center; }
        .ev-rc { grid-template-columns:1fr; padding:12px; }
        .ev-rc-actions { display:grid; grid-template-columns:1fr 1fr; }
        .ev-rc-actions .btn { width:100%; justify-content:center; }
        .ev-menu-list { right:auto; left:0; min-width:min(280px, 80vw); }
        .ev-tabs { overflow-x:auto; flex-wrap:nowrap; }
    }
}


/* ==== recruitment.css ==== */
/* Unit Control · Recruitment (command and career), from the recruitment UX pass (2026-11).
   Every class starts with rx- and lives here; the pages are Pages/RecruitmentPage, JobsPage, MyApplicationsPage and
   InvitationsPage, the pieces Recruitment/*. Dark panels throughout (the paper is kept for the dossiers): readable
   sizes (body .8rem, help .74rem, labels .68rem), one gold accent, state tones shared by the manager and the candidate.
   Contents: 1 tokens · 2 page frame · 3 bars, chips, segments · 4 list rows · 5 detail · 6 stepper · 7 fit ·
   8 vacancy cards · 9 drawer and editor · 10 talent search · 11 offers (job cards) · 12 career pages · 13 phone. */
@layer app {
    /* ---- 1 · Tokens ----------------------------------------------------------------------------------------------- */
    :root {
        --rx-panel:#0c131b;
        --rx-panel-2:#101923;
        --rx-raise:#14202c;
        --rx-line:#22303e;
        --rx-line-2:#2f4152;
        --rx-text:#dbe2e8;
        --rx-text-2:#b3bfca;
        --rx-muted:#94a3b1;
        --rx-gold:var(--ag-gold);
        --rx-gold-2:var(--ag-gold-2);
        --rx-new:#e3c06b;
        --rx-review:#67c7d9;
        --rx-short:#b79cff;
        --rx-ok:#4fcf8d;
        --rx-bad:#f0767b;
        --rx-idle:#97a3ae;
        --rx-radius:4px;
        --rx-body:.8rem;
        --rx-help:.74rem;
        --rx-label:.68rem;
    }

    /* ---- 2 · Page frame: the tab content fills the main panel and scrolls inside it (the whole page on a phone) ---- */
    .rx-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; padding:2px 2px 16px 0; }
    /* Native pickers (date, the list of a select) in the dark of the page. */
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .ux-toolbar) { color-scheme:dark; }
    .rx-grow { flex:1 1 auto; }
    .rx-muted { color:var(--rx-muted); font-size:var(--rx-help); }
    .rx-help { margin:0; color:var(--rx-text-2); font-size:var(--rx-help); line-height:1.5; letter-spacing:0; text-transform:none; }
    .rx-help.is-strong { display:flex; align-items:center; gap:6px; color:var(--rx-text); }
    .rx-error { color:var(--rx-bad); font-size:var(--rx-help); }
    .rx-count { margin-left:auto; color:var(--rx-muted); font-size:var(--rx-label); font-weight:400; letter-spacing:0; text-transform:none; }
    .rx-req { color:var(--rx-gold-2); font-style:normal; }
    .rx-code, .rx-app-detail code, .rx-row code, .rx-profile code { color:var(--rx-muted); font-family:var(--ag-mono); font-size:.7rem; }
    .rx-count-badge {
        display:inline-grid; place-items:center; min-width:22px; height:20px; padding:0 6px; border:1px solid var(--rx-line-2);
        border-radius:10px; color:var(--rx-gold-2); font:600 .68rem var(--ag-mono);
    }

    /* The figures of the head are buttons (they open the list they count). */
    .entity-page-header > .rx-kpis > button {
        display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:118px; padding:8px 12px;
        border:1px solid var(--ag-line-2); border-radius:var(--rx-radius); background:rgba(255,255,255,.02); color:inherit;
        text-align:left; cursor:pointer; transition:border-color .15s, background .15s;
    }
    .entity-page-header > .rx-kpis > button:hover { border-color:var(--rx-gold); background:var(--ag-gold-dim); }
    .entity-page-header > .rx-kpis > button:focus-visible { outline:2px solid var(--rx-gold-2); outline-offset:2px; }
    .entity-page-header > .rx-kpis > button.is-hot strong { color:var(--rx-gold-2); }

    /* Pills: the state of an application, a vacancy or an invitation, in the same tones everywhere. */
    .rx-pill {
        --tone:var(--rx-idle);
        display:inline-flex; align-items:center; gap:4px; height:22px; padding:0 8px; border:1px solid color-mix(in srgb, var(--tone) 55%, transparent);
        border-radius:11px; background:color-mix(in srgb, var(--tone) 12%, transparent); color:var(--tone);
        font:600 .66rem var(--ag-mono); letter-spacing:.06em; text-transform:uppercase; white-space:nowrap;
    }
    .rx-pill.is-lg { height:26px; padding:0 12px; font-size:.7rem; }
    .rx-pill.is-new { --tone:var(--rx-new); }
    .rx-pill.is-review { --tone:var(--rx-review); }
    .rx-pill.is-short { --tone:var(--rx-short); }
    .rx-pill.is-ok { --tone:var(--rx-ok); }
    .rx-pill.is-bad { --tone:var(--rx-bad); }
    .rx-pill.is-warn { --tone:var(--rx-new); }
    .rx-pill.is-draft { --tone:var(--rx-review); border-style:dashed; }
    .rx-pill.is-done { --tone:var(--rx-short); }
    .rx-pill.is-plain { --tone:var(--rx-text-2); background:transparent; }

    .rx-tags { display:flex; flex-wrap:wrap; gap:6px; }
    .rx-tag {
        display:inline-flex; align-items:center; height:22px; padding:0 8px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius);
        color:var(--rx-text-2); font:500 .68rem var(--ag-mono); letter-spacing:.04em;
    }
    .rx-tag.is-plain { border-style:dashed; }
    .rx-tag.is-gold { border-color:rgba(201,162,74,.6); color:var(--rx-gold-2); }
    .rx-tag.is-ok { border-color:color-mix(in srgb, var(--rx-ok) 55%, transparent); color:var(--rx-ok); }
    .rx-tag.is-bad { border-color:color-mix(in srgb, var(--rx-bad) 55%, transparent); color:var(--rx-bad); }

    .rx-icon-btn {
        display:inline-grid; place-items:center; width:34px; height:34px; flex:none; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius);
        background:transparent; color:var(--rx-text-2); font:600 1rem var(--ag-mono); cursor:pointer;
    }
    .rx-icon-btn:hover:not(:disabled) { border-color:var(--rx-gold); color:var(--rx-gold-2); }
    .rx-icon-btn:disabled { opacity:.4; cursor:not-allowed; }
    .rx-text-btn {
        display:inline-flex; align-items:center; gap:5px; min-height:30px; padding:0 8px; border:1px solid transparent; border-radius:var(--rx-radius);
        background:transparent; color:var(--rx-text-2); font:600 .7rem var(--ag-mono); letter-spacing:.06em; text-transform:uppercase; cursor:pointer;
    }
    .rx-text-btn:hover:not(:disabled) { border-color:var(--rx-line-2); color:var(--rx-text); }
    .rx-text-btn.is-danger { color:var(--rx-bad); }
    .rx-text-btn.is-danger:hover:not(:disabled) { border-color:color-mix(in srgb, var(--rx-bad) 50%, transparent); }
    .rx-text-btn:disabled { opacity:.45; cursor:not-allowed; }

    /* Form controls of recruitment: dark, legible, never the framework white. */
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) :is(.form-control, .form-select) {
        min-height:36px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius); background-color:#070c12; color:var(--rx-text);
        font-size:var(--rx-body);
    }
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) :is(.form-control, .form-select):focus {
        border-color:var(--rx-gold); box-shadow:0 0 0 2px rgba(201,162,74,.25);
    }
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) .form-control::placeholder { color:#7d8b98; opacity:1; }
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) .form-control:disabled,
    :is(.rx-bar, .rx-search, .rx-drawer, .rx-decision, .rx-apply-form) .form-select:disabled { opacity:.6; }
    .rx-drawer .form-control.is-invalid { border-color:var(--rx-bad); }

    /* ---- 3 · Bars, chips, segments --------------------------------------------------------------------------------- */
    .rx-bar { flex:none; display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:2px 0; }
    .rx-bar-note { display:inline-flex; align-items:center; gap:6px; color:var(--rx-muted); font-size:var(--rx-help); }
    .rx-chips { display:flex; flex-wrap:wrap; gap:6px; }
    .rx-chip {
        display:inline-flex; align-items:center; gap:7px; min-height:32px; padding:0 12px; border:1px solid var(--rx-line-2); border-radius:16px;
        background:var(--rx-panel); color:var(--rx-text-2); font:600 .7rem var(--ag-mono); letter-spacing:.05em; cursor:pointer; white-space:nowrap;
    }
    .rx-chip b { color:var(--rx-text); font-weight:700; }
    .rx-chip:hover { border-color:var(--rx-gold); color:var(--rx-text); }
    .rx-chip.is-active { border-color:var(--rx-gold); background:var(--ag-gold-dim); color:var(--rx-gold-2); }
    .rx-chip.is-active b { color:var(--rx-gold-2); }
    .rx-chip.is-zero:not(.is-active) { opacity:.7; }
    .rx-chip.is-zero:not(.is-active) b { color:var(--rx-muted); }
    .rx-chip.is-removable { cursor:default; }
    .rx-chip.is-removable button { border:0; background:transparent; color:inherit; padding:0 0 0 2px; cursor:pointer; }
    .rx-inline-field { display:inline-flex; align-items:center; gap:8px; margin:0; color:var(--rx-muted); font-size:var(--rx-label); text-transform:uppercase; letter-spacing:.08em; }
    .rx-inline-field .form-select { width:auto; min-width:200px; }

    .rx-segment { flex:none; display:inline-flex; align-self:flex-start; padding:3px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius); background:var(--rx-panel); }
    .rx-segment button {
        display:inline-flex; align-items:center; gap:7px; min-height:32px; padding:0 14px; border:0; border-radius:3px; background:transparent;
        color:var(--rx-text-2); font:600 .72rem var(--ag-mono); letter-spacing:.05em; cursor:pointer;
    }
    .rx-segment button.is-active { background:var(--ag-gold-dim); color:var(--rx-gold-2); box-shadow:inset 0 0 0 1px rgba(201,162,74,.55); }
    .rx-segment button b { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--rx-gold); color:#171004; font-size:.64rem; }

    /* ---- 4 · Split list and detail, rows ---------------------------------------------------------------------------- */
    .rx-split { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:minmax(340px, 440px) minmax(0, 1fr); gap:12px; }
    .rx-list, .rx-detail {
        min-height:0; overflow-y:auto; border:1px solid var(--rx-line); border-radius:var(--rx-radius); background:var(--rx-panel);
    }
    .rx-list { display:flex; flex-direction:column; }
    .rx-list > .ux-state, .rx-detail > .ux-state { margin:16px; }
    .rx-list-head { position:sticky; top:0; z-index:1; display:flex; align-items:center; gap:8px; padding:10px 14px; border-bottom:1px solid var(--rx-line); background:var(--rx-panel); color:var(--rx-text); font-size:var(--rx-body); }
    .rx-row {
        display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:12px; width:100%; padding:12px 14px;
        border:0; border-bottom:1px solid var(--rx-line); border-left:3px solid transparent; background:transparent; color:var(--rx-text); text-align:left; cursor:pointer;
    }
    .rx-row:hover { background:rgba(255,255,255,.025); }
    .rx-row.is-selected, .rx-row-wrap.is-selected .rx-row { border-left-color:var(--rx-gold); background:var(--ag-gold-dim); }
    .rx-row.is-new .rx-row-text b::after { content:""; display:inline-block; width:7px; height:7px; margin-left:7px; border-radius:50%; background:var(--rx-new); vertical-align:middle; }
    .rx-row-text { display:flex; flex-direction:column; gap:2px; min-width:0; }
    .rx-row-text b { overflow:hidden; color:var(--rx-text); font-size:.84rem; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
    .rx-row-text small { overflow:hidden; color:var(--rx-text-2); font-size:var(--rx-help); text-overflow:ellipsis; white-space:nowrap; }
    .rx-row-text .rx-row-for { color:var(--rx-muted); }
    .rx-row-side { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
    .rx-row-side small { color:var(--rx-muted); font-size:.68rem; white-space:nowrap; }
    .rx-flag { display:inline-flex; align-items:center; gap:4px; }
    .rx-flag.is-warn { color:var(--rx-new) !important; }
    .rx-row-wrap { position:relative; display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; border-bottom:1px solid var(--rx-line); }
    .rx-row-wrap .rx-row { border-bottom:0; }
    .rx-row-invite { margin-right:12px; }
    .rx-more { padding:14px; color:var(--rx-muted); text-align:center; font-size:var(--rx-help); }

    .rx-avatar {
        display:inline-grid; place-items:center; width:42px; height:42px; flex:none; border:1px solid var(--rx-line-2); border-radius:50%;
        background:var(--rx-raise); color:var(--rx-text-2); font:700 .78rem var(--ag-mono); object-fit:cover;
    }
    .rx-avatar.is-lg { width:64px; height:64px; font-size:1.05rem; }

    /* ---- 5 · Detail ----------------------------------------------------------------------------------------------- */
    .rx-detail { padding:18px 20px 22px; }
    .rx-back { margin-bottom:12px; }
    .rx-app-detail, .rx-profile { display:flex; flex-direction:column; gap:16px; color:var(--rx-text); font-size:var(--rx-body); }
    .rx-app-head { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:start; gap:14px; }
    .rx-app-who h2 { margin:0 0 4px; color:#f2f5f7; font-family:var(--ag-display); font-size:1.5rem; font-weight:600; letter-spacing:.03em; }
    .rx-app-who p { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 4px; color:var(--rx-text-2); font-size:var(--rx-body); }
    .rx-app-for b { color:var(--rx-text); }
    .rx-app-for span { color:var(--rx-muted); }
    .rx-note { display:flex; gap:8px; margin:0; padding:10px 12px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius); color:var(--rx-text-2); font-size:var(--rx-help); }
    .rx-decision { display:flex; flex-direction:column; gap:10px; padding:14px; border:1px solid rgba(201,162,74,.45); border-radius:var(--rx-radius); background:linear-gradient(180deg, rgba(201,162,74,.08), rgba(201,162,74,.02)); }
    .rx-decision-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .rx-decision .ux-confirm { margin:0; }
    .rx-section { display:flex; flex-direction:column; gap:8px; }
    .rx-section h4 {
        display:flex; align-items:center; gap:8px; margin:0; color:var(--rx-text-2); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.12em; text-transform:uppercase;
    }
    .rx-letter {
        margin:0; padding:12px 14px; border-left:3px solid var(--rx-line-2); background:rgba(255,255,255,.025); color:var(--rx-text);
        font-size:.84rem; line-height:1.6; white-space:pre-line;
    }
    .rx-letter.is-unit { border-left-color:var(--rx-gold); }
    .rx-letter footer { margin-top:6px; color:var(--rx-muted); font-size:var(--rx-help); }
    .rx-detail-actions { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
    .rx-detail .ux-xlinks { padding-top:8px; border-top:1px solid var(--rx-line); }
    .rx-detail .asp-person, .rx-detail .asp-pitch { border-radius:var(--rx-radius); }

    /* The service record. */
    .rx-profile-head { display:flex; align-items:center; gap:14px; }
    .rx-profile-head h3 { margin:0; color:#f2f5f7; font-family:var(--ag-display); font-size:1.4rem; font-weight:600; letter-spacing:.03em; }
    .rx-profile-head p { margin:2px 0 0; color:var(--rx-text-2); }
    .rx-facts { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:10px 18px; margin:0; }
    .rx-facts > div.is-wide { grid-column:1 / -1; }
    .rx-facts dt { color:var(--rx-muted); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-facts dd { margin:3px 0 0; color:var(--rx-text); font-size:var(--rx-body); }
    .rx-timeline { display:flex; flex-direction:column; gap:0; margin:0; padding:0 0 0 14px; border-left:2px solid var(--rx-line-2); list-style:none; }
    .rx-timeline li { position:relative; display:flex; flex-direction:column; gap:1px; padding:4px 0 10px; }
    .rx-timeline li::before { content:""; position:absolute; left:-20px; top:9px; width:10px; height:10px; border:2px solid var(--rx-line-2); border-radius:50%; background:var(--rx-panel); }
    .rx-timeline li.is-current::before { border-color:var(--rx-gold); background:var(--rx-gold); }
    .rx-timeline b { color:var(--rx-text); font-weight:600; }
    .rx-timeline small { color:var(--rx-muted); font-size:var(--rx-help); }
    .rx-records { display:flex; flex-direction:column; gap:6px; margin:0; padding:0; list-style:none; }
    .rx-records li { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); background:rgba(255,255,255,.015); }
    .rx-records li > div { display:flex; flex:1; flex-direction:column; gap:2px; min-width:0; }
    .rx-records b { color:var(--rx-text); font-weight:600; }
    .rx-records small { color:var(--rx-muted); font-size:var(--rx-help); }

    /* ---- 6 · Stepper ---------------------------------------------------------------------------------------------- */
    .rx-stepper { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:0; margin:0; padding:0; list-style:none; }
    .rx-stepper li { --tone:var(--rx-line-2); position:relative; display:flex; align-items:flex-start; gap:8px; padding-right:8px; color:var(--rx-muted); }
    .rx-stepper li::after { content:""; position:absolute; top:13px; left:30px; right:4px; height:2px; background:var(--rx-line-2); }
    .rx-stepper li:last-child::after { display:none; }
    .rx-stepper li.is-done { --tone:var(--rx-gold); color:var(--rx-text-2); }
    .rx-stepper li.is-done::after { background:var(--rx-gold); }
    .rx-stepper li.is-current { --tone:var(--rx-gold-2); color:var(--rx-text); }
    .rx-stepper li.rx-step-end.is-current.is-ok { --tone:var(--rx-ok); }
    .rx-stepper li.rx-step-end.is-current.is-bad { --tone:var(--rx-bad); }
    .rx-stepper li.rx-step-end.is-current.is-idle { --tone:var(--rx-idle); }
    .rx-step-dot {
        position:relative; z-index:1; display:inline-grid; place-items:center; width:26px; height:26px; flex:none; border:2px solid var(--tone); border-radius:50%;
        background:var(--rx-panel); color:var(--tone); font:700 .7rem var(--ag-mono);
    }
    .rx-stepper li.is-done .rx-step-dot { background:var(--rx-gold); color:#171004; }
    .rx-stepper li.is-current .rx-step-dot { box-shadow:0 0 0 4px color-mix(in srgb, var(--tone) 22%, transparent); }
    .rx-step-text { position:relative; z-index:1; display:flex; flex-direction:column; gap:1px; min-width:0; padding:2px 6px 0 0; background:var(--rx-panel); }
    .rx-step-text b { font-size:.72rem; font-weight:600; letter-spacing:.02em; line-height:1.25; }
    .rx-step-text small { color:var(--rx-muted); font-size:.66rem; }
    .rx-stepper.is-compact .rx-step-dot { width:20px; height:20px; font-size:.6rem; }
    .rx-stepper.is-compact li::after { top:10px; left:24px; }

    /* ---- 7 · Fit with the requirements ------------------------------------------------------------------------------ */
    .rx-fit { display:flex; flex-direction:column; gap:10px; padding:12px 14px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius); background:rgba(255,255,255,.015); }
    .rx-fit.is-ok { border-color:color-mix(in srgb, var(--rx-ok) 45%, transparent); }
    .rx-fit.is-warn { border-color:color-mix(in srgb, var(--rx-new) 50%, transparent); }
    .rx-fit-summary { display:flex; align-items:center; gap:8px; margin:0; font-size:.84rem; font-weight:600; }
    .rx-fit.is-ok .rx-fit-summary { color:var(--rx-ok); }
    .rx-fit.is-warn .rx-fit-summary { color:var(--rx-new); }
    .rx-fit-rows { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:8px; margin:0; }
    .rx-fit-rows > div { position:relative; padding:8px 34px 8px 10px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); }
    .rx-fit-rows dt { color:var(--rx-muted); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-fit-rows dd { display:flex; flex-direction:column; margin:2px 0 0; }
    .rx-fit-rows dd b { color:var(--rx-text); font-size:var(--rx-body); }
    .rx-fit-rows dd small { color:var(--rx-text-2); font-size:var(--rx-help); }
    .rx-fit-mark { position:absolute; top:8px; right:10px; font-weight:700; }
    .rx-fit-rows > .is-ok .rx-fit-mark, .rx-fit-rows > .is-ok > .rx-fit-mark { color:var(--rx-ok); }
    .rx-fit-rows > .is-warn { border-color:color-mix(in srgb, var(--rx-new) 45%, transparent); }
    .rx-fit-rows > .is-warn .rx-fit-mark { color:var(--rx-new); }

    /* ---- 8 · Vacancy cards (the managers') -------------------------------------------------------------------------- */
    .rx-vac-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap:12px; align-items:start; }
    .rx-vac {
        display:flex; flex-direction:column; gap:12px; padding:14px 16px; border:1px solid var(--rx-line); border-top:3px solid var(--rx-line-2);
        border-radius:var(--rx-radius); background:linear-gradient(180deg, var(--rx-panel-2), var(--rx-panel)); color:var(--rx-text);
    }
    .rx-vac.is-ok { border-top-color:var(--rx-ok); }
    .rx-vac.is-warn { border-top-color:var(--rx-new); }
    .rx-vac.is-draft { border-top-color:var(--rx-review); border-top-style:dashed; }
    .rx-vac.is-done { border-top-color:var(--rx-short); }
    .rx-vac.is-idle { opacity:.85; }
    .rx-vac-top { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .rx-vac-main h3 { margin:0; color:#f2f5f7; font-family:var(--ag-display); font-size:1.35rem; font-weight:600; letter-spacing:.03em; }
    .rx-vac-unit { display:flex; align-items:center; gap:8px; margin:4px 0 0; color:var(--rx-text-2); font-size:var(--rx-body); }
    .rx-vac-unit .cg-insignia, .rx-vac-unit .cg-insignia.is-empty { width:22px; height:22px; font-size:.5rem; }
    .rx-vac-facts { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; margin:0; padding:10px 0; border-top:1px solid var(--rx-line); border-bottom:1px solid var(--rx-line); }
    .rx-vac-facts dt { color:var(--rx-muted); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-vac-facts dd { margin:3px 0 0; color:var(--rx-text); font-size:var(--rx-body); font-weight:600; }
    .rx-vac-fill dd { display:flex; flex-direction:column; gap:5px; }

    span.rx-meter { display:block; height:5px; border-radius:3px; background:#1a2633; overflow:hidden; }
    span.rx-meter i { display:block; height:100%; min-width:2px; background:linear-gradient(90deg, var(--rx-gold), var(--rx-gold-2)); }
    .is-close-soon dd, .is-close-soon b { color:var(--rx-new) !important; }
    .is-close-past dd, .is-close-past b { color:var(--rx-bad) !important; }
    .rx-vac-pipe { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; }
    .rx-vac-pipe p { display:flex; flex-wrap:wrap; gap:6px 16px; margin:0; color:var(--rx-text-2); font-size:var(--rx-body); }
    .rx-vac-pipe b { color:var(--rx-text); }
    .rx-vac-pipe .is-hot b, .rx-vac-pipe .is-hot { color:var(--rx-gold-2); }
    .rx-vac-pipe .btn { display:inline-flex; align-items:center; gap:6px; }
    .rx-vac-actions { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin:0 -6px -4px; padding-top:8px; border-top:1px dashed var(--rx-line); }
    .rx-vac .ux-confirm { margin:0; }

    /* ---- 9 · Drawer and vacancy editor ------------------------------------------------------------------------------ */
    /* SideDrawer is a native modal <dialog> (FccDialog): its backdrop is the ::backdrop of the top layer. */
    .rx-drawer::backdrop { background:rgba(2,5,8,.62); backdrop-filter:blur(2px); }
    .rx-drawer {
        position:fixed; z-index:1401; top:0; right:0; bottom:0; display:flex; flex-direction:column; width:min(640px, 100vw);
        border-left:1px solid var(--rx-line-2); background:var(--rx-panel); color:var(--rx-text); box-shadow:-24px 0 60px rgba(0,0,0,.55);
        animation:rx-slide .18s ease-out;
    }
    .rx-drawer.is-wide { width:min(1120px, 100vw); }
    .rx-drawer:focus { outline:none; }
    @keyframes rx-slide { from { transform:translateX(40px); opacity:.4; } to { transform:none; opacity:1; } }
    @media (prefers-reduced-motion: reduce) { .rx-drawer { animation:none; } }
    .rx-drawer-head { flex:none; display:flex; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--rx-line); background:var(--rx-panel-2); }
    .rx-drawer-title { flex:1; min-width:0; }
    .rx-drawer-title small { display:block; color:var(--rx-gold-2); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .rx-drawer-title h2 { margin:2px 0 0; overflow:hidden; color:#f2f5f7; font-family:var(--ag-display); font-size:1.45rem; font-weight:600; letter-spacing:.04em; text-overflow:ellipsis; white-space:nowrap; }
    .rx-drawer-body { flex:1 1 auto; min-height:0; overflow-y:auto; padding:18px 20px 24px; }
    .rx-drawer-foot { flex:none; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px 20px; border-top:1px solid var(--rx-line); background:var(--rx-panel-2); }
    .rx-foot-error { display:flex; flex-basis:100%; align-items:center; gap:6px; color:var(--rx-bad); font-size:var(--rx-help); }

    .rx-editor { display:grid; grid-template-columns:minmax(0, 1fr) minmax(320px, 400px); gap:24px; align-items:start; }
    .rx-editor-form { display:flex; flex-direction:column; gap:14px; min-width:0; }
    .rx-form-section { display:flex; flex-direction:column; gap:12px; padding:16px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); background:rgba(255,255,255,.015); }
    .rx-form-section h3 { display:flex; align-items:center; gap:10px; margin:0; color:var(--rx-text); font-family:var(--ag-display); font-size:1.1rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
    .rx-form-section h3 span { display:inline-grid; place-items:center; width:24px; height:24px; border:1px solid var(--rx-gold); border-radius:50%; color:var(--rx-gold-2); font:700 .72rem var(--ag-mono); }
    .rx-field { display:flex; flex-direction:column; gap:6px; min-width:0; margin:0; }
    .rx-field > span:first-child { display:flex; align-items:baseline; gap:6px; color:var(--uc-label-dark); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-field-row { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; }
    .rx-stepper-input { display:grid; grid-template-columns:36px minmax(0, 1fr) 36px; gap:6px; }
    .rx-stepper-input .rx-icon-btn { width:36px; height:36px; }
    .rx-stepper-input input { text-align:center; }
    .rx-quick { display:flex; flex-wrap:wrap; gap:6px; }
    .rx-quick .rx-chip { min-height:28px; padding:0 10px; font-size:.66rem; }
    .rx-choice { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
    .rx-choice-card {
        display:grid; grid-template-columns:auto auto minmax(0, 1fr); align-items:start; gap:10px; padding:14px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius);
        background:transparent; color:var(--rx-text-2); text-align:left; cursor:pointer;
    }
    .rx-choice-card:hover { border-color:var(--rx-gold); }
    .rx-choice-card.is-on { border-color:var(--rx-gold); background:var(--ag-gold-dim); color:var(--rx-gold-2); box-shadow:inset 0 0 0 1px var(--rx-gold); }
    .rx-choice-radio { width:16px; height:16px; margin-top:2px; border:2px solid var(--rx-line-2); border-radius:50%; }
    .rx-choice-card.is-on .rx-choice-radio { border-color:var(--rx-gold-2); background:radial-gradient(circle, var(--rx-gold-2) 0 4px, transparent 5px); }
    .rx-choice-text { display:flex; flex-direction:column; gap:4px; }
    .rx-choice-text b { color:var(--rx-text); font-size:.86rem; }
    .rx-choice-card.is-on .rx-choice-text b { color:var(--rx-gold-2); }
    .rx-choice-text small { color:var(--rx-text-2); font-size:var(--rx-help); line-height:1.45; }
    .rx-editor-preview { position:sticky; top:0; display:flex; flex-direction:column; gap:10px; }
    .rx-editor-preview h3 { margin:0; color:var(--rx-text-2); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .rx-editor-state { display:flex; align-items:center; gap:8px; margin:0; color:var(--rx-text-2); font-size:var(--rx-help); }

    /* ---- 10 · Talent search ------------------------------------------------------------------------------------------- */
    .rx-search { flex:none; display:flex; flex-direction:column; gap:10px; padding:12px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); background:var(--rx-panel); }
    .rx-search-main { display:grid; grid-template-columns:minmax(0, 2fr) minmax(0, 1fr) auto; gap:10px; }
    .rx-search-field { position:relative; margin:0; }
    .rx-search-field > .uc-icon { position:absolute; top:50%; left:12px; color:var(--rx-muted); transform:translateY(-50%); pointer-events:none; }
    .rx-search-field .form-control { min-height:40px; padding-left:38px; }
    .rx-filter-toggle {
        display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:0 14px; border:1px solid var(--rx-line-2); border-radius:var(--rx-radius);
        background:transparent; color:var(--rx-text); font:600 .72rem var(--ag-mono); letter-spacing:.06em; text-transform:uppercase; cursor:pointer;
    }
    .rx-filter-toggle b { display:inline-grid; place-items:center; min-width:18px; height:18px; border-radius:9px; background:var(--rx-gold); color:#171004; font-size:.64rem; }
    .rx-filter-toggle.is-open, .rx-filter-toggle:hover { border-color:var(--rx-gold); }
    .rx-search-adv { display:grid; grid-template-columns:minmax(260px, 1.2fr) minmax(180px, .8fr) minmax(320px, 1.6fr) minmax(240px, 1fr); gap:14px; padding-top:10px; border-top:1px dashed var(--rx-line-2); }
    .rx-range { display:grid; grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr); align-items:center; gap:6px; color:var(--rx-muted); }
    .rx-field.is-geo .rec-geo { display:grid; grid-template-columns:minmax(0, 1fr) 130px; gap:10px; }
    .rx-field.is-geo .rec-geo label { display:flex; flex-direction:column; gap:6px; margin:0; }
    .rx-field.is-geo .rec-geo label > span:first-child { color:var(--uc-label-dark); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-field.is-geo .rec-geo-search { display:grid; grid-template-columns:minmax(0, 1fr) 36px 36px; gap:6px; }
    .rx-field.is-geo .rec-geo-search .btn { min-height:36px; padding:0; }
    .rx-field.is-geo .form-control, .rx-field.is-geo .form-select { min-height:36px; font-size:var(--rx-body); border:1px solid var(--rx-line-2); background-color:#070c12; color:var(--rx-text); }
    .rx-field.is-geo .rec-geo-chip { height:36px; font-size:var(--rx-body); }
    .rx-toggles { display:flex; flex-wrap:wrap; gap:8px; }
    .rx-switch {
        display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 12px 0 8px; border:1px solid var(--rx-line-2); border-radius:18px;
        background:transparent; color:var(--rx-text-2); font-size:var(--rx-help); cursor:pointer;
    }
    .rx-switch i { position:relative; width:28px; height:16px; border-radius:8px; background:#25323f; transition:background .15s; }
    .rx-switch i::after { content:""; position:absolute; top:2px; left:2px; width:12px; height:12px; border-radius:50%; background:#8a97a3; transition:transform .15s, background .15s; }
    .rx-switch.is-on { border-color:var(--rx-gold); color:var(--rx-text); }
    .rx-switch.is-on i { background:rgba(201,162,74,.45); }
    .rx-switch.is-on i::after { background:var(--rx-gold-2); transform:translateX(12px); }
    .rx-active-chips { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
    .rx-active-chips .rx-chip { min-height:28px; font-size:.66rem; }

    .rx-sent-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap:10px; align-items:start; }
    .rx-sent { display:flex; flex-direction:column; gap:10px; padding:14px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); background:var(--rx-panel); }
    .rx-sent.is-pending { border-left:3px solid var(--rx-new); }
    .rx-sent.is-history { opacity:.85; }
    .rx-sent-who { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:12px; }
    .rx-sent-actions { display:flex; align-items:center; gap:8px; }

    /* ---- 11 · Offers: the job cards (also the editor's preview) and the vacancy drawer ---------------------------- */
    .rx-jobs { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap:12px; align-items:start; }
    .rx-job {
        position:relative; display:flex; flex-direction:column; gap:12px; padding:16px; border:1px solid var(--rx-line); border-radius:var(--rx-radius);
        background:linear-gradient(180deg, var(--rx-panel-2), var(--rx-panel)); color:var(--rx-text); transition:border-color .15s, transform .15s;
    }
    .rx-job:not(.is-preview):hover { border-color:var(--rx-gold); }
    .rx-job.is-muted { opacity:.8; }
    .rx-job-hit { position:absolute; inset:0; z-index:0; border:0; background:transparent; cursor:pointer; }
    .rx-job-hit:disabled { cursor:default; }
    .rx-job-hit:focus-visible { outline:2px solid var(--rx-gold-2); outline-offset:-2px; }
    .rx-job > :not(.rx-job-hit) { position:relative; z-index:1; pointer-events:none; }
    .rx-job .rx-job-foot, .rx-job .rx-job-foot * { pointer-events:auto; }
    .rx-job-head { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:start; gap:12px; }
    .rx-job-head .cg-insignia { width:44px; height:44px; }
    .rx-job-title h3 { margin:0; color:#f2f5f7; font-family:var(--ag-display); font-size:1.3rem; font-weight:600; letter-spacing:.03em; line-height:1.15; }
    .rx-job-title p { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin:3px 0 0; color:var(--rx-text-2); font-size:var(--rx-help); }
    .rx-job-title p b { color:var(--rx-text); font-weight:600; }
    .rx-km { color:var(--rx-gold-2); }
    .rx-where { display:inline-flex; align-items:center; gap:4px; }
    .rx-job-flags { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
    .rx-job-desc {
        display:-webkit-box; margin:0; overflow:hidden; color:var(--rx-text-2); font-size:var(--rx-body); line-height:1.55; white-space:pre-line;
        -webkit-box-orient:vertical; -webkit-line-clamp:3;
    }
    .rx-job-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(118px, 1fr)); gap:8px; margin:0; padding:0; list-style:none; }
    .rx-job-facts li { display:flex; flex-direction:column; gap:2px; min-width:0; padding:8px 10px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); }
    .rx-job-facts li span { color:var(--rx-muted); font:600 .62rem var(--ag-mono); letter-spacing:.08em; text-transform:uppercase; }
    .rx-job-facts li b { color:var(--rx-text); font-size:.76rem; font-weight:600; line-height:1.3; }
    .rx-job-facts li.is-ok { border-color:color-mix(in srgb, var(--rx-ok) 40%, transparent); }
    .rx-job-facts li.is-warn { border-color:color-mix(in srgb, var(--rx-new) 45%, transparent); }
    .rx-mark { position:absolute; top:6px; right:8px; font-style:normal; font-weight:700; }
    .rx-job-facts li { position:relative; }
    .rx-job-facts li.is-ok .rx-mark { color:var(--rx-ok); }
    .rx-job-facts li.is-warn .rx-mark { color:var(--rx-new); }
    .rx-job-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .rx-job-lack { display:inline-flex; align-items:center; gap:5px; color:var(--rx-new); font-size:var(--rx-help); }
    .rx-job-ok { display:inline-flex; align-items:center; gap:5px; color:var(--rx-ok); font-size:var(--rx-help); }
    .rx-job-blocked { margin:0; color:var(--rx-muted); font-size:var(--rx-help); text-align:right; }
    .rx-job.is-preview { box-shadow:0 0 0 1px rgba(201,162,74,.25), 0 10px 30px rgba(0,0,0,.35); }
    .rx-job.is-preview .rx-job-facts { grid-template-columns:repeat(2, minmax(0, 1fr)); }

    .rx-vacancy { display:flex; flex-direction:column; gap:16px; font-size:var(--rx-body); }
    .rx-vacancy-unit { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); }
    .rx-vacancy-unit .rec-unit { flex:1; min-width:0; }
    .rx-vacancy-desc { margin:0; color:var(--rx-text); font-size:.86rem; line-height:1.65; white-space:pre-line; }
    .rx-vacancy-facts { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin:0; }
    .rx-vacancy-facts > div { padding:10px 12px; border:1px solid var(--rx-line); border-radius:var(--rx-radius); }
    .rx-vacancy-facts dt { color:var(--rx-muted); font:600 var(--rx-label) var(--ag-mono); letter-spacing:.1em; text-transform:uppercase; }
    .rx-vacancy-facts dd { margin:3px 0 0; color:var(--rx-text); font-weight:600; }
    .rx-apply-form { display:flex; flex-direction:column; gap:10px; padding:16px; border:1px solid rgba(201,162,74,.5); border-radius:var(--rx-radius); background:linear-gradient(180deg, rgba(201,162,74,.08), transparent); }
    .rx-apply-form h3 { margin:0; color:var(--rx-gold-2); font-family:var(--ag-display); font-size:1.15rem; letter-spacing:.06em; text-transform:uppercase; }
    .rx-apply-done { display:flex; flex-direction:column; gap:12px; padding:18px; border:1px solid color-mix(in srgb, var(--rx-ok) 50%, transparent); border-radius:var(--rx-radius); background:color-mix(in srgb, var(--rx-ok) 7%, transparent); }
    .rx-apply-done h3 { display:flex; align-items:center; gap:8px; margin:0; color:var(--rx-ok); font-family:var(--ag-display); font-size:1.25rem; letter-spacing:.04em; }
    .rx-banner { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 14px; border:1px solid color-mix(in srgb, var(--rx-new) 55%, transparent); border-radius:var(--rx-radius); background:color-mix(in srgb, var(--rx-new) 8%, transparent); color:var(--rx-text); font-size:var(--rx-body); }

    /* ---- 12 · Career pages (my applications, invitations) ------------------------------------------------------------ */
    .rx-career { display:flex; flex-direction:column; gap:12px; max-width:1100px; }
    .rx-career-head { display:flex; align-items:center; gap:10px; margin:6px 0 0; color:var(--rx-text-2); font:600 .74rem var(--ag-mono); letter-spacing:.12em; text-transform:uppercase; }
    .rx-mine {
        display:flex; flex-direction:column; gap:14px; padding:16px; border:1px solid var(--rx-line); border-radius:var(--rx-radius);
        background:linear-gradient(180deg, var(--rx-panel-2), var(--rx-panel)); color:var(--rx-text); font-size:var(--rx-body);
    }
    .rx-mine.is-history { opacity:.88; }
    .rx-mine.is-target { box-shadow:0 0 0 2px var(--rx-gold); }
    .rx-mine:focus { outline:none; }
    .rx-mine-head { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:start; gap:12px; }
    .rx-mine-head .cg-insignia { width:44px; height:44px; }
    .rx-mine-head h3 { margin:0; color:#f2f5f7; font-family:var(--ag-display); font-size:1.3rem; font-weight:600; letter-spacing:.03em; }
    .rx-mine-head p { margin:3px 0 0; color:var(--rx-text-2); font-size:var(--rx-help); }
    .rx-next { display:flex; gap:10px; margin:0; padding:10px 12px; border-left:3px solid var(--tone, var(--rx-line-2)); background:rgba(255,255,255,.02); color:var(--rx-text); line-height:1.5; }
    .rx-next.is-new { --tone:var(--rx-new); }
    .rx-next.is-review { --tone:var(--rx-review); }
    .rx-next.is-short { --tone:var(--rx-short); }
    .rx-next.is-ok { --tone:var(--rx-ok); }
    .rx-next.is-bad { --tone:var(--rx-bad); }
    .rx-next b { color:var(--tone); }
    .rx-mine-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
    .rx-mine .ux-confirm { margin:0; }

    /* ---- 13 · Narrow screens -------------------------------------------------------------------------------------- */
    @media (max-width: 1400px) {
        .rx-search-adv { grid-template-columns:repeat(2, minmax(0, 1fr)); }

    }
    @media (max-width: 1180px) {
        .rx-editor { grid-template-columns:minmax(0, 1fr); }
        .rx-editor-preview { position:static; order:2; }
        .rx-split { grid-template-columns:minmax(300px, 360px) minmax(0, 1fr); }
    }
    @media (max-width: 900px) {
        .rx-scroll, .rx-list, .rx-detail { overflow:visible; }
        .rx-split { display:block; }
        .rx-split > .rx-detail { padding:14px; }
        .rx-vac-facts { grid-template-columns:repeat(2, minmax(0, 1fr)); }
        .rx-app-head { grid-template-columns:auto minmax(0, 1fr); }
        .rx-app-head > .rx-pill { grid-column:1 / -1; justify-self:start; }
        .rx-bar-note { flex-basis:100%; }
    }
    @media (max-width: 720px) {
        .rx-search-main { grid-template-columns:minmax(0, 1fr); }
        .rx-search-adv { grid-template-columns:minmax(0, 1fr); }
        .rx-field-row, .rx-choice { grid-template-columns:minmax(0, 1fr); }
        .rx-vacancy-facts { grid-template-columns:minmax(0, 1fr); }
        .rx-stepper .rx-step-text small { display:none; }
        .rx-step-text b { white-space:normal; font-size:.64rem; }
        .rx-stepper li { flex-direction:column; gap:4px; }
        .rx-stepper li::after { left:28px; }
        .rx-chips { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; max-width:100%; }
        .rx-chips::-webkit-scrollbar { display:none; }
        .rx-inline-field { width:100%; }
        .rx-inline-field .form-select { flex:1; min-width:0; }
        .rx-drawer-head, .rx-drawer-body, .rx-drawer-foot { padding-left:14px; padding-right:14px; }
        .rx-drawer-foot .btn { flex:1 1 auto; }
        .rx-drawer-foot .rx-grow { display:none; }
        .rx-decision-bar .btn { flex:1 1 auto; }
        .rx-decision-bar .rx-grow { display:none; }
        .rx-vac-actions .btn { flex:1 1 100%; }
        .rx-job-head { grid-template-columns:auto minmax(0, 1fr); }
        .rx-job-flags { grid-column:1 / -1; flex-direction:row; align-items:center; }
        .rx-job-foot .btn { flex:1 1 auto; }
        .rx-job-foot .rx-grow { display:none; }
        .rx-job-foot small { flex-basis:100%; }
        .rx-job-blocked { text-align:left; }
        .rx-mine-head { grid-template-columns:auto minmax(0, 1fr); }
        .rx-mine-head > .rx-pill { grid-column:1 / -1; justify-self:start; }
        .entity-page-header > .rx-kpis > button { min-width:0; flex:1 1 0; }
    }

    /* ---- 14 · Frame fixes and shared bits ------------------------------------------------------------------------- */
    /* The head and the tabs of a page never give way to the content below (it scrolls instead). */
    .entity-main-panel > :is(.entity-page-header, .cmd-view-tabs, .cmd-note, .alert) { flex-shrink:0; }
    /* A record window opened from a drawer (the unit's record) comes above it by itself: both are modal <dialog>s in the
       top layer, stacked in the order they open (FccDialog). */
    .rx-jobs-page { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:10px; }
    .rx-jobs-page > .ux-toolbar { flex:none; }
    .rx-jobs-geo { grid-column:span 2; }
    .rx-jobs-geo .rec-geo { display:grid; grid-template-columns:minmax(0, 1fr) 130px; gap:10px; }
    .rx-jobs-geo .rec-geo label { display:flex; flex-direction:column; gap:4px; margin:0; }
    .rx-jobs-geo .rec-geo label > span:first-child { color:var(--uc-label-dark); font-size:var(--uc-label-size); font-weight:var(--uc-label-weight); letter-spacing:var(--uc-label-tracking); text-transform:uppercase; }
    .rx-jobs-geo .rec-geo-search { display:grid; grid-template-columns:minmax(0, 1fr) 32px 32px; gap:4px; }
    .rx-jobs-geo .rec-geo-search .btn { padding:0; }
    .rx-jobs-geo .rec-geo label, .rx-jobs-geo .rec-geo-search, .rx-jobs-geo .rec-geo-search input, .rx-field.is-geo .rec-geo label, .rx-field.is-geo .rec-geo-search input { min-width:0; }
    .rx-jobs-check { justify-content:flex-start; }
    .rx-jobs-check .rx-switch { align-self:flex-start; }
    .rx-unit-card .rec-unit-text strong { color:#f2f5f7; font-family:var(--ag-display); font-size:1.15rem; letter-spacing:.03em; }
    .rx-unit-open { display:flex; align-items:center; gap:6px; margin:0; color:var(--rx-gold-2); font-size:var(--rx-body); font-weight:600; }
    .rx-profile-head > div:not(.rx-profile-actions) { flex:1; min-width:0; }
    .rx-profile-actions { display:flex; flex-direction:column; align-items:flex-end; gap:4px; max-width:260px; text-align:right; }
    .rx-detail .ux-state, .rx-list .ux-state { background:transparent; }
    .rx-app-meta { margin:0; color:var(--rx-muted) !important; font-size:var(--rx-help) !important; }
    /* "← List" of a narrow screen, dark like the panel (the shared one is paper). */
    .ux-split-back.rx-back { border:1px solid var(--rx-line-2); background:var(--rx-panel-2); color:var(--rx-text); }
    .rx-switch { max-width:100%; text-align:left; white-space:normal; line-height:1.25; }
    @media (max-width: 720px) {
        .rx-segment { display:flex; width:100%; }
        .rx-segment button { flex:1 1 0; justify-content:center; padding:0 8px; text-align:center; }
        .rx-field.is-geo .rec-geo { grid-template-columns:minmax(0, 1fr); }
        .rx-stepper { gap:2px; }
        .rx-stepper li { padding-right:2px; }
        .rx-step-text { padding-right:0; }
        .rx-step-text b { font-size:.6rem; letter-spacing:0; overflow-wrap:anywhere; hyphens:auto; }
    }
    @media (max-width: 900px) {
        .rx-jobs-page { display:block; }
        .rx-jobs-page > * + * { margin-top:10px; }
        .rx-jobs-geo { grid-column:auto; }
    }
}

