/* ==========================================================================
   Aira Helpdesk - brand overrides on top of UBold.
   Loaded after app.min.css so these win without !important.

   Only tokens and workflow-specific components belong here. Anything that is
   really a theme-wide change belongs in wwwroot/scss and a gulp rebuild -
   see .claude/docs/ubold-ui.md.
   ========================================================================== */

:root {
    /* Brand - carried over from the approved prototype. Mirrors wwwroot/scss/_aira-brand.scss,
       which is what the compiled theme derives --ins-primary from. */
    --aira-brand: #1b56a0;
    --aira-brand-600: #16467f;
    --aira-brand-400: #2a78d6;
    --aira-brand-100: #e7f0fb;
    --aira-brand-50: #f2f7fd;
    /* Ink on a brand fill - a pressed toggle, a primary button. White on the default navy; a colour
       picked in Settings gets whichever of white or #1f2937 reads better on it (BrandPalette). */
    --aira-brand-contrast: #ffffff;

    /* The sidebar (appearance.md §5.4). These are the navy rail under Aira Blue, exactly as AppearancePalette derives
       them - AppearanceStylesheetTests holds the two together; a colour saved under Settings -> Software -> Appearance
       restates them at runtime. Every ink is white or derived from white (R5): the hover is the brand, lifted, at the
       faintest strength that is both seen and read on; the titles are white at the faintest strength that reads 4.5:1.
       --aira-nav-bg is always a solid - it is also the rail's border colour, where a gradient paints nothing (T4);
       the fill is --aira-nav-paint. */
    --aira-nav-bg: #101a2d;
    --aira-nav-paint: var(--aira-nav-bg);
    --aira-nav-ink: #ffffff;
    --aira-nav-hover: rgba(107,145,193,0.16);
    --aira-nav-active-bg: var(--aira-brand);
    --aira-nav-active-ink: #ffffff;
    --aira-nav-title: rgba(255,255,255,0.55);
    --aira-nav-muted: rgba(255,255,255,0.55);
    --aira-nav-badge-bg: rgba(255,255,255,0.14);
    --aira-nav-badge-ink: #ffffff;
    --aira-nav-badge-active-bg: rgba(255,255,255,0.22);
    --aira-nav-line: rgba(255,255,255,0.08);
    --aira-nav-thumb: rgba(255,255,255,0.14);

    /* Where each typography area applies (appearance.md §5.6) - today's stack until Appearance gives one a face. The
       body and the headings use the theme's own --ins-font-sans-serif / --ins-font-family-secondary; these three areas
       have no theme variable, so they are hooked here and stay isolated when the body's font changes. */
    --aira-font-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --aira-font-sidebar: var(--aira-font-system);
    --aira-font-header: var(--aira-font-system);
    --aira-font-table: var(--aira-font-system);

    /* The rail, at the prototype's measurements. The theme ships 240 / 75; the prototype is
       258 / 74, and every inset below is derived from those two numbers.

       The one that matters is the icon: a 24px box, inside 12px of link padding, inside 12px
       of list inset - 12 + 12 + 12 = 36px, the centre of a 74px rail. That is the whole reason
       an icon does not move when the rail opens. Retune any of the three and all three have to
       be re-derived, or every icon slides sideways on hover. */
    --ins-sidenav-width: 258px;
    --ins-sidenav-width-sm: 74px;
    --ins-sidenav-item-font-size: 13.5px;
    --ins-sidenav-item-icon-size: 18px;
    --ins-sidenav-item-padding-x: 12px;
    --ins-sidenav-item-padding-y: 10px;
    --ins-sidenav-item-gap: 14px;
    --aira-sidenav-icon-box: 24px;
    --aira-sidenav-list-inset: 12px;

    /* The brand mark plus the head's padding. The scroll container is measured against this,
       not against --ins-topbar-height: the sidebar head and the topbar are two different
       boxes and the theme's own height calc conflates them. */
    --aira-sidenav-head-height: 75px;

    /* The pin row at the foot of the rail. The theme's scroll container claims the whole
       sidebar below the logo, so this height has to be subtracted from it - see below. Zero
       by default: only the two hover sizes have a footer at all. */
    --aira-sidenav-footer-height: 0px;

    /* ----------------------------------------------------------------------
       Above every dialog, however deep the stack.

       The theme puts a dialog at 1055 and a backdrop at 1050, and app/js/aira-modals.js
       raises each STACKED dialog by 20 with its backdrop between - because Bootstrap 5 gives
       every modal the same z-index and leaves the one underneath live and undimmed. The
       deepest chain the product can open is five (report -> complaints behind a figure -> one
       complaint -> a gate -> the code boxes), so the stack tops out at 1135.

       An enhanced select's panel opens FROM inside a dialog and a refused save has to be
       readable without closing one, so both have to clear the whole stack. They were at the
       theme's 1080 / 1090, which was only ever right for a dialog with nothing on top of it -
       the third dialog in a chain would have covered both. Nothing in this product renders a
       Bootstrap tooltip or popover, so 1070-1135 is unoccupied.

       A confirmation (SweetAlert2, at its own 1060) is a question about whatever is on screen,
       so it clears the stack and the panels - which are inert behind it anyway - and stays
       under the toaster, so an outcome is never hidden by the question that produced it.
       ---------------------------------------------------------------------- */
    --aira-z-panel: 1200;
    --aira-z-alert: 1205;
    --aira-z-toast: 1210;

    /* The search bar's panel (app/js/aira-search-bar.js). Above the dialog stack's 1135
       ceiling, so a bar inside the drill dialog opens over it - and BELOW the select and
       multi-select lists at 1200, because those open FROM the panel and must land on top of
       it. Any other value is either under a dialog or over its own lists. */
    --aira-z-searchpanel: 1190;

    /* The app full screen's frame (app/js/aira-fullscreen.js), over the whole host page. The top of
       the scale: in full screen the browser's top layer holds it anyway, and out of it - the frame
       kept as an overlay - nothing the host could draw should show through. */
    --aira-z-app-frame: 1220;

    /* Stage colours. One source of truth: the Kanban column heads, the stage
       chips in the ticket list and the dashboard funnel all read these, so a
       stage never appears in two different colours on two screens. */
    --stage-draft: #8b94a3;
    --stage-ccp: #eda100;
    --stage-assign: #eb6834;
    --stage-cdp: #e87ba4;
    --stage-prog: #2a78d6;
    --stage-hold: #4a3aa7;
    --stage-solved: #1baf7a;
    --stage-mktconf: #9c6ade;
    --stage-ca: #008300;
    --stage-qc: #e34948;
    --stage-closed: #56606f;

    /* The KPI strip's own palette, at the approved design's numbers.

       A tile is not always one stage - Pending is two, Solved is two, Total is every open
       stage - so it cannot simply borrow --stage-*. It is declared here rather than in C#
       because a colour in C# is a colour dark mode cannot reach: a tile spine at #008300 on
       a dark card is the same smudge a chart fill would be. */
    --kpi-draft: #8b94a3;
    --kpi-total: #2a78d6;
    --kpi-pending: #eda100;
    --kpi-prog: #eb6834;
    --kpi-hold: #4a3aa7;
    --kpi-solved: #1baf7a;
    --kpi-ca: #008300;
    --kpi-qc: #e34948;
    --kpi-closed: #56606f;
    --kpi-sla: #0ca30c;

    --kpi-cost-total: #008300;
    --kpi-cost-average: #2a78d6;
    --kpi-cost-chargeable: #eda100;
    --kpi-cost-absorbed: #e34948;
    --kpi-cost-undecided: #8b94a3;

    /* The chart palette, one hue per card, at the prototype's numbers.

       The prototype draws every bar in a card in ONE colour and reserves the eight-colour
       series list for charts whose slices are categories - a donut. Ours drew every bar in a
       different colour, which says "these seven products are seven kinds of thing" when the
       only thing that differs is the count. Tokens rather than hexes in JS for the same
       reason --kpi-* is: a hex in JS is a colour dark mode cannot reach. */
    --chart-product: #2a78d6;
    --chart-customer: #eb6834;
    --chart-received: #4a3aa7;
    --chart-division: #e87ba4;
    --chart-caction: #1baf7a;
    --chart-cost: #008300;
    --chart-trend: #2a78d6;

    /* The helpdesk's four departments, as a chart series - unused since Phase 2, until the CRM's departments
       (WP3.1) take or drop them:
       Marketing, Customer Care, Complaint Department, Quality Control. Four hues no stage uses -
       teal, plum, brown, olive - because a department chart beside a stage chart must not read
       as the same thing, and every stage hue is already taken. */
    --dept-1: #0f9d9a;
    --dept-2: #b0328f;
    --dept-3: #8c5a3c;
    --dept-4: #6b8e23;

    /* The ageing stack and the SLA gauge. The gauge's three are the prototype's own status
       hues, which are not the same as the ageing stack's - a breach is not a stale ticket. */
    --chart-age-fresh: #1baf7a;
    --chart-age-ageing: #eda100;
    --chart-age-stale: #e34948;
    --chart-good: #0ca30c;
    --chart-warn: #fab219;
    --chart-crit: #d03b3b;

    /* The notification Overview's outcomes (notification-overview.md, OV12), stacked in this order.
       Validated with the dataviz script in both modes: green Delivered beside red Failed was
       deutan dE 4.1, and red beside amber fails in dark - so the blue bulk sits between them. */
    --chart-failed: #e34948;
    --chart-delivered: #2a78d6;
    --chart-notsent: #eda100;

    /* Chart chrome. The theme paints axis text at --ins-secondary-color and gridlines dashed;
       the prototype's are #8b94a3 solid, with printed values a full step darker than the
       ticks so a figure reads before its axis does. */
    --chart-grid: #e9edf3;
    --chart-axis: #c9d1dd;
    --chart-tick: #8b94a3;
    --chart-dlab: #56606f;
    /* A tooltip's ground. White on the white card: its edge and shadow set it apart. */
    --chart-tip-bg: #ffffff;

    /* The complaint calendar's ramp - the approved design's own six steps, one per legend
       swatch, so the legend is a key a cell can be looked up in rather than a gradient the
       reader has to interpolate against the card behind it.

       The ramp is the BRAND's, which is also the prototype's: --aira-brand-400 at step 4 and
       --aira-brand at step 5, with three tints under them. It was orange for a while, which
       made the one card that is nothing but colour the one card that did not look like this
       product - and orange is already the Assign lens and the customer bars, so a busy day
       read as a stage. Hexes rather than var(--aira-brand-*): three steps are tints the brand
       scale has no token for, and stating half a ramp by reference is how it stops being
       evenly spaced.

       Six and not seven: a seventh hue introduced in a pass whose whole purpose is fidelity
       to the approved design would contradict the thing it is doing. A calendar cell carries
       a count, never a stage, so the blue is read against the legend beside it.

       Each step carries its own ink. Deciding it at runtime would need a luminance
       calculation in JS - and JS is exactly what cannot re-run here: app.js's theme observer
       repaints ApexCharts instances and nothing else, so a DOM calendar keeps whatever
       colour it was painted with, for ever, after a switch to dark mode. */
    --aira-heat-0: #eef3fb;
    --aira-heat-1: #cde2fb;
    --aira-heat-2: #9ec5f4;
    --aira-heat-3: #5598e7;
    --aira-heat-4: #2a78d6;
    --aira-heat-5: #1b56a0;
    --aira-heat-ink-0: #8b94a3;
    --aira-heat-ink-1: #17406e;
    --aira-heat-ink-2: #123659;
    --aira-heat-ink-3: #0c2a49;
    --aira-heat-ink-4: #ffffff;
    --aira-heat-ink-5: #ffffff;
    --aira-heat-ring: rgba(42, 120, 214, .45);

    /* The prototype's ink, rules and shadows, as semantic tokens.

       These are not a second copy of the --ins-* palette. They are the values UBold has no
       equivalent for, plus the two planes the board needs. --aira-ink-2 is the one that
       mattered most: the theme has body ink and one muted grey; the prototype has three -
       body ink, a *readable* secondary for card descriptions and table sub-text, and a
       genuinely muted grey. Collapsing the middle one onto --ins-secondary-color is what
       made every board card read as disabled. */
    --aira-ink: #131a26;
    --aira-ink-2: #56606f;

    /* A form's label (crm/63 §5) - the owner's "proper black", and white in dark mode. Read by the compiled .form-label. */
    --aira-label-ink: #000;

    /* A transaction form's section head and the item editor's ground (crm/63 §4-§5): the brand - a runtime setting - over the card. */
    --aira-section-head-bg: color-mix(in srgb, var(--ins-primary) 15%, var(--ins-secondary-bg));
    --aira-section-head-rule: color-mix(in srgb, var(--ins-primary) 32%, var(--ins-secondary-bg));
    --aira-qf-editor-bg: color-mix(in srgb, var(--ins-primary) 4%, var(--ins-secondary-bg));
    --aira-qf-editor-head-bg: color-mix(in srgb, var(--ins-primary) 12%, var(--ins-secondary-bg));

    /* Every list's options (crm/96 §1): the one under the pointer or the arrows, and the current choice - the brand, a runtime
       setting, never the theme's grey, which barely moved. Translucent, so each list's own ground shows through; built from the
       family BrandPalette restates, so a colour saved in Settings repaints every list. Read by .dropdown-menu's own variables
       and by every list the product draws (the block after *Refused controls*). */
    --aira-option-hover-bg: color-mix(in srgb, var(--aira-brand-400) 12%, transparent);
    --aira-option-hover-ink: var(--aira-brand-600);
    --aira-option-current-bg: color-mix(in srgb, var(--aira-brand-400) 16%, transparent);
    --aira-option-current-ink: var(--aira-brand-600);
    --aira-option-current-mark: var(--ins-primary);
    --aira-muted: #8b94a3;
    --aira-line: #e5e9f0;
    --aira-line-2: #d6dce6;
    --aira-surface-2: #f8fafc;

    /* The board's ground. It has to be a clear step darker than the page, or the white cards
       on it have nothing to sit on and the whole board reads as one flat sheet. */
    --aira-board-bg: #eef1f6;

    /* Crisp and close. UBold's card shadow is `0 12px 96px rgba(56,65,74,.03)` - a 96px blur
       at 3% opacity, which is not a shadow, it is a rumour. */
    --aira-shadow-1: 0 1px 2px rgba(19, 26, 38, .06), 0 1px 3px rgba(19, 26, 38, .04);
    --aira-shadow-2: 0 4px 16px rgba(19, 26, 38, .10), 0 1px 3px rgba(19, 26, 38, .06);
}

/* The same set in dark mode. A hard-coded #eef1f6 board ground would be a white slab in the
   middle of a dark page, and every card on it unreadable. */
html[data-bs-theme="dark"] {
    --aira-ink: #e4e8ee;
    --aira-ink-2: #aab8c5;
    --aira-label-ink: #fff;
    --aira-section-head-bg: color-mix(in srgb, var(--ins-primary) 28%, var(--ins-secondary-bg));
    --aira-section-head-rule: color-mix(in srgb, var(--ins-primary) 50%, var(--ins-secondary-bg));
    --aira-qf-editor-bg: color-mix(in srgb, var(--ins-primary) 8%, var(--ins-secondary-bg));
    --aira-qf-editor-head-bg: color-mix(in srgb, var(--ins-primary) 22%, var(--ins-secondary-bg));
    /* The brand's dark ink would vanish on a dark list: a light tint of it, readable on the dark ground for any brand. */
    --aira-option-hover-bg: color-mix(in srgb, var(--aira-brand-400) 22%, transparent);
    --aira-option-hover-ink: color-mix(in srgb, var(--aira-brand-400) 45%, #fff);
    --aira-option-current-bg: color-mix(in srgb, var(--aira-brand-400) 28%, transparent);
    --aira-option-current-ink: color-mix(in srgb, var(--aira-brand-400) 45%, #fff);
    --aira-option-current-mark: var(--aira-brand-400);
    --aira-muted: #8391a2;
    --aira-line: #293036;
    --aira-line-2: #333b42;
    --aira-surface-2: #1e1f27;
    --aira-board-bg: #1b1c24;
    --aira-shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --aira-shadow-2: 0 4px 16px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);

    /* The stage palette, lifted for dark mode.

       The chips got away without this: they render their stage colour at 12% alpha through
       color-mix, so any hex survives behind them. A CHART does not - it fills a whole donut
       ring or column with the flat colour, and #008300 and #56606f on a #1b1c24 card are two
       barely-distinguishable dark smudges. These are the same hues lifted in luminance until
       they read as themselves against a dark ground, which keeps the board, the chip and the
       chart agreeing about which stage is which without any of them being unreadable. */
    --stage-draft: #a5adba;
    --stage-ccp: #f5b731;
    --stage-assign: #ff8355;
    --stage-cdp: #f294b6;
    --stage-prog: #529ff0;
    --stage-hold: #7d6ce0;
    --stage-solved: #2fd39a;
    --stage-mktconf: #b58bf0;
    --stage-ca: #21ab53;
    --stage-qc: #ff6f6e;
    --stage-closed: #8c98a8;

    /* The KPI palette lifted the same way, and for the same reason: the spine is a solid
       3px bar, so the hue has to carry at full saturation against a dark card. */
    --kpi-draft: #a5adba;
    --kpi-total: #529ff0;
    --kpi-pending: #f5b731;
    --kpi-prog: #ff8355;
    --kpi-hold: #7d6ce0;
    --kpi-solved: #2fd39a;
    --kpi-ca: #21ab53;
    --kpi-qc: #ff6f6e;
    --kpi-closed: #8c98a8;
    --kpi-sla: #2ecc57;

    --kpi-cost-total: #21ab53;
    --kpi-cost-average: #529ff0;
    --kpi-cost-chargeable: #f5b731;
    --kpi-cost-absorbed: #ff6f6e;
    --kpi-cost-undecided: #a5adba;

    /* The chart palette lifted the same way. A bar is a solid fill, so the hue has to carry
       at full saturation against a dark card - #008300 on #1b1c24 is a smudge. */
    --chart-product: #529ff0;
    --chart-customer: #ff8355;
    --chart-received: #8e7ef0;
    --chart-division: #f294b6;
    --chart-caction: #2fd39a;
    --chart-cost: #21ab53;
    --chart-trend: #529ff0;

    --dept-1: #2cc4c0;
    --dept-2: #d95cb6;
    --dept-3: #b98363;
    --dept-4: #97bd4a;

    --chart-age-fresh: #2fd39a;
    --chart-age-ageing: #f5b731;
    --chart-age-stale: #ff6f6e;
    --chart-good: #2ecc57;
    --chart-warn: #f5b731;
    --chart-crit: #ff6f6e;

    --chart-failed: #e66767;
    --chart-delivered: #3987e5;
    --chart-notsent: #c98500;

    --chart-grid: #2b313a;
    --chart-axis: #3a424c;
    --chart-tick: #8391a2;
    --chart-dlab: #aab8c5;
    /* A step up from the card (#1e1f27). The theme's own tooltip ground is the card's colour, so
       in dark mode a tooltip had no surface of its own - only a hairline said where it began. */
    --chart-tip-bg: #2a2c37;

    /* The ramp inverted in luminance, not faded in opacity. An opacity ramp on a dark card
       collapses towards the ground under it and the quiet days stop being readable at all,
       which is the half of the calendar that carries "nothing much happened". The top two
       steps are the lightest ones here, so theirs are the dark inks. */
    --aira-heat-0: #232630;
    --aira-heat-1: #16324f;
    --aira-heat-2: #1e4d80;
    --aira-heat-3: #2a6fbf;
    --aira-heat-4: #4e97ea;
    --aira-heat-5: #8dbcf5;
    --aira-heat-ink-0: #6b7684;
    --aira-heat-ink-1: #9cc0e8;
    --aira-heat-ink-2: #d3e4f8;
    --aira-heat-ink-3: #ffffff;
    --aira-heat-ink-4: #0a2743;
    --aira-heat-ink-5: #0a2743;
    --aira-heat-ring: rgba(141, 188, 245, .5);
}

/* The option's ink for ANY brand Settings allows (crm/96 §1): a pale brand - a yellow - printed as text on its own tint is
   unreadable, so the ink is the brand held to OKLCH lightness 0.45 at most in light mode and 0.80 at least in dark. The default
   navy is under the cap already and comes out unchanged. Only where the browser has relative colour: a custom property holding
   an unsupported `oklch(from …)` is not dropped at parse, it fails where it is read and the ink falls to `unset` (crm/96 T1). */
@supports (color: oklch(from red min(l, 0.45) c h)) {
    :root {
        --aira-option-hover-ink: oklch(from var(--aira-brand-600) min(l, 0.45) c h);
        --aira-option-current-ink: oklch(from var(--aira-brand-600) min(l, 0.45) c h);
    }

    html[data-bs-theme="dark"] {
        --aira-option-hover-ink: oklch(from var(--aira-brand-400) max(l, 0.8) c h);
        --aira-option-current-ink: oklch(from var(--aira-brand-400) max(l, 0.8) c h);
    }
}

/* --------------------------------------------------------------------------
   The light palette, corrected to the approved design.

   UBold's light theme is a full stop paler than the prototype: body text at #4c4c5c, muted at
   #9ba6b7, `--ins-emphasis-color` at 75% opacity - *lighter* than the body colour it is
   supposed to emphasise - and the card shadow above. On screen that reads as a greyed-out
   build rather than a calm one; headings look disabled and nothing separates a card from the
   panel under it.

   Scoped to `html:not([data-bs-theme="dark"])` on purpose, and this is the trap: the theme
   declares its light values on bare `:root` and its dark ones on `[data-bs-theme="dark"]`,
   both (0,1,0). aira.css loads last, so a plain `:root` block here would also outrank the
   DARK block and repaint dark mode in light ink. The :not() takes it to (0,1,1), which beats
   the light declarations and never applies in dark mode.
   -------------------------------------------------------------------------- */
html:not([data-bs-theme="dark"]) {
    --ins-body-color: var(--aira-ink);
    --ins-body-color-rgb: 19, 26, 38;
    --ins-emphasis-color: var(--aira-ink);
    --ins-emphasis-color-rgb: 19, 26, 38;

    --ins-secondary-color: var(--aira-muted);
    --ins-secondary-color-rgb: 139, 148, 163;

    --ins-body-bg: #f3f5f9;
    --ins-body-bg-rgb: 243, 245, 249;
    --ins-border-color: var(--aira-line);

    /* Also --ins-theme-card-box-shadow, so every .card in the product gains an edge. */
    --ins-box-shadow-sm: var(--aira-shadow-1);
}

/* UBold renames Bootstrap's CSS-variable prefix from `bs` to `ins`: the theme defines
   --ins-primary, --ins-border-color and so on, and defines no --bs-* variable at all. The
   [data-bs-theme] *selector* is unchanged, which is what makes the rename easy to miss -
   var(--bs-success) simply resolves to nothing and the colour silently falls back.
   Everything below reads --ins-*. See .claude/docs/ubold-ui.md.

   The brand itself is NOT set here. --ins-primary is compiled from $aira-brand in
   wwwroot/scss/_aira-brand.scss, so every button, link, focus ring, badge and table accent
   derives from one value rather than being patched component by component. Restating it
   here would give the brand two sources of truth. */

/* --------------------------------------------------------------------------
   Keyboard focus - which the product had none of, anywhere.

   THE THEME ERASES IT TWICE OVER, and neither one is visible from the source:

     * `a, button { outline: none !important }` - one blanket rule in app.min.css that takes
       the ring off every link and every button there is. It carries `!important`, so it also
       beat the rings THIS file already declared: the timeline's own
       `.tl-filter:focus-visible { outline: 2px solid var(--ins-primary) }` matched, lost, and
       has painted nothing for as long as it has existed.

     * `$btn-focus-width`, `$form-select-focus-width` and `$form-check-focus-width` are all
       compiled to zero, so `--ins-btn-focus-box-shadow` is `0 0 0 0 rgba(...)` - a ring with
       no spread. The rule fires and draws nothing. `--ins-btn-close-focus-shadow` and
       `--ins-accordion-btn-focus-box-shadow` are outright `none`, `.nav-link:focus-visible`
       is another zero, and SweetAlert2's own ring dies on `.swal2-styled:focus { box-shadow:
       none }`.

   The net of it was that a `.form-control` was the ONLY control in the product that said
   anything when the keyboard reached it. Every button, every link, every select, checkbox,
   switch and tab - and both buttons of "Discard your changes?" - took focus, held the
   keyboard and answered Enter with nothing on screen saying which one was live. Read out of
   Chrome with CSS.getMatchedStylesForNode rather than off the source, because a rule that
   matches and draws nothing looks exactly like a rule that works.

   So: one ring, declared once, for everything that takes focus. The `!important` on the
   outline is not a shortcut - it is the only thing that beats an `!important` in a file
   rule 10 forbids editing.

   TWO LANGUAGES, on purpose, and both are ones the theme already speaks:

     * a FIELD glows - the brand border and the soft halo `.form-control:focus` has always
       drawn. Selects, checkboxes and switches simply never did; now they match the text box
       beside them instead of growing a second look for the same state.
     * an ACTION is ringed - 2px of the brand, held 2px off the control so the gap shows the
       ground behind it and the ring reads against a filled button as well as a bare one.

   Tuning it: set `--aira-focus-ring-offset` on the component (negative to sit the ring
   inside, which is what a row reaching its container's edge needs). Never restate the
   `outline` - it loses to the `!important` above, which is the whole point of it.
   -------------------------------------------------------------------------- */

:root {
    --aira-focus-ring-width: 2px;
    --aira-focus-ring-offset: 2px;
    --aira-focus-ring-color: var(--ins-primary);
}

/* The brand does not move in dark mode - BrandPalette keeps --ins-primary and lifts the
   readable derivations around it - so a navy ring on a near-black panel is a ring nobody
   sees. --ins-primary-text-emphasis is the theme's own "this brand, against this ground",
   and it follows the colour picked under Settings in both modes. */
html[data-bs-theme="dark"] {
    --aira-focus-ring-color: var(--ins-primary-text-emphasis);
}

/* Windows High Contrast throws every author colour away, the ring's included. Highlight is
   the system's own focus colour and is the one value guaranteed to contrast with whatever it
   replaced them with. */
@media (forced-colors: active) {
    :root {
        --aira-focus-ring-color: Highlight;
    }
}

/* Where the ring sits, at the lowest specificity there is, so a component that needs it
   somewhere else wins with one declaration rather than having to out-shout the rule below.
   `outline` is a shorthand for colour, style and width only - it does not reset the offset. */
:focus-visible {
    outline-offset: var(--aira-focus-ring-offset);
}

/* An action: everything that takes focus and is not a field. The two enhanced selects are
   `<button class="form-select">` and are excluded here on purpose - they are fields, they
   stand where a native select stood, and they glow with the rest of the form below. */
a:focus-visible,
button:not(.form-select):not(.form-control):focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
.btn-check:focus-visible + .btn,
/* A checkbox, a radio and a switch are 1em square. The border going navy carries the state on
   a 35px field and does not carry it here - there is not enough of the control to see it change
   - so the small controls take the ring as well as the glow. Keyboard only: a click on a
   checkbox is aimed, and the box it lands in does not need pointing at. */
.form-check-input:focus-visible {
    outline: var(--aira-focus-ring-width) solid var(--aira-focus-ring-color) !important;
}

/* The shell's dark surfaces. Everywhere else the brand rings against a near-white page at
   6.7:1 or, in dark mode, at 5.6:1 - comfortably past the 3:1 a focus indicator owes its
   surroundings. The rail is the exception, and twice over: navy on the rail's own ground is
   2.4:1, and the ACTIVE item's pill is the brand itself, so the ring would be the same colour
   as the thing it rings. White is 17:1 on the rail and 7.3:1 on that pill. Measured, not
   judged by eye - a dim ring looks like a design choice in a screenshot.

   The rail is dark in both colour modes (`data-menu-color="dark"` from _Layout), so this
   follows the attribute rather than the theme. */
html[data-menu-color="dark"] .sidenav-menu,
html[data-topbar-color="dark"] .topbar {
    --aira-focus-ring-color: #ffffff;
}

/* Rows that reach their container's edge. A ring held outside one is a ring the menu's own
   rounding and overflow clip away, so these wear it inside. */
.dropdown-item,
.list-group-item-action,
.aira-bell-item,
.aira-bell-link,
.aira-sel-opt,
.aira-ms-opt {
    --aira-focus-ring-offset: -2px;
}

/* A field. Restated at the theme's own specificity, which is all it takes - aira.css loads
   last. Only the two compiled-to-zero rings are touched; `.form-control:focus` already draws
   exactly this and is left alone, so the three controls finally agree. */
.form-select:focus,
.form-check-input:focus {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px var(--ins-primary-bg-subtle);
}

/* The question over everything - Aira.confirm, and every Swal.fire behind it.

   Its buttons ring on plain `:focus`, and they are the only controls in the product that do.
   A question is answered with Enter, so which button Enter presses has to be on screen from
   the moment it opens - and SweetAlert2 puts focus on that button ITSELF, programmatically,
   which is precisely the move Chrome decides is not `:focus-visible`. Waiting for
   `:focus-visible` means the default answer is invisible until the operator has already
   pressed a key to go looking for it.

   They can afford it: the question is gone the moment either button is pressed, so a ring
   left behind by a mouse click has nothing to linger on.

   (0,3,0) against the theme's `.swal2-styled:focus { box-shadow: none }` at (0,2,0). The
   `!important` is for the same `a, button` rule as everywhere else. */
.swal2-actions .swal2-styled:focus,
.swal2-popup .swal2-close:focus-visible {
    outline: var(--aira-focus-ring-width) solid var(--aira-focus-ring-color) !important;
    outline-offset: var(--aira-focus-ring-offset);
}

/* --------------------------------------------------------------------------
   Refused controls - Aira.refuse in app/js/aira.js (ubold-ui.md, *Refused controls*).

   The theme's disabled look without the theme's `pointer-events: none`, which took the cursor,
   the hover and the reason's tooltip with it - so a refusal whose sentence the code had written
   carefully showed nobody anything. The control keeps its focus, so the ring above still marks
   it and a keyboard user learns why too.
   -------------------------------------------------------------------------- */
.is-refused[aria-disabled="true"] { cursor: not-allowed; }

.btn.is-refused[aria-disabled="true"],
.btn.is-refused[aria-disabled="true"]:hover {
    color: var(--ins-btn-disabled-color);
    background-color: var(--ins-btn-disabled-bg);
    border-color: var(--ins-btn-disabled-border-color);
    opacity: var(--ins-btn-disabled-opacity);
    box-shadow: none;
}

.dropdown-item.is-refused[aria-disabled="true"],
.dropdown-item.is-refused[aria-disabled="true"]:hover {
    color: var(--ins-dropdown-link-disabled-color);
    background-color: transparent;
}

/* --------------------------------------------------------------------------
   Every list's options (crm/96 §1) - one hover and one current choice, in the brand, for every list in the product.

   Bootstrap's dropdowns through their own variables (the theme compiled both to the grey --ins-tertiary-bg, which barely
   moved); the product's own lists by name further down, each where it is declared. The current choice is a stronger tint
   with a mark at its start - never a solid fill, which in a long list reads as one selection of many. A refused item keeps
   no hover (the rule above outranks these), and a destructive one hovers in its own colour, never the brand behind red words.
   -------------------------------------------------------------------------- */
.dropdown-menu {
    --ins-dropdown-link-hover-bg: var(--aira-option-hover-bg);
    --ins-dropdown-link-hover-color: var(--aira-option-hover-ink);
    --ins-dropdown-link-active-bg: var(--aira-option-current-bg);
    --ins-dropdown-link-active-color: var(--aira-option-current-ink);
}

.dropdown-item.active {
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--aira-option-current-mark);
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background-color: color-mix(in srgb, var(--ins-danger) 10%, transparent);
}

/* The sentence under the pointer, with the ban sign before it; wider than Bootstrap's 200px so a
   reason reads as a line rather than a column. */
.aira-refuse-tooltip { --ins-tooltip-max-width: 18rem; }
.aira-refuse-tip { display: inline-flex; align-items: flex-start; gap: .375rem; text-align: left; }
.aira-refuse-icon { flex: 0 0 auto; margin-top: .2em; }

/* --------------------------------------------------------------------------
   Toggles - every segmented control: a workspace's view switch, the Graph's types, modes and
   order, the Pivot's Heat, the inbox's All / Unread, the audit log's view (ubold-ui.md, *Toggles*).

   Pressed is the brand, filled, with ink that reads on it whatever colour Settings holds
   (--aira-brand-contrast, BrandPalette). It supersedes T42's outline-secondary, whose pressed
   grey-blue was not the software's colour, and keeps T42's reason: pressed reads MORE pressed than
   rest, never paler. aria-pressed is the only state - no .active, which the theme paints on its own.
   Toolbar controls, so they carry -sm (hard rule 10a); the focus ring is the central one (10c).
   -------------------------------------------------------------------------- */
.aira-toggle {
    --ins-btn-color: var(--ins-body-color);
    --ins-btn-bg: transparent;
    --ins-btn-border-color: var(--ins-border-color);
    --ins-btn-hover-color: var(--ins-emphasis-color);
    --ins-btn-hover-bg: color-mix(in srgb, var(--aira-brand-400) 9%, transparent);
    --ins-btn-hover-border-color: var(--ins-border-color);
    --ins-btn-active-color: var(--ins-emphasis-color);
    --ins-btn-active-bg: color-mix(in srgb, var(--aira-brand-400) 16%, transparent);
    --ins-btn-active-border-color: var(--ins-border-color);
    --ins-btn-disabled-color: var(--ins-body-color);
    --ins-btn-disabled-bg: transparent;
    --ins-btn-disabled-border-color: var(--ins-border-color);
}

/* Variables only: the theme's .btn, :hover, :active and :focus-visible read these, so every state
   of a pressed toggle is the brand without restating a property. A toggle that is one of a set of exclusive
   choices is a radio (Settings -> Appearance's header modes) - its state is aria-checked, never aria-pressed. */
.aira-toggle[aria-pressed="true"],
.aira-toggle[role="radio"][aria-checked="true"] {
    --ins-btn-color: var(--aira-brand-contrast);
    --ins-btn-bg: var(--ins-primary);
    --ins-btn-border-color: var(--ins-primary);
    --ins-btn-hover-color: var(--aira-brand-contrast);
    --ins-btn-hover-bg: var(--aira-brand-600);
    --ins-btn-hover-border-color: var(--aira-brand-600);
    --ins-btn-active-color: var(--aira-brand-contrast);
    --ins-btn-active-bg: var(--aira-brand-600);
    --ins-btn-active-border-color: var(--aira-brand-600);
    --ins-btn-disabled-color: var(--aira-brand-contrast);
    --ins-btn-disabled-bg: var(--ins-primary);
    --ins-btn-disabled-border-color: var(--ins-primary);
}

/* A gradient brand (appearance.md §5.3) paints a CLOSED list of fills: primary buttons, pressed toggles, the rail's
   current row, the brand tile and the Settings menu's chosen row - never a card, a table, text or a badge. The paints
   are `none` until Appearance chooses a gradient, so a solid brand draws exactly as before; the hover and the press
   darken the gradient with a layer over it rather than swapping it for a colour. The ink is still
   --aira-brand-contrast, which a save only allows when both stops carry it. */
.btn-primary,
.aira-toggle[aria-pressed="true"],
.aira-toggle[role="radio"][aria-checked="true"] {
    background-image: var(--aira-brand-paint-image, none);
}

.btn-primary:hover,
.aira-toggle[aria-pressed="true"]:hover,
.aira-toggle[role="radio"][aria-checked="true"]:hover {
    background-image: var(--aira-brand-paint-hover, none);
}

.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary,
.show > .btn-primary.dropdown-toggle {
    background-image: var(--aira-brand-paint-active, none);
}

/* --------------------------------------------------------------------------
   The sidebar, in the prototype's navy. These are only custom properties, so
   they belong here rather than in the SCSS - no rebuild needed to retune them.
   `data-menu-color="dark"` is set on <html> by _Layout.
   -------------------------------------------------------------------------- */
html[data-menu-color="dark"],
/* The theme collapses dark, gray and light into one shared block in dark colour mode:
   `html[data-bs-theme="dark"][data-menu-color="dark"]`. That selector outranks a plain
   `html[data-menu-color="dark"]` however late this file loads, so the rail silently stops
   being navy the moment somebody switches to dark mode. Stated at both specificities.
   See .claude/docs/ubold-layout.md. */
html[data-bs-theme="dark"][data-menu-color="dark"] {
    /* The fill may be a gradient (Appearance); the border may not - it reads the solid (T4). */
    --ins-sidenav-bg: var(--aira-nav-paint);
    --ins-sidenav-border-color: var(--aira-nav-bg);
    --ins-sidenav-item-color: var(--aira-nav-ink);
    --ins-sidenav-item-hover-color: var(--aira-nav-ink);
    /* A row under the pointer takes a tint of the brand (R5) - translucent, so it lifts whichever part of a
       gradient rail it sits on. */
    --ins-sidenav-item-hover-bg: var(--aira-nav-hover);
    --ins-sidenav-item-active-color: var(--aira-nav-active-ink);
    /* The active item is the brand, not a darker shade of the bar - it is the only
       thing on the sidebar that has to be findable at a glance. Where the brand is the
       rail's own colour, Appearance swaps it for a lift and a bar (§5.4). */
    --ins-sidenav-item-active-bg: var(--aira-nav-active-bg);
}

html[data-menu-color="dark"] .side-nav-title {
    color: var(--aira-nav-title);
}

/* A row under the pointer - or reached by the keyboard - takes the brand-lifted hover (R5). The theme declares
   --ins-sidenav-item-hover-bg and reads it nowhere: a hovered row only turned its text white (appearance.md T21).
   Not the current row, which keeps its own fill, and not the condensed rail, where the theme draws a hovered row as
   a flyout over the page and a translucent fill would show the page through it. */
html[data-menu-color="dark"]:not([data-sidenav-size="condensed"]) .side-nav .side-nav-item:not(.active) > .side-nav-link:hover,
html[data-menu-color="dark"]:not([data-sidenav-size="condensed"]) .side-nav .side-nav-item:not(.active) > .side-nav-link:focus-visible {
    background-color: var(--ins-sidenav-item-hover-bg);
}

/* The rail's sub-boxes repaint --ins-sidenav-bg - the condensed head, a flyout, the hovered flyout label, the pin's
   footer. On a gradient each would restart it and show a seam (T5): painted against the window instead, rail and boxes
   share one gradient. A solid rail is unchanged by it. iOS Safari ignores `fixed`, and a faint seam there is accepted. */
.sidenav-menu,
html[data-sidenav-size="condensed"] .sidenav-menu .side-nav .side-nav-item .collapse .sub-menu,
html[data-sidenav-size="condensed"] .sidenav-menu .side-nav .side-nav-item .collapsing .sub-menu,
html[data-sidenav-size="condensed"] .sidenav-menu .side-nav > .side-nav-item:hover > .side-nav-link {
    background-attachment: fixed;
}

/* The sidebar's typography area (appearance.md §5.6). The theme draws its rows in the headings' font
   (--ins-font-family-secondary), so the rows are hooked as well as the rail - a heading font must not reach the menu. */
.sidenav-menu,
.side-nav .side-nav-item .side-nav-link {
    font-family: var(--aira-font-sidebar);
}

/* The prototype's section labels are wider-tracked than the theme's, and sit tighter to the
   group they head than the theme's symmetrical 10px. */
.side-nav .side-nav-title {
    letter-spacing: .18em;
    padding: 16px 24px 7px;
    /* Tracked for the open rail, so it is far wider than 74px. Without its own clip the
       overflow reaches SimpleBar's scrollWidth and the collapsed menu becomes scrollable
       sideways - invisibly, because the theme paints that track transparent. */
    overflow: hidden;
}

/* The prototype weights the current page. Matches the theme's own
   `.side-nav > .side-nav-item.active > a`, which is where the class has to live. */
html[data-menu-color="dark"] .side-nav > .side-nav-item.active > .side-nav-link {
    font-weight: 600;
    /* A gradient brand paints the current row too; where the brand cannot be told from the rail, a 3px white bar
       says it instead, so the state never rests on colour alone (WCAG 1.4.1). Both none by default. */
    background-image: var(--aira-nav-active-image, none);
    box-shadow: var(--aira-nav-active-bar, none);
}

html[data-menu-color="dark"] .side-nav-link .badge {
    background: var(--aira-nav-badge-bg) !important;
    color: var(--aira-nav-badge-ink) !important;
}

html[data-menu-color="dark"] .side-nav-item.active .side-nav-link .badge {
    background: var(--aira-nav-badge-active-bg) !important;
    color: var(--aira-nav-badge-ink) !important;
}

/* --------------------------------------------------------------------------
   The rail's geometry - so nothing moves when it opens.

   The theme's on-hover rail centres each icon while collapsed and left-aligns it once
   expanded, scales it up 15% on the way, and drops the labels, counts and section titles
   out of the flow with `display: none`. Every icon therefore slides and every row jumps the
   moment the pointer arrives. The prototype does none of that: one fixed layout at both
   widths, and only the opacity of the text changes.

   Everything below restates a theme rule at its own specificity or higher. aira.css loads
   after app.min.css, so an equal-specificity restatement wins - the counts in the comments
   are what make each one safe to move. See .claude/docs/ubold-layout.md.
   -------------------------------------------------------------------------- */

/* Labels are laid out at their full open width even while the rail is 74px, so the rail itself
   has to be the clip. Only these two sizes: condensed flies a sub-menu out past the rail's
   right edge, and a blanket clip would swallow it the day the menu grows one. */
html[data-sidenav-size="on-hover"] .sidenav-menu,
html[data-sidenav-size="on-hover-active"] .sidenav-menu {
    overflow: hidden;
}

/* Hovering floats the rail over the page; pinning makes it part of the page. */
html[data-sidenav-size="on-hover"] .sidenav-menu:hover {
    box-shadow: 0 18px 50px rgba(19, 26, 38, .2);
}

.side-nav {
    gap: 2px;
    padding-top: 6px;
    /* The theme reserves 50px for its floating pin button. Ours is a real footer row. */
    padding-bottom: 16px;
}

.side-nav > .side-nav-item {
    padding: 0 var(--aira-sidenav-list-inset);
}

.side-nav .side-nav-item .side-nav-link {
    border-radius: 9px;
    /* A label typeset for the open rail still exists at 74px. Without this it escapes the row
       and SimpleBar grows a horizontal scrollbar under the menu. */
    overflow: hidden;
}

/* The fixed box is what holds the icon at one x-position in both states. */
.side-nav .side-nav-item .side-nav-link .menu-icon {
    flex: 0 0 var(--aira-sidenav-icon-box);
    width: var(--aira-sidenav-icon-box);
    display: flex;
    justify-content: center;
}

/* (0,6,1), over the theme's (0,5,1) `:not(:hover)` centring - the sideways slide. */
html[data-sidenav-size="on-hover"] .sidenav-menu .side-nav .side-nav-item .side-nav-link,
html[data-sidenav-size="on-hover-active"] .sidenav-menu .side-nav .side-nav-item .side-nav-link {
    justify-content: flex-start;
}

/* The theme also grows the collapsed icon to 115%, which is a second, subtler jump. */
html[data-sidenav-size="on-hover"] .sidenav-menu .side-nav .side-nav-item .side-nav-link .menu-icon,
html[data-sidenav-size="on-hover"] .sidenav-menu .side-nav .side-nav-item .side-nav-link .menu-icon i {
    font-size: var(--ins-sidenav-item-icon-size);
    line-height: var(--ins-sidenav-item-icon-size);
}

html[data-sidenav-size="on-hover"] .sidenav-menu .side-nav .side-nav-item .side-nav-link .menu-icon svg {
    width: var(--ins-sidenav-item-icon-size);
    height: var(--ins-sidenav-item-icon-size);
}

/* Labels, counts and section titles keep their place in the flow at both widths - taking a
   section title out of the flow is what shunts the whole menu upwards while collapsed. They
   are faded instead. Stated unconditionally, so there is no state in which the theme's
   `display: none` can come back; the fade below is the only thing that hides them. */
html[data-sidenav-size="on-hover"] .sidenav-menu .scrollbar .side-nav .side-nav-item .side-nav-link .menu-text {
    display: block;
}

html[data-sidenav-size="on-hover"] .sidenav-menu .scrollbar .side-nav .side-nav-item .side-nav-link .badge {
    display: inline-block;
}

html[data-sidenav-size="on-hover"] .sidenav-menu .scrollbar .side-nav .side-nav-title {
    display: block;
}

/* Keyboard focus opens the rail exactly as hover does. Without it, tabbing through the menu
   moves focus between rows whose labels the person cannot read. (0,3,1) ties the theme's
   `:not(:hover)` width rule and wins on order. */
html[data-sidenav-size="on-hover"] .sidenav-menu:focus-within {
    width: var(--ins-sidenav-width);
}

html[data-sidenav-size="on-hover"] .sidenav-menu:not(:hover):not(:focus-within) .scrollbar .side-nav .side-nav-item .side-nav-link .menu-text,
html[data-sidenav-size="on-hover"] .sidenav-menu:not(:hover):not(:focus-within) .scrollbar .side-nav .side-nav-item .side-nav-link .badge,
html[data-sidenav-size="on-hover"] .sidenav-menu:not(:hover):not(:focus-within) .scrollbar .side-nav .side-nav-title,
html[data-sidenav-size="on-hover"] .sidenav-menu:not(:hover):not(:focus-within) .sidenav-footer .menu-text {
    opacity: 0;
}

/* --------------------------------------------------------------------------
   The brand mark - the prototype's gradient tile with the software's initials,
   replaced by the uploaded logo when Settings has one. One partial, two places.
   -------------------------------------------------------------------------- */
.aira-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.aira-brand-mark {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    overflow: hidden;
    display: grid;
    place-items: center;
    /* A gradient brand (Appearance, §5.3) paints the tile with it; otherwise the prototype's own lift. */
    background: var(--aira-brand-mark-paint, linear-gradient(150deg, var(--aira-brand-400), var(--aira-brand)));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.aira-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The initials sit under the logo and only show when there is no logo, or when one was
   configured and the file has since gone missing. */
.aira-brand-mark:has(img) .aira-brand-initials { display: none; }
.aira-brand-mark.is-fallback .aira-brand-initials { display: block; }

.aira-brand-text {
    min-width: 0;
    line-height: 1.25;
}

.aira-brand-text b {
    display: block;
    color: var(--aira-nav-ink);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sized to fit "Aira Euro Automation" in the 258px rail. A longer company name still
   ellipses rather than pushing the mark - an operator can type anything into Settings. */
.aira-brand-text span {
    display: block;
    color: var(--aira-nav-title);
    font-size: .625rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The collapsed rail is only wide enough for the mark, so the wordmark goes with the menu
   labels rather than clipping mid-letter. */
html[data-sidenav-size="on-hover"] .sidenav-menu .aira-brand-text {
    opacity: 0;
}

html[data-sidenav-size="on-hover"] .sidenav-menu:hover .aira-brand-text,
html[data-sidenav-size="on-hover"] .sidenav-menu:focus-within .aira-brand-text,
html[data-sidenav-size="on-hover-active"] .sidenav-menu .aira-brand-text {
    opacity: 1;
}

.aira-brand-link,
.aira-brand-link:hover {
    text-decoration: none;
}

/* The signed-out screens' mark - the vendor's, not the brand above (Partials/_AuthMark).
   It is drawn for a white ground, and on the dark card its navy tagline all but vanished, so it
   keeps a white plate of its own. On the light card the plate is the card's own colour. */
.aira-auth-mark {
    display: block;
    width: auto;
    height: 176px;
    margin: 0 auto;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    user-select: none;
}

@media (max-width: 575.98px) {
    .aira-auth-mark { height: 148px; }
}

/* The theme's .logo box is built around a single centred image on a 70px line-height. Ours
   is a two-part flex row, so it needs its own box: the prototype's head with real padding,
   rather than a mark jammed against the top corner.

   16px of padding either side of a 42px mark centres it in the 74px rail, which is what keeps
   the mark still while the rail opens - the same arithmetic as the menu icons above. */
.sidenav-menu .logo {
    display: flex;
    align-items: center;
    min-height: var(--aira-sidenav-head-height);
    padding: 17px 16px 16px;
    line-height: 1.25;
    text-align: left;
}

/* Condensed zeroes this padding at (0,3,1) and would drop the mark into the top-left corner.
   Restated at the same specificity so the rail below 1140px is laid out like the one above it. */
html[data-sidenav-size="condensed"] .sidenav-menu .logo {
    padding: 17px 16px 16px;
    /* The theme repaints the rail here; against the window, a gradient rail shows no seam (T5). */
    background-attachment: fixed;
}

/* Only in offcanvas does anything share this box - the close button, absolutely positioned
   over its right edge. Elsewhere the wordmark gets the full width. */
html[data-sidenav-size="offcanvas"] .sidenav-menu .logo {
    padding-right: 40px;
}

/* --------------------------------------------------------------------------
   The pin, at the foot of the rail - the prototype's "Pin sidebar open".

   The theme ships this as `.button-on-hover`, a bare icon absolutely positioned
   in the logo corner. The class is kept so app.js still owns the toggle; only
   the box it sits in is ours. See .claude/docs/ubold-layout.md.
   -------------------------------------------------------------------------- */
html[data-sidenav-size="on-hover"],
html[data-sidenav-size="on-hover-active"] {
    --aira-sidenav-footer-height: 60px;
}

/* The theme gives the scroll container the entire rail below the logo, so the footer has to
   be carved out of it or the pin lands on top of the last menu item. The head is measured by
   its own token: the theme subtracts --ins-topbar-height here, which is a different box. */
.sidenav-menu [data-simplebar] {
    height: calc(100% - var(--aira-sidenav-head-height) - var(--aira-sidenav-footer-height));
}

.sidenav-footer {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--aira-sidenav-footer-height);
    align-items: center;
    padding: 10px var(--aira-sidenav-list-inset) 14px;
    border-top: 1px solid var(--aira-nav-line);
    background: var(--ins-sidenav-bg);
    background-attachment: fixed;
}

/* Condensed, compact and offcanvas have no hover state to pin, so the row would be a button
   that does nothing you can see. */
html[data-sidenav-size="on-hover"] .sidenav-footer,
html[data-sidenav-size="on-hover-active"] .sidenav-footer {
    display: flex;
}

.sidenav-footer .button-on-hover {
    position: static;
    align-items: center;
    gap: var(--ins-sidenav-item-gap);
    width: 100%;
    padding: 9px var(--ins-sidenav-item-padding-x);
    border-radius: 9px;
    line-height: 1.25;
    font-size: .78125rem;
    white-space: nowrap;
    color: var(--aira-nav-muted);
}

.sidenav-footer .button-on-hover:hover,
.sidenav-footer .button-on-hover:focus-visible {
    background: var(--ins-sidenav-item-hover-bg);
    color: var(--ins-sidenav-item-hover-color);
}

/* The theme reveals this button with `display: block` at (0,3,1), which beats a plain
   `.sidenav-footer .button-on-hover` - and a block box lays the icon and label out as running
   text. The row has to restate flex at the theme's own specificity. */
html[data-sidenav-size="on-hover"] .sidenav-menu .sidenav-footer .button-on-hover,
html[data-sidenav-size="on-hover-active"] .sidenav-menu .sidenav-footer .button-on-hover {
    display: flex;
}

/* Lucide renders a 24px SVG by default. Inside .side-nav the theme sizes it; the footer is
   outside that, so it needs a size stated or the pin dwarfs every menu icon. The prototype
   draws the pin a notch smaller than the menu icons - the shared 24px box below is what still
   holds it on their x-axis.

   The pin carries .menu-icon too, so the theme's collapsed 115% scale-up reaches it at (0,4,1);
   (0,5,1) here is what stops the pin growing and shrinking as the rail opens. */
html[data-sidenav-size="on-hover"] .sidenav-menu .sidenav-footer .aira-pin-icon svg,
html[data-sidenav-size="on-hover-active"] .sidenav-menu .sidenav-footer .aira-pin-icon svg {
    width: 16px;
    height: 16px;
}

/* Pinned reads as a state, not a hover. The theme colours it --ins-primary, which is the
   brand navy sitting on the navy rail - invisible. It was the prototype's lighter blue until
   Appearance let the rail take any colour: on a Cobalt rail that blue vanished too (WP3's walk).
   The rail's own ink now - full white against the unpinned label's muted white, with the icon
   that changes beside it; (0,5,1) to clear the theme's own (0,4,1) rule. */
html[data-sidenav-size="on-hover-active"] .sidenav-menu .sidenav-footer .button-on-hover {
    color: var(--aira-nav-ink);
}

/* The theme hides the whole button on the collapsed rail. The prototype keeps the icon and
   fades only the label, which is what makes the pin discoverable before you hover. The row is
   NOT re-centred here: that was the pin's own copy of the icon jump the menu no longer has.
   Has to out-specify `html[…on-hover] .sidenav-menu:not(:hover) .button-on-hover`. */
html[data-sidenav-size="on-hover"] .sidenav-menu:not(:hover) .sidenav-footer .button-on-hover {
    display: flex;
}

/* The theme drops every .menu-text out of the collapsed rail at (0,4,1). The pin's label is
   faded along with the menu's instead. Only the "off" label: the "on" one belongs to the
   pinned state and is switched by the rules below. */
html[data-sidenav-size="on-hover"] .sidenav-menu .sidenav-footer .menu-text.aira-pin-off {
    display: inline;
}

/* Two icons and two labels, swapped by state rather than rewritten in script: Lucide replaces
   each <i> with an <svg> at load, so a JS swap would have to re-run createIcons every click. */
.sidenav-footer .aira-pin-icon {
    display: inline-flex;
    justify-content: center;
    flex: 0 0 var(--aira-sidenav-icon-box);
}

.sidenav-footer .aira-pin-on {
    display: none;
}

html[data-sidenav-size="on-hover-active"] .sidenav-footer .aira-pin-off {
    display: none;
}

html[data-sidenav-size="on-hover-active"] .sidenav-footer .aira-pin-icon.aira-pin-on {
    display: inline-flex;
}

html[data-sidenav-size="on-hover-active"] .sidenav-footer .aira-pin-label.aira-pin-on {
    display: inline;
}

/* The topbar carries the mark alone - the wordmark is already in the sidebar, and the page
   title sits immediately to its right. */
.logo-topbar {
    line-height: 1.25;
}

.logo-topbar .aira-brand-mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: .8rem;
}

/* --------------------------------------------------------------------------
   The page title, on the topbar.

   `_PageTitle` is rendered by `_Topbar`, not by the page - the prototype puts the screen's
   name and its one-line description immediately left of the search. The band it used to
   occupy at the top of `.container-fluid` is what pushed the Kanban columns below the fold.
   -------------------------------------------------------------------------- */
/* Which group gives up width, in order.

   `.topbar-menu` sizes both groups to their content. The right-hand one is icons and a name and
   has no slack: squeezing it wrapped "Mitul A Modi" onto three lines at 1200px, and clipped it
   entirely at 1024. So it never shrinks, and the left group - title, then search - absorbs the
   whole shortfall by ellipsising and narrowing. */
.aira-topbar-left {
    min-width: 0;
    /* Grows, so the search actually gets its 380px basis. With `flex: 0 1 auto` the group is
       sized from its children's *max-content* rather than their flex bases, which quietly gave
       the search 287px and ellipsised the subtitle on a 1600px screen with room to spare.
       Growing cannot push the toolbar off the edge the way a growing search would: the toolbar
       is a sibling of this group, not a child of it, and it does not shrink. */
    flex: 1 1 auto;
}

.aira-topbar-right {
    flex: 0 0 auto;
}

.aira-topbar-right .nav-user h5 {
    white-space: nowrap;
}

.aira-page-title {
    /* min-width:0 is what lets the ellipsis below actually fire: a flex item defaults to
       min-width:auto and refuses to shrink under its text, which would instead push the
       search - and then the toolbar - off the right edge. */
    min-width: 0;
    flex: 0 1 auto;
    max-width: 20rem;
    margin-left: .375rem;
    padding-right: .5rem;
}

.aira-page-title-h {
    margin: 0;
    /* The header's typography area (appearance.md §5.6): its size and, on a coloured header, its ink. */
    font-size: var(--aira-topbar-title-size, 1.03125rem);
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.25;
    color: var(--aira-head-title-ink, var(--aira-ink));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The page's trail (crm/52 P3, Partials/_PageTrail) - on every page, over its content, never in the topbar: one quiet line -
   home › Sales › Quotations › Edit Quotation - its places links, its last step the page, in the body's ink. The separators are
   drawn here and read by nothing; on a phone the line wraps rather than pushing the page sideways. Its bottom margin is the
   .75rem a record page's sticky head pulls itself up by, so the two never overlap. Focus mode gives the window to the work. */
.aira-trail { margin: -.25rem 0 .75rem; }

html[data-aira-focus] .aira-trail { display: none; }

.aira-trail-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: .125rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--ins-secondary-color);
}

.aira-trail-step {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.aira-trail-step + .aira-trail-step::before {
    margin: 0 .5rem;
    content: "\203A" / "";
    opacity: .7;
}

.aira-trail-step a {
    color: inherit;
    text-decoration: none;
    border-radius: .25rem;
    --aira-focus-ring-offset: 1px;
}

.aira-trail-step a:hover {
    color: var(--ins-primary-text-emphasis);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aira-trail-step [aria-current="page"] {
    font-weight: 600;
    color: var(--ins-body-color);
}

.aira-trail-home { display: inline-flex; align-items: center; }
.aira-trail-step a.aira-trail-home:hover { text-decoration: none; }
.aira-trail-home-icon { width: .875rem; height: .875rem; }

/* The title used to supply the page's top margin through `.page-title-head`'s 1.5rem of
   padding. With it gone the first card butts against the topbar, so the gutter is stated
   here instead - on the content wrapper, where it applies to every screen. */
.content-page > .container-fluid {
    padding-top: 1.25rem;
}

/* The theme gives a condensed sidebar's page `min-height: 1900px`, and layout-boot.js condenses it at 1140 px and under: any short
   page on a laptop or a half-screen window scrolled over 1900 px of nothing (crm/71 §7.4). The theme's own height for every other size. */
html[data-sidenav-size="condensed"] .content-page {
    min-height: calc(100vh - var(--ins-topbar-height) - 1px);
}

/* --------------------------------------------------------------------------
   The header's typography and colour (appearance.md §5.5, §5.6).

   The page title is an h1 and the person's name an h5, and the theme draws headings in --ins-font-family-secondary at
   multiples of the body's base - so both are hooked here, or a heading font or a body size would move the bar. Their
   defaults are today's: 16.5 px title (above), 14 px name, 13 px search.
   -------------------------------------------------------------------------- */
.app-topbar,
.app-topbar .aira-page-title-h,
.app-topbar .nav-user .topbar-link h5 {
    font-family: var(--aira-font-header);
}

.app-topbar .nav-user .topbar-link h5 {
    font-size: calc(14px * var(--aira-topbar-scale, 1));
}

.app-topbar .app-search .form-control {
    font-size: calc(13px * var(--aira-topbar-scale, 1));
}

/* A panel opened FROM the bar - the bell, the user menu - is a panel, not the bar: the body's font (T9). */
.app-topbar .dropdown-menu {
    font-family: var(--ins-body-font-family);
}

/* A coloured header: the search sits on the bar's own ink, not on the page's tertiary ground. */
html[data-aira-head="custom"] .app-topbar .app-search .form-control {
    background-color: var(--ins-topbar-search-bg);
    border-color: var(--ins-topbar-search-border);
    color: var(--ins-topbar-item-hover-color);
}

html[data-aira-head="custom"] .app-topbar .app-search .form-control::placeholder,
html[data-aira-head="custom"] .app-topbar .app-search .app-search-icon {
    color: var(--ins-topbar-item-color) !important;
}

/* A header carrying white text rings its controls in white - the brand would not read on it (10c tunes the colour,
   never the outline) - and its panels keep the brand's ring. An uploaded logo keeps a white plate there: a dark mark
   on a dark bar disappears (T19). */
html[data-topbar-color="dark"] .app-topbar {
    --aira-focus-ring-color: #ffffff;
}

html[data-topbar-color="dark"] .app-topbar .dropdown-menu {
    --aira-focus-ring-color: var(--ins-primary);
}

html[data-topbar-color="dark"] .logo-topbar .aira-brand-mark:has(img) {
    background: #ffffff;
}

/* The person's initials sit on the brand's pale tint - on a dark bar that is a smudge (WP3's walk). The bar's own ink
   on a lift of it instead; !important because the avatar's colours are utility classes. */
html[data-topbar-color="dark"] .app-topbar .nav-user .avatar {
    background-color: rgba(255, 255, 255, .18) !important;
    color: var(--ins-topbar-item-hover-color) !important;
}

/* The tables' typography area (§5.6). Their cells' size is restated at runtime only when it is chosen (D13). */
.table,
table.dataTable,
.pv-tree,
.dash-table {
    font-family: var(--aira-font-table);
}

/* A hovered row in EVERY hover table wears the brand (crm/48 R2): a wash of it across the row and its bar down the row's
   first cell, so the row the eye or the ⋯ will act on is unmistakable. The theme's own hover was a grey at 45 % of
   --ins-light - on a white card, nearly nothing. Both are the theme's state channel (a cell's inset shadow reads
   --ins-table-bg-state), so a striped or an active row underneath still composes; the brand is a runtime setting, so the
   colour is its token, never a literal - dark mode and a chosen brand follow by themselves. */
.table {
    --ins-table-hover-bg: color-mix(in srgb, var(--aira-brand-400) 8%, transparent);
    --ins-table-hover-color: var(--ins-body-color);
}

html[data-bs-theme="dark"] .table { --ins-table-hover-bg: color-mix(in srgb, var(--aira-brand-400) 16%, transparent); }

/* The bar is a layer every first cell carries - transparent until its row is hovered - over the theme's own state wash,
   restated as the theme writes it. Set on every first cell, never left to inherit, so a table nested in a hovered row's
   first cell keeps its own. */
.table-hover > tbody > tr > td:first-child,
.table-hover > tbody > tr > th:first-child {
    --aira-row-mark: transparent;
    box-shadow: inset 3px 0 0 var(--aira-row-mark),
                inset 0 0 0 9999px var(--ins-table-bg-state, var(--ins-table-bg-type, var(--ins-table-accent-bg)));
}

.table-hover > tbody > tr:hover > td:first-child,
.table-hover > tbody > tr:hover > th:first-child { --aira-row-mark: var(--aira-brand-400); }

/* --------------------------------------------------------------------------
   Motion (crm/69). Nothing eases and nothing waits: a hover, a switch or a section lands in the next frame. What still
   moves is the closed list in crm/69 §6, which ThemeRenderingTests holds.
   -------------------------------------------------------------------------- */

/* Page to page: the old page dissolves into the next rather than cutting to it (ubold-ui.md, *Page to page*). A press during it
   ends it - layout-boot.js, because no CSS can pass the pointer through a root transition (crm/69 §10). */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: .15s;
}

/* Every transition in the product, in one rule: the theme's and the plugins' are compiled and not ours to edit, and a list
   would miss the next one. A duration of zero, never `none`: Bootstrap and aira-token-field read it and finish at once. */
*,
*::before,
*::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* The theme's smooth scrolling: a refused field or an anchor is there, not on its way. */
:root { scroll-behavior: auto; }

/* The theme's entrances: a list that slid for .3 s, a dialog that zoomed, a confirmation that popped. */
.dropdown-menu,
.dropdown-menu[data-popper-placement],
.choices__list--dropdown,
.choices__list--dropdown.is-active,
.modal.show .modal-dialog,
.swal2-show,
.swal2-hide {
    animation: none;
}

.swal2-icon-show,
.swal2-icon-show * {
    animation: none !important;
}

/* Bootstrap shows a .fade pane, waits out the fade, and only then adds .show - so however short the fade, a frame can land
   on a pane at opacity 0. That hole, 0.3 s of it with the fade, was the blink of changing a section. */
.tab-pane.fade:not(.show) {
    opacity: 1;
}

/* Feedback for a wait starts at 180 ms, and ends at once. Under about 200 ms a person reads a change as immediate, so anything
   sooner is only a flash: a fast answer shows no skeleton, no dim and no dots. Held by visibility, so what is held keeps its
   room and the page does not move when it goes. It delays the indicator, never the data. */
@keyframes aira-wait {
    from, to { visibility: hidden; }
}

@keyframes aira-dim {
    to { opacity: .55; }
}

.spinner-border {
    animation: aira-wait 0s linear .18s backwards,
               var(--ins-spinner-animation-speed) linear infinite var(--ins-spinner-animation-name);
}

.dt-processing,
.aira-skel--panel {
    animation: aira-wait 0s linear .18s backwards;
}

/* A host's reserved height holds from the first frame, not from when its script arrives: the dashboard's load after that frame,
   and everything below jumped by the height of every skeleton. Important over the theme's .apex-charts { min-height: 10px }. */
[style*="--aira-skel-h"]:empty {
    min-height: var(--aira-skel-h) !important;
}

/* One line, whether or not its figures have landed. */
.aira-dash-head {
    min-height: 1.25rem;
}

/* The prototype's search: a fixed lane next to the logo rather than a bar that grows to fill
   the topbar. The right-hand toolbar is the topbar's second flex child - see _Topbar.cshtml -
   so the search must NOT take flex-grow, or it pushes the toolbar off the right edge. */
.aira-topbar-search {
    /* Shrinks, never grows. Growing would push the right-hand group off the edge; refusing to
       shrink would do the same to the page title beside it. */
    flex: 0 1 380px;
    min-width: 12rem;
}

.aira-topbar-search .app-search,
.aira-topbar-search .app-search .position-relative {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Search fields - the topbar's global search and the Configuration rail's filter.
   -------------------------------------------------------------------------- */

/* The prototype's search is a pill on a tinted ground, not the theme's 4.8px rounded box.
   Scoped to .app-search - the magnifier-in-the-field pattern - so a search input that is one
   half of an .input-group keeps its square edge against the button beside it. */
.app-search .form-control {
    border-radius: 50rem;
    background-color: var(--ins-tertiary-bg);
}

/* The theme flattens :focus to no ring at all. The prototype lifts the field to the plain
   surface and rings it in the brand. Both colours are derived, so the primary colour an
   operator picks under Settings carries into it. */
.app-search .form-control:focus {
    background-color: var(--ins-secondary-bg);
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px var(--ins-primary-bg-subtle);
}

/* SimpleBar paints its own track; without this it is a light bar on a navy panel. */
html[data-menu-color="dark"] .sidenav-menu .simplebar-scrollbar::before {
    background: var(--aira-nav-thumb);
}

/* --------------------------------------------------------------------------
   The scope note - a brand-tinted band carrying a figure the operator needs before
   they act (the closure cost awaiting QC approval, say).

   The screens used to open with an explanatory one of these as well; those were removed
   because they said the same thing on every visit and pushed the work below the fold.
   Keep this class for a note that carries *data*, not for one that explains the screen.

   The prototype's `.hero-note`: brand-tinted, not white. `alert alert-light border` put a
   white panel on a near-white page, so it was the least visible thing on it. Blue also
   separates it from the red/amber alerts, which carry outcomes rather than context.

   `.alert` ships `--ins-alert-border: 0 solid ...`, which is why the old markup needed the
   `border` utility on top; that utility is `!important` and would repaint the border grey,
   so it must be dropped when this class is used.
   -------------------------------------------------------------------------- */
.aira-note {
    --ins-alert-bg: var(--aira-brand-50);
    --ins-alert-border-color: #cfe2f8;
    --ins-alert-border: 1px solid var(--ins-alert-border-color);
    --ins-alert-color: var(--aira-brand-600);
    line-height: 1.6;
}

/* The second half of the sentence is context, not a different subject - keeping it grey on a
   blue ground read as two unrelated messages. `.text-muted` is !important, so this must be. */
.aira-note .text-muted {
    color: color-mix(in srgb, var(--aira-brand-600) 74%, transparent) !important;
}

html[data-bs-theme="dark"] .aira-note {
    --ins-alert-bg: color-mix(in srgb, var(--ins-primary) 14%, transparent);
    --ins-alert-border-color: color-mix(in srgb, var(--ins-primary) 34%, transparent);
    --ins-alert-color: #b9d4f5;
}

html[data-bs-theme="dark"] .aira-note .text-muted {
    color: color-mix(in srgb, #b9d4f5 76%, transparent) !important;
}

/* --------------------------------------------------------------------------
   Stage chip - used anywhere a ticket stage is displayed.
   -------------------------------------------------------------------------- */
.stage-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    color: var(--stage-color, var(--ins-secondary-color));
    background: color-mix(in srgb, var(--stage-color, #888) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--stage-color, #888) 28%, transparent);
}

.stage-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* --------------------------------------------------------------------------
   Kanban board. The column is the drop target, so it must keep a minimum
   height even when empty - otherwise a board with one empty column cannot be
   dropped into at all.
   -------------------------------------------------------------------------- */
.kanban-board {
    display: flex;
    gap: .8125rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    align-items: stretch;
}

/* The column is a tinted panel and the cards on it are white. That contrast is the whole
   reason a board reads as a board: on --ins-tertiary-bg (#f6f7fb) against a #f5f6f8 page,
   with cards painted --ins-body-bg, all three planes were the same grey and the columns
   dissolved into the page. */
.kanban-column {
    flex: 0 0 300px;
    max-width: 300px;
    background: var(--aira-board-bg);
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius-lg);
    display: flex;
    flex-direction: column;
}

.kanban-column-head {
    display: flex;
    align-items: center;
    gap: .5625rem;
    padding: .6875rem .8125rem;
    border-bottom: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius-lg) var(--ins-border-radius-lg) 0 0;
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .01em;
    line-height: 1.3;
    color: var(--aira-ink);
}

/* Cards are laid out by the column, not by their own margin, so the last one leaves no dead
   space above `.kanban-more`. The body is the drop target and grows to fill its stretched
   column, never shrinking below its own cards. */
.kanban-column-body {
    padding: .625rem;
    flex: 1 0 auto;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: .5625rem;
}

/* Drop feedback is set by the board script from the server's allowed-transition
   map, so an illegal drop is refused visually before it is refused by the API. */
.kanban-column.is-drop-allowed { outline: 2px dashed var(--aira-brand-400); outline-offset: -2px; }
.kanban-column.is-drop-denied  { outline: 2px dashed var(--ins-danger); outline-offset: -2px; }

.kanban-card {
    background: var(--ins-secondary-bg);
    border: 1px solid var(--aira-line);
    border-radius: 9px;
    padding: .6875rem .75rem;
    box-shadow: var(--aira-shadow-1);
    cursor: grab;
    /* A card must not stretch to the column's width-minus-padding through some other
       flex rule, nor shrink under its own content when the column is full. */
    flex: 0 0 auto;
}

.kanban-card:hover { box-shadow: var(--aira-shadow-2); transform: translateY(-1px); }

/* A ticket that is read-only for this user still shows on the board, but must
   not look draggable. */
.kanban-card.is-locked { cursor: default; opacity: .78; }

/* --------------------------------------------------------------------------
   Ageing indicator - shared by the board card and the ticket list.
   -------------------------------------------------------------------------- */
.age-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.age-dot.age-ok    { background: var(--ins-success); }
.age-dot.age-warn  { background: var(--ins-warning); }
.age-dot.age-crit  { background: var(--ins-danger); }

/* --------------------------------------------------------------------------
   Configuration - the master rail.
   -------------------------------------------------------------------------- */
#master-rail {
    max-height: calc(100vh - 320px);
    min-height: 18rem;
    overflow-y: auto;
    /* Bootstrap's .nav is flex-wrap: wrap. With flex-direction: column and a capped height
       that wraps the list into a second column the moment the viewport is short, which
       clips half the masters. It has to scroll instead. */
    flex-wrap: nowrap;
    /* The containing block of what is absolute inside the list - the folded strip's names, kept for their titles and
       readers. With nothing positioned up to the page, the names of the masters scrolled out of the strip were laid out
       on the page itself, below the fold, and the whole page scrolled 216 px with the list folded and none open (1920 x
       945). Positioned, they stay inside the list's own scroll. */
    position: relative;
}

#master-rail .nav-link {
    font-size: .8125rem;
    border-radius: var(--ins-border-radius);
}

#master-rail .nav-link.active .badge {
    background: rgba(255, 255, 255, .2) !important;
    color: #fff !important;
}

/* The list beside the panel (crm/31 T1). One column under 1200 px; from there a fixed list and the rest for the
   register, and the list folds to a strip of icons - remembered by configuration.js - when a register wants it all.
   Open or folded it stands still while the register scrolls (crm/76): see the sticky rail in the media block below. */
.aira-config {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.aira-config-panel { min-width: 0; }

/* The theme's card header is a centred flex row, which shrank the title's line and the find box to their content: the
   head is a column, each line the list's full width. */
.aira-config-rail-head {
    flex-direction: column;
    align-items: stretch;
}

.aira-config-fold { display: none; }
.aira-config-when-closed { display: none; }

@media (min-width: 1200px) {
    .aira-config { grid-template-columns: 17.5rem minmax(0, 1fr); }
    .aira-config.is-rail-collapsed { grid-template-columns: 4.25rem minmax(0, 1fr); }

    /* The rail never travels with the register (the owner, 04/11/2026). A fitted page cannot scroll, but under 600 px of window - a laptop at
       125 % - the page does (crm/71 FT4), and it took the rail up to 300 px off the top. So it sticks whichever way the page falls, as tall as the
       window leaves it, and the list inside takes what its head does not and scrolls on its own. Stuck where it rests, so it does not move at all:
       3rem is the trail and the page's padding above it, and .75rem the page's padding under it. */
    .aira-config-rail {
        position: sticky;
        top: calc(var(--ins-topbar-height) + 3rem);
        align-self: start;
        height: calc(100dvh - var(--ins-topbar-height) - 3.75rem);
    }

    .aira-config-rail .card-body {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #master-rail {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    html[data-aira-focus] .aira-config-rail {
        top: .75rem;
        height: calc(100dvh - 1.5rem);
    }

    .aira-config-fold { display: inline-flex; flex: 0 0 auto; }

    .is-rail-collapsed .aira-config-when-open { display: none; }
    .is-rail-collapsed .aira-config-when-closed { display: inline-block; }

    /* Folded: the fold button alone in the head, each master its icon - its name stays its title and its accessible
       name - and a group a hairline. The find box and the counts go: a strip has no room to read them. */
    .is-rail-collapsed .aira-config-rail-head { padding: .75rem .5rem; }
    .is-rail-collapsed .aira-config-rail-top { justify-content: center; }
    .is-rail-collapsed .aira-config-rail-title,
    .is-rail-collapsed .aira-config-find,
    .is-rail-collapsed .aira-config-count,
    .is-rail-collapsed #master-search-empty { display: none; }

    .is-rail-collapsed .aira-config-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .is-rail-collapsed .aira-config-group {
        height: 0;
        margin: .375rem .5rem;
        padding: 0 !important;
        border-top: 1px solid var(--ins-border-color);
    }

    .is-rail-collapsed #master-rail { align-items: stretch; }
    .is-rail-collapsed #master-rail .nav-link { justify-content: center !important; padding: .5rem 0 !important; }
}

/* The customer register's "25 rows" is DataTables' own markup drawn outside its table
   (configuration.js, buildPageSize). Every other master has its table's row straight under the
   control's; here the table is a second .dt-container, pulled up .75rem by the theme and opened
   by an empty layout row, which leaves the gap .25rem short. Padding, because a margin here
   would collapse into the rows' own. */
[data-master-page-size] { padding-bottom: .25rem; }

/* --------------------------------------------------------------------------
   Coming soon / in-shell 404. The mark is the prototype's gradient tile at the
   size the card wants, so a page that does not exist yet still looks built.
   -------------------------------------------------------------------------- */
.aira-coming-soon-mark {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(150deg, var(--aira-brand-400), var(--aira-brand));
}

.aira-coming-soon-mark svg {
    width: 24px;
    height: 24px;
}

/* A 404 is not an announcement. Same tile, drained of the brand. */
.aira-coming-soon-mark-muted {
    background: var(--ins-tertiary-bg);
    color: var(--ins-secondary-color);
    border: 1px solid var(--ins-border-color);
}

/* --------------------------------------------------------------------------
   Toasts.

   Top-right, clear of the topbar, above the modal a save was very likely
   launched from. One corner for every outcome in the product: an operator
   learns a single place to look instead of tracking two.

   The dialog language (SweetAlert2) is still used for confirmations, which are
   decisions and should block. A toast is a receipt and must not.

   The tone is carried three ways at once - a filled icon, a tinted card and the
   message set bold in the tone's own emphasis colour - because a toast is read
   out of the corner of the eye while the operator is still looking at the
   board. The earlier white card with a hairline border was missed entirely.
   -------------------------------------------------------------------------- */
.aira-toaster {
    position: fixed;
    right: 1rem;
    /* Below the topbar rather than over it - the search box and the profile menu
       are exactly what an operator reaches for after reading a refusal. */
    top: calc(var(--ins-topbar-height, 70px) + .75rem);
    /* A save refused from inside a dialog has to be readable without closing the dialog -
       including the third dialog in a stack. See --aira-z-panel for the arithmetic. */
    z-index: var(--aira-z-toast);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(26rem, calc(100vw - 2rem));
    pointer-events: none;
}

.aira-toast {
    /* Overridden per tone below; the fallbacks keep an unknown tone legible. */
    --aira-toast-tone: var(--ins-secondary-color);
    --aira-toast-tone-rgb: 108, 117, 125;

    /* Coloured ink, mixed rather than picked. The theme's own -text-emphasis pairs sit a shade
       off the tone itself - warning is #d29c40 - which over a tinted card is 2.3:1 and cannot be
       read. Mixing the tone INTO the body ink keeps both: dark tinted ink in light mode, light
       tinted ink in dark, from one declaration. The plain colour above it is the fallback for a
       browser without color-mix. */
    --aira-toast-text: var(--ins-body-color);

    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .75rem .75rem .75rem .875rem;
    border-radius: .5rem;
    /* A tint layered over an opaque card, not a translucent card: it has to read the
       same over the board, over a modal backdrop and in dark mode. */
    background-color: var(--ins-secondary-bg);
    background-image: linear-gradient(90deg,
        rgba(var(--aira-toast-tone-rgb), .20), rgba(var(--aira-toast-tone-rgb), .10));
    color: var(--aira-toast-text);
    color: color-mix(in srgb, var(--aira-toast-tone) 35%, var(--aira-toast-text));
    border: 1px solid rgba(var(--aira-toast-tone-rgb), .45);
    border-left: .25rem solid var(--aira-toast-tone);
    box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .18), 0 .125rem .25rem rgba(15, 23, 42, .08);
    font-size: .875rem;
    line-height: 1.45;
    animation: aira-toast-in .22s cubic-bezier(.21, 1.02, .73, 1) both;
}

.aira-toast.is-leaving {
    animation: aira-toast-out .2s cubic-bezier(.06, .71, .55, 1) both;
}

/* In from the edge it sits against, so the eye is pulled to the right-hand corner. */
@keyframes aira-toast-in {
    from { opacity: 0; transform: translate3d(1rem, -.25rem, 0) scale(.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes aira-toast-out {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translate3d(1rem, 0, 0) scale(.96); }
}

/* The icon carries the verdict, so the message never has to open with "Error:". */
.aira-toast-icon {
    flex: 0 0 1.375rem;
    width: 1.375rem;
    height: 1.375rem;
    margin-top: .0625rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--aira-toast-tone);
    color: #fff;
}

.aira-toast-icon svg {
    width: .8125rem;
    height: .8125rem;
}

.aira-toast-message {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: .0625rem;
    font-weight: 600;
    /* A refusal can name a customer whose name has no spaces to break on. */
    overflow-wrap: anywhere;
}

.aira-toast-close {
    flex: 0 0 auto;
    padding: 0;
    width: 1.125rem;
    height: 1.125rem;
    border: 0;
    background: none;
    border-radius: .25rem;
    color: inherit;
    opacity: .55;
}

.aira-toast:hover .aira-toast-close,
.aira-toast-close:focus-visible { opacity: 1; }

.aira-toast-close svg { width: .875rem; height: .875rem; }

/* A tone is two values: the colour itself for the icon and the accent, and its rgb triple for
   every translucent layer. The ink is mixed from the first, above. */
.aira-toast-success {
    --aira-toast-tone: var(--ins-success);
    --aira-toast-tone-rgb: var(--ins-success-rgb);
}

.aira-toast-error {
    --aira-toast-tone: var(--ins-danger);
    --aira-toast-tone-rgb: var(--ins-danger-rgb);
}

.aira-toast-warning {
    --aira-toast-tone: var(--ins-warning);
    --aira-toast-tone-rgb: var(--ins-warning-rgb);
}

.aira-toast-info {
    --aira-toast-tone: var(--ins-info);
    --aira-toast-tone-rgb: var(--ins-info-rgb);
}

@media (prefers-reduced-motion: reduce) {
    .aira-toast, .aira-toast.is-leaving { animation-duration: .01ms; }
}

/* A worklist read again quietly - the interval, a return to the tab, somebody else's write
   (aira-queue.js, live-data.md L3): DataTables' own "Processing" box does not flash over rows that
   are still right. A read the operator asked for - a filter, a page - still shows it. */
.aira-quiet .dt-processing { display: none !important; }

/* --------------------------------------------------------------------------
   The Sr No column, on every list table.

   Narrow and fixed so four digits cannot shove the first real column off a phone, and
   CENTRED under its own heading - the column is two characters of body text wide, so a
   right-aligned figure sat hard against the customer name beside it and read as part of that
   cell rather than as the row's number. Tabular figures keep the units in line down the page
   anyway - a 9 sitting under the 1 of a 10 is how a column of numbers stops being scannable -
   which is what the right edge was bought for, and centring does not cost it. Muted because
   the serial is a position, not data, and must not compete with the row it leads.

   The number itself is never written in a view: Utils/SerialNo.cs for a server-rendered
   table, Aira.tables.serial for a DataTables-rendered one.

   A total or sub-total row carries an EMPTY `.sr-col` cell rather than a number: it is not a
   record, so it has no position, and numbering it makes the count one too many.
   -------------------------------------------------------------------------- */
.sr-col {
    width: 4rem;
    text-align: center;
    white-space: nowrap;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
}

/* A moment in a table cell - Created at, an import's run (crm/31 T2): the date, and the time under it, smaller and
   muted. One line read as one long value and pushed the column wide; two lines scan down the page as dates.
   AiraDate.StampLines on the server, Aira.tables.stampLines in the browser - the same two spans. */
.aira-stamp {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.3;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.aira-stamp-day { color: var(--ins-body-color); }

.aira-stamp-time {
    font-size: .75rem;
    color: var(--ins-secondary-color);
}

/* The rows region while a filter is in flight. Dimmed rather than emptied (the shared rule under
   *Loading*): a table that blanks between keystrokes reads as "no matches" for the fraction of a
   second before the real answer arrives, and the operator stops typing. */
[data-master-rows].is-loading { pointer-events: none; }

/* --------------------------------------------------------------------------
   Every table stays inside its card (ui-screens.md, *A table never leaves its card*).

   A table cannot be narrower than its longest unbreakable line, so the worklists' eleven
   columns - reminders, a validity badge, two buttons - come to 1,300px whatever the card
   says. Nothing in the theme gives the rest anywhere to go: Bootstrap caps `.row > *` at the
   row's width, so the cell DataTables puts the table in stays put and the table paints on
   past it, over the card's edge and off the page, and the whole page scrolls sideways with
   it. Pending Confirmation did it at 1440px, Corrective Action and QC Approval with it, Track
   My Complaints on a phone - and no error anywhere.

   So that cell scrolls sideways itself, for EVERY DataTables table rather than screen by
   screen: a new worklist is covered by being a DataTable. Only the rows move - the row count
   above them and the pager below stay where they are. A table DataTables does not own sits
   in `.table-responsive` in its own markup instead; TableContainmentTests holds both halves.

   Matched through `.dt-layout-table`, the one DataTables class the Bootstrap 5 integration
   leaves on that row (aira-tables.js). Not `.aira-tfill`: the drill and report dialogs chain
   the height down to an `.aira-tscroll` that already owns both axes, and a second scroller
   around it is the second scrollbar that chain exists to prevent. Nothing in a DataTables
   table is sticky to the page and no row carries a dropdown, so the box costs nothing. */
.dt-container .dt-layout-table > :not(.aira-tfill) {
    overflow-x: auto;
}

/* --------------------------------------------------------------------------
   Forms - the two states the compiled scale has no rule for.

   Size, radius, focus ring and label ink are all compiled, from the control metrics in
   wwwroot/scss/_aira-brand.scss. Do NOT restate padding, font-size or border-radius for a
   form control here: two sources for one measurement is how the create screen and the
   Settings screen start disagreeing about how tall a field is.
   -------------------------------------------------------------------------- */

/* Read-only is not disabled. The value is real and the operator is meant to read it - the
   ticket number, the derived chargeable flag - it simply is not
   theirs to type. Bootstrap styles :disabled and stops there, so a readonly field was
   indistinguishable from an editable one until somebody clicked into it and nothing
   happened. The prototype drops it to the second surface and takes the focus ring off. */
.form-control[readonly]:not(.form-control-plaintext) {
    background-color: var(--aira-surface-2);
    color: var(--aira-ink-2);
    cursor: default;
}

/* Not a refused one: the engine focuses the field the server refused (C13's fixed marketing person
   is read-only), and this rule's weight took the red off it at exactly that moment. */
.form-control[readonly]:not(.form-control-plaintext):not(.is-invalid):hover,
.form-control[readonly]:not(.form-control-plaintext):not(.is-invalid):focus {
    border-color: var(--ins-border-color);
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Validation.

   The theme already ships Bootstrap's .is-invalid / .invalid-feedback pair, so
   there is nothing to restyle - only the two places the theme's own layout
   leaves the message in the wrong spot. See app/js/aira-validation.js.
   -------------------------------------------------------------------------- */

/* The engine inserts the feedback *immediately* after its control so the source order
   matches the reading order, which puts it above the field's help text. Without this the
   two run together and the red sentence stops looking like the answer to what went wrong. */
.invalid-feedback { margin-bottom: .125rem; }

.invalid-feedback:empty { display: none !important; }

/* A switch turns its own label red rather than pushing a sentence between it and the next
   control - the message there is always about the label itself. */
.form-check-input.is-invalid ~ .form-check-label { color: var(--ins-form-invalid-color); }

/* There is no validation glyph to offset: $enable-validation-icons is off in _variables.scss,
   because its padding ate the room the value needed - see "A refused field keeps its room" in
   .claude/docs/forms.md. Do not add one back here for a single screen. */

/* ==========================================================================
   Phase 3 - the ticket flow.

   Everything below belongs to the board, the complaint page and the queues.
   Colours come from the --stage-* tokens at the top of this file, so a stage
   can never appear in two shades on two screens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   The period rail.

   A row of pills over the two dates rather than a <select> beside them. The
   select carried "Custom range" as a pickable option and picking it did
   nothing at all - no dates, no reload, no focus - so the one gesture that
   says "I am about to type my own dates" reached dead code, and the control
   then sat there claiming Custom while the query was still last month.

   The lit pill is always DERIVED from the two dates, so there is still exactly
   one statement of what is being asked for. Custom is a state the operator
   arms, never a value that is read or posted.

   No sizes are restated: a pill IS a .btn.btn-sm, so its padding and font come
   from the compiled control metrics in _aira-brand.scss (hard rule 10a).
   -------------------------------------------------------------------------- */
.aira-period-rail {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.aira-period-pill { border-radius: 999px; }

.aira-period-pill.is-active,
.aira-period-pill.is-active:hover,
.aira-period-pill.is-active:focus {
    background: var(--ins-primary);
    border-color: var(--ins-primary);
    color: #fff;
}

.aira-period-read { color: var(--aira-muted); }

/* The two dates under the rail, side by side - the panel is one column of sections, and a date
   is narrow. Their labels are the section's sub-labels, so they keep the compiled .form-label
   size (rule 10a) and only step back in colour. */
.aira-period-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin-top: .5rem;
}

.aira-period-dates .form-label {
    margin-bottom: .25rem;
    color: var(--aira-muted);
}

/* Armed, and waiting for the operator to type. Deliberately the same ring the
   multi-select trigger wears when its panel is open, so the two read as one
   product rather than as two controls that happen to share a bar. */
.aira-filterbar[data-period-custom="on"] [data-period-dates] {
    box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--ins-primary) 18%, transparent);
    border-radius: var(--ins-border-radius);
}

/* --------------------------------------------------------------------------
   The multi-select (app/js/aira-multiselect.js) - its first rules. The rows, ticks, footer and
   groups are the block further down (.aira-ms-opt, -box, -act, -group); the rules here are the
   trigger, panel and list properties that block does not restate, and both apply.

   Why it is ours and not the theme's Choices skin is in app/js/aira-multiselect.js, and it
   comes down to one line of that plugin: its container template copies only its own class, so
   `form-select-sm` never reaches the box it renders, and the theme's _choice.scss has no `-sm`
   variant to fall back to. The widget is architecturally incapable of being the toolbar size,
   and forcing it would mean either editing a theme file or restating a compiled control
   metric here - which is exactly what rule 10a exists to stop.

   So nothing below states a height, a padding or a font size for the control. The trigger IS
   a .form-select.form-select-sm - a <button> wearing the select's own classes - which is what
   lines it up with the Age select and the two date inputs beside it without one measurement
   being typed twice. The panel is a .dropdown-menu, so its ground, border, radius and shadow
   arrive from --ins-dropdown-* in both colour modes for free.

   The native <select multiple> underneath is the source of truth: it keeps the name the server
   reads, it is what the label points at, and everything here is a view of it.
   -------------------------------------------------------------------------- */

/* One line of text and the select's own caret, clipped rather than wrapped. A box that grows
   with its contents would move every control on the bar the moment somebody ticks a fourth
   value - and the summary is never shortened in JS, so what a screen reader announces stays
   whole even where the box has cut it off. */
.aira-ms-trigger {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.aira-ms-summary {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.aira-ms-trigger[aria-expanded="true"] {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--ins-primary) 18%, transparent);
}

/* Only the ceiling is ours. The component copies the trigger's measured width onto the
   panel's min-width on every open, because Popper's fixed strategy - which is what keeps the
   panel out of the drill dialog's scroll clip, where no z-index would have saved it - takes
   the panel out of any layout that could have sized it.

   Do NOT give this rule a `display`. .dropdown-menu is display:none until Bootstrap adds
   .show, both at one class of specificity, and this file loads last: a display here would win
   the hidden case and leave all nine panels on the bar permanently open. */
.aira-ms-panel { max-width: 22rem; }

/* Search box, rows and note share one left edge, on the theme's own dropdown item inset. */
.aira-ms-search { padding: .125rem var(--ins-dropdown-item-padding-x) .5rem; }

.aira-ms-list {
    max-height: 15rem;
    overflow-y: auto;
    outline: none;
    /* The bar renders inside the drill dialog's scrolling body as well as on the page.
       Without this, hitting the end of the list carries on scrolling the dialog underneath
       and the panel walks off the screen mid-pick. */
    overscroll-behavior: contain;
}

.aira-ms-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Kanban board
   -------------------------------------------------------------------------- */
.kanban-board {
    /* The page scrolls, not the columns, and every lane runs the board's full height
       (`align-items: stretch` above), so a short column still takes a drop level with the
       bottom of a long one. */
    padding-bottom: .75rem;
    /* No scroll-snap. With columns 313px apart, `proximity` refused to rest anywhere but a column
       edge: a 100px wheel notch or a scrollbar drag let go mid-column was pulled back to where it
       started or flung a whole column on, so sideways scrolling juddered instead of gliding.
       A swipe past the last column scrolls nothing further rather than navigating the tab back. */
    overscroll-behavior-x: contain;
}

/* The stage's colour, as the prototype draws it: a small rounded square, not a dot. It is the
   only place the stage colour appears on the board, so it carries full saturation. */
.kanban-column-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--stage-color, var(--ins-secondary-color));
    flex: 0 0 9px;
}

.kanban-column-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A white pill on the tinted head - the count has to stay legible when the column is the one
   with 34 cards in it. */
.kanban-column-count {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--aira-line);
    color: var(--aira-ink-2);
    font-size: .6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

.kanban-column-hidden {
    background: transparent;
    border-style: dashed;
    border-color: var(--aira-line-2);
}

.kanban-column-hidden .kanban-column-head {
    border-bottom-color: transparent;
    color: var(--aira-muted);
    text-transform: uppercase;
    letter-spacing: .09em;
}

/* Only while something is actually being dragged. Painting every column at rest would make
   the board look like a permanent error state. */
.kanban-board.is-dragging .kanban-column.is-drop-denied { opacity: .55; }

.kanban-board.is-dragging .kanban-column.is-drop-allowed {
    background: color-mix(in srgb, var(--ins-primary) 6%, var(--ins-tertiary-bg));
}

.kanban-card:focus-visible {
    outline: 2px solid var(--ins-primary);
    outline-offset: 1px;
}

/* The gap a dragged card will drop into. It follows the pointer and the card is dropped exactly
   there, so it reads as a slot rather than a faded copy of the card: a faint card on the column
   plane could be mistaken for a real one. Its height is set from the dragged card's own.

   No entrance animation: the gap is moved by re-inserting it, which restarts any animation on every
   move, and a gap that fades in each time it changes place reads as flicker - the opposite of the
   instant response it exists for. */
.kanban-drop-slot {
    flex: 0 0 auto;
    border-radius: 9px;
    border: 2px dashed color-mix(in srgb, var(--ins-primary) 55%, transparent);
    background: color-mix(in srgb, var(--ins-primary) 7%, transparent);
}

/* The card being dragged is hidden where it sat - the gap has taken its place - and the browser's
   drag image, a copy of it, is what follows the pointer. */
.kanban-card.is-drag-source { display: none; }

/* The drag image. Rendered off-screen for one frame and photographed by the browser, so it needs its
   lift in its own rules rather than borrowed from :hover. */
.kanban-card.kanban-drag-preview {
    box-shadow: 0 14px 30px rgba(15, 23, 42, .22);
    border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--aira-line));
    transform: none;
}

/* A hover lift under the pointer mid-drag nudges the cards the gap is measured against. */
.kanban-board.is-dragging .kanban-card:hover { transform: none; box-shadow: var(--aira-shadow-1); }

/* The column the gap is in right now, stronger than the other columns that would also take it. */
.kanban-board.is-dragging .kanban-column.is-drop-over {
    background: color-mix(in srgb, var(--ins-primary) 12%, var(--ins-tertiary-bg));
}

/* An empty column's "No complaints here" would otherwise sit beside the gap being offered. */
.kanban-column-body:has(> .kanban-drop-slot) > .kanban-empty { display: none; }

/* Dropped and on its way to the server. Not draggable again until the answer is in: a second drag
   of the same card would post a placement against a position that is about to change. */
.kanban-card.is-saving {
    pointer-events: none;
    opacity: .72;
}

.kanban-card-no {
    font-size: .6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ins-primary);
    letter-spacing: .01em;
    line-height: 1.4;
}

/* The customer is what an operator scans a column for, so it is the only thing on the card
   painted in full body ink. */
.kanban-card-customer {
    font-size: .8125rem;
    font-weight: 650;
    margin: .1875rem 0 .125rem;
    line-height: 1.35;
    color: var(--aira-ink);
}

.kanban-card-desc {
    font-size: .71875rem;
    line-height: 1.45;
    /* --aira-ink-2, not --ins-secondary-color: the description is meant to be read, and the
       theme's muted grey is for text that is not. */
    color: var(--aira-ink-2);
    margin: 0;
    /* Two lines is the point where a card stops being scannable. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-flag {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-top: .5625rem;
    padding: .3125rem .5625rem;
    border-radius: 6px;
    font-size: .65625rem;
    font-weight: 650;
    line-height: 1.35;
}

.kanban-card-flag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
    flex: 0 0 6px;
}

.kanban-card-flag.is-good {
    background: var(--ins-success-bg-subtle);
    color: var(--ins-success-text-emphasis);
    border: 1px solid var(--ins-success-border-subtle);
}

.kanban-card-flag.is-warn {
    background: var(--ins-warning-bg-subtle);
    color: var(--ins-warning-text-emphasis);
    border: 1px solid var(--ins-warning-border-subtle);
}

.kanban-card-flag.is-bad {
    background: var(--ins-danger-bg-subtle);
    color: var(--ins-danger-text-emphasis);
    border: 1px solid var(--ins-danger-border-subtle);
}

/* One rule, ruled off from the body above it. The attachment / follow-up / SLA markers used
   to sit on their own line below the footer, which made a card with any of them a third
   taller than one without - so a column of them scanned as ragged rather than as a list. */
.kanban-card-foot {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
    margin-top: .5625rem;
    padding-top: .5625rem;
    border-top: 1px solid var(--aira-line);
    overflow: hidden;
}

.kanban-card-age {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: .65625rem;
    font-weight: 600;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.kanban-meta {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    flex: 0 0 auto;
    font-size: .65625rem;
    color: var(--aira-muted);
    white-space: nowrap;
}

.kanban-meta svg { width: 12px; height: 12px; }
.kanban-meta.is-breached { color: var(--ins-danger); font-weight: 700; }

.kanban-empty,
.kanban-more {
    text-align: center;
    font-size: .71875rem;
    color: var(--aira-muted);
    padding: 1.125rem .375rem;
}

.kanban-more {
    padding: .5625rem;
    border: 1px dashed var(--aira-line-2);
    border-radius: 9px;
    background: var(--ins-secondary-bg);
    color: var(--aira-ink-2);
    font-weight: 600;
}

/* A column that is still loading has to hold its height, or the board reflows under the
   cursor the moment the first response lands. The shimmer is the shared one (*Loading* below);
   on the board's grey ground it is card-coloured, which is what a card-shaped block should be. */
.kanban-skeleton {
    --aira-skel-base: var(--ins-secondary-bg);
    --aira-skel-glint: var(--ins-tertiary-bg);
    height: 76px;
    flex: 0 0 auto;
    border-radius: 9px;
}

/* --------------------------------------------------------------------------
   Loading - Aira.loading in app/js/aira.js, ubold-ui.md *Loading*.

   ONE shimmer for the product. It was two copies of one gradient (the helpdesk
   board's and its list's) and a third area - the dashboard - that had none and
   showed a title over nothing. A host holds its height through --aira-skel-h, so
   nothing jumps when the figures land. Colours come only from --ins-secondary-bg,
   --ins-tertiary-bg and --aira-line-2, so dark mode follows by itself: on a white
   card the theme's tertiary ground is a near-invisible #f6f7fb, so the light
   base is mixed a step towards the line colour.
   -------------------------------------------------------------------------- */
html:not([data-bs-theme="dark"]) {
    --aira-skel-base: color-mix(in srgb, var(--aira-line-2) 50%, var(--ins-tertiary-bg));
    --aira-skel-glint: var(--ins-tertiary-bg);
}

html[data-bs-theme="dark"] {
    --aira-skel-base: var(--ins-tertiary-bg);
    --aira-skel-glint: var(--aira-line-2);
}

.aira-skel,
.kanban-skeleton {
    background: linear-gradient(90deg,
        var(--aira-skel-base) 25%,
        var(--aira-skel-glint) 37%,
        var(--aira-skel-base) 63%);
    background-size: 400% 100%;
    border-radius: 4px;
    animation: aira-wait 0s linear .18s backwards, aira-shimmer 1.3s ease-in-out infinite;
}

@keyframes aira-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* A shimmer is motion, and says nothing a still block does not. */
@media (prefers-reduced-motion: reduce) {
    .aira-skel,
    .kanban-skeleton { animation: aira-wait 0s linear .18s backwards; }
}

/* The containers are not blocks of their own - their parts are. */
.aira-skel.aira-skel--chart,
.aira-skel.aira-skel--rows {
    background: none;
    animation: none;
    border-radius: 0;
}

/* Five bars seated on a baseline, at the height the chart will be. */
.aira-skel--chart {
    display: flex;
    align-items: flex-end;
    gap: 6%;
    height: var(--aira-skel-h, 240px);
    padding: 1rem 6% 0;
    border-bottom: 1px solid var(--aira-line-2);
}

.aira-skel--chart > i {
    flex: 1 1 0;
    border-radius: 4px 4px 0 0;
}

/* The ring a donut or a gauge will draw, at its own diameter. */
.aira-skel--donut {
    width: var(--donut-size, var(--aira-skel-h, 180px));
    max-width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
    mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
}

/* A tile of the grid it waits in - .kpi-card's height, .report-card's radius. */
.aira-skel--tile {
    height: var(--aira-skel-h, 104px);
    border-radius: var(--ins-border-radius-lg, .5rem);
}

/* The dashboard's SLA card, always the last tile, carries a third figure (No target) that wraps
   under the other two at a tile's usual width - so its skeleton waits a line taller, and its row
   does not grow when it lands. */
[data-dash-tiles] > .aira-skel--tile:last-child { height: calc(var(--aira-skel-h, 104px) + 1.8rem); }

.aira-skel--rows {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .75rem 1rem;
    min-height: var(--aira-skel-h, 0);
}

.aira-skel--rows > i { display: block; height: 1rem; }

/* A table body's rows: a bar per row, on a row with no rule under it. */
.aira-skel-row > td { border-bottom-color: transparent; }
.aira-skel--bar { display: block; height: 1.125rem; }

/* A line of text still to come - a count beside a heading. */
.aira-skel--line {
    display: inline-block;
    width: 9rem;
    height: .875em;
    vertical-align: middle;
}

/* A dialog body, a pane or a stage waiting for a whole form: the theme's own spinner in the middle of the box that waits (crm/90).
   The panel takes the whole host - a flex row's width, a grid's every column, a host's height when it has one - because centred
   inside a panel that shrank to its spinner is the host's edge: the print stage, a flex row, drew it at the left (LC1). height: 100%
   resolves to auto in a host that grows with its content, so there the panel stays its own band (LC2). */
.aira-skel--panel {
    display: flex;
    flex: 1 1 auto;
    align-self: stretch;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: var(--aira-skel-h, 0);
    padding: 3rem 0;
}

/* A refresh dims what is there rather than emptying it: a card that empties and refills reads
   as data disappearing. aria-busy is the state; .is-loading only says this host dims. */
.is-loading[aria-busy="true"] {
    animation: aira-dim 0s linear .18s forwards;
}

/* What a failed host held answers a question no longer on screen, so the failure replaces it. */
[data-aira-failed] > :not([data-aira-fail]) { display: none !important; }

/* The compact failed box, where figures were: it sits in a card rather than above a view, and
   across every column of a tile grid rather than in the first cell of it. */
.aira-ws-state.aira-load-failed {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

/* A table whose draw failed counts nothing: its info and pager described the rows that went. */
[data-table-failed] .dt-info,
[data-table-failed] .dt-paging { visibility: hidden; }

/* Nor one waiting on a different question; its skeleton rows are the one indicator (stale-dialogs.md). */
[data-table-pending] .dt-info,
[data-table-pending] .dt-paging { visibility: hidden; }
[data-table-pending] .dt-processing { display: none !important; }

/* --------------------------------------------------------------------------
   Chips shared by the board, the tables and the ticket page.
   -------------------------------------------------------------------------- */
/* Priority is a coloured dot and a coloured word, not a pill - the prototype's `.pri`.
   Four filled pills on one card footer, next to a fifth pill for the product, turned a card
   into a row of badges with the customer's name lost above them. The dot carries the
   saturation; the text carries a darker shade of the same hue so it stays readable. */
.pri-chip {
    display: inline-flex;
    align-items: center;
    gap: .3125rem;
    /* Never shrinks. It is one short word, and letting it compress inside the card footer
       squeezed it under the product chip beside it. The product chip absorbs the slack. */
    flex: 0 0 auto;
    font-size: .71875rem;
    font-weight: 600;
    white-space: nowrap;
}

.pri-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pri-dot, currentColor);
    flex: 0 0 7px;
}

.pri-low    { color: #6c7684; --pri-dot: #9aa4b2; }
.pri-normal { color: #20609f; --pri-dot: #2a78d6; }
.pri-high   { color: #b25a32; --pri-dot: #ec835a; }
.pri-urgent { color: #a52d2d; --pri-dot: #d03b3b; }

/* The dots hold; only the words are lifted off the dark ground. */
html[data-bs-theme="dark"] .pri-low    { color: #9aa4b2; }
html[data-bs-theme="dark"] .pri-normal { color: #74aae8; }
html[data-bs-theme="dark"] .pri-high   { color: #f0a583; }
html[data-bs-theme="dark"] .pri-urgent { color: #ea8484; }

.chip-muted,
.chip-info {
    display: inline-block;
    white-space: nowrap;
    vertical-align: bottom;
    padding: .1875rem .5625rem;
    border-radius: 999px;
    font-size: .71875rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid var(--aira-line);
    background: var(--aira-surface-2);
    color: var(--aira-ink-2);
}

.chip-info {
    background: var(--aira-brand-50);
    border-color: #cfe2f8;
    color: var(--aira-brand-600);
}

/* Only on a 300px card, where the footer also carries the priority, the markers and the age -
   this is the one item allowed to give up width, and it ellipsises when it does. In a table
   cell the same chip has room for the whole product name and must not hide half of it. */
.kanban-card-foot .chip-muted {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-bs-theme="dark"] .chip-info {
    background: color-mix(in srgb, var(--ins-primary) 18%, transparent);
    border-color: color-mix(in srgb, var(--ins-primary) 38%, transparent);
    color: #9cc4f2;
}

/* --------------------------------------------------------------------------
   The complaint page.
   -------------------------------------------------------------------------- */
.ticket-panel { padding: 1rem 1.25rem 0; }
.ticket-panel-head { padding-bottom: .75rem; }

.ticket-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
    margin-top: .5rem;
    border-top: 1px solid var(--ins-border-color);
    position: sticky;
    bottom: 0;
    background: var(--ins-body-bg);
    z-index: 2;
}

/* The progress rail. Horizontal on a wide screen, and it scrolls rather than wrapping -
   a wrapped rail reads as two workflows. */
.stage-rail {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    /* Stated, because overflow-x: auto alone computes overflow-y to auto too: one pixel of line box over the rail's height drew a vertical
       scroll bar at the end of the quotation read's head (crm/76). The rail scrolls sideways or not at all. */
    overflow-y: hidden;
    padding: .5rem 0 .75rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.stage-rail-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    min-width: 5.5rem;
    flex: 1 0 auto;
    position: relative;
    text-align: center;
}

/* The connector is drawn on the step rather than as its own element, so a step cannot end up
   with a line pointing at nothing. */
.stage-rail-step:not(:first-child)::before {
    content: "";
    position: absolute;
    top: 11px;
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--ins-border-color);
}

.stage-rail-step.is-done::before,
.stage-rail-step.is-current::before { background: var(--stage-color, var(--ins-primary)); }

.stage-rail-dot {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .625rem;
    font-weight: 700;
    background: var(--ins-secondary-bg);
    color: var(--ins-secondary-color);
    border: 2px solid var(--ins-border-color);
}

.stage-rail-dot svg { width: 12px; height: 12px; }

.stage-rail-step.is-done .stage-rail-dot {
    background: var(--stage-color);
    border-color: var(--stage-color);
    color: #fff;
}

.stage-rail-step.is-current .stage-rail-dot {
    background: var(--ins-body-bg);
    border-color: var(--stage-color);
    color: var(--stage-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color) 20%, transparent);
}

/* Label over timestamp. The two stack so a nine-step rail stays one row of dots rather than
   growing a second rail's worth of width per step. */
.stage-rail-body {
    display: flex;
    flex-direction: column;
    gap: .0625rem;
    min-width: 0;
}

.stage-rail-label {
    font-size: .6875rem;
    line-height: 1.25;
    color: var(--ins-secondary-color);
    max-width: 7.5rem;
}

.stage-rail-step.is-current .stage-rail-label { color: var(--ins-emphasis-color); font-weight: 600; }

/* The moment the complaint entered the stage. Never wraps: a date broken across two lines reads
   as two dates, and this rail already scrolls sideways by design. */
.stage-rail-when {
    font-size: .625rem;
    line-height: 1.2;
    color: var(--aira-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* On Hold is appended to the rail, not part of it - so it is drawn as an interruption rather
   than as the next step along. */
.stage-rail-step.is-hold .stage-rail-dot {
    background: var(--ins-body-bg);
    border-color: var(--stage-hold, var(--ins-warning));
    color: var(--stage-hold, var(--ins-warning));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-hold, var(--ins-warning)) 22%, transparent);
}

.stage-rail-step.is-hold .stage-rail-label {
    color: var(--stage-hold, var(--ins-warning));
    font-weight: 700;
}

/* Dashed, because the complaint did not travel this leg - it stopped. */
.stage-rail-step.is-hold::before {
    background: none;
    border-top: 2px dashed var(--stage-hold, var(--ins-warning));
    height: 0;
}

/* The mandatory-field strip. It is the difference between "why will this not go to Solved?"
   and a support call. */
.missing-strip {
    border: 1px solid var(--ins-warning-border-subtle);
    background: var(--ins-warning-bg-subtle);
    border-radius: var(--ins-border-radius);
    padding: .5rem .75rem;
    margin-bottom: .75rem;
}

.missing-strip.is-clear {
    border-color: var(--ins-success-border-subtle);
    background: var(--ins-success-bg-subtle);
}

.missing-strip-head {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ins-warning-text-emphasis);
}

.missing-strip.is-clear .missing-strip-head { color: var(--ins-success-text-emphasis); }

.missing-strip-block {
    margin-left: auto;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .4rem;
    border-radius: 999px;
    background: var(--ins-danger);
    color: #fff;
}

.missing-strip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: baseline;
    margin-top: .375rem;
    font-size: .75rem;
}

.missing-strip-group {
    font-weight: 600;
    min-width: 10rem;
    color: var(--ins-emphasis-color);
}

.missing-strip-fields { color: var(--ins-secondary-color); }

.ticket-tabs { margin-bottom: 0; }
.ticket-tab-content { padding-top: 1rem; }

.ticket-section {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg);
    padding: .875rem 1rem;
    margin-bottom: 1rem;
}

/* The prototype's `.form-sec > h4`: brand-blue small caps over a hairline. It was 13px in
   the muted grey - the same ink as the help text under every field - with nothing beneath
   it, so a long complaint read as one undivided run of fields. The rule sits on the head
   rather than on the title because the head is a flex row carrying the pending badge and
   the Edit button: underlining the <h5> alone would underline three words mid-row.

   --ins-primary-text-emphasis, not --ins-primary: this is text, and the brand at full strength
   is #1b56a0 - a navy that all but disappears against the dark theme's ground. The emphasis
   pair is #174988 in light (the prototype's own --brand-600) and lifts to #769ac6 in dark, and
   BrandPalette.cs re-derives both when an operator picks their own colour under Settings. */
.ticket-section-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.ticket-section-title {
    margin: 0;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--ins-primary-text-emphasis);
}

.ticket-section-blurb {
    font-size: .75rem;
    color: var(--ins-secondary-color);
    margin: -.25rem 0 .75rem;
}

.ticket-section-note {
    font-size: .75rem;
    color: var(--ins-secondary-color);
    margin: .5rem 0 0;
    padding-top: .5rem;
    border-top: 1px dashed var(--ins-border-color);
}

.ticket-section-lock {
    display: inline-flex;
    align-items: center;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--ins-secondary-color);
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
    padding: .15rem .5rem;
}

/* Both views are in the DOM; editing swaps them. A round trip to open a form the operator
   opens forty times a day is forty round trips. */
.ticket-section-form { display: none; }
.ticket-section.is-editing .ticket-section-form,
.ticket-section-form.is-open { display: block; }
.ticket-section.is-editing [data-section-read],
.ticket-section.is-editing [data-cost-read] { display: none; }
.ticket-section.is-editing { border-color: var(--ins-primary); }

/* An Edit button on a section already being edited does nothing; the bar below is the way out. */
.ticket-section.is-editing [data-section-edit],
.ticket-section.is-editing [data-cost-edit] { display: none; }

/* The editing section's own bar. Sticky to the bottom of whatever scrolls - the dialog body or
   the window - and lifted by the panel's action bar's height (measured by ticket-detail.js),
   so Save section is on screen for as long as any of the section is. Its containing block is
   the form, so once the section's end is in view it settles back into place.

   It bleeds to the section's border (the negative margins undo .ticket-section's padding) and
   paints an opaque ground, because stuck it sits over the fields scrolling beneath it. */
.ticket-section-actions {
    position: sticky;
    bottom: var(--ticket-foot-height, 0px);
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 1rem -1rem -.875rem;
    padding: .625rem 1rem;
    background: var(--ins-secondary-bg);
    border-top: 1px solid var(--ins-border-color);
    border-radius: 0 0 var(--ins-border-radius-lg) var(--ins-border-radius-lg);
    box-shadow: 0 -.5rem 1rem -.75rem rgba(0, 0, 0, .2);
}

.ticket-section-status {
    display: flex;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
}

.ticket-section-status::before {
    content: "";
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--ins-primary);
}

.ticket-section-buttons {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

/* Off the dirty guard's own .is-dirty on the form, so the words cannot disagree with whether
   Save section is alive. */
.ticket-section-status-dirty,
.ticket-section-status-nudge { display: none; }

.ticket-section-form.is-dirty .ticket-section-status-clean { display: none; }
.ticket-section-form.is-dirty .ticket-section-status-dirty {
    display: inline;
    font-weight: 600;
    color: var(--ins-warning-text-emphasis);
}
.ticket-section-form.is-dirty .ticket-section-status::before { background: var(--ins-warning); }

/* A move, a close or a second Edit was held because of these changes. The reason is painted
   on the bar the operator has to use next, not put in a toast. */
.ticket-section-actions.is-nudged .ticket-section-status-clean,
.ticket-section-actions.is-nudged .ticket-section-status-dirty { display: none; }
.ticket-section-actions.is-nudged .ticket-section-status-nudge {
    display: inline;
    font-weight: 600;
    color: var(--ins-danger-text-emphasis);
}
.ticket-section-actions.is-nudged .ticket-section-status::before { background: var(--ins-danger); }
.ticket-section-actions.is-nudged { animation: aira-section-nudge .45s ease-in-out 2; }

@keyframes aira-section-nudge {
    50% { box-shadow: 0 -.5rem 1rem -.75rem rgba(0, 0, 0, .2), inset 0 0 0 2px rgba(var(--ins-danger-rgb), .55); }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-section-actions.is-nudged { animation: none; }
}

/* The read view: a two-column definition list that collapses to one on a phone. */
.ticket-kv {
    display: grid;
    grid-template-columns: minmax(9rem, 12rem) 1fr;
    gap: .25rem 1rem;
    margin: 0;
    font-size: .8125rem;
}

.ticket-kv dt {
    font-weight: 500;
    color: var(--ins-secondary-color);
    font-size: .75rem;
    padding-top: .1rem;
}

.ticket-kv dd { margin: 0 0 .25rem; }
.ticket-kv-blank { color: var(--ins-secondary-color); font-style: italic; opacity: .8; }

@media (max-width: 575.98px) {
    .ticket-kv { grid-template-columns: 1fr; }
    .ticket-kv dd { margin-bottom: .5rem; }
}

/* --------------------------------------------------------------------------
   Sizes and quantities - the size lines editor and its read view
   (size-lines.md, D16-D17).

   A bordered grid with a light brand tint on its header, the look the owner
   asked of a table somebody works in. The controls inside it are the compiled
   field sizes (rule 10a) and nothing here restates one. No `overflow: hidden`
   on the grid to round its corners: it would clip the focus ring of every
   control on its edge (rule 10c) - the head and the foot round their own.
   -------------------------------------------------------------------------- */
.ticket-sizes-label {
    display: flex;
    align-items: baseline;
    margin-bottom: .375rem;
}

.ticket-sizes-grid {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

.ticket-sizes-head,
.ticket-sizes-row,
.ticket-sizes-foot {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) minmax(9rem, 13rem) 2.75rem;
    gap: .75rem;
    align-items: start;
    padding: .5rem .75rem;
}

.ticket-sizes-head {
    padding-block: .4rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-secondary-color);
    background: rgba(var(--ins-primary-rgb), .06);
    border-bottom: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius) var(--ins-border-radius) 0 0;
}

.ticket-sizes-head > :first-child,
.ticket-sizes-sr { text-align: center; }

.ticket-sizes-row + .ticket-sizes-row { border-top: 1px dashed var(--ins-border-color); }

/* Level with the middle of the 35px field beside it, and staying there when a refusal grows the
   row: a position, so muted and in tabular figures like every .sr-col. */
.ticket-sizes-sr {
    padding-top: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
}

.ticket-sizes-qty .form-control { font-variant-numeric: tabular-nums; }

.ticket-sizes-remove { color: var(--ins-secondary-color); }
.ticket-sizes-remove:hover { color: var(--ins-danger); }

.ticket-sizes-foot {
    align-items: center;
    background: var(--ins-tertiary-bg);
    border-top: 1px solid var(--ins-border-color);
    border-radius: 0 0 var(--ins-border-radius) var(--ins-border-radius);
}

.ticket-sizes-actions { grid-column: 1 / 3; }

.ticket-sizes-total {
    grid-column: 3;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    font-size: .8125rem;
}

.ticket-sizes-total-label {
    font-weight: 600;
    color: var(--ins-secondary-color);
}

.ticket-sizes-total-value {
    font-weight: 700;
    color: var(--ins-emphasis-color);
    text-align: end;
    font-variant-numeric: tabular-nums;
}

/* A refusal about the lines as a whole - changed by somebody else - is painted on the block. */
.ticket-sizes.is-invalid .ticket-sizes-grid,
.ticket-costs.is-invalid .ticket-sizes-grid { border-color: var(--ins-danger); }

/* The closure cost sheet's rows are this same grid (cost-categories.md). */
.ticket-costs-none { margin-top: .75rem; }
.ticket-costs.is-none .ticket-costs-none { margin-top: 0; }

/* On a phone the category takes the line and the amount the next. */
@media (max-width: 575.98px) {
    .ticket-costs .ticket-sizes-head { display: none; }
    .ticket-costs .ticket-sizes-row { grid-template-columns: 1.5rem minmax(0, 1fr) 2.75rem; row-gap: .5rem; }
    .ticket-costs .ticket-sizes-sr { grid-column: 1; grid-row: 1 / span 2; }
    .ticket-costs .ticket-costs-category { grid-column: 2; grid-row: 1; }
    .ticket-costs .ticket-costs-amount { grid-column: 2; grid-row: 2; }
    .ticket-costs .ticket-sizes-remove { grid-column: 3; grid-row: 1; }
}

@media (max-width: 575.98px) {
    .ticket-sizes-head,
    .ticket-sizes-row,
    .ticket-sizes-foot {
        grid-template-columns: 1.5rem minmax(0, 1fr) 7rem 2.75rem;
        gap: .5rem;
        padding-inline: .5rem;
    }

    .ticket-sizes-actions,
    .ticket-sizes-total { grid-column: 1 / -1; }
}

/* The read view: one line as a sentence, several as a small table with its total. */
.ticket-sizes-times {
    margin-left: .25rem;
    color: var(--ins-secondary-color);
}

.ticket-sizes-read-wrap { max-width: 32rem; }
.ticket-sizes-read { font-size: .8125rem; }

.ticket-sizes-read thead th {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-secondary-color);
    background: rgba(var(--ins-primary-rgb), .06);
}

.ticket-sizes-read td.text-end,
.ticket-sizes-read th.text-end { font-variant-numeric: tabular-nums; }

.ticket-sizes-read-total td {
    font-weight: 600;
    background: var(--ins-tertiary-bg);
}

.ticket-empty {
    text-align: center;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
    background: var(--ins-tertiary-bg);
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    padding: 1.25rem 1rem;
}

/* --------------------------------------------------------------------------
   Timeline - a record's whole story in one list. Drawn for the helpdesk's complaint log, whose markup
   went with it in Phase 2; kept for the CRM's history rail (crm/16, crm/12 §3.3).

   One rail down the left, a dated pill where the day changes, a coloured
   marker per entry. Each entry sets --tl-color: the target stage's own colour
   on a move, a theme token for everything else.

   The marker and the day pill are opaque on --ins-secondary-bg, which is the
   ground of both callers (the dialog and the card on the full page) - that is
   what lets the rail pass behind them rather than through them.
   -------------------------------------------------------------------------- */
.tl-total {
    font-size: .75rem;
    color: var(--ins-secondary-color);
    white-space: nowrap;
}

/* Two buttons beside the title leave a phone no room; they drop under it instead. */
.tl-section .ticket-section-head { flex-wrap: wrap; }

.tl-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-left: auto;
}

.tl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: 1rem;
}

.tl-filter,
.tl-order {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3125rem .6875rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ins-secondary-color);
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
    cursor: pointer;
}

.tl-filter svg,
.tl-order svg { width: .875rem; height: .875rem; }

.tl-filter:hover,
.tl-order:hover {
    color: var(--ins-emphasis-color);
    border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--ins-border-color));
}

.tl-filter:focus-visible,
.tl-order:focus-visible,
.tl-more:focus-visible {
    outline: 2px solid var(--ins-primary);
    outline-offset: 2px;
}

.tl-filter.active {
    color: #fff;
    background: var(--ins-primary);
    border-color: var(--ins-primary);
}

.tl-filter-count {
    min-width: 1.25rem;
    padding: .0625rem .375rem;
    font-size: .6875rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-radius: 999px;
    background: var(--ins-tertiary-bg);
}

.tl-filter.active .tl-filter-count { background: rgba(255, 255, 255, .22); }

.tl { position: relative; }

.tl::before {
    content: "";
    position: absolute;
    top: .75rem;
    bottom: .75rem;
    left: calc(1rem - 1px);
    width: 2px;
    border-radius: 1px;
    background: var(--ins-border-color);
}

.tl-day { position: relative; }
.tl-day + .tl-day { margin-top: .375rem; }

.tl-day-head {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .875rem;
    padding: .25rem .75rem;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ins-primary-text-emphasis);
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
}

.tl-day-date {
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--ins-secondary-color);
    font-variant-numeric: tabular-nums;
}

.tl-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: .75rem;
    padding-bottom: .875rem;
}

.tl-marker {
    position: relative;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-top: .3125rem;
    border-radius: 50%;
    color: var(--tl-color);
    background: color-mix(in srgb, var(--tl-color) 14%, var(--ins-secondary-bg));
    border: 1px solid color-mix(in srgb, var(--tl-color) 40%, var(--ins-secondary-bg));
    box-shadow: 0 0 0 3px var(--ins-secondary-bg);
}

.tl-marker svg { width: .9375rem; height: .9375rem; }

.tl-card {
    min-width: 0;
    padding: .625rem .875rem .6875rem;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.tl-item:hover .tl-card {
    border-color: color-mix(in srgb, var(--tl-color) 45%, var(--ins-border-color));
    box-shadow: 0 .25rem .75rem -.25rem rgba(0, 0, 0, .12);
}

.tl-card-head {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
}

.tl-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .02em;
    background: var(--aira-brand-100);
    color: var(--aira-brand-600);
}

.tl-avatar.is-system {
    background: var(--ins-tertiary-bg);
    color: var(--ins-secondary-color);
}

.tl-avatar svg { width: .875rem; height: .875rem; }

.tl-line {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .375rem;
    padding-top: .125rem;
    font-size: .8125rem;
    line-height: 1.5;
}

.tl-actor { font-weight: 600; color: var(--ins-emphasis-color); }
.tl-verb { color: var(--ins-secondary-color); }
.tl-subject { font-weight: 600; color: var(--ins-body-color); }

.tl-count {
    padding: .0625rem .4375rem;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--ins-secondary-color);
    background: var(--ins-tertiary-bg);
    border-radius: 999px;
}

.tl-line .stage-chip { font-size: .6875rem; line-height: 1.5; }

.tl-arrow {
    flex: none;
    width: .875rem;
    height: .875rem;
    color: var(--ins-secondary-color);
}

.tl-flag {
    padding: .0625rem .4375rem;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ins-danger-text-emphasis);
    background: var(--ins-danger-bg-subtle);
    border: 1px solid var(--ins-danger-border-subtle);
    border-radius: 999px;
}

.tl-time {
    flex: none;
    display: inline-flex;
    align-items: baseline;
    gap: .375rem;
    margin-left: auto;
    padding-top: .1875rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--ins-secondary-color);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tl-time-day::after {
    content: "\00b7";
    margin-left: .375rem;
}

.tl-time-clock {
    font-weight: 600;
    color: var(--ins-body-color);
}

/* Folding. The header is the handle as well as the chevron, because it is the larger target and
   the one the eye is already on. */
.tl-item[data-tl-foldable] .tl-card-head { cursor: pointer; }

.tl-toggle {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: -.0625rem -.25rem 0 0;
    padding: 0;
    color: var(--ins-secondary-color);
    background: none;
    border: 0;
    border-radius: var(--ins-border-radius);
    cursor: pointer;
}

.tl-toggle:hover { color: var(--ins-emphasis-color); background: var(--ins-tertiary-bg); }
.tl-toggle:focus-visible { outline: 2px solid var(--ins-primary); outline-offset: 1px; }
.tl-toggle svg { width: 1rem; height: 1rem; }
.tl-item.is-collapsed .tl-toggle svg { transform: rotate(-90deg); }

/* 1fr to 0fr animates the height of content nobody measured. Visibility follows the fold, late on
   the way closed and at once on the way open, so a folded entry's "Show more" leaves the tab order.
   Overflow is clipped only while folded or folding - clipped always, it ate the focus ring of the
   last control in the body. */
.tl-collapsible {
    display: grid;
    /* minmax(0, 1fr), not the implicit auto column: a grid track grows to its widest unbreakable
       content, and a long file name then pushed the whole card past a phone's edge instead of
       ellipsing. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
}

.tl-collapsible-inner { min-width: 0; min-height: 0; }

.tl-item.is-collapsed .tl-collapsible {
    grid-template-rows: 0fr;
    visibility: hidden;
}

.tl-item.is-collapsed .tl-collapsible-inner,
.tl-item.is-folding .tl-collapsible-inner { overflow: hidden; }

/* Indented by the avatar and its gap, so everything under a name lines up with the name. */
.tl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .375rem;
    margin: .125rem 0 0 2.375rem;
    font-size: .75rem;
    color: var(--ins-secondary-color);
}

.tl-meta svg { width: .8125rem; height: .8125rem; }
.tl-meta .stage-chip { padding: .0625rem .5rem; font-size: .6875rem; line-height: 1.4; }

.tl-body { margin: .5rem 0 0 2.375rem; }

/* Two classes deep on purpose: .tl-detail and .tl-quote reset their own margin, and at equal
   specificity the later rule won and pressed a follow-up's remark against the line above it. */
.tl .tl-body > * + * { margin-top: .5rem; }

.tl-quote,
.tl-note,
.tl-detail {
    margin: 0;
    font-size: .8125rem;
    line-height: 1.55;
    color: var(--ins-body-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tl-quote {
    padding: .375rem .75rem;
    background: var(--ins-tertiary-bg);
    border-left: 3px solid color-mix(in srgb, var(--tl-color) 60%, transparent);
    border-radius: 0 var(--ins-border-radius) var(--ins-border-radius) 0;
}

/* The same amber as the Conversation tab, so a note reads as a note wherever it turns up. */
.tl-note {
    padding: .5rem .75rem;
    background: var(--ins-warning-bg-subtle);
    border: 1px solid var(--ins-warning-border-subtle);
    border-left: 3px solid var(--ins-warning);
    border-radius: var(--ins-border-radius);
}

.tl-item.is-bad .tl-detail { color: var(--ins-danger-text-emphasis); }

.tl-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    font-size: .75rem;
    color: var(--ins-secondary-color);
}

.tl-facts span { display: inline-flex; align-items: center; gap: .3125rem; }
.tl-facts svg { width: .8125rem; height: .8125rem; }

.tl-diff {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
    margin: 0;
    font-size: .8125rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    overflow: hidden;
}

.tl-diff-row { display: contents; }

.tl-diff dt,
.tl-diff dd {
    padding: .4375rem .75rem;
    border-top: 1px solid var(--ins-border-color);
}

.tl-diff-row:first-child dt,
.tl-diff-row:first-child dd { border-top: 0; }

.tl-diff dt {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-secondary-color);
    background: var(--ins-tertiary-bg);
}

.tl-diff dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    min-width: 0;
    margin: 0;
}

.tl-val {
    padding: .0625rem .4375rem;
    line-height: 1.5;
    border-radius: .25rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.tl-val.is-old {
    color: var(--ins-danger-text-emphasis);
    background: var(--ins-danger-bg-subtle);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--ins-danger) 55%, transparent);
}

.tl-val.is-new {
    font-weight: 500;
    color: var(--ins-success-text-emphasis);
    background: var(--ins-success-bg-subtle);
}

.tl-val.is-blank {
    padding: 0;
    font-style: italic;
    color: var(--ins-secondary-color);
}

.tl-more {
    padding: 0;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-primary-text-emphasis);
    background: none;
    border: 0;
    cursor: pointer;
}

.tl-more:hover { text-decoration: underline; }

.tl-files {
    display: flex;
    flex-direction: column;
    gap: .3125rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tl-files li {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    padding: .375rem .625rem;
    font-size: .8125rem;
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.tl-files svg { flex: none; width: .9375rem; height: .9375rem; color: var(--tl-color); }

.tl-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.tl-file-size {
    flex: none;
    margin-left: auto;
    font-size: .75rem;
    color: var(--ins-secondary-color);
    font-variant-numeric: tabular-nums;
}

.tl-item.is-bad .tl-file-name {
    color: var(--ins-secondary-color);
    text-decoration: line-through;
}

@media (max-width: 575.98px) {
    .tl-item { grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: .5rem; }
    .tl::before { left: calc(.875rem - 1px); }
    .tl-marker { width: 1.75rem; height: 1.75rem; }
    .tl-meta,
    .tl-body { margin-left: 0; }
    .tl-diff { grid-template-columns: minmax(0, 1fr); }
    .tl-diff dd { padding-top: 0; border-top: 0; }

    /* Date over time: side by side they took the width the name needs. */
    .tl-time { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.35; }
    .tl-time-day::after { content: none; }
}

/* --------------------------------------------------------------------------
   Attachments - a record's files (crm/12 §4), as the helpdesk drew them on a complaint; their markup
   went with it in Phase 2 and returns with the CRM's record pages. Behaviour: app/js/aira-attachments.js.
   -------------------------------------------------------------------------- */
.attach-count {
    margin-left: auto;
    font-size: .75rem;
    color: var(--ins-secondary-color);
}

.attach-field { position: relative; }

/* The input carries the files and the refusal; the zone is what the operator sees. Kept in the
   DOM (not [hidden]) because the validation engine skips a control inside [hidden] - and the
   .invalid-feedback it inserts after the input is a sibling Bootstrap reveals off .is-invalid
   whether the input itself is displayed or not. */
.attach-input { display: none; }

.attach-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: 6rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 1.5px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg);
    background: var(--ins-tertiary-bg);
}

.attach-drop-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

.attach-drop:hover,
.attach-drop.is-over {
    border-color: var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 5%, var(--ins-tertiary-bg));
}

.attach-drop:focus-visible {
    outline: none;
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--ins-primary) 22%, transparent);
}

.attach-drop-icon svg { width: 1.5rem; height: 1.5rem; color: var(--ins-secondary-color); }
.attach-drop.is-over .attach-drop-icon svg { color: var(--ins-primary); }
.attach-drop-text { font-size: .8125rem; }

.attach-drop-link {
    font-weight: 600;
    color: var(--ins-primary-text-emphasis);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.attach-drop-hint { font-size: .75rem; color: var(--ins-secondary-color); }

.attach-field:has(.attach-input.is-invalid) .attach-drop {
    border-color: var(--ins-danger);
    background: color-mix(in srgb, var(--ins-danger) 4%, var(--ins-tertiary-bg));
}

/* Uploading. The zone stays where it is and becomes the progress bar, rather than a spinner
   somewhere else on a tab the operator may have scrolled. */
.attach-field.is-busy .attach-drop { cursor: progress; }
.attach-field.is-busy .attach-drop-idle { display: none; }

.attach-progress {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(100%, 22rem);
}

.attach-progress-text { font-size: .8125rem; font-weight: 600; }

.attach-progress-bar {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--ins-secondary-bg);
}

.attach-progress-bar > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--ins-primary);
}

/* Every byte has arrived and the server is saving (examining and compressing, unseen - crm/116 IC2).
   There is no figure to show for that, so the bar says "working" instead of sitting at 100% looking stuck. */
.attach-progress-bar.is-indeterminate > span {
    width: 35%;
    animation: attach-indeterminate 1.1s ease-in-out infinite;
}

@keyframes attach-indeterminate {
    from { transform: translateX(-100%); }
    to { transform: translateX(290%); }
}

@media (prefers-reduced-motion: reduce) {
    .attach-progress-bar.is-indeterminate > span { width: 100%; opacity: .5; animation: none; }
}

.attach-grid {
    display: grid;
    /* min(100%, ...) so a column never demands more than the pane has: at phone width the old
       minmax(15rem, 1fr) was wider than the dialog body and pushed the tiles off its edge. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: .625rem;
    margin-top: .75rem;
}

.attach-grid:empty { display: none; }
.ticket-section-head + .attach-grid { margin-top: 0; }

/* A tile. min-width: 0 on the tile and its body is the whole fix for a file name running out of
   the card: a flex or grid item's automatic minimum is its content, so a long name made the tile
   wider than its column instead of truncating. The markup asked for Bootstrap's `min-w-0`, which
   Bootstrap 5.3 does not have - so nothing was ever holding it in. */
.attach-tile {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    padding: .5rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}

.attach-tile:hover { border-color: color-mix(in srgb, var(--ins-primary) 40%, var(--ins-border-color)); }

.attach-tile.is-pending {
    border-style: dashed;
    background: var(--ins-tertiary-bg);
}

.attach-thumb {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    overflow: hidden;
    border-radius: var(--ins-border-radius);
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    text-decoration: none;
    background: var(--ins-secondary-color);
}

.attach-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attach-thumb.is-image { background: var(--ins-secondary-bg); }

/* A video's first frame, with the play mark over it so it is not taken for a photo. */
.attach-thumb.is-video { position: relative; background: #111418; }

.attach-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.attach-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: auto;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .6);
}

.attach-play svg { width: .625rem; height: .625rem; margin-left: 1px; fill: currentColor; }

/* The file would not load - most often a storage folder in the wrong place. Said with a mark
   rather than the browser's broken-image icon, and the viewer says the rest. */
.attach-thumb.is-broken { color: var(--ins-danger-text-emphasis); background: var(--ins-danger-bg-subtle); }
.attach-thumb.is-broken img,
.attach-thumb.is-broken video,
.attach-thumb.is-broken .attach-play { display: none; }
.attach-thumb.is-broken::after { content: "!"; font-size: 1rem; font-weight: 700; }

/* A PDF is the common case here - a customer's complaint mail, a test report - so it gets the
   colour people already associate with one. */
.attach-thumb.is-pdf { background: #d03b3b; }

.attach-body {
    flex: 1 1 auto;
    min-width: 0;
}

.attach-name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .8125rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

a.attach-name:hover,
button.attach-name:hover { color: var(--ins-primary-text-emphasis); text-decoration: underline; }

/* A pending tile's thumbnail and name are buttons - they open the file viewer before Save (C12) -
   drawn exactly as a saved tile's links. */
button.attach-thumb {
    padding: 0;
    border: 0;
    cursor: pointer;
}

button.attach-name {
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

/* One line, always. Size and date never shrink; the uploader's name gives way first and ends in
   an ellipsis, with the full name on its title. */
.attach-meta {
    display: flex;
    gap: .375rem;
    min-width: 0;
    margin-top: .125rem;
    white-space: nowrap;
    font-size: .6875rem;
    color: var(--ins-secondary-color);
}

.attach-meta > span { flex: 0 0 auto; }
/* Where a shared file is used is read, not glanced at: it wraps, never cut (crm/73 R1). */
.attach-meta[data-file-used-on] { white-space: normal; }
.attach-meta[data-file-used-on] > span { flex: 1 1 auto; min-width: 0; }
[data-size-file-list] .attach-meta { flex-wrap: wrap; white-space: normal; }
[data-size-file-list] .attach-meta > span:last-child,
[data-size-file-list] .attach-tile.is-pending .attach-meta > span:last-child { flex: 1 1 100%; overflow: visible; }
[data-size-file-list] .attach-meta > span:last-child::before { content: none; }
.attach-meta > span + span::before { content: "\00b7"; margin-right: .375rem; }

.attach-meta > .attach-meta-by {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attach-remove { flex: 0 0 auto; }
.attach-remove svg { width: 1rem; height: 1rem; }

/* The eye beside the bin - opens the file in the viewer (crm/37 §5); the two read as one pair of actions. */
.attach-view { flex: 0 0 auto; }
.attach-view svg { width: 1rem; height: 1rem; }
.attach-view + .attach-remove { margin-left: -.375rem; }

/* Viewing is never an edit. A locked quotation's or OA's sections sit in a <fieldset disabled>, and the theme's
   `fieldset:disabled .btn` takes every button's pointer and paints it disabled - it also outranks `.btn:hover`. The eye is
   a link, so the fieldset cannot disable it; these give it back its own look, hover and click. */
fieldset:disabled .btn.attach-view {
    color: var(--ins-btn-color);
    background-color: var(--ins-btn-bg);
    border-color: var(--ins-btn-border-color);
    opacity: 1;
    pointer-events: auto;
}

fieldset:disabled .btn.attach-view:hover {
    color: var(--ins-btn-hover-color);
    background-color: var(--ins-btn-hover-bg);
    border-color: var(--ins-btn-hover-border-color);
}

/* A waiting tile's "Uploads when you save" gives way with an ellipsis, as the uploader's name does - the size never does. */
.attach-tile.is-pending .attach-meta > span:last-child {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A site visit report among the complaint's files under Attachments (site-visit-report.md, D13): a
   small light-tinted chip on a line of its own under the name, so it reads as what the file is for
   rather than one more fact about it. It sat in the meta line first, which is one line that never
   wraps: the date ran under the bin and the uploader's name was squeezed out. */
.attach-tag {
    margin-top: .125rem;
    line-height: 1;
}

.attach-chip {
    display: inline-block;
    padding: .125rem .375rem;
    border-radius: 1rem;
    font-size: .625rem;
    font-weight: 600;
    color: var(--ins-primary-text-emphasis);
    background: var(--ins-primary-bg-subtle);
}

/* Settings -> Attachments: one row per kind, its name on the left and the two named choices on
   the right, so the answer in force reads down one column. Markup: Views/Settings/_AttachmentsTab. */
.attach-kind-list {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.attach-kind-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .625rem .875rem;
}

.attach-kind-row + .attach-kind-row { border-top: 1px solid var(--ins-border-color); }

.attach-kind-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attach-kind-row .btn-group .btn { min-width: 6.5rem; }

/* --------------------------------------------------------------------------
   The file viewer - app/js/aira-file-viewer.js (attachments.md, "The file viewer").
   Full screen and dark in both colour modes, as every photo viewer is: a picture is judged
   against black, not against the page. A stacked dialog like any other; nothing over the
   screen is blurred (hard rule 10b) - the ground is a colour.
   -------------------------------------------------------------------------- */
.aira-fv {
    --aira-fv-ground: #0d0f12;
    --aira-fv-ink: #f3f5f7;
    --aira-fv-muted: rgba(243, 245, 247, .64);
    --aira-fv-line: rgba(255, 255, 255, .1);
    --aira-fv-control: rgba(255, 255, 255, .08);
    --aira-fv-control-hover: rgba(255, 255, 255, .18);
    --aira-fv-pressed: rgba(255, 255, 255, .24);
    /* The brand is an operator's choice and some choices vanish on near-black; white does not. */
    --aira-focus-ring-color: #ffffff;
}

.aira-fv .modal-content {
    border: 0;
    border-radius: 0;
    color: var(--aira-fv-ink);
    background: var(--aira-fv-ground);
}

.aira-fv-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .75rem;
    min-height: 3.5rem;
    padding: .5rem .75rem .5rem 1rem;
    border-bottom: 1px solid var(--aira-fv-line);
}

.aira-fv-count {
    flex: 0 0 auto;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--aira-fv-control);
}

.aira-fv-count[hidden] { display: none; }

.aira-fv-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.aira-fv-title {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .9375rem;
    font-weight: 600;
    color: inherit;
}

.aira-fv-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .125rem .75rem;
    margin-top: .125rem;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    color: var(--aira-fv-muted);
}

.aira-fv-note {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 600;
    color: #fcd34d;
}

.aira-fv-note[hidden] { display: none; }
.aira-fv-note svg { width: .875rem; height: .875rem; }

.aira-fv-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .25rem;
}

.aira-fv-zoom {
    display: inline-flex;
    align-items: center;
    gap: .125rem;
    margin-right: .25rem;
    padding: .125rem;
    border-radius: .5rem;
    background: var(--aira-fv-control);
}

.aira-fv-zoom[hidden] { display: none; }

.aira-fv-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    border: 0;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--aira-fv-ink);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

.aira-fv-tool:hover { color: var(--aira-fv-ink); background: var(--aira-fv-control-hover); }
.aira-fv-tool[hidden] { display: none; }
.aira-fv-tool svg { width: 1.125rem; height: 1.125rem; }
.aira-fv-tool[aria-pressed="true"] { background: var(--aira-fv-pressed); }
.aira-fv-tool.is-text { min-width: 2.75rem; font-variant-numeric: tabular-nums; }
.aira-fv-tool.is-refused[aria-disabled="true"],
.aira-fv-tool.is-refused[aria-disabled="true"]:hover { opacity: .38; background: transparent; }

.aira-fv-body {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

/* touch-action none: every gesture on the stage is ours - a swipe, a pinch, a pull - and the
   browser's own panning would scroll the page under the dialog instead. */
.aira-fv-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.aira-fv-stage.is-zoomed { cursor: grab; }
.aira-fv-stage.is-panning { cursor: grabbing; }

.aira-fv-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 4.5rem;
}

.aira-fv-stage.is-frame .aira-fv-slide { padding: .75rem 4.5rem; }

/* Drawn at an explicit size by the script - crisp at every zoom, which a scale() transform on a
   fitted image is not - and centred on the stage, so a photo larger than it can be dragged to
   any of its four edges. Hidden until it has been measured, or it flashes at its full size. */
.aira-fv-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.aira-fv-img.is-sized { opacity: 1; }

.aira-fv-video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: .25rem;
    background: #000;
}

.aira-fv-frame {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: .25rem;
    background: #fff;
}

.aira-fv-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aira-fv-muted);
    pointer-events: none;
}

.aira-fv-unshowable {
    max-width: 34rem;
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: var(--aira-fv-muted);
}

.aira-fv-doc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    max-width: 20rem;
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--aira-fv-line);
    border-radius: 1rem;
    text-align: center;
    background: var(--aira-fv-control);
}

.aira-fv-doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: .875rem;
    color: #fca5a5;
    background: rgba(208, 59, 59, .2);
}

.aira-fv-doc-icon svg { width: 1.75rem; height: 1.75rem; }

.aira-fv-doc-name {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .8125rem;
    color: var(--aira-fv-muted);
}

/* The arrows either side. Over the picture, on a ground of their own, so they read against a
   white photo as well as a black one. */
.aira-fv-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-top: -1.375rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .14);
}

.aira-fv-nav.is-prev { left: 1rem; }
.aira-fv-nav.is-next { right: 1rem; }
.aira-fv-nav:hover { background: rgba(255, 255, 255, .22); }
.aira-fv-nav svg { width: 1.5rem; height: 1.5rem; }
.aira-fv-nav.is-refused[aria-disabled="true"],
.aira-fv-nav.is-refused[aria-disabled="true"]:hover { opacity: .28; background: rgba(0, 0, 0, .55); }

.aira-fv.is-single .aira-fv-nav,
.aira-fv.is-single .aira-fv-strip { display: none; }

/* Every file on the complaint, along the bottom - the way to jump rather than step. */
.aira-fv-strip {
    display: flex;
    flex: 0 0 auto;
    justify-content: safe center;
    gap: .625rem;
    padding: .625rem 1rem .875rem;
    overflow-x: auto;
    border-top: 1px solid var(--aira-fv-line);
    scrollbar-width: thin;
}

.aira-fv-strip:empty { display: none; }

.aira-fv-thumb {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    height: 3.75rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: .5rem;
    background: var(--aira-fv-control);
    opacity: .55;
}

.aira-fv-thumb:hover { opacity: .85; }
.aira-fv-thumb.is-current { border-color: #fff; opacity: 1; }
.aira-fv-thumb.is-pdf { background: rgba(208, 59, 59, .55); }

.aira-fv-thumb img,
.aira-fv-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.aira-fv-thumb-kind {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--aira-fv-ink);
}

.aira-fv-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: auto;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .6);
}

.aira-fv-thumb-play svg { width: .75rem; height: .75rem; margin-left: 1px; fill: currentColor; }

/* A touch screen zooms with the fingers - pinch, double tap - so the buttons would only be in
   the way of the title. */
@media (pointer: coarse) {
    .aira-fv-zoom { display: none !important; }
}

@media (max-width: 575.98px) {
    .aira-fv-head { gap: .5rem; padding-left: .75rem; }
    .aira-fv-word { display: none; }
    .aira-fv-slide { padding: .5rem; }
    .aira-fv-stage.is-frame .aira-fv-slide { padding: .5rem; }
    .aira-fv-nav { width: 2.25rem; height: 2.25rem; margin-top: -1.125rem; }
    .aira-fv-nav.is-prev { left: .375rem; }
    .aira-fv-nav.is-next { right: .375rem; }
    .aira-fv-strip { gap: .5rem; padding: .5rem .5rem .75rem; }
    .aira-fv-thumb { width: 3.5rem; height: 2.625rem; }
}

/* --------------------------------------------------------------------------
   Follow-ups (follow-ups.md) - a card per follow-up with its whole record: who
   has it, how it ended, its history and every notification about it. Light
   tints and small chips (the owner's look); colour carries the state on the
   card's left edge and its mark, never a filled band.
   -------------------------------------------------------------------------- */
.fu-counts { display: flex; flex-wrap: wrap; gap: .375rem; margin-left: .25rem; }

.fu-quiet {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .75rem;
    padding: .5rem .75rem;
    font-size: .75rem;
    color: var(--ins-secondary-color);
    background: var(--aira-surface-2);
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.fu-quiet svg { width: 14px; height: 14px; flex: 0 0 auto; }

.fu-list { display: flex; flex-direction: column; gap: .625rem; }

.fu-card {
    border: 1px solid var(--ins-border-color);
    border-left: 3px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    padding: .75rem .875rem;
    background: var(--ins-secondary-bg);
}

.fu-card.is-open { border-left-color: var(--ins-primary); }
.fu-card.is-today { border-left-color: var(--ins-warning); }
.fu-card.is-late { border-left-color: var(--ins-danger); }
.fu-card.is-done { border-left-color: var(--ins-success); }
.fu-card.is-cancelled { border-left-color: var(--ins-secondary-color); }

.fu-head { display: flex; align-items: flex-start; gap: .625rem; }
.fu-main { flex: 1 1 auto; min-width: 0; }

.fu-mark {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ins-primary-bg-subtle);
    color: var(--ins-primary);
}

.fu-mark svg { width: 14px; height: 14px; }
.fu-card.is-today .fu-mark { background: var(--ins-warning-bg-subtle); color: var(--ins-warning); }
.fu-card.is-late .fu-mark { background: var(--ins-danger-bg-subtle); color: var(--ins-danger); }
.fu-card.is-done .fu-mark { background: var(--ins-success-bg-subtle); color: var(--ins-success); }
.fu-card.is-cancelled .fu-mark { background: var(--ins-tertiary-bg); color: var(--ins-secondary-color); }

.fu-title { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; font-size: .875rem; }

.fu-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin-top: .3rem;
    font-size: .8125rem;
}

.fu-facts > span { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.fu-facts svg { width: 13px; height: 13px; color: var(--ins-secondary-color); flex: 0 0 auto; }
.fu-fact-label { color: var(--ins-secondary-color); }

.fu-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .375rem; flex: 0 0 auto; }
.fu-actions .btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--ins-primary); }

.fu-remark { margin: .5rem 0 0 2.375rem; font-size: .8125rem; color: var(--ins-body-color); white-space: pre-line; }

.fu-trace {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.5rem;
    margin: .5rem 0 0 2.375rem;
    font-size: .75rem;
}

.fu-trace > div { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-width: 0; }
.fu-trace dt { font-weight: 500; color: var(--ins-secondary-color); }
.fu-trace dt::after { content: ":"; }
.fu-trace dd { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; }

.fu-outcome {
    margin: .5rem 0 0 2.375rem;
    padding: .5rem .75rem;
    font-size: .8125rem;
    border-radius: var(--ins-border-radius);
    background: var(--aira-surface-2);
    border: 1px solid var(--ins-border-color);
}

.fu-outcome p { margin: .125rem 0 0; white-space: pre-line; }
.fu-outcome-label { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ins-secondary-color); }
.fu-outcome.is-auto { display: flex; align-items: center; gap: .5rem; color: var(--ins-secondary-color); }
.fu-outcome.is-auto svg { width: 14px; height: 14px; flex: 0 0 auto; }

.fu-panel {
    margin: .75rem 0 0 2.375rem;
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.fu-panel-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }

.fu-more { margin: .5rem 0 0 2.375rem; }

.fu-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .125rem 0;
    border: 0;
    background: none;
    font-size: .75rem;
    font-weight: 500;
    color: var(--ins-primary-text-emphasis);
}

.fu-more-toggle svg { width: 14px; height: 14px; }
.fu-more-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

.fu-more-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: .5rem;
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.fu-more-body[hidden] { display: none; }

.fu-col { min-width: 0; }

.fu-col-title {
    margin: 0 0 .5rem;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ins-secondary-color);
}

.fu-history, .fu-notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .75rem; }

.fu-history li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .5rem; }
.fu-when { color: var(--ins-secondary-color); white-space: nowrap; }
.fu-history-note { margin: .125rem 0 0; color: var(--ins-secondary-color); white-space: pre-line; }

.fu-notices li { padding-bottom: .5rem; border-bottom: 1px dashed var(--ins-border-color); }
.fu-notices li:last-child { padding-bottom: 0; border-bottom: 0; }
.fu-notice-head { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.fu-notice-meta { display: flex; flex-wrap: wrap; gap: .125rem .875rem; margin-top: .2rem; color: var(--ins-secondary-color); }
.fu-notice-meta > span { display: inline-flex; align-items: center; gap: .25rem; }
.fu-notice-meta svg { width: 12px; height: 12px; flex: 0 0 auto; }
.fu-notice-reason { margin-top: .2rem; color: var(--ins-body-color); }
.fu-notice-source { display: flex; flex-wrap: wrap; gap: .125rem .875rem; margin-top: .2rem; color: var(--ins-secondary-color); }
.fu-notice-source b, .fu-notice-source a { font-weight: 500; }

/* Was the person told, and will they be reminded (notification-outcomes.md, D2). */
.fu-told {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .3rem .75rem;
    margin: .5rem 0 0 2.375rem;
    font-size: .75rem;
}
.fu-told dt { font-weight: 500; color: var(--ins-secondary-color); }
.fu-told dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; min-width: 0; }
.fu-told-link { white-space: nowrap; }

.fu-none { margin: 0; font-size: .75rem; color: var(--ins-secondary-color); font-style: italic; }

.fu-list + .fu-schedule,
.ticket-empty + .fu-schedule { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--ins-border-color); }

.fu-schedule-title {
    margin: 0 0 .5rem;
    font-size: .8125rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}

@media (max-width: 767.98px) {
    .fu-head { flex-wrap: wrap; }
    .fu-main { flex: 1 1 calc(100% - 2.5rem); }
    .fu-actions { width: 100%; justify-content: flex-start; padding-left: 2.375rem; }
    .fu-more-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .fu-remark, .fu-trace, .fu-told, .fu-outcome, .fu-panel, .fu-more { margin-left: 0; }
    .fu-told { grid-template-columns: minmax(0, 1fr); gap: .125rem; }
    .fu-told dd { margin-bottom: .375rem; }
    .fu-actions { padding-left: 0; }
    .fu-history li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* The Investigation section's planned site visit follow-up (follow-ups.md, D1). */
.sv-followup {
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-left: 3px solid var(--ins-primary);
    border-radius: var(--ins-border-radius);
    background: var(--aira-surface-2);
}

.sv-followup-head { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-bottom: .625rem; }
.sv-followup-head svg { width: 15px; height: 15px; color: var(--ins-primary); }
.sv-followup-title { font-weight: 600; font-size: .8125rem; }

.sv-followup-read { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.sv-followup-read svg { color: var(--ins-secondary-color); }
.sv-followup-link { font-size: .75rem; }

html[data-bs-theme="dark"] .fu-quiet,
html[data-bs-theme="dark"] .fu-outcome,
html[data-bs-theme="dark"] .sv-followup { background: var(--ins-tertiary-bg); }

/* ------------------------------------------------------------------
   View as - an administrator previewing another role.

   The topbar control is now the whole of it: the page-wide amber band that used to
   restate it was removed as noise. Amber on the control while a preview is running,
   colour-mixed against --ins-* rather than hard-coded so it survives dark mode
   without a second rule.
   ------------------------------------------------------------------ */
.aira-viewas .topbar-link.is-previewing {
    color: #b57a00;
    background: color-mix(in srgb, #eda100 16%, transparent);
    border-radius: 6px;
}

.aira-viewas-menu {
    min-width: 16rem;
    max-height: 26rem;
    overflow-y: auto;
}

/* Each entry is its own <form> - a GET that changed the permissions the next page
   renders under could be fired by any image tag - so the buttons have to be made to
   look like the dropdown items they replace. */
.aira-viewas-menu form { margin: 0; }
.aira-viewas-menu .dropdown-item { width: 100%; text-align: left; border: 0; background: none; }

/* ------------------------------------------------------------------
   Language (gujarati-language.md, D27, D28). The current language's name on the bar;
   a menu of names with a tick on the current one. No flags.
   ------------------------------------------------------------------ */
.aira-lang .topbar-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.aira-lang-name { font-size: calc(13px * var(--aira-type-scale, 1)); }

.aira-lang-menu { min-width: 11rem; }
.aira-lang-menu form { margin: 0; }
.aira-lang-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    width: 100%;
    text-align: left;
    border: 0;
}
.aira-lang-menu button.dropdown-item { background: none; }
.aira-lang-menu button.dropdown-item:hover,
.aira-lang-menu button.dropdown-item:focus-visible { background-color: var(--ins-dropdown-link-hover-bg); }

/* The current language is a statement, not a button: no pointer, and not the theme's
   filled "active" bar, which read as a hover stuck on. */
.aira-lang-menu .dropdown-item.active {
    cursor: default;
    color: var(--ins-dropdown-link-color);
    font-weight: 600;
    background-color: transparent;
}
.aira-lang-check { color: var(--ins-primary); }

/* A section of the create form that exists for context and is filled by somebody else.
   Its inputs are genuinely disabled, so this only has to make that legible rather than
   simulate it. */
.ticket-section-form.is-locked {
    opacity: 0.72;
    /* The cursor is the fastest way to answer "why can I not click this?" before
       anybody reads the sentence above it. */
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   The dashboard.

   Tiles, chart cards, the drill dialog and the two derived tables. Sizes come
   from the approved design rather than from a Bootstrap utility, for the same
   reason the control metrics do: a KPI figure set with `fs-4` lands wherever
   the theme's scale happens to put it.
   -------------------------------------------------------------------------- */

/* Auto-fit rather than a fixed column count. The tile set is role-scoped - a
   Customer Care user gets four tiles where an administrator gets ten - and a
   twelve-column grid would leave one of them stranded on a row of its own. */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .75rem;
}

.kpi-card {
    position: relative;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg, .5rem);
    box-shadow: var(--aira-shadow-1);
    padding: .875rem .9375rem .75rem;
    overflow: hidden;
    container-type: inline-size;
}

/* The stage's own colour as a spine down the left edge, which is what ties a
   tile to its board column without tinting the whole card. */
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--kc, var(--ins-primary));
}

.kpi-card[data-drill] { cursor: pointer; }

.kpi-card[data-drill]:hover,
.kpi-card[data-drill]:focus-visible {
    box-shadow: var(--aira-shadow-2);
    border-color: color-mix(in srgb, var(--kc, var(--ins-primary)) 45%, var(--ins-border-color));
    transform: translateY(-1px);
    outline: none;
}

.kpi-label {
    display: flex;
    align-items: center;
    gap: .4375rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--aira-ink-2);
    margin-bottom: .375rem;
}

.kpi-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--kc, var(--ins-primary));
    flex: 0 0 8px;
}

/* A figure is never cut (crm/69 §12): the size it wants, or what fits its tile if that is less. --kpi-ems is how wide it runs
   (Aira dashboard's figure()); 100cqi is the tile's own width, so this holds at every width and needs no measuring. */
.kpi-value {
    font-size: min(var(--kpi-size, 1.75rem), calc(100cqi / var(--kpi-ems, 1)));
    white-space: nowrap;
    font-weight: 700;
    line-height: 1.1;
    color: var(--aira-ink);
    font-variant-numeric: tabular-nums;
}

/* The ageing split. It is part of the tile, not decoration: a count of 40 with
   30 of them over a month old is a different situation from 40 raised today,
   and the tile that hides that is the one nobody can act on. */
.kpi-age {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .5625rem;
    padding-top: .5rem;
    border-top: 1px solid var(--ins-border-color);
    font-size: .6875rem;
    color: var(--aira-muted);
}

.kpi-age b {
    color: var(--aira-ink-2);
    font-variant-numeric: tabular-nums;
}

/* The SLA card's three figures are three populations, so each opens its own - the
   card behind them opens all three. They have to look like the separate targets
   they are, or the only discoverable one is the card. */
.kpi-age span[data-drill] {
    cursor: pointer;
    border-radius: 3px;
    padding: 0 .1875rem;
    margin: 0 -.1875rem;
}

.kpi-age span[data-drill]:hover,
.kpi-age span[data-drill]:focus-visible {
    background: color-mix(in srgb, var(--kc, var(--ins-primary)) 12%, transparent);
    color: var(--aira-ink);
    outline: none;
}

.kpi-age span[data-drill]:hover b,
.kpi-age span[data-drill]:focus-visible b { color: var(--aira-ink); }

.kpi-age-plain { color: var(--aira-ink-2); }

/* The cost strip reads as money, so its figures are a step down in size - a
   nine-digit rupee total at the count size wraps and breaks the row. */
.kpi-grid-cost .kpi-value,
.kpi-value.is-long { --kpi-size: 1.375rem; }
/* The CRM's money strip (crm/46 §4.3) - six figures on one line at a desktop width, rather than five and one stranded under them. */
.kpi-grid-money { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.apex-charts { min-height: 60px; }

/* The department load bar. */
.dept-load-track {
    height: 7px;
    border-radius: 4px;
    background: var(--ins-tertiary-bg);
    overflow: hidden;
}

.dept-load-fill {
    height: 100%;
    border-radius: 4px;
}

[data-dash-departments] tr[data-drill] { cursor: pointer; }

/* A figure with nothing behind it inside a mark that opens - a tile's empty age bucket, an empty
   SLA state, a department's dash. It opens nothing, the card or row around it included, so it
   does not invite the click either. A dash's title says why. */
[data-drill-none] { cursor: default; }

/* The two derived tables on the page.

   `table-sm` alone put six columns and a load bar into a card at the theme's tightest
   cell padding, which reads as a dump of figures rather than as a table. The min-width
   is what makes the wrapper scroll instead of crushing "Complaint Department" to one
   word a line - a column that wraps mid-name is how a department stops being scannable. */
.dash-table { min-width: 34rem; }

.dash-table > thead > tr > th {
    padding: .5rem .75rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--aira-ink-2);
    white-space: nowrap;
}

.dash-table > tbody > tr > td {
    padding: .5625rem .75rem;
    font-variant-numeric: tabular-nums;
}

/* The name column is the only one allowed to wrap; every other cell is a figure, and a
   figure that wraps has been misread once already. The name is the SECOND cell - Sr No
   leads the row - so this selector is positional and has to move when the row does. Left
   on :first-child it silently hands nowrap to the department name, min-width stops helping
   and the card scrolls sideways instead of wrapping. */
.dash-table > tbody > tr > td:not(:nth-child(2)),
.dash-table > thead > tr > th:not(:nth-child(2)) { white-space: nowrap; }

/* Recent quotations' name is its third cell - the number and the date come first - and a party's name is the one that may wrap, so a
   half-row card holds the table without a sideways scroll (crm/88 A5). */
.dash-table[data-dash-table="recent"] > tbody > tr > td:nth-child(3) { white-space: normal; min-width: 11rem; }

.pivot-total td { background: var(--ins-tertiary-bg); }

/* A figure that opens the complaints behind it.

   THE AT-REST SIGNAL IS THE POINT. This was `cursor: pointer` plus a colour change on
   hover, and a colour change is invisible on a cell the pivot has already tinted with a
   colour-mix shade - so the grid read as dead, and a cell that could not open looked
   exactly like one that could. A dotted underline says "this opens" before the pointer
   arrives, which is the question the operator actually has. */
.drill-cell {
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    text-decoration: underline dotted;
    text-decoration-color: color-mix(in srgb, var(--ins-primary) 32%, transparent);
    text-underline-offset: 3px;
}

/* An INSET ring rather than `outline`: the grid lives in a scroll box, and an outline is
   painted outside the cell where the box clips it away. */
.drill-cell:hover,
.drill-cell:focus-visible {
    color: var(--ins-primary);
    text-decoration-color: currentColor;
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ins-primary);
}

/* A figure that genuinely cannot be listed exactly. Not greyed - it is a real number,
   and dimming it would read as missing data. It simply does not invite the click. */
.pv-locked { cursor: default; }

/* --------------------------------------------------------------------------
   The drill dialog
   -------------------------------------------------------------------------- */

.drill-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .625rem;
    margin-bottom: 1rem;
}

.drill-stat {
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    padding: .625rem .75rem;
}

.drill-stat-l {
    font-size: .6875rem;
    font-weight: 600;
    color: var(--aira-muted);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.drill-stat-v {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--aira-ink);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.drill-stat-s {
    font-size: .6875rem;
    color: var(--aira-muted);
}

/* A figure that opens the complaints behind it. The lift is the same one .report-card
   uses, so "this is clickable" reads the same across the page - and the outline is the
   theme's own focus ring, because these are reached by Tab as well as by mouse. */
.drill-stat.is-drillable {
    cursor: pointer;
}

.drill-stat.is-drillable:hover,
.drill-stat.is-drillable:focus-visible {
    border-color: var(--ins-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
    outline: none;
}

/* --------------------------------------------------------------------------
   A stacked dialog's own backdrop.

   app/js/aira-modals.js puts it above the dialog underneath, which is what dims that
   dialog - two dialogs at the theme's single z-index are equally bright and nothing on
   screen says which of them is live. What it must NOT do is repeat the first backdrop at
   full strength: the theme's is 0.7, and two of those put the page behind 91% black - which
   is what a report with one complaint open looked like.

   Lighter, and like every backdrop, never blurred: a backdrop-filter over the whole screen
   is what made a dialog blink while its table scrolled (scss/components/_modal.scss).
   -------------------------------------------------------------------------- */
.modal-backdrop.aira-backdrop-stacked {
    --ins-backdrop-opacity: .42;
}

/* 90% of the viewport. The dialog carries the register's own ten columns, and at
   modal-xl they wrapped two words to a line - the operator was reading a squeezed copy
   of a table that renders properly one click away. */
.drill-dialog {
    width: 90vw;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    /* Bootstrap's own dialog below md: 90vw of a phone is a ten-column table squeezed
       into 90% of nothing, and the horizontal scroll is the readable answer there. */
    .drill-dialog {
        width: auto;
        max-width: none;
    }

    /* The frozen columns on a phone: after the rules they undo (crm/118 §7), further down. */

    .aira-tscroll .w-wide { max-width: 14rem; }
}

/* ONE VERTICAL SCROLLBAR, AND IT BELONGS TO THE TABLE.

   The dialog used to have two. The body scrolled because Bootstrap gives
   .modal-dialog-scrollable .modal-body `overflow-y: auto`, and the table box scrolled
   because it was capped at 58vh - so a report opened with a scrollbar down the dialog and
   a second one down the rows four pixels to its left, and reading the last column of the
   last row meant dragging both. That is not a cosmetic complaint: the figures, the filter
   bar and the pager all rode the outer scroll, so the operator paged a table whose pager
   had scrolled off the bottom and whose totals had scrolled off the top.

   The whole body is now a flex column that hands its height down instead of growing to fit
   the rows: the head and the footnote take what they need, the table box takes the rest and
   is the only thing that scrolls. There is no 58vh guess anywhere - the height comes from
   what the dialog actually has left, so the rows fill the screen on a large monitor and
   still leave the pager reachable on a laptop.

   The body keeps `overflow-y: auto` as a floor, not as the plan: below about 500px of
   viewport the head alone is taller than the dialog, and clipping the filter bar would be
   worse than a scrollbar nobody reaches.

   `overflow-x: hidden` stays for the reason it was added - a fifty-eight column report
   otherwise makes the BODY the horizontal scrollport (overflow-y on one axis computes the
   other to `auto`), and the figures and the filter bar slide off to the left. Sideways
   scrolling belongs to the table box and nothing else. */
.drill-dialog .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
}

/* The figures and the filter bar: what the operator opened the dialog to read, so they are
   fixed above the rows rather than scrolled with them.

   Plain, not sticky. Sticky was how this held still while the body scrolled; the body no
   longer scrolls, so pinning it to an axis that does not move is dead weight - and the
   negative margin it needed to bleed over the body's padding then had to be argued about
   every time the flex arithmetic below changed. The padding restates what the margin used
   to cancel, so it sits exactly where it did. */
.drill-head {
    flex: 0 0 auto;
    margin-bottom: .625rem;
    padding-bottom: .375rem;
    border-bottom: 1px solid var(--ins-border-color);
}

/* --------------------------------------------------------------------------
   Dialog density.

   Everything above the rows is fixed, so every pixel it takes is a pixel of table the
   operator does not get - and on a laptop the head was 334px of a 656px body, which opened a
   twenty-six row report on one and a half rows of it. Nothing is removed and nothing is
   hidden behind a toggle; the same figures and the same bar are laid out for a dialog rather
   than for a page, and the rows get what that gives back.

   Scoped to .drill-head, so the page's own cards and bars keep the approved page metrics.
   -------------------------------------------------------------------------- */

.drill-head .drill-stats {
    gap: .5rem;
    margin-bottom: .625rem;
}

.drill-head .drill-stat { padding: .4375rem .625rem; }

.drill-head .drill-stat-v { font-size: 1.0625rem; }

/* The one part of the dialog that gives up its height: everything else is measured, this
   takes what is left. `min-height: 0` and not `auto`, or a flex item refuses to shrink
   below its content and the rows push the footer off the bottom of the screen - which is
   the default, and is exactly the bug this block exists to stop. */
.drill-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Before the rows arrive - "Building the report...", or a refusal - .drill-body holds one
   line of text. Without a floor the dialog collapses to that line and then jumps to full
   height when the answer lands. */
.drill-body > .report-empty { min-height: 8rem; }

/* Every wrapper DataTables puts between .drill-body and the scroll box, marked by
   Aira.tables.init - see app/js/aira-tables.js for why it is marked rather than matched.
   Each one has to pass the height down; a wrapper left at its default grows to fit the rows
   and the chain breaks at that link with nothing on screen saying which.

   `align-self` on the children rather than `align-items` here: the Bootstrap 5 integration
   puts `align-items-center` on the cell that holds the table, and that is an `!important`
   utility - a child's own align-self is the one thing that outranks it without writing
   another. Left alone it centres the scroll box and the table renders at its content width
   instead of the dialog's. */
.aira-tfill {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-height: 0;
}

.aira-tfill > * { align-self: stretch; }

/* The row-count selector above the rows and the count/pager below them keep their own
   height; only the row that carries the table flexes. */
.aira-tfill.dt-container > * { flex: 0 0 auto; }

.aira-tfill.dt-container > .aira-tfill {
    flex: 1 1 auto;
    min-height: 0;
}

/* A SHORT SCREEN, AND THE SAME MODEL. On a 768px laptop the header, the footer, the figures
   and the filter bar have nearly spent the dialog before the rows get a line - measuring the
   head out of a 524px body left sixty pixels of table, which is one clipped row, and the body
   then overflowed anyway and brought the second scrollbar back.

   The answer is to spend less on the chrome, not to change how the dialog scrolls. Letting
   the whole body scroll again would work and was tried: it puts the table's horizontal
   scrollbar at the bottom of a two-thousand-pixel box, somewhere off the screen, and that is
   the one control a fifty-eight column report is read with. One scroll model at every height.

   So the dialog sits closer to the edges and its bands sit closer to their content, and the
   figures go to one line each - the same figures, and they still open. Roughly a hundred
   pixels, all of it handed to the rows. */
@media (max-height: 840px) {
    .drill-dialog { --ins-modal-margin: .5rem; }

    .drill-dialog .modal-content {
        --ins-modal-padding: .875rem;
        --ins-modal-header-padding: .875rem 1.25rem;
    }

    .drill-head .drill-stats {
        grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
        gap: .375rem;
        margin-bottom: .5rem;
    }

    .drill-head .drill-stat {
        display: flex;
        align-items: baseline;
        gap: .375rem;
        padding: .3125rem .5rem;
    }

    .drill-head .drill-stat-v { font-size: .9375rem; }

    .drill-head .drill-stat-s { margin-left: auto; }

    /* The floor drops with everything else, or the one box that refuses to shrink is the one
       that hands the scroll back to the dialog. */
    .drill-body .aira-tfill > .aira-tscroll { min-height: 5rem; }
}

/* The one `!important` in this block, and it answers another. The theme ships DataTables'
   own `.dt-container .dt-layout-table > div { display: block !important }`, which lands on
   the box holding the table - so the chain above reached that link and stopped dead there,
   the scroll box grew to all 2,000px of rows, and the dialog scrolled again with nothing in
   the stylesheet looking wrong. An important declaration can only be outranked by another;
   the selector is narrowed to the boxes we marked so nothing else moves. */
.dt-container .dt-layout-table > div.aira-tfill { display: flex !important; }

/* What the figure itself pinned - the pivot's open/closed scope, a narrowing the bar has
   no control for. Stated rather than offered: these decide WHICH figure was opened. */
.drill-locked {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: .5rem;
}

.drill-lock-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .125rem .5rem;
    border: 1px solid color-mix(in srgb, var(--ins-primary) 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ins-primary) 10%, transparent);
    color: var(--ins-primary);
    font-size: .6875rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   The scrolling table box, shared by both dialogs.

   Added by Aira.tables.init when a caller passes `scroll: true`. It is the one
   thing that scrolls sideways, so nothing above it can be dragged off screen.
   -------------------------------------------------------------------------- */

.aira-tscroll {

    /* Bounded, so the box scrolls in BOTH directions on its own rather than handing the
       vertical one back to the page or the dialog. That is what lets the header row stay put -
       a sticky thead only sticks inside a scrollport that actually scrolls - and it keeps
       the pager reachable instead of pushed below the fold by a hundred rows.

       70% of the window is the bound for a table that is one section of a longer page. A fitted
       page and the drill's dialog replace it with the height actually left (crm/71 §7), which is
       the only figure that cannot disagree with what the table is drawn in. */
    max-height: 70dvh;
    overflow: auto;
    position: relative;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

/* EVERY box takes its column's width, never its table's (crm/118 RT1). The theme ships DataTables'
   `.dt-layout-full > :only-child { margin-inline: auto }`, and this box is that only child: an auto margin
   on a flex item's cross axis cancels `stretch`, so the box took the WHOLE table's width, had nothing to
   scroll, and painted past its card and off the window - the Dashboard's Reports view at every width and
   every register on a phone, with no error anywhere. Undone here once rather than per screen; the dialog's
   and the fitted page's own rules below say the same.

   AS HEAVY AS THE THEME'S RULE, never lighter: `.dt-container .dt-layout-full > :only-child` weighs three
   classes (`:only-child` counts as one), and a lighter `.aira-tfill > .aira-tscroll` lost to it silently -
   measured in Chrome, the box still 1,491px in a 1,119px card. Equal weight, and this file loads after the
   theme's, so this one wins (crm/118 T5). */
.dt-container .aira-tfill > .aira-tscroll {
    margin-inline: 0;
    min-width: 0;
}

/* In a dialog: exactly the room left under the figures and the filter bar, never a guess.

   The margins undo DataTables' own `.dt-layout-full > :only-child { margin-inline: auto }`.
   An auto margin on the cross axis cancels `stretch` outright - the box stops filling the
   dialog and takes its CONTENT width instead, which for a fifty-eight column report is seven
   thousand pixels of table with nothing clipping it. Written through .aira-tfill so the
   selector outweighs that one; it is centring a box that fills the width either way. */
.drill-body .aira-tfill > .aira-tscroll {
    flex: 1 1 auto;
    max-height: none;
    min-height: 8rem;
    margin-inline: 0;
}

/* The header row survives the vertical scroll. An INSET box-shadow, never border-bottom:
   the theme sets border-collapse:collapse, and a collapsed border belongs to the table
   grid rather than to the cell, so it does not travel with a sticky one - the underline
   simply disappears the moment the rows move. */
.aira-tscroll > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--ins-tertiary-bg);
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 var(--ins-border-color);
}

/* The two identifying columns survive the horizontal one. Positional rather than by
   class, so both dialogs get it without marking their cells up twice - Sr No is always
   first and the complaint is always second, in the register, the drill and every report.

   At column thirty of the Excel Report the row otherwise has no identity at all: the
   complaint number has scrolled away and nothing on screen says whose observation this is. */
.aira-tscroll--freeze > table > * > tr > :nth-child(1),
.aira-tscroll--freeze > table > * > tr > :nth-child(2) {
    position: sticky;
    z-index: 2;
    background: var(--ins-secondary-bg);
}

.aira-tscroll--freeze > table > * > tr > :nth-child(1) { left: 0; }
.aira-tscroll--freeze > table > * > tr > :nth-child(2) { left: 4rem; }

/* Above the frozen columns where they cross. */
.aira-tscroll--freeze > table > thead > tr > :nth-child(1),
.aira-tscroll--freeze > table > thead > tr > :nth-child(2) {
    z-index: 4;
    background: var(--ins-tertiary-bg);
}

/* The 4rem offset above is only exact if the first column really is 4rem. .sr-col sets
   width alone, which auto table layout treats as a suggestion - pinned here rather than
   on .sr-col itself, which the whole product shares. */
.aira-tscroll .sr-col {
    width: 4rem;
    min-width: 4rem;
    max-width: 4rem;
}

/* The edge, painted only while something is actually hidden behind it. */
.aira-tscroll--freeze.is-scrolled > table > * > tr > :nth-child(2)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 6px;
    transform: translateX(100%);
    pointer-events: none;
    background: linear-gradient(to right, rgba(0, 0, 0, .13), transparent);
}

html[data-bs-theme="dark"] .aira-tscroll--freeze.is-scrolled > table > * > tr > :nth-child(2)::after {
    background: linear-gradient(to right, rgba(0, 0, 0, .55), transparent);
}

/* A report's table freezes its FIRST column alone (crm/118 RT2) - the row's name; it has no Sr No before it, so
   `--freeze`'s second column at 4rem would stick over the name the moment the box scrolled sideways. */
.aira-tscroll--freeze-first > table > * > tr > th:first-child,
.aira-tscroll--freeze-first > table > * > tr > td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--ins-secondary-bg);
}

.aira-tscroll--freeze-first > table > thead > tr > th:first-child {
    z-index: 4;
    background: var(--ins-tertiary-bg);
}

.aira-tscroll--freeze-first.is-scrolled > table > * > tr > th:first-child::after,
.aira-tscroll--freeze-first.is-scrolled > table > * > tr > td:first-child::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 6px;
    transform: translateX(100%);
    pointer-events: none;
    background: linear-gradient(to right, rgba(0, 0, 0, .13), transparent);
}

html[data-bs-theme="dark"] .aira-tscroll--freeze-first.is-scrolled > table > * > tr > th:first-child::after,
html[data-bs-theme="dark"] .aira-tscroll--freeze-first.is-scrolled > table > * > tr > td:first-child::after {
    background: linear-gradient(to right, rgba(0, 0, 0, .55), transparent);
}

/* A frozen column on a 400px screen leaves about nothing for the rest, so the table scrolls as one.

   AFTER the rules above, never before them: a media query adds no weight, so at equal weight the later rule wins - written
   in the phone block further up, this override never applied and both frozen columns stayed pinned on a phone (crm/118 §7).
   Unpinned sideways by `left: auto`, never `position: static`: static also took the heading's own sticky top from those
   cells, and the report's total its sticky foot. No edge without a pin. */
@media (max-width: 767.98px) {
    .aira-tscroll--freeze > table > * > tr > :nth-child(1),
    .aira-tscroll--freeze > table > * > tr > :nth-child(2),
    .aira-tscroll--freeze-first > table > * > tr > th:first-child,
    .aira-tscroll--freeze-first > table > * > tr > td:first-child { left: auto; }

    .aira-tscroll--freeze.is-scrolled > table > * > tr > :nth-child(2)::after,
    .aira-tscroll--freeze-first.is-scrolled > table > * > tr > th:first-child::after,
    .aira-tscroll--freeze-first.is-scrolled > table > * > tr > td:first-child::after { content: none; }
}

/* How wide a column may be, and whether it may wrap. Set from the column's own kind and
   declared width by pages/reports.js - never from a list of column names. */
.aira-tscroll td.cell-atomic,
.aira-tscroll th.cell-atomic { white-space: nowrap; }

.aira-tscroll td.cell-prose {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Three lines, then an ellipsis. One four-thousand-character observation otherwise sets the
   height of every row beside it and the report becomes unreadable.

   ON AN INNER DIV, NEVER ON THE CELL. `display: -webkit-box` on a <td> takes it out of table
   layout altogether - the cell stops being a cell, the row's columns stack vertically and the
   headers line up with nothing. */
.aira-tscroll .cell-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aira-tscroll .w-narrow { max-width: 12rem; }
.aira-tscroll .w-mid { max-width: 18rem; }
.aira-tscroll .w-wide { max-width: 26rem; }

.drill-body tbody tr { cursor: pointer; }

/* DataTables' own chrome - the row-count selector above the table, the count and the
   pager below it. Both sit inside the dialog rather than on a card, so they get the
   toolbar's size rather than the page's. */
.drill-body .dt-length,
.drill-body .dt-info,
.drill-body .dt-paging { font-size: .8125rem; }

.drill-body .dt-length select { min-width: 4.5rem; }

.drill-body .dt-paging .page-link {
    padding: .25rem .5rem;
    font-size: .8125rem;
}

/* --------------------------------------------------------------------------
   The multi-select.

   See app/js/aira-multiselect.js for why this exists rather than Choices. The
   whole point of the control is that its box never changes size, so nothing
   here may make the trigger grow: the summary is one line, clipped.

   No sizes are restated. The trigger IS a .form-select.form-select-sm, so its
   height, padding and font come from the compiled control metrics in
   _aira-brand.scss and it lines up with the date inputs beside it for free.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   The searchable single-select (app/js/aira-select.js).

   Deliberately shaped like .aira-ms below it - same trigger, same panel, same
   placement maths - because the two sit side by side in every filter bar and a
   single and a multiple that look like different controls read as a bug.
   -------------------------------------------------------------------------- */
.aira-sel { position: relative; }

.aira-sel-native {
    /* Hidden by CLIP, never `display: none`. aira-validation.js treats a control it
       considers hidden as one the operator cannot fix and skips it entirely - so a
       `display: none` here would silently stop every required dropdown in the product
       being validated, with nothing on the screen to say so. Same rule, and the same
       reason, as .aira-ms-native. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.aira-sel-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    /* The theme's .form-select paints its own chevron as a background image, which is
       exactly the affordance this control wants - kept, not replaced. */
    overflow: hidden;
}

.aira-sel-summary {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--aira-ink);
}

/* Empty reads as a placeholder, not as an answer. */
.aira-sel-summary.is-empty { color: var(--ins-secondary-color); }

/* A list waiting on the one above it (aira-cascade.js, crm/68 §2) reads as shut, and its words stay legible: they say what to do first. */
.aira-sel-trigger:disabled,
.aira-ms-trigger:disabled {
    background-color: var(--ins-tertiary-bg);
    cursor: not-allowed;
    opacity: 1;
}

.aira-sel.is-open .aira-sel-trigger {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--ins-primary) 18%, transparent);
}

.aira-sel-panel {
    position: fixed;
    /* Opens from inside a dialog, so it has to clear the whole stack - see --aira-z-panel. */
    z-index: var(--aira-z-panel);
    display: flex;
    flex-direction: column;
    max-width: 26rem;
    padding: .5rem;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    box-shadow: var(--aira-shadow-2);
}

.aira-sel-search { padding: 0 0 .5rem; }

/* Positioned for the same reason as .aira-ms-list: highlight() in aira-select.js measures a row
   from its offsetTop, which is taken from the nearest positioned ancestor. Unpositioned, that
   was the fixed panel, and the list scrolled early or late by the search box's height. */
.aira-sel-list {
    position: relative;
    max-height: 15rem;
    overflow-y: auto;
    outline: none;
}

.aira-sel-opt {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3125rem .4375rem;
    border-radius: var(--ins-border-radius-sm);
    font-size: .8125rem;
    color: var(--aira-ink-2);
    cursor: pointer;
}

.aira-sel-opt:hover,
.aira-sel-opt.is-active { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

.aira-sel-opt[aria-selected="true"] {
    color: var(--aira-option-current-ink);
    font-weight: 500;
    background: var(--aira-option-current-bg);
    box-shadow: inset 3px 0 0 var(--aira-option-current-mark);
}

.aira-sel-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.aira-sel-empty,
.aira-sel-note {
    padding: .375rem .4375rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-sel-note { border-top: 1px solid var(--ins-border-color); margin-top: .25rem; }

/* A master's Add at the foot of its list (crm/114) - the single-select's and the multi-select's alike, drawn only for whoever
   holds the master's Create. A row of the list in the brand's ink, set off by a rule, never a second button style. */
.aira-pick-add {
    border-top: 1px solid var(--ins-border-color);
    margin-top: .25rem;
    padding-top: .25rem;
}

.aira-pick-add[hidden] { display: none; }

.aira-pick-add-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .3125rem .4375rem;
    border: 0;
    border-radius: var(--ins-border-radius-sm);
    background: transparent;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--ins-primary);
    text-align: start;
    cursor: pointer;
}

.aira-pick-add-btn:hover,
.aira-pick-add-btn:focus-visible { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

.aira-pick-add-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ins-primary) 14%, transparent);
    font-weight: 600;
    line-height: 1;
}

.aira-pick-add-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The multi-select's Add sits above its Select all / Clear foot, which brings its own rule. */
.aira-ms-panel .aira-pick-add { margin-bottom: .25rem; padding-bottom: .25rem; }

.aira-ms { position: relative; }

.aira-ms-native {
    /* Present for the form post and for read()/write(), never seen. `display: none`
       would take it out of the form in some browsers' reset paths; this keeps it a
       real control that simply occupies nothing. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.aira-ms-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    /* The theme's .form-select paints its own chevron as a background image, which
       is exactly the affordance this control wants - so it is kept, not replaced. */
    overflow: hidden;
}

.aira-ms-summary {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--aira-ink);
}

/* Empty reads as a placeholder, not as an answer. */
.aira-ms-summary.is-empty { color: var(--ins-secondary-color); }

/* What a list holds, as chips under it (data-ms-chips, crm/104 MC1): the brand's soft ground, the name, and an x that takes it off.
   They wrap below the field, so the field itself never grows; nothing chosen, no row at all (MC4). */
.aira-ms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-top: .5rem;
}

.aira-ms-chips[hidden] { display: none; }

.aira-ms-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    min-height: 1.625rem;
    padding: .125rem .5rem .125rem .625rem;
    border: 1px solid color-mix(in srgb, var(--ins-primary) 32%, transparent);
    border-radius: 999px;
    background: var(--ins-primary-bg-subtle);
    color: var(--aira-ink);
    font-size: .8125rem;
    line-height: 1.3;
}

/* A chip with its x keeps less room on its right - the button carries its own. */
.aira-ms-chip:has(> .aira-ms-chip-x) { padding-right: .1875rem; }

.aira-ms-chip-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The parent's name before the child's (MC3) - muted, so the child is what reads. */
.aira-ms-chip-parent {
    flex: 0 0 auto;
    color: var(--aira-muted);
}

.aira-ms-chip-parent::after { content: " \00b7"; }

.aira-ms-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--aira-muted);
    font-size: 1rem;
    line-height: 1;
    --aira-focus-ring-offset: -1px;
}

.aira-ms-chip-x:hover {
    background: color-mix(in srgb, var(--ins-danger) 14%, transparent);
    color: var(--ins-danger);
}

.aira-ms.is-open .aira-ms-trigger {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--ins-primary) 18%, transparent);
}

/* Positioned from the trigger's rectangle by the component, because the drill
   dialog's scrolling body would clip an absolutely positioned child - and no
   z-index survives a clip. */
.aira-ms-panel {
    position: fixed;
    /* Opens from inside a dialog, so it has to clear the whole stack - see --aira-z-panel. */
    z-index: var(--aira-z-panel);
    display: flex;
    flex-direction: column;
    max-width: 22rem;
    padding: .5rem;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    box-shadow: var(--aira-shadow-2);
}

.aira-ms-search { padding: 0 0 .5rem; }

.aira-ms-list {
    max-height: 15rem;
    overflow-y: auto;
    outline: none;
}

.aira-ms-opt {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3125rem .4375rem;
    border-radius: var(--ins-border-radius-sm);
    font-size: .8125rem;
    color: var(--aira-ink-2);
    cursor: pointer;
}

.aira-ms-opt:hover,
.aira-ms-opt.is-active { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

/* Ticked is the box's job (below); the row only weighs more - and still takes the hover's ink. */
.aira-ms-opt[aria-selected="true"] { color: var(--aira-ink); font-weight: 500; }
.aira-ms-opt[aria-selected="true"]:hover,
.aira-ms-opt[aria-selected="true"].is-active { color: var(--aira-option-hover-ink); }

.aira-ms-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.aira-ms-box {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    border: 1px solid var(--aira-line-2);
    border-radius: 4px;
    background: var(--ins-secondary-bg);
    position: relative;
}

.aira-ms-opt[aria-selected="true"] .aira-ms-box {
    background: var(--ins-primary);
    border-color: var(--ins-primary);
}

.aira-ms-opt[aria-selected="true"] .aira-ms-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* The refusal past 200 values and the "showing the first 300" line. It is role="status", so
   it is announced when it appears rather than only seen by whoever was looking there. */
.aira-ms-empty,
.aira-ms-note,
.aira-ms-more {
    padding: .5rem .4375rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-ms-note,
.aira-ms-more { border-top: 1px solid var(--ins-border-color); }

/* The server search's line (C08): "Searching all of your complaints...", or the count with Load
   more. The button (.aira-ms-act) sits in the sentence it finishes, not in a second footer. */
.aira-ms-more {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem;
}

.aira-ms-more[hidden] { display: none; }

.aira-ms-foot {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .375rem;
    padding-top: .5rem;
    border-top: 1px solid var(--ins-border-color);
}

.aira-ms-act {
    padding: 0;
    border: 0;
    background: none;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-primary);
}

.aira-ms-act:hover { text-decoration: underline; }

/* Pushed to the middle so the two actions sit at the ends and the figure between
   them is read rather than clicked. */
.aira-ms-count {
    margin: 0 auto;
    font-size: .75rem;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
}

/* The highlight scrolls the LIST (see highlight() in aira-multiselect.js), measuring each row
   from its offsetTop - which is taken from the nearest positioned ancestor. Unpositioned, that
   was the fixed panel, and every measurement was off by the height of the search box. */
.aira-ms-list { position: relative; }

/* An <optgroup>, drawn as a heading over its options - the notification pickers' forty events
   and a workspace's groupings are read by section, not as one list. */
.aira-ms-group,
.aira-sel-group {
    padding: .5rem .4375rem .1875rem;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-ms-group:first-child,
.aira-sel-group:first-child { padding-top: .1875rem; }

/* ==========================================================================
   The search bar - app/js/aira-search-bar.js, TagHelpers/SearchBarTagHelper.cs.

   One box holding the search text, a chip per narrowing and the Filters toggle, over a panel of
   the page's controls. Two forms: a workspace's master bar and the compact bar
   every other filter screen is on (filters.md).

   The box IS a .form-control.form-control-sm - the classes are on the container - so it
   inherits the compiled control metrics (rule 10a) and nothing below states its height, padding
   or font. The panel stays INSIDE the bar's root and is positioned fixed from the bar's
   rectangle: re-parented to <body>, every page driver that delegates from its root would go deaf
   to the controls it holds (filters.md T3).
   ========================================================================== */
.aira-searchbar-root {
    position: relative;
    min-width: 0;
}

.aira-searchbar {
    display: flex;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    cursor: text;
}

/* The field's own focus state, carried by the container. The input inside is borderless, so its
   own :focus would say nothing - this is .form-control:focus, restated on the box: the brand
   border, the soft halo and the field ground. The one place a container mirrors a field
   (filters.md T8); FocusRingTests pins it. */
.aira-searchbar:focus-within {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px var(--ins-primary-bg-subtle);
    background-color: var(--ins-secondary-bg);
}

.aira-searchbar-icon {
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    color: var(--aira-muted);
}

/* One line tall, always. Chips never wrap - they scroll sideways with the scrollbar hidden
   (airacrm's rule) - and the strip gives way before the text box does, so there is always
   somewhere to type. */
.aira-searchbar-chips {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.aira-searchbar-chips::-webkit-scrollbar { display: none; }
.aira-searchbar-chips:empty { display: none; }

.aira-searchbar-input {
    flex: 1 1 8rem;
    min-width: 6rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

/* The box above carries the focus state, exactly as Bootstrap's own .form-control:focus drops the
   browser's outline for its border and halo. A ring inside a glowing box is two indicators for one
   field. (This is a field's outline, not the action ring rule 10c declares once.) */
.aira-searchbar-input:focus { outline: 0; }
.aira-searchbar-input::placeholder { color: var(--ins-secondary-color); }

/* type=search draws its own clear button, which would be a second x beside ours. */
.aira-searchbar-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.aira-searchbar-clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: .125rem;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--aira-muted);
    line-height: 1;
}

.aira-searchbar-clear:hover { color: var(--aira-ink); background: var(--ins-tertiary-bg); }

/* A .btn.btn-light for its colour, radius and states - but sitting in the field's own padding
   rather than standing a button's height inside it, or the box would grow a row taller than the
   control beside it. */
.aira-searchbar-toggle {
    --ins-btn-padding-y: .0625rem;
    --ins-btn-padding-x: .5rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-block: -.25rem;
    margin-inline-end: -.375rem;
}

.aira-searchbar-toggle[aria-expanded="true"] {
    background: var(--ins-primary-bg-subtle);
    border-color: color-mix(in srgb, var(--ins-primary) 35%, transparent);
    color: var(--ins-primary-text-emphasis);
}

.aira-searchbar-count {
    min-width: 1.25rem;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   A facet chip: one per narrowing, "Label: summary" and an x that clears that facet alone.
   -------------------------------------------------------------------------- */
.aira-facet {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 20rem;
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
    background: var(--ins-tertiary-bg);
    color: var(--aira-ink);
    font-size: .75rem;
    line-height: 1.4;
    white-space: nowrap;
}

.aira-facet-body {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    padding: .0625rem .125rem .0625rem .5rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: inherit;
    font: inherit;
    /* Rings inside: the strip scrolls, and a ring held outside a chip is clipped by it. */
    --aira-focus-ring-offset: -2px;
}

.aira-facet-icon {
    flex: 0 0 auto;
    width: .875rem;
    height: .875rem;
    color: var(--aira-muted);
}

.aira-facet-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.aira-facet-remove {
    display: inline-flex;
    align-items: center;
    padding: .125rem .375rem .125rem .1875rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--aira-muted);
    line-height: 1;
}

.aira-facet-remove:hover { color: var(--ins-danger); }

/* A figure's path is the narrowing an operator did not type: it gets the brand, so a list that
   is shorter than expected says why at a glance. */
.aira-facet--drill {
    border-color: color-mix(in srgb, var(--ins-primary) 40%, transparent);
    background: var(--ins-primary-bg-subtle);
    color: var(--ins-primary-text-emphasis);
}

.aira-facet--drill .aira-facet-icon { color: inherit; }

/* The grouping is a shape, not a narrowing - an outline, so it is never read as a filter. */
.aira-facet--groupby {
    border-style: dashed;
    background: transparent;
}

/* Kept on screen where it does not apply (the board is always grouped by stage), and dimmed. */
.aira-facet.is-dim { opacity: .55; }
/* A facet the set on screen does not read (crm/46 §3.3): kept, counted in the badge, struck through at half ink - its title says why. */
.aira-facet.is-muted .aira-facet-text { text-decoration: line-through; opacity: .55; }
.aira-facet.is-muted .aira-facet-icon { opacity: .55; }

/* --------------------------------------------------------------------------
   The panel. A child of the bar's root, fixed from the bar's rectangle by the script.
   -------------------------------------------------------------------------- */
.aira-search-panel {
    position: fixed;
    z-index: var(--aira-z-searchpanel);
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    box-shadow: var(--aira-shadow-2);
    overflow: hidden;
}

.aira-search-panel--compact {
    width: 22rem;
    min-width: 300px;
    max-width: calc(100vw - 1.5rem);
}

.aira-search-panel--master { width: min(1180px, 96vw); }

.aira-search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .875rem;
    border-bottom: 1px solid var(--ins-border-color);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-search-panel-body {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    min-height: 0;
    padding: .75rem .875rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.aira-search-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .375rem .875rem;
    border-top: 1px solid var(--ins-border-color);
}

/* One control of the panel: an uppercase label, with a count badge while it is set, over the
   control. The label's size is the compiled .form-label's (rule 10a); only its voice is ours. */
.aira-search-section > .form-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    color: var(--aira-muted);
}

.aira-search-section[hidden],
.aira-search-group-head[hidden] { display: none !important; }

/* Find a filter (crm/85 FF1): one box under the compact panel's head, narrowing the panel - never the data. */
.aira-search-find { padding: .5rem .875rem 0; }
.aira-search-find-box { position: relative; }
.aira-search-find-box > .form-control { padding-left: 1.875rem; }
.aira-search-find-icon {
    position: absolute;
    top: 50%;
    left: .625rem;
    width: .875rem;
    height: .875rem;
    transform: translateY(-50%);
    color: var(--aira-muted);
    pointer-events: none;
}
.aira-search-find-none { padding: .5rem 0 0; font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }

/* A group of controls in the panel - Product Selection (crm/80 PF1). Its own row across the panel's columns, so the six fall in pairs,
   each under the one it follows. Quiet: it names the group, the controls' labels stay the labels. */
.aira-search-group-head {
    grid-column: 1 / -1;
    margin-top: .25rem;
    padding-top: .625rem;
    border-top: 1px dashed var(--ins-border-color);
    color: var(--ins-emphasis-color);
    font-size: calc(12px * var(--aira-type-scale, 1));
    font-weight: 600;
}

/* The count beside a section's label while it narrows - "CUSTOMER 2" (filters.md, *The compact search bar*).
   A .badge, so its size is the badge's own; the label's tracking is for its words, not a number. */
.aira-search-section-count {
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

/* Two fields in one section - a From and a To - keep a gap between the first field and the
   second one's label, which would otherwise sit flush under it. */
.aira-search-section > .form-control + .form-label,
.aira-search-section > .form-select + .form-label,
.aira-search-section > .aira-sel + .form-label,
.aira-search-section > .aira-ms + .form-label { margin-top: .625rem; }

/* A compact bar with a dozen facets - the Rules and Message formats lists - in two columns from md
   (notification-filters.md, LF9): thirteen facets in the one 22rem column was a panel taller than the
   screen. The script places it against the bar's right edge and keeps it in the viewport; below sm it
   is the full-width sheet like every compact panel. A period rail, wider than one column, spans both. */
@media (min-width: 768px) {
    .aira-filterbar--wide .aira-search-panel--compact { width: min(44rem, calc(100vw - 1.5rem)); }

    .aira-filterbar--wide .aira-search-panel-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        column-gap: 1rem;
    }

    .aira-filterbar--wide .aira-search-panel-body > [data-period] { grid-column: 1 / -1; }
    .aira-filterbar--wide .aira-search-panel-body > .aira-search-section--wide { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   The master panel: Filters · Group By · Refine, each column scrolling on its own.
   -------------------------------------------------------------------------- */
.aira-search-panel--master .aira-search-panel-body {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.aira-search-cols {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) minmax(13rem, 1fr) minmax(0, 2.2fr);
    flex: 1 1 auto;
    min-height: 0;
}

/* The Kanban view hides Group By (tickets-search.js, setBoard): Refine takes the freed width
   rather than leaving an empty third track. */
.aira-search-cols:has(> [data-col="groupby"][hidden]) {
    grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.2fr);
}

.aira-search-col {
    min-height: 0;
    padding: .375rem 0 .75rem;
    border-inline-start: 1px solid var(--ins-border-color);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.aira-search-col:first-child { border-inline-start: 0; }

.aira-search-col-head {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .875rem .25rem;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-search-col-head svg { width: .875rem; height: .875rem; }

/* Groups of toggles, a rule between them: OR inside a group, AND across. */
.aira-search-group { padding: .25rem 0; }
.aira-search-group + .aira-search-group { border-top: 1px solid var(--ins-border-color); }

.aira-search-group-label {
    padding: .25rem .875rem 0;
    font-size: .6875rem;
    color: var(--aira-muted);
}

/* A toggle is a dropdown row with a tick: role="menuitemcheckbox", aria-checked carries the state. */
.aira-search-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .25rem .875rem;
    border: 0;
    background: none;
    color: var(--aira-ink-2);
    font: inherit;
    font-size: .8125rem;
    text-align: left;
    white-space: nowrap;
    --aira-focus-ring-offset: -2px;
}

.aira-search-item:hover,
.aira-search-item.is-active { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

.aira-search-item:disabled,
.aira-search-item[aria-disabled="true"] {
    color: var(--ins-secondary-color);
    background: none;
    cursor: not-allowed;
}

.aira-search-tick {
    position: relative;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    border: 1px solid var(--aira-line-2);
    border-radius: 4px;
    background: var(--ins-secondary-bg);
}

.aira-search-item[aria-checked="true"] { color: var(--aira-ink); font-weight: 500; }
.aira-search-item[aria-checked="true"]:hover,
.aira-search-item[aria-checked="true"].is-active { color: var(--aira-option-hover-ink); }

.aira-search-item[aria-checked="true"] .aira-search-tick {
    background: var(--ins-primary);
    border-color: var(--ins-primary);
}

/* The same drawn tick the multi-select's rows carry - one look for "this is on" across the panel. */
.aira-search-item[aria-checked="true"] .aira-search-tick::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* A radio choice (a date period): a dot rather than a tick. */
.aira-search-item[role="menuitemradio"] .aira-search-tick { border-radius: 50%; }

.aira-search-item[role="menuitemradio"][aria-checked="true"] .aira-search-tick::after {
    left: 4px;
    top: 4px;
    width: 5px;
    height: 5px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    transform: none;
}

.aira-search-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A Group By position: 1, 2, 3 in the order the groupings were ticked. */
.aira-search-order {
    flex: 0 0 auto;
    min-width: 1.125rem;
    padding: 0 .3125rem;
    border-radius: 999px;
    background: var(--ins-primary);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.125rem;
    text-align: center;
}

/* A date field, and a date's intervals: an accordion inside its own column, so nothing ever
   flies out of the panel (Odoo 18's arrangement). The theme's accordion-button look, opened and
   closed by the script - no Bootstrap collapse, whose animation would shift the column mid-click. */
.aira-search-acc-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .3125rem .875rem;
    border: 0;
    background: none;
    color: var(--aira-ink);
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    text-align: left;
    --aira-focus-ring-offset: -2px;
}

.aira-search-acc-head:hover { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

.aira-search-acc-head::after {
    content: "";
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    margin-inline-start: auto;
    border: solid var(--aira-muted);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(-45deg);
}

.aira-search-acc-head[aria-expanded="true"]::after { transform: rotate(45deg); }

.aira-search-acc-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    color: var(--ins-primary-text-emphasis);
}

.aira-search-acc-body { padding: .125rem 0 .375rem 1rem; }

/* The custom range: two dates and Apply, refused on the field when it runs backwards (rule 15). */
.aira-search-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .375rem;
    padding: .25rem .875rem .25rem 0;
}

.aira-search-range .aira-search-range-foot {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.aira-search-custom { padding: .25rem .875rem .25rem; }

/* The Refine column: two columns of controls above xl, one below, and a field finder on top. */
.aira-refine-find { padding: .25rem .875rem .5rem; }

.aira-refine-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1rem;
    padding: 0 .875rem;
}

@media (max-width: 1199.98px) {
    .aira-refine-grid { grid-template-columns: minmax(0, 1fr); }
}

.aira-refine-empty {
    padding: .5rem .875rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

/* --------------------------------------------------------------------------
   Typing: the "Search <field> for" list under the bar.
   -------------------------------------------------------------------------- */
.aira-search-menu {
    position: fixed;
    z-index: var(--aira-z-searchpanel);
    min-width: 20rem;
    max-width: min(44rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding: .25rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    box-shadow: var(--aira-shadow-2);
}

.aira-search-menu-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .3125rem .5rem;
    border: 0;
    border-radius: var(--ins-border-radius-sm);
    background: none;
    color: var(--aira-ink-2);
    font: inherit;
    font-size: .8125rem;
    text-align: left;
    cursor: pointer;
}

.aira-search-menu-row:hover,
.aira-search-menu-row.is-active { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }
.aira-search-menu-row:hover strong,
.aira-search-menu-row.is-active strong { color: inherit; }
.aira-search-menu-row strong { color: var(--aira-ink); font-weight: 600; }

/* A row with matches to pick from: an arrow says "press right". */
.aira-search-menu-row[aria-haspopup="true"]::after {
    content: "";
    width: .4375rem;
    height: .4375rem;
    margin-inline-start: auto;
    border: solid var(--aira-muted);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(-45deg);
}

.aira-search-menu-sub {
    margin: .125rem 0 .25rem 1.25rem;
    padding-inline-start: .5rem;
    border-inline-start: 2px solid var(--ins-border-color);
}

.aira-search-menu-note {
    padding: .3125rem .5rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

/* The topbar's global search (crm/16 §5): a record found by its number typed whole, above the field
   rows - its number, the fact that tells two apart, and its module once there are several - and the
   module headings the field rows are grouped under. */
.aira-search-menu-detail,
.aira-search-menu-module {
    color: var(--aira-muted);
    font-size: .75rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aira-search-menu-module { margin-inline-start: auto; }

.aira-search-menu-group {
    padding: .375rem .5rem .125rem;
    color: var(--aira-muted);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Below md the master panel is a full-screen sheet over an OPAQUE scrim - a colour, never a
   backdrop-filter (rule 10b: a blur over the screen blinks whatever is drawn above it) - with a
   Done button. Below sm the compact panel spans the width. The script adds these classes.
   -------------------------------------------------------------------------- */
.aira-search-scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--aira-z-searchpanel) - 1);
    background: rgba(18, 22, 30, .5);
}

.aira-search-panel.is-sheet {
    inset: 0;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* Stacked as blocks in ONE scrolling box. Left a grid, the columns' `min-height: 0` - which is what
   lets each scroll on its own beside the others - lets the implicit rows shrink below their
   content, and the three columns were drawn on top of one another. */
.aira-search-panel.is-sheet .aira-search-cols {
    display: block;
    overflow-y: auto;
}

.aira-search-panel.is-sheet .aira-search-col {
    min-height: auto;
    border-inline-start: 0;
    border-top: 1px solid var(--ins-border-color);
    overflow: visible;
}

.aira-search-panel.is-sheet .aira-search-col:first-child { border-top: 0; }

.aira-search-panel.is-wide {
    left: .75rem;
    right: .75rem;
    width: auto;
    min-width: 0;
}

.aira-search-done { display: none; }
.aira-search-panel.is-sheet .aira-search-done { display: inline-flex; }

/* ==========================================================================
   A workspace page - one module's records under one search bar (app/js/aira-workspace.js); the
   helpdesk's Tickets page was the first.

   Row 1: New complaint, the search bar, the view switch. Row 2: the view's
   summary - a figure the operator needs, so not an explainer band. Then the
   views, all of them rendered and one shown, chosen by `data-view` on the
   root. An inline script sets that before the first paint, so the page never
   flashes the board on its way to the List.

   The bar, the switch and the state buttons are toolbar controls, so -sm is
   their size (hard rule 10a); nothing here restates a control metric.
   ========================================================================== */

/* The page's scrollbar keeps its gutter here. The analysis views size themselves to the page, and a
   scrollbar that came and went with the chart changed the width it was drawn for, so it was drawn
   again (analysis.md T71). This page only: on a short Settings page a reserved gutter is an empty
   strip for nothing. The window is the only scroller - inside the app full screen's frame too. */
html:has([data-workspace]) { scrollbar-gutter: stable; }

/* Focus mode (app/js/aira-focus.js; analysis.md, *Full screen*): an analysis view with the whole
   screen. The shell steps aside - hidden, never covered: no overlay, no z-index, no backdrop-filter
   (hard rule 10b) - and the workspace keeps working, dialogs and toasts included, because the
   document is what is in full screen, not a card (T75). Keyed on our own attribute, never on
   data-sidenav-size (hard rule 12). */
html[data-aira-focus] .wrapper > .app-topbar,
html[data-aira-focus] .wrapper > .sidenav-menu { display: none !important; }

html[data-aira-focus] .wrapper > .content-page {
    margin-left: 0;
    min-height: 100dvh;
    /* The theme slides the page across when the sidebar changes size; here the sidebar is gone. */
}

html[data-aira-focus] .content-page > .container-fluid { padding-top: .75rem; }

/* Not a place to start a complaint. */
html[data-aira-focus] .aira-ws-new { display: none; }

.aira-ws-bar,
.aira-ws-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.aira-ws-bar > .aira-searchbar-root {
    flex: 1 1 auto;
    min-width: 20rem;
}

.aira-ws-new,
.aira-ws-switch,
.aira-ws-switch-menu { flex: 0 0 auto; }

.aira-ws-switch .btn { display: inline-flex; align-items: center; }

/* Below md the switch is one dropdown naming the view, and the bar takes a row of its own. */
.aira-ws-switch-menu { display: none; }
.aira-ws-switch-label { display: none; align-items: center; gap: .375rem; }

@media (max-width: 767.98px) {
    .aira-ws-bar > .aira-searchbar-root { order: 3; flex-basis: 100%; min-width: 0; }
    .aira-ws-switch { display: none; }
    .aira-ws-switch-menu { display: block; margin-left: auto; }
}

.aira-ws-summary {
    display: none;
    margin-left: auto;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
}

.aira-ws-view { display: none; }

.aira-ws[data-view="dashboard"] [data-view-pane="dashboard"],
.aira-ws[data-view="reports"] [data-view-pane="reports"],
.aira-ws[data-view="kanban"] [data-view-pane="kanban"],
.aira-ws[data-view="list"] [data-view-pane="list"],
.aira-ws[data-view="pivot"] [data-view-pane="pivot"],
.aira-ws[data-view="graph"] [data-view-pane="graph"] { display: block; }

.aira-ws[data-view="dashboard"] [data-view-summary="dashboard"],
.aira-ws[data-view="reports"] [data-view-summary="reports"],
.aira-ws[data-view="kanban"] [data-view-summary="kanban"],
.aira-ws[data-view="list"] [data-view-summary="list"],
.aira-ws[data-view="pivot"] [data-view-summary="pivot"],
.aira-ws[data-view="graph"] [data-view-summary="graph"] { display: inline; }

.aira-ws[data-view="dashboard"] [data-view-label="dashboard"],
.aira-ws[data-view="reports"] [data-view-label="reports"],
.aira-ws[data-view="kanban"] [data-view-label="kanban"],
.aira-ws[data-view="list"] [data-view-label="list"],
.aira-ws[data-view="pivot"] [data-view-label="pivot"],
.aira-ws[data-view="graph"] [data-view-label="graph"] { display: inline-flex; }

/* Empty and failed - the same two states in every view, above what the view could still show.
   Loading is the shared shimmer (*Loading*), never a spinner over a blank page. */
.aira-ws-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-bottom: .75rem;
    padding: .875rem 1rem;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
    background: var(--ins-tertiary-bg);
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-ws-state[hidden] { display: none; }

.aira-ws-state.is-failed {
    color: var(--ins-danger-text-emphasis);
    background: var(--ins-danger-bg-subtle);
    border-color: var(--ins-danger-border-subtle);
}

/* --------------------------------------------------------------------------
   A workspace's Pivot - app/js/aira-workspace-pivot.js, analysis.md, *The Pivot*.

   It carries the .pivot-table / .drill-cell / .pv-total /
   .pv-empty / .is-shaded contract and adds the tree: one scroll box both
   ways, the header rows and the row-header column pinned inside it. The
   table stays border-collapse: separate, so every cell owns its rules and a
   pinned cell takes them with it - under collapse a border belongs to the
   grid and stays behind while the cell travels. The frozen edges add an
   INSET box-shadow on top, so they read stronger than the grid.
   -------------------------------------------------------------------------- */
.aira-ws-toolbar { display: none; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* The Pivot's and the Graph's Analyse (crm/14 §2.2, crm/110): the records the figures count. Its word is the strip's
   (.pv-strip-label - ANALYSE · ROWS · COLUMNS · MEASURES), outside the btn-group, whose first and last buttons keep
   their own corners; a rule after it parts it from what depends on it (AN4). Only a module with several sets renders it. */
.aira-ws-sets {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding-right: .625rem;
    border-right: 1px solid var(--ins-border-color);
}
.aira-ws-sets-label { white-space: nowrap; }
.aira-ws-sets-toggle { display: inline-flex; align-items: center; gap: .375rem; font-weight: 600; }

/* Its menu: each set its name over the line saying what one record is and what it measures (AN3). */
.aira-ws-sets-menu { width: min(27rem, calc(100vw - 2rem)); }
.aira-ws-set { display: flex; flex-direction: column; align-items: flex-start; gap: .0625rem; white-space: normal; }
.aira-ws-set-name { font-weight: 600; }
.aira-ws-set-hint { font-size: .75rem; line-height: 1.3; color: var(--aira-muted); }
.aira-ws-set.active .aira-ws-set-hint,
.aira-ws-set:active .aira-ws-set-hint { color: inherit; opacity: .85; }

/* A measures menu's head - whose measures it lists (crm/110 AN5). The quotations' twenty measures are taller than a
   laptop's window: the menu scrolls in itself. */
.pv-measures-menu { max-height: min(70vh, 36rem); overflow-y: auto; }
.pv-measures-head { white-space: normal; }

.aira-ws[data-view="reports"] [data-view-tools="reports"],
.aira-ws[data-view="list"] [data-view-tools="list"],
.aira-ws[data-view="pivot"] [data-view-tools="pivot"],
.aira-ws[data-view="graph"] [data-view-tools="graph"] { display: flex; }

/* A Pivot control only one look has (pivot-variant.md): shown under that look alone. The look is on
   the root from the boot script's first-paint decision, so the other look's controls never flash. */
.aira-ws[data-pivot-variant="clear"] [data-pivot-look="classic"],
.aira-ws:not([data-pivot-variant="clear"]) [data-pivot-look="clear"] { display: none; }

/* T45: the theme paints an OPEN btn-light (.show, and :active) in its tertiary colours - half-opacity
   ink on a paler ground - so a chip whose menu was open read as disabled in light mode, and did not
   change at all in dark. The toolbar's light buttons keep their ink when open and darken a step. The
   dark rule restates both: the theme's own dark .btn-light outranks the first one. */
.aira-ws-toolbar .btn-light {
    --ins-btn-active-color: var(--ins-emphasis-color);
    --ins-btn-active-bg: var(--ins-border-color);
}

html[data-bs-theme="dark"] .aira-ws-toolbar .btn-light {
    --ins-btn-active-color: var(--ins-emphasis-color);
    --ins-btn-active-bg: rgba(var(--ins-white-rgb), .18);
}

.pv-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-right: .25rem;
}

.pv-strip-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; }

.pv-strip-label {
    margin-right: .125rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.pv-strip-sep { color: var(--aira-muted); }

/* Below md the strip is the Layout menu (tickets-pivot.js foldStrip gives it .dropdown-menu there):
   the three groups one under another. Stated with both classes - .pv-strip's display: flex would
   otherwise show it closed, and the theme's .dropdown-menu.show { block } would un-flex it open. */
.pv-strip.dropdown-menu:not(.show) { display: none; }

.pv-strip.dropdown-menu.show {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    width: min(20rem, calc(100vw - 2rem));
    margin-right: 0;
    padding: .75rem;
}

/* Folded, each group reads as a field: its name on one line, its chips and [+] on the next. */
.pv-strip.dropdown-menu .pv-strip-group { display: flex; }
.pv-strip.dropdown-menu .pv-strip-label { flex: 0 0 100%; margin: 0 0 .125rem; }
.pv-chip { display: inline-flex; align-items: center; gap: .25rem; }
.pv-chip-caret { opacity: .6; }

/* The measures menu's rows carry the search panel's tick - one look for "this is on". */
.pv-check { display: flex; align-items: center; gap: .5rem; }
.pv-check[aria-checked="true"] .aira-search-tick { background: var(--ins-primary); border-color: var(--ins-primary); }
.pv-check[aria-checked="true"] .aira-search-tick::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pv-card { overflow: hidden; }

.pv-scroll {
    overflow: auto;
    /* Set by the script from the box's real distance to the bottom of the window, as the board's. */
    max-height: var(--pv-max-height, 70vh);
    overscroll-behavior: contain;
    /* The table's outer frame, on the box rather than the cells, so it stays at the edge of what
       is on screen while the grid scrolls under it (C01). */
    border: var(--ins-border-width) solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.pv-tree {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* A ring outside a cell is clipped by the scroll box it sits in: inside, here (rule 10c). */
    --aira-focus-ring-offset: -2px;
}

/* C01: a full grid, as a table on paper and the "this table" file draw it. A right and a bottom rule
   on every cell - never .table-bordered, whose row rules are on the <tr> and paint only under
   collapse. Where a cell meets the box's frame it drops that side, so no edge is drawn twice. */
.pv-tree > thead > tr > th,
.pv-tree > tbody > tr > th,
.pv-tree > tbody > tr > td {
    border-right: var(--ins-border-width) solid var(--ins-border-color);
    border-bottom: var(--ins-border-width) solid var(--ins-border-color);
}

/* The grand total stands off the body, as the file's bold top row does. */
.pv-tree > tbody > tr.pv-total-row > * { border-bottom-width: calc(var(--ins-border-width) * 2); }

/* The right edge: every body row's last cell, the first header row's and the measure row's. The
   header rows between reach it only when there is no Total column spanning down beside them.
   `th:last-child` after the :has(), never a bare `:last-child` - see "A :has() rule ends in a tag or
   a class" in .claude/docs/ubold-ui.md; ThemeRenderingTests pins it. */
.pv-tree > tbody > tr > :last-child,
.pv-tree > thead > tr:first-child > :last-child,
.pv-tree > thead > tr.pv-measures > :last-child,
.pv-tree:not(:has(> thead th.pv-col-head.pv-total)) > thead > tr > th:last-child { border-right: 0; }

.pv-tree > tbody > tr:last-child > * { border-bottom: 0; }

/* A heading over several columns sits over the middle of them; the measure row stays right-aligned. */
.pv-tree > thead > tr > th.pv-col-head[colspan]:not([colspan="1"]) { text-align: center; }

.pv-tree > thead > tr > th {
    position: sticky;
    z-index: 2;
    background: var(--ins-tertiary-bg);
    box-shadow: none;
}

/* The frozen header's edge is under its last row, a step stronger than the grid. */
.pv-tree > thead > tr.pv-measures > th { box-shadow: inset 0 -1px 0 var(--ins-border-color); }

/* Each header row pinned under the one above it, at the offset tickets-pivot.js measured it drawn at
   (pinHeader, T85). Never an offset per row here: the rows are column levels + 2 with no ceiling, and
   a row is as tall as its content - five rows at 2.125rem apiece left a fourth level's measure row
   unpinned, sliding up over the rest, and every pinned row over the last 1.25px - the rule - of the
   one above. */
.pv-tree > thead > tr > th { top: var(--pv-top, 0px); height: 2.125rem; }

/* Above the header cells that scroll under it sideways and the row headers that scroll under it
   down. Stated at (0,2,3): the Reports-era `.pivot-table th.pv-corner { z-index: 2 }` further down
   is (0,2,2) and later, so at this file's old (0,2,2) it won, and every header scrolled over the corner. */
.pv-tree > thead > tr > th.pv-corner {
    left: 0;
    z-index: 4;
    text-align: left;
    vertical-align: bottom;
    box-shadow: inset -1px -1px 0 var(--ins-border-color);
}

.pv-tree > tbody > tr > th.pv-head-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
    background: var(--ins-secondary-bg);
    box-shadow: inset -1px 0 0 var(--ins-border-color);
}

.pv-tree > tbody > tr:hover > th.pv-head-cell {
    background: color-mix(in srgb, var(--aira-brand-400) 16%, var(--ins-secondary-bg));
}

.pv-tree .pv-total-row > *,
.pv-tree .pv-total { font-weight: 700; }

.pv-tree > tbody > tr.pv-total-row > th.pv-head-cell { background: var(--ins-tertiary-bg); }

.pv-tree td.pv-value {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* The column under the pointer - on a wide table, the half an eye loses (Odoo washes both). */
.pv-tree td.pv-col-hover { background: color-mix(in srgb, var(--aira-brand-400) 7%, transparent); }

.pv-toggle,
.pv-sort {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
}

.pv-tree th.pv-head-cell .pv-toggle { padding-left: calc(var(--pv-depth, 0) * 1.25rem); }

/* No sizes here: the theme's svg.lucide { 1em } outranks a class, so an icon is the size of its text. */
.pv-toggle-icon { flex: 0 0 auto; color: var(--aira-muted); }
.pv-measure { text-align: right; }

.pv-tree tr.pv-foot > td { text-align: left; color: var(--aira-muted); font-weight: 400; }

/* A refusal the table cannot show on itself, with the way round it. */
.pv-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    padding: .625rem .875rem;
    font-size: .8125rem;
    color: var(--ins-warning-text-emphasis);
    background: var(--ins-warning-bg-subtle);
    border: 1px solid var(--ins-warning-border-subtle);
    border-radius: var(--ins-border-radius);
}

.pv-notice[hidden] { display: none; }

/* --------------------------------------------------------------------------
   The Pivot's second look, Clear - app/js/pages/tickets-pivot-clear.js,
   .claude/docs/pivot-variant.md. A block of its own: Clear's table carries
   neither .pivot-table nor .pv-tree, so no rule of Classic's reaches it - the
   40rem floor that kept Classic from filling its box included (F5, V18) -
   and nothing here reaches Classic.

   The product owner's reviews (01/10/2026): a professional grid, with borders
   and colour under the column headings, the nesting shown. Then (02/10/2026,
   D18) the deep-brand header band with pastel pills on it read as "odd" and
   "old fashioned" - Excel's Medium styles - and its pills as too big. So the
   colour moved from fills to accents, as current grids draw it:
     * LIGHT SURFACES - the header a cool near-white with a hint of the brand,
       its headings in a slate that leans to the brand; the groups and the
       totals on the brand's faint tints, a step deeper each: a second-level
       group, a top-level group, the header, the totals, the grand total;
     * THE BRAND AS ACCENT - a 2px rule under the header, a bar on every
       group's name (strongest at the top level, fainter down - the nesting's
       map, its guides in the same ramp, the corner's chips carrying the same
       dots), the rules that set the totals off;
     * SMALL CHIPS - a stage or a department at 11.5px on a 20px chip, its
       label deepened from its colour until it holds 4.5:1 (the product's
       chip ink is 1.8-3.5:1 for half the stages), its dot the true colour;
     * a full grid in two weights. Never a figure coloured by its category.
   Every ink is mixed toward a fixed slate, so it stays dark whatever brand
   Settings picks; every token is restated for dark, where the tints are of a
   lifted brand (--ins-primary is about 2:1 there as ink, T49).

   Every pinned offset is measured by the script (fit()) - the header rows'
   --pv-top, the Total column's --pvc-r0..7 - and none is restated here (V1).
   The stacking ladder, highest first, is written once (V2): the corner 9,
   the header's Total cells 8, the header 7, the Total row's name 6, its Total
   cells 5, the Total row 4, the row names 3, the Total column 2.
   -------------------------------------------------------------------------- */
.pvc {
    --pvc-row-h: 2.5rem;
    --pvc-indent: 20px;
    --pvc-chev: 24px;
    --pvc-pad: .75rem;

    --pvc-bg: var(--ins-secondary-bg);
    --pvc-brand: var(--ins-primary);

    /* Ink: a slate leaning to the brand for the headings, a deeper one for group names and totals. */
    --pvc-ink: color-mix(in srgb, var(--pvc-brand) 26%, #1f2937);
    --pvc-ink-strong: color-mix(in srgb, var(--pvc-brand) 45%, #0f172a);

    /* The header: a cool near-white with a hint of the brand - every row of it alike, the brand's
       rule under its floor the one accent. */
    --pvc-head-bg: color-mix(in srgb, var(--pvc-brand) 7%, #f8fafc);
    --pvc-head-hover: color-mix(in srgb, var(--pvc-brand) 14%, #f8fafc);
    --pvc-head-ink: var(--pvc-ink);
    --pvc-head-line: color-mix(in srgb, var(--pvc-brand) 11%, #e1e6ec);

    /* The grid: neutral hairlines warmed by the brand, a column group's end stronger, the frozen row
       names' edge stronger again; the rule under the header in the brand. */
    --pvc-line: color-mix(in srgb, var(--pvc-brand) 6%, #e8ebf0);
    --pvc-vline: color-mix(in srgb, var(--pvc-brand) 4%, #eef0f4);
    --pvc-line-2: color-mix(in srgb, var(--pvc-brand) 12%, #d6dbe3);
    --pvc-edge: color-mix(in srgb, var(--pvc-brand) 16%, #d0d6df);
    --pvc-rule: var(--pvc-brand);

    /* The groups: a top-level one on the brand's faintest tint, its name in the strong ink and a rule
       above it; a second-level one fainter; deeper groups are bold on the card. */
    --pvc-g1-bg: color-mix(in srgb, var(--pvc-brand) 6%, var(--pvc-bg));
    --pvc-g1-ink: var(--pvc-ink-strong);
    --pvc-g1-rule: color-mix(in srgb, var(--pvc-brand) 20%, var(--pvc-bg));
    --pvc-g2-bg: color-mix(in srgb, var(--pvc-brand) 2.5%, var(--pvc-bg));

    /* The nesting's marks, level 1 to 5 and on: the bar on a group's name, the dot on its chip in
       the corner, and (a step lighter) the guide line under it. */
    --pvc-mark-1: var(--pvc-brand);
    --pvc-mark-2: color-mix(in srgb, var(--pvc-brand) 58%, var(--pvc-bg));
    --pvc-mark-3: color-mix(in srgb, var(--pvc-brand) 36%, var(--pvc-bg));
    --pvc-mark-4: color-mix(in srgb, var(--pvc-brand) 24%, var(--pvc-bg));
    --pvc-mark-5: color-mix(in srgb, var(--pvc-brand) 16%, var(--pvc-bg));
    --pvc-guide-1: color-mix(in srgb, var(--pvc-brand) 46%, var(--pvc-bg));
    --pvc-guide-2: color-mix(in srgb, var(--pvc-brand) 32%, var(--pvc-bg));
    --pvc-guide-3: color-mix(in srgb, var(--pvc-brand) 24%, var(--pvc-bg));
    --pvc-guide-4: color-mix(in srgb, var(--pvc-brand) 18%, var(--pvc-bg));
    --pvc-guide-5: color-mix(in srgb, var(--pvc-brand) 13%, var(--pvc-bg));

    /* The totals a step deeper than the header, bold in the strong ink, set off by a rule in the
       brand's tint; the grand total deeper again - the figure the table adds up to. */
    --pvc-total-bg: color-mix(in srgb, var(--pvc-brand) 11%, #f8fafc);
    --pvc-total-ink: var(--pvc-ink-strong);
    --pvc-total-rule: color-mix(in srgb, var(--pvc-brand) 55%, var(--pvc-bg));
    --pvc-grand-bg: color-mix(in srgb, var(--pvc-brand) 19%, var(--pvc-bg));
    --pvc-grand-ink: var(--pvc-ink-strong);

    /* A stage or department chip's label, deepened from its colour toward the slate until the
       lightest stage (Customer Care Pending's amber) holds 4.5:1 on its tint; its dot stays true. */
    --pvc-chip-ink-to: #1f2937;
    --pvc-chip-ink-keep: 50%;

    /* A real zero, grey - and still 4.5:1 (R18): --aira-muted is 3:1 on white, so light takes ink-2. */
    --pvc-zero: var(--aira-ink-2);
    --pvc-underline: color-mix(in srgb, var(--pvc-brand) 22%, transparent);
    --pvc-shadow: rgba(16, 36, 64, .16);

    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--ins-body-color);
    /* A ring outside a cell is clipped by the scroll box it sits in: inside, here (rule 10c). */
    --aira-focus-ring-offset: -2px;
}

/* Dark: every surface is a tint of the brand LIFTED (+55%) over the dark card - the brand mixed into
   the card barely moves its lightness (40% of it reached L* 22 from 12) - and the inks lean to the
   lifted brand, never to --ins-primary (about 2:1 there, T49). The zero is a grey that still holds
   4.5:1 on the Total column's ground. */
html[data-bs-theme="dark"] .pvc {
    --pvc-lift: color-mix(in srgb, var(--pvc-brand) 45%, #fff);

    --pvc-ink: color-mix(in srgb, var(--pvc-lift) 30%, #e2e8f0);
    --pvc-ink-strong: color-mix(in srgb, var(--pvc-lift) 40%, #f1f5f9);

    --pvc-head-bg: color-mix(in srgb, var(--pvc-lift) 8%, var(--pvc-bg));
    --pvc-head-hover: color-mix(in srgb, var(--pvc-lift) 18%, var(--pvc-bg));
    --pvc-head-line: color-mix(in srgb, var(--pvc-lift) 14%, var(--pvc-bg));

    --pvc-line: color-mix(in srgb, var(--pvc-lift) 10%, var(--pvc-bg));
    --pvc-vline: color-mix(in srgb, var(--pvc-lift) 7%, var(--pvc-bg));
    --pvc-line-2: color-mix(in srgb, var(--pvc-lift) 22%, var(--pvc-bg));
    --pvc-edge: color-mix(in srgb, var(--pvc-lift) 28%, var(--pvc-bg));
    --pvc-rule: var(--pvc-lift);

    --pvc-g1-bg: color-mix(in srgb, var(--pvc-lift) 6%, var(--pvc-bg));
    --pvc-g1-rule: color-mix(in srgb, var(--pvc-lift) 24%, var(--pvc-bg));
    --pvc-g2-bg: color-mix(in srgb, var(--pvc-lift) 3%, var(--pvc-bg));

    --pvc-mark-1: var(--pvc-lift);
    --pvc-mark-2: color-mix(in srgb, var(--pvc-lift) 62%, var(--pvc-bg));
    --pvc-mark-3: color-mix(in srgb, var(--pvc-lift) 42%, var(--pvc-bg));
    --pvc-mark-4: color-mix(in srgb, var(--pvc-lift) 30%, var(--pvc-bg));
    --pvc-mark-5: color-mix(in srgb, var(--pvc-lift) 22%, var(--pvc-bg));
    --pvc-guide-1: color-mix(in srgb, var(--pvc-lift) 40%, var(--pvc-bg));
    --pvc-guide-2: color-mix(in srgb, var(--pvc-lift) 30%, var(--pvc-bg));
    --pvc-guide-3: color-mix(in srgb, var(--pvc-lift) 24%, var(--pvc-bg));
    --pvc-guide-4: color-mix(in srgb, var(--pvc-lift) 19%, var(--pvc-bg));
    --pvc-guide-5: color-mix(in srgb, var(--pvc-lift) 15%, var(--pvc-bg));

    --pvc-total-bg: color-mix(in srgb, var(--pvc-lift) 12%, var(--pvc-bg));
    --pvc-total-rule: color-mix(in srgb, var(--pvc-lift) 50%, var(--pvc-bg));
    --pvc-grand-bg: color-mix(in srgb, var(--pvc-lift) 22%, var(--pvc-bg));

    --pvc-chip-ink-to: #fff;
    --pvc-chip-ink-keep: 70%;

    --pvc-zero: color-mix(in srgb, var(--aira-muted) 60%, var(--ins-emphasis-color));
    --pvc-underline: color-mix(in srgb, var(--pvc-lift) 32%, transparent);
    --pvc-shadow: rgba(0, 0, 0, .45);
}

/* The lift exactly - HLS lightness moved toward white, the saturation kept - where the browser
   computes it from the runtime brand (Chrome 119, Firefox 128, Safari 16.4); a shade greyer without. */
@supports (color: hsl(from red h s l)) {
    html[data-bs-theme="dark"] .pvc { --pvc-lift: hsl(from var(--pvc-brand) h s calc(l + (100 - l) * .55)); }
}

/* R28: Comfortable 40px, Compact 32px - the header rows too. */
.pvc[data-density="compact"] { --pvc-row-h: 2rem; }

/* ---- the grid: every cell owns a right and a bottom line - under separate borders a line travels
   with its pinned cell (C01's reason, Classic's too) ---- */
.pvc > thead > tr > th,
.pvc > tbody > tr > th,
.pvc > tbody > tr > td {
    height: var(--pvc-row-h);
    padding: 0 var(--pvc-pad);
    vertical-align: middle;
    white-space: nowrap;
    border: 0;
    border-right: var(--ins-border-width) solid var(--pvc-vline);
    border-bottom: var(--ins-border-width) solid var(--pvc-line);
    background-color: transparent;
    /* A wash is a layer over the cell's own ground, so a group's tint and the Total's survive a hover. */
    background-image: linear-gradient(var(--pvc-wash, transparent), var(--pvc-wash, transparent));
}

/* Where a column's measures or a column group end: the grid's second weight. */
.pvc > tbody > tr > td.pvc-gend { border-right-color: var(--pvc-line-2); }

/* ---- the header: a light band, every heading boxed, pinned where it was drawn (T85) ---- */
.pvc > thead > tr > th {
    position: sticky;
    top: var(--pv-top, 0px);
    z-index: 7;
    border-right-color: var(--pvc-head-line);
    border-bottom-color: var(--pvc-head-line);
    background-color: var(--pvc-head-bg);
    color: var(--pvc-head-ink);
    font-weight: 600;
    text-align: center;
}
.pvc > thead > tr > th.pvc-gend { border-right-color: var(--pvc-edge); }

/* The box's frame is the last line on the right and at the foot - never drawn twice. A heading is on
   the right edge only when it heads the last column (pvc-redge, the renderer's): `:last-child` is the
   last cell of its ROW, and in a lower header row that is the last child of an open group - the rule
   took the line between it and the folded column beside it (the owner's review, 01/10/2026). */
.pvc > thead > tr > th.pvc-redge,
.pvc > tbody > tr > td:last-child { border-right: 0; }
.pvc > tbody > tr:last-child > th,
.pvc > tbody > tr:last-child > td { border-bottom: 0; }

/* The header's floor is a frozen edge: a rule in the brand. */
.pvc > thead > tr > th.pvc-floor { border-bottom: 2px solid var(--pvc-rule); }

/* A heading's words, its chevron and its sort sit together in the middle of what it heads. */
.pvc .pvc-hc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: var(--pvc-chev);
}
.pvc > thead .pv-toggle,
.pvc > thead .pv-sort { gap: .25rem; font-weight: inherit; color: inherit; }
.pvc > thead .pv-toggle:hover > .pv-toggle-label:not(.stage-chip),
.pvc > thead .pv-sort:hover > .pvc-head-label { text-decoration: underline; text-underline-offset: 3px; }

/* The corner names both axes: the column groupings across the top, the rows' down the side. */
.pvc > thead > tr > th.pv-corner {
    left: 0;
    z-index: 9;
    text-align: left;
    vertical-align: bottom;
    padding-block: .5rem;
    border-right: var(--ins-border-width) solid var(--pvc-edge);
}
/* The table is max-content wide, so a cell is as wide as its content on one line: the cap is what
   lets five row groupings wrap onto two lines instead of widening the row names' column. */
.pvc .pvc-axes { display: flex; flex-direction: column; gap: .3125rem; min-width: 11rem; max-width: 21rem; }
.pvc .pvc-axis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    font-size: .71875rem;
    font-weight: 600;
}
.pvc .pvc-axis-cols { justify-content: flex-end; }
.pvc .pvc-axis-icon { flex: 0 0 auto; width: .8125rem; height: .8125rem; opacity: .55; }
.pvc .pvc-axis-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---- taking a grouping out (D16): a chip per grouping in the corner, a minus on every heading ---- */

/* A grouping in the corner: its level's mark - the dot is the bar its groups carry down the table
   (D17), so the corner is the key to the nesting - its name, its own ×. A small token on the card's
   own ground, squarer than a stage chip so the two never read as one kind (D18). */
.pvc .pvc-lvl {
    display: inline-flex;
    align-items: center;
    gap: .0625rem;
    height: 1.25rem;
    padding: 0 .0625rem 0 .375rem;
    border: var(--ins-border-width) solid var(--pvc-line-2);
    border-radius: .3125rem;
    background-color: var(--pvc-bg);
    color: var(--pvc-head-ink);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.pvc .pvc-lvl::before {
    content: "";
    flex: 0 0 auto;
    width: .375rem;
    height: .375rem;
    margin-right: .25rem;
    border-radius: 50%;
    background-color: var(--pvc-mark);
}
.pvc .pvc-lvl[data-level] { --pvc-mark: var(--pvc-mark-5); }
.pvc .pvc-lvl[data-level="1"] { --pvc-mark: var(--pvc-mark-1); }
.pvc .pvc-lvl[data-level="2"] { --pvc-mark: var(--pvc-mark-2); }
.pvc .pvc-lvl[data-level="3"] { --pvc-mark: var(--pvc-mark-3); }
.pvc .pvc-lvl[data-level="4"] { --pvc-mark: var(--pvc-mark-4); }
.pvc .pvc-lvl-sep { opacity: .65; font-weight: 400; }
.pvc .pvc-lvl-x,
.pvc .pvc-drop {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}
.pvc .pvc-lvl-x { width: 1rem; height: 1rem; font-size: .6875rem; opacity: .6; }

/* The minus: out of sight until its heading is pointed at or focused - on a table of 400 rows it
   would otherwise be 400 minuses. The keyboard's way is the heading's right-click menu. */
.pvc .pvc-drop {
    position: absolute;
    z-index: 1;
    color: var(--aira-ink-2);
    opacity: 0;
    pointer-events: none;
}
.pvc > tbody > tr:hover > th.pv-head-cell > .pvc-drop,
.pvc > tbody > tr > th.pv-head-cell:focus-within > .pvc-drop,
.pvc > thead > tr > th:hover > .pvc-drop,
.pvc > thead > tr > th:focus-within > .pvc-drop { opacity: 1; pointer-events: auto; }
.pvc .pvc-lvl-x:hover,
.pvc .pvc-drop:hover { opacity: 1; color: var(--ins-danger); background-color: var(--ins-danger-bg-subtle); }

/* A row heading keeps the minus's room at its right end, so the minus never covers a name, and the
   minuses stand in one line down the table. */
.pvc > tbody > tr > th.pv-head-cell { padding-right: calc(var(--pvc-pad) + 1.5rem); }
.pvc > tbody > tr > th.pv-head-cell > .pvc-drop {
    top: 50%;
    right: .25rem;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: -.75rem;
    font-size: .9375rem;
}
/* A column heading has no room to spare in every column: its minus sits in the heading's top corner,
   clear of the words and the sort's arrow. */
.pvc > thead > tr > th > .pvc-drop {
    top: 2px;
    right: 2px;
    width: 1rem;
    height: 1rem;
    font-size: .6875rem;
}
/* Touch has no hover to show it: the corner's chips and the strip remove a grouping there. */
@media (hover: none) { .pvc .pvc-drop { display: none; } }

/* While the pointer is on a minus or a ×, every heading of that grouping - and its chip - says it is
   going (the controller's previewRemoval): one press takes them all. */
.pvc > tbody > tr > th.pv-head-cell.pvc-doomed,
.pvc > thead > tr > th.pvc-doomed { --pvc-wash: color-mix(in srgb, var(--ins-danger) 14%, transparent); }
.pvc .pvc-doomed .pv-toggle-label,
.pvc .pvc-lvl.pvc-doomed .pvc-lvl-name {
    text-decoration: line-through;
    text-decoration-color: var(--ins-danger);
    text-decoration-thickness: 2px;
}
.pvc .pvc-lvl.pvc-doomed { border-color: var(--ins-danger); background-color: var(--ins-danger-bg-subtle); }

/* The Total column's headings stand on the totals' ground. */
.pvc > thead > tr > th.pv-total { font-weight: 700; color: var(--pvc-total-ink); background-color: var(--pvc-total-bg); }

/* The sort: its own arrow, faint at rest so it is found, whole on hover, on focus and while sorted;
   a sorted heading stands on the deeper tint. */
.pvc .pvc-sort-icon { flex: 0 0 auto; opacity: .45; }
.pvc .pv-sort:hover .pvc-sort-icon,
.pvc .pv-sort:focus-visible .pvc-sort-icon,
.pvc th[aria-sort="ascending"] .pvc-sort-icon,
.pvc th[aria-sort="descending"] .pvc-sort-icon { opacity: 1; }
.pvc .pvc-sort-only {
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: var(--ins-border-radius);
}
.pvc .pvc-sort-only:hover { background-color: var(--pvc-head-hover); }
.pvc > thead > tr > th[aria-sort="ascending"],
.pvc > thead > tr > th[aria-sort="descending"],
.pvc > thead > tr > th.pv-col-hover { background-color: var(--pvc-head-hover); }

/* ---- the rows: a chevron, an indent with a guide per ancestor, a group that reads as one ---- */
.pvc > tbody > tr > th.pv-head-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    font-weight: 400;
    text-align: left;
    color: var(--ins-body-color);
    background-color: var(--pvc-bg);
    background-image: linear-gradient(var(--pvc-wash, transparent), var(--pvc-wash, transparent)),
        var(--pvc-guides, none), var(--pvc-guides-deep, none);
    background-repeat: no-repeat;
    background-size: 100% 100%, calc((var(--pv-depth, 1) - 1) * var(--pvc-indent)) 100%,
        max(0px, calc((var(--pv-depth, 1) - 6) * var(--pvc-indent))) 100%;
    background-position: 0 0, calc(var(--pvc-pad) + var(--pvc-chev) / 2) 0,
        calc(var(--pvc-pad) + var(--pvc-chev) / 2 + var(--pvc-indent) * 5) 0;
    border-right: var(--ins-border-width) solid var(--pvc-edge);
}

/* One line per ancestor, through the chevrons above it (R4), each in its level's step of the marks'
   ramp - the top level's strongest - so a row's lineage reads down the left (D17). One gradient
   drawn to the row's own depth by its size: a background, no extra element. Past five levels the
   lines repeat in the fifth's step. */
.pvc > tbody > tr.pvc-deep > th.pv-head-cell {
    --pvc-guides: linear-gradient(to right,
        var(--pvc-guide-1) 0 1px, transparent 1px var(--pvc-indent),
        var(--pvc-guide-2) var(--pvc-indent) calc(var(--pvc-indent) + 1px),
        transparent calc(var(--pvc-indent) + 1px) calc(var(--pvc-indent) * 2),
        var(--pvc-guide-3) calc(var(--pvc-indent) * 2) calc(var(--pvc-indent) * 2 + 1px),
        transparent calc(var(--pvc-indent) * 2 + 1px) calc(var(--pvc-indent) * 3),
        var(--pvc-guide-4) calc(var(--pvc-indent) * 3) calc(var(--pvc-indent) * 3 + 1px),
        transparent calc(var(--pvc-indent) * 3 + 1px) calc(var(--pvc-indent) * 4),
        var(--pvc-guide-5) calc(var(--pvc-indent) * 4) calc(var(--pvc-indent) * 4 + 1px),
        transparent calc(var(--pvc-indent) * 4 + 1px));
    --pvc-guides-deep: repeating-linear-gradient(to right, var(--pvc-guide-5) 0 1px, transparent 1px var(--pvc-indent));
}

/* A row's level in the marks' ramp - the bar on its name when it is a group (below), its chip's dot
   in the corner (above). The Total row is level 1 in the tree and no group. */
.pvc > tbody > tr[aria-level] { --pvc-mark: var(--pvc-mark-5); }
.pvc > tbody > tr[aria-level="2"] { --pvc-mark: var(--pvc-mark-1); }
.pvc > tbody > tr[aria-level="3"] { --pvc-mark: var(--pvc-mark-2); }
.pvc > tbody > tr[aria-level="4"] { --pvc-mark: var(--pvc-mark-3); }
.pvc > tbody > tr[aria-level="5"] { --pvc-mark: var(--pvc-mark-4); }

.pvc th.pv-head-cell .pv-toggle {
    gap: .25rem;
    min-height: var(--pvc-chev);
    padding-left: calc((var(--pv-depth, 1) - 1) * var(--pvc-indent));
    font-weight: inherit;
    color: inherit;
}

/* The chevron's 24px target (R3, SC 2.5.8); a row with nothing under it keeps the gutter, so the
   names at one level line up. */
.pvc-chev {
    display: inline-flex;
    flex: 0 0 var(--pvc-chev);
    align-items: center;
    justify-content: center;
    width: var(--pvc-chev);
    height: var(--pvc-chev);
    font-size: 1rem;
    color: var(--pvc-head-ink);
    border-radius: var(--ins-border-radius);
}
.pvc .pv-toggle:hover .pvc-chev:not(.pvc-gutter) { background-color: var(--pvc-head-hover); }
.pvc .pv-toggle.is-open .pvc-chev svg { transform: rotate(90deg); }

/* A top-level group: bold on the brand's faint tint, its name in the strong ink, a rule above it so
   each block reads as one; a second-level group semi-bold on a fainter one; deeper groups semi-bold on
   the card - fills on two levels, weight for the rest; a detail row regular (R5). Every group's name
   carries its level's bar. A folded group is a group. */
.pvc > tbody > tr.pvc-g1 > * { font-weight: 700; background-color: var(--pvc-g1-bg); }
.pvc > tbody > tr.pvc-g1 > th.pv-head-cell { background-color: var(--pvc-g1-bg); color: var(--pvc-g1-ink); }
.pvc > tbody > tr.pvc-g > * { font-weight: 600; }
.pvc > tbody > tr.pvc-g[aria-level="3"] > *,
.pvc > tbody > tr.pvc-g[aria-level="3"] > th.pv-head-cell { background-color: var(--pvc-g2-bg); }
.pvc > tbody > tr.pvc-g1 > th.pv-head-cell,
.pvc > tbody > tr.pvc-g > th.pv-head-cell { box-shadow: inset 3px 0 0 var(--pvc-mark); }
.pvc > tbody > tr.pvc-g1:not(:first-child) > td { box-shadow: inset 0 1px 0 var(--pvc-g1-rule); }
.pvc > tbody > tr.pvc-g1:not(:first-child) > th.pv-head-cell { box-shadow: inset 3px 0 0 var(--pvc-mark), inset 0 1px 0 var(--pvc-g1-rule); }
/* The Total column keeps the totals' ground on every row - a level's fill above outranked it. */
.pvc > tbody > tr[aria-level] > td.pvc-tc { background-color: var(--pvc-total-bg); }

/* A stage or a department is the product's chip (R24) - smaller here, where a heading row of ten
   stages at the board's size crowded the header (the owner, 02/10/2026): 11.5px on a 20px chip.
   Its label is its colour deepened to 4.5:1 and its ground opaque, so the chip reads the same on the
   header, a group's tint and the card; the dot keeps the true colour. */
.pvc .pvc-chip {
    gap: .3125rem;
    padding: 0 .5rem;
    font-size: .71875rem;
    line-height: 1.125rem;
    color: color-mix(in srgb, var(--stage-color, #888) var(--pvc-chip-ink-keep), var(--pvc-chip-ink-to));
    background: color-mix(in srgb, var(--stage-color, #888) 10%, var(--pvc-bg));
    border-color: color-mix(in srgb, var(--stage-color, #888) 30%, var(--pvc-bg));
}
.pvc .pvc-chip::before { width: .375rem; height: .375rem; background: var(--stage-color, #888); }

/* ---- figures (R17, R18) ---- */
.pvc > tbody > tr > td.pv-value { text-align: right; }
.pvc > tbody > tr > td.pvc-zero,
.pvc > tbody > tr > td.pv-locked { color: var(--pvc-zero); }

/* The at-rest "this opens" signal stays - the product's contract - drawn lighter (F15, D10). */
.pvc td.drill-cell { text-decoration-color: var(--pvc-underline); }
.pvc td.drill-cell:hover,
.pvc td.drill-cell:focus-visible { color: var(--ins-link-color); }

.pvc tr.pv-foot > td { text-align: left; color: var(--aira-ink-2); font-weight: 400; background-color: var(--pvc-head-bg); }

/* ---- the washes: the row and the column under the pointer, the figure itself stronger ---- */
.pvc > tbody > tr:hover > * { --pvc-wash: color-mix(in srgb, var(--aira-brand-400) 7%, transparent); }
.pvc > tbody > tr:hover > th.pv-head-cell { --pvc-wash: color-mix(in srgb, var(--aira-brand-400) 16%, transparent); }
.pvc > tbody > tr > td.pv-col-hover { --pvc-wash: color-mix(in srgb, var(--aira-brand-400) 7%, transparent); }
.pvc > tbody > tr > td.drill-cell:hover,
.pvc > tbody > tr > td.drill-cell:focus-visible { --pvc-wash: color-mix(in srgb, var(--aira-brand-400) 26%, transparent); }

/* ---- the totals: the Total column pinned right, the Total row pinned to the bottom, bold, behind
   a rule in the brand's tint, on the totals' tint - never coloured by their figures (R10, D9) ---- */
.pvc > tbody > tr > td.pvc-tc {
    position: sticky;
    z-index: 2;
    font-weight: 700;
    color: var(--pvc-total-ink);
    background-color: var(--pvc-total-bg);
}
.pvc > thead > tr > th.pvc-tc,
.pvc > thead > tr > th.pvc-tc-head { z-index: 8; }
.pvc > thead > tr > th.pvc-tc-head { right: 0; }
.pvc > thead > tr > th.pvc-tc-head,
.pvc [data-tc="0"] { border-left: 2px solid var(--pvc-total-rule); }

/* Each of the Total column's cells at the width of those to its right, as fit() measured it. */
.pvc [data-tc="0"] { right: var(--pvc-r0, 0px); }
.pvc [data-tc="1"] { right: var(--pvc-r1, 0px); }
.pvc [data-tc="2"] { right: var(--pvc-r2, 0px); }
.pvc [data-tc="3"] { right: var(--pvc-r3, 0px); }
.pvc [data-tc="4"] { right: var(--pvc-r4, 0px); }
.pvc [data-tc="5"] { right: var(--pvc-r5, 0px); }
.pvc [data-tc="6"] { right: var(--pvc-r6, 0px); }
.pvc [data-tc="7"] { right: var(--pvc-r7, 0px); }

/* Past eight measures the Total column scrolls whole (cost-categories.md, C6). */
.pvc.pvc-free-totals > tbody > tr:not(.pvc-total) > td.pvc-tc { position: static; }
.pvc.pvc-free-totals [data-tc],
.pvc.pvc-free-totals > thead > tr > th.pvc-tc-head { right: auto; }
.pvc.pvc-free-totals [data-tc="0"]::before,
.pvc.pvc-free-totals > thead > tr > th.pvc-tc-head::before { display: none; }

.pvc > tbody > tr.pvc-total > * {
    position: sticky;
    bottom: 0;
    z-index: 4;
    font-weight: 700;
    color: var(--pvc-total-ink);
    background-color: var(--pvc-total-bg);
    border-top: 2px solid var(--pvc-total-rule);
}
.pvc > tbody > tr.pvc-total > td.pvc-tc { z-index: 5; }
/* The grand total, bottom right, a tint deeper - the figure the table adds up to. */
.pvc > tbody > tr.pvc-total > td.pvc-grand { color: var(--pvc-grand-ink); background-color: var(--pvc-grand-bg); }
.pvc > tbody > tr.pvc-total > th.pv-head-cell { z-index: 6; background-color: var(--pvc-total-bg); }

/* ---- a soft shadow on a pinned edge while something is scrolled under it (classes the script
   puts on the box): ::before the sideways edges, ::after the up-and-down ones ---- */
.pvc > tbody > tr > th.pv-head-cell::before,
.pvc > thead > tr > th.pv-corner::before,
.pvc [data-tc="0"]::before,
.pvc > thead > tr > th.pvc-tc-head::before,
.pvc > thead > tr > th.pvc-floor::after,
.pvc > tbody > tr.pvc-total > *::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}
.pvc > tbody > tr > th.pv-head-cell::before,
.pvc > thead > tr > th.pv-corner::before {
    top: 0;
    bottom: 0;
    right: -7px;
    width: 6px;
    background: linear-gradient(to right, var(--pvc-shadow), transparent);
}
.pvc [data-tc="0"]::before,
.pvc > thead > tr > th.pvc-tc-head::before {
    top: 0;
    bottom: 0;
    left: -8px;
    width: 6px;
    background: linear-gradient(to left, var(--pvc-shadow), transparent);
}
.pvc > thead > tr > th.pvc-floor::after {
    left: 0;
    right: 0;
    bottom: -8px;
    height: 6px;
    background: linear-gradient(to bottom, var(--pvc-shadow), transparent);
}
.pvc > tbody > tr.pvc-total > *::after {
    left: 0;
    right: 0;
    top: -8px;
    height: 6px;
    background: linear-gradient(to top, var(--pvc-shadow), transparent);
}
.pv-scroll.pvc-scrolled-x .pvc > tbody > tr > th.pv-head-cell::before,
.pv-scroll.pvc-scrolled-x .pvc > thead > tr > th.pv-corner::before,
.pv-scroll.pvc-more-x .pvc [data-tc="0"]::before,
.pv-scroll.pvc-more-x .pvc > thead > tr > th.pvc-tc-head::before,
.pv-scroll.pvc-scrolled-y .pvc > thead > tr > th.pvc-floor::after,
.pv-scroll.pvc-more-y .pvc > tbody > tr.pvc-total > *::after { opacity: 1; }

/* Below md the row names and a pinned Total column cannot both hold an edge: at 390 the names (210px)
   and two pinned Total cells filled the box, a Total cell sat under the names and no column had room
   (the WP2 walk). The names are capped at 45% of the screen and ellipsised (F17); the Total column
   scrolls with the rest and arrives last - the Total row stays pinned. */
@media (max-width: 767.98px) {
    .pvc th.pv-head-cell .pv-toggle,
    .pvc th.pv-corner .pvc-axes { max-width: 45vw; }
    .pvc .pvc-axes { min-width: 0; }
    .pvc th.pv-head-cell .pv-toggle-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .pvc > tbody > tr:not(.pvc-total) > td.pvc-tc { position: static; }
    .pvc [data-tc],
    .pvc > thead > tr > th.pvc-tc-head { right: auto; }
    /* A scrolling Total cell has no edge to shade - and a static cell would place the shadow by the table. */
    .pvc [data-tc="0"]::before,
    .pvc > thead > tr > th.pvc-tc-head::before { display: none; }
}

/* A cell the keyboard reaches is scrolled clear of all four pinned edges, never under one (SC 2.4.11);
   the four widths are fit()'s. */
.aira-ws[data-pivot-variant="clear"] .pv-scroll {
    scroll-padding: var(--pvc-sp-top, 0px) var(--pvc-sp-right, 0px) var(--pvc-sp-bottom, 0px) var(--pvc-sp-left, 0px);
}

/* The group-by menu, "Replace with" and [+]: kept inside the pane, fixed from its anchor. */
.pv-menu {
    position: fixed;
    z-index: var(--aira-z-panel);
    min-width: 15rem;
    max-width: 22rem;
    max-height: 60vh;
    overflow: auto;
    padding: .375rem;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    box-shadow: var(--aira-shadow-2);
    --aira-focus-ring-offset: -2px;
}

.pv-menu-short { min-width: 11rem; }

.pv-menu-item {
    display: block;
    width: 100%;
    padding: .375rem .625rem;
    border: 0;
    border-radius: calc(var(--ins-border-radius) - 2px);
    background: none;
    color: inherit;
    font-size: .8125rem;
    text-align: left;
}

.pv-menu-item:hover:not(.is-refused) { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }
/* A grouping already taken stays listed, at half strength, with its reason under the pointer (Aira.refuse). */
.pv-menu-item.is-refused[aria-disabled="true"] { opacity: .5; }

.pv-menu-group { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--ins-border-color); }

.pv-menu-head {
    padding: .25rem .625rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.pv-menu-line { display: flex; flex-wrap: wrap; gap: .125rem; }
.pv-menu-line .pv-menu-item { width: auto; }

/* --------------------------------------------------------------------------
   The searchable option list - Aira.optionList (app/js/aira-option-list.js),
   every grouping menu in a workspace (C07). The search box stays pinned;
   the list scrolls under it, inside the room Aira.groupPicker.place() measured.
   Toolbar menus, so the box is -sm (hard rule 10a).
   -------------------------------------------------------------------------- */
.pv-menu-search { display: flex; flex-direction: column; overflow: hidden; min-width: 17rem; }
.pv-menu-search .aira-ol { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.aira-ol-search { flex: 0 0 auto; padding: .125rem .125rem .375rem; }
.aira-ol-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* The search bar's Group By column is the scroller there, like the two columns beside it: the list
   has no height of its own, so as a scroll container it could never scroll, and its `contain` still
   stopped the wheel - the column moved only from its heading (filters.md T85). */
.aira-search-col .aira-ol-list { overflow: visible; overscroll-behavior: auto; }

.aira-ol-head {
    padding: .25rem .625rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-ol-group + .aira-ol-group { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--ins-border-color); }
.aira-ol-empty { padding: .5rem .625rem; font-size: .8125rem; color: var(--aira-muted); }

/* The option the arrows are on - the focus stays in the box, so this is its only mark. */
[data-ol-option][aria-selected="true"] { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

/* What the typed words found, in the label: the brand's tint, the ink kept. */
mark.aira-ol-hit {
    padding: 0;
    color: inherit;
    background: color-mix(in srgb, var(--aira-brand-400) 24%, transparent);
    border-radius: 2px;
}

/* "More groupings": the rest of the catalogue, folded, so the menu is no taller than it was. */
.pv-menu-more-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .375rem .625rem;
    border: 0;
    border-radius: calc(var(--ins-border-radius) - 2px);
    background: none;
    color: inherit;
    font-size: .8125rem;
    font-weight: 600;
    text-align: left;
}

.pv-menu-more-toggle:hover { background: var(--ins-tertiary-bg); }
.pv-menu-more-count { font-size: .75rem; font-weight: 400; color: var(--aira-muted); }

/* The right-click menu: the header's actions, then its group-by list under a rule. */
.pv-menu-actions { flex: 0 0 auto; }
.pv-menu-sep { flex: 0 0 auto; margin-top: .25rem; padding-top: .5rem; border-top: 1px solid var(--ins-border-color); }
.pv-menu-context > .aira-ol-empty { flex: 0 0 auto; }


/* --------------------------------------------------------------------------
   A workspace's Graph - app/js/aira-workspace-graph.js, analysis.md, *The Graph*.

   The toolbar reuses the pivot's strip and chips, so a measure and an axis look
   the same in both views. The chart fills the card; a donut sits beside its own
   legend, the dashboard's .donut-legend rows, at the ring's own diameter.
   -------------------------------------------------------------------------- */
.gr-body { padding: 1rem 1.25rem .75rem; }

/* What was left off, with its figure. Not an explainer: it is empty unless something was. */
.gr-notes { margin: 0 0 .5rem; font-size: .8125rem; color: var(--aira-ink-2); }

.gr-stage { display: block; }
.gr-ring { width: 100%; min-width: 0; }

/* ApexCharts measures the ring's wrapper for its width, so for a donut the wrapper IS the
   diameter the script drew it at - a width on .apex-charts itself would be ignored (dashboard.md). */
.gr-stage.is-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.gr-stage.is-donut .gr-ring { flex: 0 0 var(--donut-size, 320px); max-width: var(--donut-size, 320px); }
.gr-stage.is-donut .gr-legend { flex: 1 1 240px; max-width: 440px; }

.gr-message { margin: 0; padding: 3rem 1rem; text-align: center; color: var(--aira-muted); }

/* Top N's menu heading is a sentence, not a caption: it wraps inside the menu (C05). */
.gr-top-menu { max-width: 20rem; }
.gr-top-head { white-space: normal; text-transform: none; letter-spacing: 0; font-size: .75rem; line-height: 1.4; }

.gr-foot { display: flex; justify-content: flex-end; }
.gr-table-link { display: inline-flex; align-items: center; font-size: .8125rem; }


/* --------------------------------------------------------------------------
   The grouped List - pages/ticket-list.js, ticket-screens.md, *The List*.

   Odoo's grouped list: a group is a row of its own - chevron, name, count, and
   its cost and age under the columns they belong to - and what it holds is
   indented a step under it. The complaint rows are the flat table's own cells.
   -------------------------------------------------------------------------- */
.gl-table > tbody > tr.gl-group > td {
    background: var(--aira-surface-2);
    font-weight: 600;
}

.gl-table > tbody > tr.gl-group > td.gl-head { padding-left: calc(.5rem + var(--gl-depth, 0) * 1.5rem); }

/* C02: the whole group row opens and folds, so it says so under the pointer. */
.gl-table > tbody > tr.gl-group { cursor: pointer; }
/* table-hover's wash is an inset shadow over the ground; the group's is the brand's, in its place. */
.gl-table > tbody > tr.gl-group:hover > td { --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 9%, transparent); }

/* As wide as the head cell, so the keyboard's ring marks the row the click acts on. Its text stays
   selectable - Chrome selects nothing inside a button otherwise, so a drag across a customer's name
   ended as a click and folded the group; selected, the row's click handler leaves it be. */
.gl-toggle {
    display: inline-flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: .5rem;
    padding: 0;
    user-select: text;
    border: 0;
    background: none;
    color: var(--aira-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.gl-chevron { flex: 0 0 auto; color: var(--aira-muted); }
.gl-toggle[aria-expanded="true"] .gl-chevron { transform: rotate(90deg); }

.gl-count {
    padding: 0 .4rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--aira-ink-2);
    background: var(--ins-tertiary-bg);
    font-variant-numeric: tabular-nums;
}

.gl-agg { font-variant-numeric: tabular-nums; }
.gl-agg-note { font-size: .75rem; font-weight: 400; color: var(--aira-muted); }

/* What a group holds sits a step under it: the Sr No cell carries the indent. */
.gl-table > tbody > tr.gl-row > td:first-child,
.gl-table > tbody > tr.gl-more > td { padding-left: calc(.5rem + var(--gl-depth, 1) * 1.5rem); }

.gl-table > tbody > tr.gl-row { cursor: pointer; }

/* The List's tables scroll sideways in their own box (ticket-screens.md, *The List*). Thirteen columns come to
   1,160px - wider than a phone and than a laptop - and with nothing to scroll them the whole PAGE
   went sideways, the search bar and the view switch with it. The flat table is a DataTable and is
   held by the product-wide rule under *Every table stays inside its card*; the grouped one is not,
   so its box is named here. Nothing in the List is sticky, so the scroll box costs it nothing. */
[data-view-pane="list"] .gl {
    overflow-x: auto;
}
.gl-more-button { font-size: .8125rem; }


/* --------------------------------------------------------------------------
   Chart chrome.

   The theme's compiled _apexcharts.scss paints axis text, gridlines, markers and
   the donut's centre block from its own tokens, two of them with `!important`.
   Those rules beat anything passed in the options object, which is why a chart
   could be configured correctly and still render pale and dashed. aira.css loads
   after app.min.css, so this is where the prototype's ink actually lands.

   These are chart chrome, not control metrics - _aira-brand.scss still owns
   every field, label and button size. The card-title rule is scoped to the
   dashboard for exactly that reason.
   -------------------------------------------------------------------------- */
.apex-charts .apexcharts-gridline {
    stroke: var(--chart-grid);
    stroke-dasharray: 0;
}

.apex-charts .apexcharts-xaxis text,
.apex-charts .apexcharts-yaxis text {
    fill: var(--chart-tick);
    font-size: calc(11.5px * var(--aira-type-scale, 1));
}

/* `apexcharts-data-labels` is the group and `apexcharts-datalabel` the text node.
   `apexcharts-datalabels`, without the hyphen, is a THIRD class ApexCharts uses
   somewhere else entirely - it matches none of these, so the rule that named it
   styled nothing and the printed values kept whatever grey they landed in.

   Not inside a heatmap: there each figure is written in its band's own ink (the
   calendar ramp's --aira-heat-ink-*, as the fill attribute), and this grey - a CSS
   declaration, which always beats an attribute - put dark figures on the dark cells
   of the Graph's heatmap, where they could not be read. */
.apex-charts .apexcharts-data-labels text:not(.apexcharts-heatmap-series text),
.apex-charts text.apexcharts-datalabel:not(.apexcharts-heatmap-series text) {
    fill: var(--chart-dlab);
    font-size: calc(12px * var(--aira-type-scale, 1));
    font-weight: 700;
}

.apex-charts .apexcharts-heatmap-series text.apexcharts-datalabel { font-size: calc(12px * var(--aira-type-scale, 1)); font-weight: 700; }

/* The centre of a donut and the figure in the gauge. The theme pins both to
   --ins-body-color with !important, so this has to answer in kind. */
.apex-charts .apexcharts-datalabel-value {
    fill: var(--aira-ink) !important;
    letter-spacing: -.02em;
}

.apex-charts .apexcharts-datalabel-label {
    fill: var(--aira-muted) !important;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#chart-sla .apexcharts-track path { stroke: var(--chart-grid); }

/* Chart tooltips - one surface for every chart, in both themes.

   Neutral ground, the page's ink, a real edge. A donut's rows used to be painted in their slice's
   own hue (`fillSeriesColor`, off in Aira.charts.base); the slice now shows as the row's swatch.
   The theme's compiled rules set ground, border and shadow with !important, so these answer in
   kind; the selector is a class deeper than ApexCharts' own, which it injects after this file. */
.apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-light,
.apexcharts-canvas .apexcharts-tooltip.apexcharts-theme-dark {
    color: var(--aira-ink);
    background: var(--chart-tip-bg) !important;
    border: 1px solid var(--aira-line-2) !important;
    border-radius: 8px;
    box-shadow: var(--aira-shadow-2) !important;
}

.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label { color: var(--aira-ink-2); }
.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value { color: var(--aira-ink); font-weight: 700; }

/* A donut's row: a little more air than an axis chart's, which shares its box with a title band. */
.is-donut-chart .apexcharts-tooltip .apexcharts-tooltip-series-group { padding: 2px 12px 2px 10px; }

/* A donut's tooltip is placed by Aira.charts after ApexCharts has placed it, on every move. It
   wraps rather than running a long "Others" sentence across the legend beside it.

   max-content, because an absolutely placed box is otherwise as wide as the room left of where it
   stands: moved to the chart's left edge, it wrapped a short name onto two lines - after it had
   been measured, so it grew down over the very figure it had been placed to keep clear of. */
.is-donut-chart .apexcharts-tooltip,
.is-donut-chart .apexcharts-tooltip.apexcharts-active {
    white-space: normal;
    width: max-content;
    max-width: 280px;
}


/* --------------------------------------------------------------------------
   The SLA gauge.

   The arc is a semicircle, so ApexCharts leaves the lower half of the SVG box
   empty and will not crop it - the reading is pulled back up into the arc by
   the ring's negative margin rather than left floating under a half-empty box.

   The figure is HTML, not an ApexCharts data label, because the theme pins
   `.apexcharts-datalabel-value` with `!important` and a 34px reading is the one
   number on this card somebody actually reads.
   -------------------------------------------------------------------------- */
.gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-bottom: .5rem;
}

.gauge-ring {
    /* Wide enough not to clip the ring the chart's own height decides - see gauge() in
       pages/dashboard.js. Wider than that is white space either side of it. */
    width: 300px;
    max-width: 100%;
    /* The part of the box the semicircle does not use. Without it the reading sits a
       hundred pixels below the arc it belongs to, which is how it shipped.

       Retune this whenever the arc's thickness changes: ApexCharts crops a semicircle's
       container to the arc it drew, so a thicker band is a shorter box, and the figure
       climbs into the opening of the arc rather than sitting on its baseline. */
    margin-bottom: -53px;
}

.gauge-figure {
    text-align: center;
    /* Over the empty half of the arc's box - which has no marks in it, but does
       have the SVG's own hit area. */
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.gauge-big {
    font-size: calc(34px * var(--aira-type-scale, 1));
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--aira-ink);
    font-variant-numeric: tabular-nums;
}

.gauge-cap {
    margin-top: .375rem;
    font-size: calc(11.5px * var(--aira-type-scale, 1));
    color: var(--aira-muted);
}

/* The prototype's card header: a shade smaller and a step heavier than the
   theme's, with a description that is readable rather than a whisper. */
#dashboard-page .card-header .card-title {
    font-size: calc(14px * var(--aira-type-scale, 1));
    font-weight: 650;
    letter-spacing: -.005em;
    color: var(--aira-ink);
}

/* Under the title, always. The theme's card header is a flex row, so a title and a
   caption side by side sit on ONE line until the caption is long enough to wrap - which
   made a card's header shape depend on how much its caption happened to say. Stacked is
   also the prototype's own header, and it leaves the caption the full card width. */
#dashboard-page .card-header .card-sub {
    flex: 0 0 100%;
    display: block;
    margin-top: 1px;
    font-size: calc(12px * var(--aira-type-scale, 1));
    line-height: 1.45;
    color: var(--aira-muted);
}


/* --------------------------------------------------------------------------
   The donut's legend.

   Ours rather than ApexCharts', and the reason is in donut() in
   pages/dashboard.js. The shape is the prototype's: swatch, name, count, and a
   percentage in a fixed right-hand column so the numbers line up down the card.
   -------------------------------------------------------------------------- */
.donut-wrap {
    display: flex;
    align-items: center;
    /* 1rem rather than 1.5: the legend's rows carry a name, a count and a percentage in
       columns, and the name is the one that gives way. Eight pixels of gap is eight
       pixels of stage name. */
    gap: 1rem;
    flex-wrap: wrap;
}

/* The ring is exactly the diameter its card reserved. ApexCharts measures
   el.parentNode, so --donut-size on this wrapper is the only place the number can
   be stated - a width on .apex-charts itself is a silent no-op, and a fixed width
   here ignored the variable the view was setting and drew every ring at 190. */
.donut-ring { flex: 0 0 var(--donut-size, 190px); max-width: var(--donut-size, 190px); }

.donut-legend { flex: 1 1 150px; min-width: 150px; }

.donut-leg {
    display: flex;
    align-items: center;
    gap: 9px;
    /* Bleeds into the card's own padding so the hover band reads as a row of the
       card rather than as a box floating inside it. */
    margin: 0 -8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: calc(12.5px * var(--aira-type-scale, 1));
    line-height: 1.5;
}

.donut-leg[data-drill] { cursor: pointer; }
.donut-leg[data-drill]:hover,
.donut-leg[data-drill]:focus-visible {
    background: var(--aira-brand-50);
    outline: none;
}

/* The class names are aira-charts.js's own. They were `.n`, `.b` and `.p` here
   while the factory wrote `donut-leg-name` / `-count` / `-pct`, so the name never
   took its `flex: 1` and the row collapsed against the ring: the count and the
   percentage sat wherever the text ended instead of in columns down the card, and
   a third of every donut card was empty. Element selectors are not enough - rename
   one side and the other must follow. */
.donut-leg-dot {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

/* Takes the slack, which is what puts the two figures on the card's right edge. */
.donut-leg-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--aira-ink-2);
}

.donut-leg-count {
    min-width: 28px;
    text-align: right;
    color: var(--aira-ink);
    font-variant-numeric: tabular-nums;
}

.donut-leg-pct {
    width: 44px;
    text-align: right;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
}

html[data-bs-theme="dark"] .donut-leg[data-drill]:hover,
html[data-bs-theme="dark"] .donut-leg[data-drill]:focus-visible {
    background: var(--ins-tertiary-bg);
}


/* --------------------------------------------------------------------------
   The complaint calendar.

   A month grid rather than the ApexCharts heatmap it replaces: weeks-as-columns
   is compact and unreadable, and an operator asking what happened on the 22nd
   should not have to count squares. Every colour is a --aira-heat-* token,
   because this is DOM and app.js's theme observer repaints ApexCharts instances
   and nothing else - a resolved hex here would survive a theme switch for ever.
   -------------------------------------------------------------------------- */
.aira-cal {
    /* Panels are an intrinsic width and the row wraps. Never flex: 1 - one month
       stretched across a full-width card is a grid of 34px cells in 1600px of
       dead space. */
    --aira-cal-cell: 34px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem .875rem;
}

.aira-cal-month {
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: .625rem;
    background: var(--aira-surface-2);
}

.aira-cal-month-name {
    margin-bottom: .625rem;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--aira-ink);
}

.aira-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, var(--aira-cal-cell));
    gap: 3px;
}

.aira-cal-wd {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    font-size: calc(10px * var(--aira-type-scale, 1));
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-cal-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--aira-cal-cell);
    height: var(--aira-cal-cell);
    border-radius: 6px;
    font-size: .6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

/* In the month, outside the window. It holds its column so the weeks under it
   stay beneath the right weekday, and shows nothing. */
.aira-cal-day.is-out { visibility: hidden; }

.aira-cal-day[data-level="0"] { background: var(--aira-heat-0); color: var(--aira-heat-ink-0); }
.aira-cal-day[data-level="1"] { background: var(--aira-heat-1); color: var(--aira-heat-ink-1); }
.aira-cal-day[data-level="2"] { background: var(--aira-heat-2); color: var(--aira-heat-ink-2); }
.aira-cal-day[data-level="3"] { background: var(--aira-heat-3); color: var(--aira-heat-ink-3); }
.aira-cal-day[data-level="4"] { background: var(--aira-heat-4); color: var(--aira-heat-ink-4); }
.aira-cal-day[data-level="5"] { background: var(--aira-heat-5); color: var(--aira-heat-ink-5); }

.aira-cal-day:hover,
.aira-cal-day:focus-visible {
    outline: 2px solid var(--aira-heat-ring);
    outline-offset: 1px;
}

/* The bubble is CSS rather than a tooltip instance per cell: eight hundred day
   cells is eight hundred initialisations, and this one survives keyboard focus,
   which the reference design needs. */
.aira-cal-day:hover::after,
.aira-cal-day:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: .25rem .4375rem;
    border-radius: 6px;
    background: var(--aira-ink);
    color: var(--ins-secondary-bg);
    font-size: calc(10px * var(--aira-type-scale, 1));
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
}

.aira-cal-legend {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: calc(11px * var(--aira-type-scale, 1));
    color: var(--aira-muted);
}

.aira-cal-legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.aira-cal-legend i[data-level="0"] { background: var(--aira-heat-0); box-shadow: inset 0 0 0 1px var(--ins-border-color); }
.aira-cal-legend i[data-level="1"] { background: var(--aira-heat-1); }
.aira-cal-legend i[data-level="2"] { background: var(--aira-heat-2); }
.aira-cal-legend i[data-level="3"] { background: var(--aira-heat-3); }
.aira-cal-legend i[data-level="4"] { background: var(--aira-heat-4); }
.aira-cal-legend i[data-level="5"] { background: var(--aira-heat-5); }

@media (max-width: 575.98px) {
    .aira-cal { --aira-cal-cell: 30px; }
}

/* ==========================================================================
   REPORTS

   The catalog tiles, the two analytical cards and the pivot grid.

   Every colour here is a token. A hex written in a block dark mode does not
   redefine is a colour dark mode cannot reach - the same reason --kpi-* and
   --chart-* exist rather than hexes in C#.
   ========================================================================== */

/* The five response bands, at the prototype's own hues. Declared beside the
   chart palette rather than in C# so the bar and the stat spine that share a
   band share one definition. */
:root {
    --resp-fast: #0ca30c;
    --resp-good: #1baf7a;
    --resp-fair: #eda100;
    --resp-slow: #ec835a;
    --resp-late: #d03b3b;

    /* The report tile accents, one per catalogue category (crm/47 §1, ReportCatalog.AccentOf). */
    --report-quote: #2a78d6;
    --report-trace: #4a3aa7;
    --report-team: #1baf7a;
    --report-party: #eb6834;
    --report-order: #eda100;
}

/* Lifted for dark mode, the same way --stage-* and --kpi-* are: these fill a
   whole tile badge and a whole bar, and the darker half of the set reads as two
   indistinguishable smudges on a #1b1c24 card. */
html[data-bs-theme="dark"] {
    --resp-fast: #35c035;
    --resp-good: #2fd39a;
    --resp-fair: #f5b731;
    --resp-slow: #ff9d70;
    --resp-late: #ff6f6e;

    --report-quote: #529ff0;
    --report-trace: #8f7ee8;
    --report-team: #2fd39a;
    --report-party: #ff8355;
    --report-order: #f5b731;
}

/* ---- One record's timeline (crm/47 §4.5) -------------------------------- */

/* A DOM strip: each stay a segment as wide as its working minutes, in its stage's chip colour (--stage-color, the token the
   server names), an open one hatched to now. Tokens, never a hex - a theme switch repaints it for free. */
.aira-timeline-strip {
    display: flex;
    height: 1.375rem;
    border-radius: 6px;
    overflow: hidden;
    background: var(--ins-tertiary-bg);
}

.aira-timeline-seg {
    min-width: 3px;
    background: var(--stage-color, var(--aira-brand-400));
    border-right: 1px solid var(--ins-secondary-bg);
}

.aira-timeline-seg:last-child { border-right: 0; }

.aira-timeline-seg.is-open {
    background-image: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--ins-secondary-bg) 45%, transparent) 5px 10px);
}

/* ---- The catalog ------------------------------------------------------- */

/* A category's heading over its tiles (crm/47 §1) - the card title's weight, a step smaller. */
.report-category {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--aira-muted);
    margin: 1rem 0 .5rem;
}

.report-category:first-child { margin-top: 0; }

.report-grid {
    display: grid;
    /* The prototype's 268px minimum. Below it a tile's description wraps to five
       lines and the grid reads as a list. */
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: .875rem;
}

.report-card {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg);
    padding: 1.0625rem;
    box-shadow: var(--aira-shadow-1);
}

.report-card:hover,
.report-card:focus-visible {
    box-shadow: var(--aira-shadow-2);
    transform: translateY(-1px);
    border-color: var(--aira-brand-400);
}

.report-ic {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: .75rem;
    /* The accent at 12% behind the icon at full strength - the same recipe the
       stage chip uses, so a tile and a chip of the same hue look related. */
    background: color-mix(in srgb, var(--report-accent) 12%, transparent);
    color: var(--report-accent);
}

.report-ic svg { width: 20px; height: 20px; }

.report-card b {
    display: block;
    font-size: .875rem;
    font-weight: 650;
    margin-bottom: .25rem;
    color: var(--aira-ink);
}

.report-card p {
    margin: 0;
    font-size: .75rem;
    color: var(--aira-ink-2);
    line-height: 1.5;
}

.report-scope {
    display: block;
    margin-top: .5rem;
    font-size: .6875rem;
    color: var(--aira-muted);
    line-height: 1.45;
}

.report-foot {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

.report-format {
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .1875rem .4375rem;
    border-radius: 4px;
    background: var(--ins-tertiary-bg);
    color: var(--aira-ink-2);
}

/* How many complaints the report would cover right now. The point of the tile:
   a report whose answer is empty says so before anybody downloads it. */
.report-count {
    margin-left: auto;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--aira-ink-2);
}

.report-count.is-empty { color: var(--aira-muted); font-weight: 400; }

.report-empty {
    padding: 1.25rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--aira-muted);
}

/* ---- The Dashboard's Reports view (crm/88 §4) ----------------------------
   A report of the menu: its head, its figures (the Dashboard's tiles), its chart and its table. Every
   size the type scale's (crm/71); nothing eases (hard rule 10e); the focus ring is the central one. */

.aira-rv-heading { min-width: 0; }

.aira-rv-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: calc(18px * var(--aira-type-scale, 1));
    font-weight: 600;
}

.aira-rv-notused { cursor: help; }

.aira-rv-menu { min-width: 19rem; }
.aira-rv-menu .dropdown-item { white-space: normal; }

.aira-rv-menu-sub {
    font-size: calc(12px * var(--aira-type-scale, 1));
    color: var(--aira-muted);
}

.aira-rv-menu .dropdown-item.active .aira-rv-menu-sub { color: inherit; opacity: .85; }

/* A figure that opens its records, as a Dashboard tile that does. */
.aira-rv .kpi-card[data-rv-stat] { cursor: pointer; }

.aira-rv .kpi-card[data-rv-stat]:hover {
    box-shadow: var(--aira-shadow-2);
    border-color: color-mix(in srgb, var(--kc, var(--ins-primary)) 45%, var(--ins-border-color));
}

.aira-rv [data-rv-table] > tbody > tr.is-clickable > td,
.aira-rv [data-rv-table] > tbody > tr > td.is-clickable { cursor: pointer; }

.aira-rv [data-rv-table] > tbody > tr > td.is-clickable:hover { text-decoration: underline; }

/* ---- A report's table and its rows bar (crm/118) - the Dashboard's Reports view and the Reports page's dialog ------------
   The table scrolls sideways in its own box (RT1, .aira-tfill > .aira-tscroll); its first column, the row's name, is frozen
   (RT2, .aira-tscroll--freeze-first). */

/* One line a cell - the box scrolls sideways now - but the name wraps within 10-20rem (RT3): frozen whole, a 34-character party
   name left a laptop no room for the figures it names. */
.aira-report-table > thead > tr > th,
.aira-report-table > tbody > tr > td,
.aira-report-table > tfoot > tr > td { white-space: nowrap; }

.aira-report-table > tbody > tr > td:first-child,
.aira-report-table > tfoot > tr > td:first-child {
    white-space: normal;
    min-width: 10rem;
    max-width: 20rem;
    overflow-wrap: anywhere;
}

/* The total stays in view at the box's foot, as the heading at its head (RT4) - opaque, so the rows pass under it, and its rule an
   inset shadow: a collapsed border belongs to the grid and does not travel with a sticky cell. */
.aira-tscroll > .aira-report-table > tfoot > tr > td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--ins-tertiary-bg);
    border-top: 0;
    box-shadow: inset 0 2px 0 var(--ins-border-color);
}

/* Where the frozen name column meets the frozen foot, above both. */
.aira-tscroll--freeze-first > .aira-report-table > tfoot > tr > td:first-child { z-index: 4; }

/* While the rows bar narrows the rows, the total says it is every row's (RT12) - a caption under its label. */
.aira-report-total-all {
    display: block;
    font-size: calc(12px * var(--aira-type-scale, 1));
    font-weight: 400;
    color: var(--aira-muted);
}

/* The bar's place. On the Dashboard: the card's head - the title and the count at the left, the bar beside them up to 34rem; its own
   full line under them on a narrow window (§3). */
.aira-rv-table-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

.aira-rv-table-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
    flex: 1 1 auto;
    min-width: 0;
}

.aira-report-find {
    flex: 1 1 22rem;
    max-width: 34rem;
    min-width: 0;
}

/* In the Reports page's dialog: where DataTables' box stood - over the table, at the head's right. */
.aira-report-find--dialog {
    width: 100%;
    max-width: 28rem;
    margin: .5rem 0 0 auto;
}

/* No toggle over an empty panel (RT15) - from the first frame, before the engine has read the report's columns. */
.aira-report-find:not(.has-facets) .aira-searchbar-toggle { display: none; }

@media (max-width: 767.98px) {
    .aira-report-find,
    .aira-report-find--dialog {
        flex-basis: 100%;
        max-width: none;
    }
}

/* The chart's room is reserved from the first frame (crm/69 §9); a donut sits beside its legend, centred. */
.aira-rv-plot { min-height: 340px; }

.aira-rv-plot.is-donut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem 3rem;
}

.aira-rv-plot.is-donut > .aira-rv-canvas { flex: 0 0 280px; max-width: 100%; }

.aira-rv-legend { flex: 1 1 280px; max-width: 34rem; min-width: 0; }

.aira-rv-legend > .donut-leg[data-rv-point] { cursor: pointer; }

/* ---- Shared bars ------------------------------------------------------- */

.share-track {
    display: block;
    height: 7px;
    border-radius: 4px;
    background: var(--ins-tertiary-bg);
    overflow: hidden;
}

.share-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--aira-brand-400);
}

.report-bars { display: flex; flex-direction: column; gap: .4375rem; }

.report-bar {
    display: grid;
    grid-template-columns: 8.5rem 1fr 3rem 2.5rem;
    align-items: center;
    gap: .625rem;
    font-size: .75rem;

    /* Bleeds into the card's own padding so the hover band reads as a row OF the card
       rather than a box floating inside it - .donut-leg's trick, because a response band
       and a donut legend row are the same gesture. On .report-bar rather than on
       [data-drill] so a bar that ever stops opening keeps its alignment. */
    margin: 0 -.5rem;
    padding: .1875rem .5rem;
    border-radius: 6px;
}

.report-bar[data-drill] {
    cursor: pointer;
}

/* The same band-and-tint the dashboard's own drillable rows use. A colour change on the
   label alone was too quiet to read as clickable, and there was no focus state at all -
   tabbing onto one showed a browser outline that appears nowhere else in the product. */
.report-bar[data-drill]:hover,
.report-bar[data-drill]:focus-visible {
    background: var(--aira-brand-50);
    outline: none;
}

.report-bar[data-drill]:focus-visible {
    box-shadow: inset 0 0 0 2px var(--ins-primary);
}

.report-bar[data-drill]:hover .report-bar-name,
.report-bar[data-drill]:focus-visible .report-bar-name { color: var(--ins-primary); }

/* --aira-brand-50 is a near-white, defined on bare :root only - left alone it is a
   glowing block on a dark card. The same override .donut-leg already carries. */
html[data-bs-theme="dark"] .report-bar[data-drill]:hover,
html[data-bs-theme="dark"] .report-bar[data-drill]:focus-visible {
    background: var(--ins-tertiary-bg);
}

.report-bar-name { color: var(--aira-ink-2); }
.report-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.report-bar-pct { text-align: right; color: var(--aira-muted); font-variant-numeric: tabular-nums; }

/* A band that counted nothing is still printed - it is a step of the scale - but it opens nothing,
   so it carries no data-drill and reads quieter than the bands that do. */
.report-bar.is-empty .report-bar-name,
.report-bar.is-empty .report-bar-value { color: var(--aira-muted); }
.report-bar.is-empty .report-bar-value { font-weight: 500; }

@media (max-width: 575.98px) {
    .report-bar { grid-template-columns: 1fr 3rem; }
    .report-bar .share-track { grid-column: 1 / -1; order: 3; }
}

[data-rep-marketing-rows] tr[data-drill] { cursor: pointer; }

/* The Team scorecard's share column (crm/47 §2): a member's bar and its percentage in one cell, wide enough to compare. */
td.report-share { min-width: 9rem; }
td.report-share > .share-track { display: inline-block; width: calc(100% - 3.25rem); vertical-align: middle; }
td.report-share > .report-bar-pct { display: inline-block; width: 3rem; margin-left: .25rem; font-size: .75rem; }

/* ---- The pivot table, and a section's labelled bar ------------------------
   Written for the Reports cross-tab, retired in Phase 7h. The table rules are the
   workspace Pivot's now (.pivot-table.pv-tree, whose tree is further up);
   the bar is the cost card's Group by. */

.pivot-bar {
    display: flex;
    gap: .625rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.pivot-field { display: flex; flex-direction: column; min-width: 9.5rem; flex: 0 1 11rem; }
.pivot-field .form-label { letter-spacing: .06em; }
.pivot-spacer { flex: 1 1 auto; }

.pivot-table { min-width: 40rem; font-variant-numeric: tabular-nums; }

.pivot-table > thead > tr > th {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--aira-muted);
    white-space: nowrap;
    vertical-align: bottom;
}

.pivot-table > tbody > tr > td { font-size: .8125rem; }

/* The corner stays put while the grid scrolls sideways. A table thirty columns
   wide is unreadable the moment the row names leave the viewport. */
.pivot-table th.pv-corner {
    position: sticky;
    left: 0;
    z-index: 2;
    white-space: nowrap;
    background: var(--ins-secondary-bg);
}

.pivot-table th.pv-corner {
    text-transform: none;
    color: var(--aira-ink-2);
    background: var(--ins-tertiary-bg);
}

/* The link colour, the theme's primary-for-text: the same blue in light, #769ac6 in dark.
   --ins-primary stays dark blue on the dark ground - about 2:1. */
.pivot-table th.pv-corner span { color: var(--ins-link-color); font-weight: 800; }

/* The row under the pointer, so a cell thirty columns out is readable back to its name. */
.pivot-table tbody tr:hover > td {
    background: color-mix(in srgb, var(--aira-brand-400) 7%, transparent);
}

/* Beats td.is-shaded below, which is a single class and would otherwise win the tie and
   leave the hover doing nothing on exactly the cells that carry a value. */
.pivot-table td.drill-cell:hover,
.pivot-table td.drill-cell:focus-visible {
    background: color-mix(in srgb, var(--aira-brand-400) 26%, transparent);
}

.pivot-table th.pv-col-head { cursor: pointer; }

.pivot-table .pv-total { background: var(--ins-tertiary-bg); }

.pivot-table tr.pv-foot > td {
    background: var(--ins-tertiary-bg);
    border-top: 2px solid var(--aira-line-2);
}

/* A cell with nothing behind it. Deliberately blank rather than an em dash: a
   dash is a value somebody could read as zero, and a genuine zero in the next
   column along is a different fact. */
.pivot-table td.pv-empty { background: transparent; }

/* The shade. Painted as a tint of the brand at an opacity the server's value
   decided, so it survives dark mode - a fixed rgba() would be a light wash on a
   dark card. */
.pivot-table td.is-shaded {
    background: color-mix(in srgb, var(--aira-brand-400) calc(var(--pv-shade, 0) * 100%), transparent);
}

/* --------------------------------------------------------------------------
   The confirmation (Aira.confirm, SweetAlert2) over the dialog stack.

   SweetAlert2 sits at its own 1060, which is above a single dialog and BELOW a stacked one
   (1075 and up) - so "Discard your changes?" asked from a complaint opened out of a report was
   painted under the complaint it was about. See --aira-z-alert. What makes it hold the keyboard
   and the page is app/js/aira-modals.js, not this.
   -------------------------------------------------------------------------- */
.swal2-container {
    z-index: var(--aira-z-alert);
}

/* ==========================================================================
   Access & permissions - the grid in Settings > Access, the person's dialog and the role dialog (crm/107 §5;
   Views/Shared/_PermissionEditorBody.cshtml, pages/permission-grid.js).

   Cards, every one open: narrow cards dealt into balanced lanes, the masters' and the reports' tables across the width.
   Around them a sticky toolbar (search, filter, bulk, the count), a jump bar, the review and a sticky foot.
   ONE selection colour - the brand - for every granted box, chip, switch and row (crm/107 U8); a card keeps its accent on
   its icon only. Every colour is a token with a dark value; the brand is mixed against `transparent` so a tint sits on
   either theme. Nothing eases (rule 10e); the focus ring is the central one (rule 10c).
   ========================================================================== */
.modal-dialog.aira-modal-wide {
    max-width: min(1720px, calc(100vw - 2.5rem));
}

/* The grid hides with [hidden]; a display rule on a chip or a row must never win over it (crm/66 trap). */
.permission-editor [hidden],
.perm-actions [hidden] { display: none !important; }

.permission-editor {
    --perm-brand: var(--ins-primary);
    --perm-on-bg: color-mix(in srgb, var(--perm-brand) 9%, transparent);
    --perm-on-bg-strong: color-mix(in srgb, var(--perm-brand) 14%, transparent);
    --perm-on-line: color-mix(in srgb, var(--perm-brand) 42%, var(--aira-line));
    --perm-on-ink: color-mix(in srgb, var(--perm-brand) 78%, var(--ins-body-color));
    --perm-changed: var(--ins-warning);
    --perm-radius: .625rem;
}

/* ---- A person's head (Access tab) ------------------------------------------ */
.perm-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .875rem;
}

.perm-person-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--perm-on-bg-strong);
    color: var(--perm-on-ink);
    font-weight: 700;
}

.perm-person-text { min-width: 0; }

.perm-person-name {
    margin: 0;
    font-weight: 700;
    color: var(--ins-heading-color, var(--ins-body-color));
}

.perm-person-role { color: var(--ins-secondary-color); font-size: .8125rem; }

.perm-special {
    background: color-mix(in srgb, var(--ins-warning) 16%, transparent);
    color: color-mix(in srgb, var(--ins-warning) 70%, var(--ins-body-color));
    border: 1px solid color-mix(in srgb, var(--ins-warning) 40%, transparent);
    font-weight: 600;
}

.perm-special svg { width: 12px; height: 12px; vertical-align: -2px; }

/* ---- The toolbar ------------------------------------------------------------- */
/* Sticky under the topbar on the Settings page, at the top of the body in a dialog - so the search, the filter and the
   count stay in reach over a grid several screens tall. Opaque, like every bar over moving content. */
.perm-toolbar {
    position: sticky;
    top: var(--ins-topbar-height, 70px);
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 0 0 .5rem;
    padding: .625rem .75rem;
    border: 1px solid var(--aira-line);
    border-radius: var(--perm-radius);
    background-color: color-mix(in srgb, var(--ins-primary) 3%, var(--ins-secondary-bg));
    box-shadow: 0 .25rem 1rem -.5rem rgba(0, 0, 0, .18);
}

.modal-body .perm-toolbar { top: calc(-1 * var(--ins-modal-padding) + .25rem); }

html[data-bs-theme="dark"] .perm-toolbar {
    background-color: color-mix(in srgb, var(--ins-primary) 7%, var(--ins-secondary-bg));
    box-shadow: 0 .25rem 1rem -.5rem rgba(0, 0, 0, .55);
}

.perm-search {
    position: relative;
    flex: 1 1 18rem;
    min-width: 14rem;
    max-width: 30rem;
}

.perm-search > svg {
    position: absolute;
    top: 50%;
    left: .75rem;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--ins-secondary-color);
    pointer-events: none;
}

.perm-search .form-control {
    padding-left: 2.25rem;
    padding-right: 2.25rem;
    border-radius: 2rem;
}

.perm-search-key {
    position: absolute;
    top: 50%;
    right: .625rem;
    transform: translateY(-50%);
    padding: .05rem .4rem;
    border: 1px solid var(--aira-line);
    border-radius: .3rem;
    background: var(--aira-surface-2);
    color: var(--ins-secondary-color);
    font-size: .6875rem;
    line-height: 1.4;
}

.perm-search:has(input:focus) .perm-search-key { display: none; }

.perm-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--aira-line);
    border-radius: 2rem;
    background: var(--aira-surface-2);
}

.perm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border: 0;
    border-radius: 2rem;
    background: transparent;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.perm-filter-btn:hover { color: var(--ins-body-color); background: var(--ins-secondary-bg); }

.perm-filter-btn.is-active {
    background: var(--ins-secondary-bg);
    color: var(--perm-on-ink);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--perm-on-line), 0 1px 2px rgba(0, 0, 0, .12);
}

.perm-filter-count {
    min-width: 1.25rem;
    padding: 0 .35rem;
    border-radius: 1rem;
    background: color-mix(in srgb, currentColor 16%, transparent);
    font-size: .6875rem;
    line-height: 1.25rem;
    text-align: center;
}

.perm-bulk { display: inline-flex; gap: .375rem; }
.perm-bulk svg { vertical-align: -2px; }

.perm-summary {
    margin-left: auto;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
    white-space: nowrap;
}

.perm-summary strong { color: var(--perm-on-ink); font-size: .9375rem; }
.perm-showing::before { content: "·"; margin: 0 .35rem; }

/* What a tick did beyond itself - the rights it turned on or off with it. */
.perm-status {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .625rem;
    padding: .45rem .75rem;
    border-left: 3px solid var(--perm-brand);
    border-radius: .375rem;
    background: var(--perm-on-bg);
    color: var(--ins-body-color);
    font-size: .8125rem;
}

/* ---- Jump to ------------------------------------------------------------------ */
.perm-jump {
    display: flex;
    gap: .375rem;
    margin: 0 0 .875rem;
    padding-bottom: .125rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.perm-jump-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    padding: .25rem .7rem;
    border: 1px solid var(--aira-line);
    border-radius: 2rem;
    background: var(--ins-secondary-bg);
    color: var(--ins-body-color);
    font-size: .78125rem;
    text-decoration: none;
    white-space: nowrap;
}

.perm-jump-chip:hover { border-color: var(--perm-on-line); color: var(--perm-on-ink); }

.perm-jump-count {
    color: var(--ins-secondary-color);
    font-size: .6875rem;
    font-variant-numeric: tabular-nums;
}

.perm-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin: 1rem 0;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--aira-line);
    border-radius: var(--perm-radius);
    color: var(--ins-secondary-color);
}

.perm-empty > svg { width: 22px; height: 22px; }

/* ---- The board ------------------------------------------------------------------- */
.perm-board {
    container: perm-board / inline-size;
    display: grid;
    gap: 1rem;
}

/* Lanes that each stack their own cards; the script deals the cards so the lanes end level. */
.perm-modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.perm-lane {
    display: grid;
    gap: 1rem;
    align-content: start;
    min-width: 0;
}

@container perm-board (max-width: 1180px) {
    .perm-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container perm-board (max-width: 700px) {
    .perm-modules { grid-template-columns: minmax(0, 1fr); }
}

/* ---- A card ----------------------------------------------------------------------- */
.perm-card {
    min-width: 0;
    border: 1px solid var(--aira-line);
    border-radius: var(--perm-radius);
    background: var(--ins-secondary-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    scroll-margin-top: calc(var(--ins-topbar-height, 70px) + 5.5rem);
}

.modal-body .perm-card { scroll-margin-top: 5rem; }

.perm-card-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem .75rem;
    border-bottom: 1px solid var(--aira-line);
}

.perm-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    background: color-mix(in srgb, var(--perm-accent) 13%, transparent);
    color: var(--perm-accent);
}

.perm-card-icon svg { width: 18px; height: 18px; }

.perm-card-heading { flex: 1 1 auto; min-width: 0; }

.perm-card-titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; }

.perm-card-title {
    margin: 0;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--ins-heading-color, var(--ins-body-color));
}

.perm-card-desc {
    margin: .2rem 0 0;
    color: var(--ins-secondary-color);
    font-size: .78125rem;
    line-height: 1.45;
}

.perm-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
    flex: 0 0 auto;
}

.perm-card-meta .perm-all { margin: 0; }

.perm-count {
    color: var(--ins-secondary-color);
    font-size: .75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.perm-meter {
    display: block;
    width: 3.5rem;
    height: 4px;
    border-radius: 2px;
    background: var(--aira-line);
    overflow: hidden;
}

.perm-meter > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--perm-brand);
}

.perm-sensitive {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .05rem .4rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--ins-danger) 12%, transparent);
    color: color-mix(in srgb, var(--ins-danger) 80%, var(--ins-body-color));
    font-size: .65625rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

.perm-sensitive svg { width: 11px; height: 11px; }

/* A tri-state "all" box (card, table, column, row, every master): the brand when on or mixed. */
.perm-all.form-check-input:indeterminate {
    background-color: var(--perm-brand);
    border-color: var(--perm-brand);
}

/* ---- A list: a row per right, a switch at its end ------------------------------------ */
.perm-list { padding: .25rem 0; }

.perm-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin: 0;
    padding: .625rem 1rem;
    border-top: 1px solid var(--aira-line);
    cursor: pointer;
}

.perm-row:first-child { border-top: 0; }
.perm-row:hover { background: var(--aira-surface-2); }
.perm-row.is-on { background: var(--perm-on-bg); }
.perm-row.is-on:hover { background: var(--perm-on-bg-strong); }

/* A dependent row sits under its parent, with a short elbow saying so. */
.perm-row[data-depth="1"] { padding-left: 2rem; }
.perm-row[data-depth="2"] { padding-left: 3.25rem; }

.perm-row[data-depth="1"]::before,
.perm-row[data-depth="2"]::before {
    content: "";
    position: absolute;
    top: .5rem;
    width: .5rem;
    height: .75rem;
    border-left: 1px solid var(--aira-line);
    border-bottom: 1px solid var(--aira-line);
    border-bottom-left-radius: 3px;
}

.perm-row[data-depth="1"]::before { left: 1.15rem; }
.perm-row[data-depth="2"]::before { left: 2.4rem; }

.perm-row-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }

.perm-row-label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    color: var(--ins-body-color);
    font-size: .84375rem;
    font-weight: 500;
}

.perm-row.is-on .perm-row-label { color: var(--perm-on-ink); font-weight: 600; }

.perm-row-hint {
    color: var(--ins-secondary-color);
    font-size: .75rem;
    line-height: 1.45;
}

.perm-switch { flex: 0 0 auto; margin: .1rem 0 0; padding-left: 2.5em; min-height: 0; }
.perm-switch .form-check-input { cursor: pointer; }

.perm-row-locked,
.perm-needs-note {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--ins-secondary-color);
    font-size: .71875rem;
}

.perm-row-locked svg,
.perm-needs-note svg { width: 12px; height: 12px; flex: 0 0 auto; }

.perm-needs-note { color: color-mix(in srgb, var(--ins-info) 75%, var(--ins-body-color)); }

/* ---- Sections of chips (the modules) ------------------------------------------------- */
.perm-sections { padding: .25rem 0 .5rem; }

.perm-section { padding: .625rem 1rem .5rem; }
.perm-section + .perm-section { border-top: 1px dashed var(--aira-line); }

.perm-section-head {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin-bottom: .5rem;
}

.perm-section-title {
    color: var(--ins-secondary-color);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.perm-section-hint { color: var(--ins-secondary-color); font-size: .75rem; line-height: 1.4; }

.perm-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.perm-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .35rem .75rem .35rem .55rem;
    border: 1px solid var(--aira-line);
    border-radius: 2rem;
    background: var(--ins-secondary-bg);
    color: var(--ins-body-color);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.perm-chip .form-check-input { margin: 0; flex: 0 0 auto; cursor: pointer; }
.perm-chip:hover { border-color: var(--perm-on-line); background: var(--aira-surface-2); }

.perm-chip.is-on {
    border-color: var(--perm-on-line);
    background: var(--perm-on-bg-strong);
    color: var(--perm-on-ink);
    font-weight: 600;
}

.perm-chip:has(.perm-check:disabled) { cursor: not-allowed; opacity: .7; }
.perm-chip-lock { width: 12px; height: 12px; color: var(--ins-secondary-color); }

/* ---- Records: one choice ------------------------------------------------------------------ */
.perm-choice { display: grid; gap: .5rem; padding: .75rem 1rem 1rem; }

.perm-choice-option {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 0;
    padding: .6rem .75rem;
    border: 1px solid var(--aira-line);
    border-radius: .5rem;
    cursor: pointer;
}

.perm-choice-option:hover { background: var(--aira-surface-2); }

.perm-choice-option.is-on {
    border-color: var(--perm-on-line);
    background: var(--perm-on-bg);
}

.perm-choice-option .form-check-input { margin: .15rem 0 0; flex: 0 0 auto; }

.perm-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--aira-surface-2);
    color: var(--ins-secondary-color);
}

.perm-choice-option.is-on .perm-choice-icon { background: var(--perm-on-bg-strong); color: var(--perm-on-ink); }
.perm-choice-icon svg { width: 15px; height: 15px; }
.perm-choice-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }

.perm-choice-label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    font-size: .84375rem;
    font-weight: 600;
    color: var(--ins-body-color);
}

.perm-choice-option.is-on .perm-choice-label { color: var(--perm-on-ink); }
.perm-choice-hint { color: var(--ins-secondary-color); font-size: .75rem; }

/* ---- Tables: the masters and the reports ------------------------------------------------------ */
.perm-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: .875rem;
    padding: .875rem 1rem 1rem;
    align-items: start;
}

.perm-table-wrap {
    border: 1px solid var(--aira-line);
    border-radius: .5rem;
}

.perm-matrix { margin: 0; font-size: .8125rem; }

.perm-matrix > :not(caption) > * > * {
    padding: .45rem .6rem;
    border-bottom-color: var(--aira-line);
    background: transparent;
    box-shadow: none;
}

.perm-matrix thead th {
    background: var(--aira-surface-2);
    color: var(--ins-secondary-color);
    font-size: .71875rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.perm-matrix tbody th { font-weight: 400; vertical-align: middle; }
.perm-matrix tbody tr:last-child > th,
.perm-matrix tbody tr:last-child > td { border-bottom: 0; }

.perm-matrix .perm-matrix-col,
.perm-matrix .perm-matrix-cell {
    width: 4.5rem;
    text-align: center;
    vertical-align: middle;
}

.perm-th-inner { display: inline-flex; align-items: center; gap: .45rem; }
.perm-th-inner--col { flex-direction: column; gap: .25rem; }
.perm-th-inner .form-check-input { margin: 0; }

.perm-row-head { display: flex; align-items: flex-start; gap: .55rem; }
.perm-row-head > .form-check-input { margin: .1rem 0 0; flex: 0 0 auto; }

.perm-matrix .perm-row-label { font-size: .8125rem; }
.perm-matrix .perm-row-hint { font-size: .71875rem; }

.perm-matrix-hit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    margin: 0;
    cursor: pointer;
}

.perm-matrix-hit .form-check-input { margin: 0; cursor: pointer; }

.perm-matrix-cell--none { color: var(--ins-secondary-color); opacity: .5; }

.perm-master-icon { width: 14px; height: 14px; margin-right: .35rem; color: var(--ins-secondary-color); vertical-align: -2px; }

/* A row with anything granted is tinted in the brand - by the box's own class, and by tag (rule 10d). */
.perm-matrix tbody tr:has(.perm-check:checked) > th,
.perm-matrix tbody tr:has(.perm-check:checked) > td {
    background: var(--perm-on-bg);
}

.perm-matrix tbody tr:has(.perm-check:checked) .perm-row-label { color: var(--perm-on-ink); font-weight: 600; }
.perm-matrix tbody tr:hover > th,
.perm-matrix tbody tr:hover > td { background: var(--aira-surface-2); }

.perm-matrix tbody tr:has(.perm-check:checked):hover > th,
.perm-matrix tbody tr:has(.perm-check:checked):hover > td { background: var(--perm-on-bg-strong); }

/* "Every master": the helpdesk's three global rights, now a bulk action over the table rather than a second switch. */
.perm-master-all {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: .875rem 1rem 0;
    padding: .5rem .75rem;
    border: 1px dashed var(--perm-on-line);
    border-radius: .5rem;
    background: var(--perm-on-bg);
}

.perm-master-all-label { color: var(--perm-on-ink); font-size: .78125rem; font-weight: 700; }

.perm-master-all-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    font-size: .8125rem;
    cursor: pointer;
}

.perm-master-all-item .form-check-input { margin: 0; }

/* ---- Every box's states ----------------------------------------------------------------- */
/* Changed since the grid opened: an amber dot. */
.perm-dirty-dot {
    display: none;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--perm-changed);
}

.is-changed > .perm-dirty-dot,
.is-changed .perm-row-label > .perm-dirty-dot,
.is-changed .perm-choice-label > .perm-dirty-dot { display: inline-block; }

.perm-chip > .perm-dirty-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border: 2px solid var(--ins-secondary-bg); }
.perm-matrix-hit > .perm-dirty-dot { position: absolute; top: .3rem; right: .35rem; }

/* Where it comes from: the role grants it or does not (a person's grid). */
.perm-role-tag {
    padding: 0 .35rem;
    border-radius: .25rem;
    background: color-mix(in srgb, var(--ins-info) 14%, transparent);
    color: color-mix(in srgb, var(--ins-info) 80%, var(--ins-body-color));
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.perm-matrix-hit > .perm-role-tag { position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); font-size: .5625rem; }

/* What a search or filter leaves out of a row or a choice it still shows. */
.perm-matrix-cell.is-dim .perm-matrix-hit,
.perm-choice-option.is-dim { opacity: .35; }

.permission-editor mark {
    padding: 0 1px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--ins-warning) 35%, transparent);
    color: inherit;
}

/* A read-only grid paints its boxes at full strength: the theme fades a disabled box to half, which made granted and not
   granted look alike. */
.permission-editor[data-readonly="true"] .perm-check:disabled,
.permission-editor[data-readonly="true"] .perm-radio:disabled { opacity: 1; }
.permission-editor[data-readonly="true"] .perm-chip,
.permission-editor[data-readonly="true"] .perm-row,
.permission-editor[data-readonly="true"] .perm-choice-option { cursor: default; }

/* ---- The review --------------------------------------------------------------------------- */
.perm-review {
    margin-top: 1rem;
    border: 1px solid var(--perm-on-line);
    border-radius: var(--perm-radius);
    background: var(--ins-secondary-bg);
}

.perm-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--aira-line);
}

.perm-review-list {
    max-height: 18rem;
    margin: 0;
    padding: .25rem 0;
    overflow-y: auto;
    list-style: none;
}

.perm-review-list > li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem 1rem;
    font-size: .8125rem;
}

.perm-review-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    font-weight: 700;
}

.perm-review-list > li.is-granted .perm-review-sign { background: color-mix(in srgb, var(--ins-success) 18%, transparent); color: var(--ins-success); }
.perm-review-list > li.is-removed .perm-review-sign { background: color-mix(in srgb, var(--ins-danger) 15%, transparent); color: var(--ins-danger); }
.perm-review-text { flex: 1 1 auto; min-width: 0; }
.perm-review-card { margin-left: .35rem; color: var(--ins-secondary-color); font-size: .75rem; }

/* ---- The role dialog's heading over the grid ----------------------------------------------- */
.perm-dialog-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin: 1.25rem 0 .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--aira-line);
}

.perm-dialog-reach {
    display: inline-flex;
    align-items: center;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
}

.perm-dialog-reach svg { vertical-align: -2px; }

/* ---- The foot -------------------------------------------------------------------------------- */
/* Save stays in reach at the foot of a grid taller than the screen. Pulled out to the edges of the card or dialog it sits in, so
   it reads as that container's footer. Its ground is the shared opaque one below (crm/54). */
.perm-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    margin-top: 1.25rem;
    padding: .75rem 0;
    border-top: 1px solid var(--aira-line);
}

.perm-changes {
    margin-right: auto;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
}

.perm-changes.has-changes { color: color-mix(in srgb, var(--ins-warning) 75%, var(--ins-body-color)); font-weight: 600; }
.perm-changes.has-changes::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: .45rem;
    border-radius: 50%;
    background: var(--perm-changed, var(--ins-warning));
}

/* A sticky box sticks at its scroll container's PADDING edge, so `bottom: 0` inside .modal-body
   left the grid scrolling past under the bar for the depth of the body's padding. */
.modal-body .perm-actions {
    bottom: calc(-1 * var(--ins-modal-padding));
    margin-inline: calc(-1 * var(--ins-modal-padding));
    margin-bottom: calc(-1 * var(--ins-modal-padding));
    padding-inline: var(--ins-modal-padding);
}

.card-body .perm-actions {
    margin-inline: calc(-1 * var(--ins-card-spacer-x));
    margin-bottom: calc(-1 * var(--ins-card-spacer-y));
    padding-inline: var(--ins-card-spacer-x);
    border-radius: 0 0 var(--ins-card-inner-border-radius) var(--ins-card-inner-border-radius);
}

/* ---- Narrow windows ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .perm-toolbar { position: static; }
    .perm-search { max-width: none; flex-basis: 100%; }
    .perm-summary { margin-left: 0; }
    .perm-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
}

/* ==========================================================================
   Settings - User Management.

   The avatar falls back to initials that are rendered already and only un-hidden when the
   Employee software host fails to serve the photo - see Views/Users/_Avatar.cshtml. The
   fallback wrapper carries no display utility, so [hidden] is the only rule that applies to it.
   ========================================================================== */
.aira-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.aira-avatar-photo { object-fit: cover; }

/* The theme ships no min-width utility, and a flex child holding a long name will not shrink
   under it without one - it pushes the actions column out of the card instead. */
.min-w-0 { min-width: 0 !important; }

/* Dimmed by the shared rule under *Loading*; a click on a row that is about to be replaced is lost. */
[data-user-rows].is-loading { pointer-events: none; }

/* One run open at a time in the sync history; the chevron says which. */
[aria-expanded="true"] > .history-chevron { transform: rotate(90deg); }

[data-history-toggle]:hover,
[data-history-toggle]:focus-visible { background: var(--ins-tertiary-bg); }

/* Six columns with a photo on each side: below this the picker and the reason chips collide. */
.mapping-table { min-width: 1040px; }
.mapping-employee-cell { min-width: 300px; }

.import-check-col { width: 2.5rem; }

/* ==========================================================================
   NOTIFICATIONS
   The topbar bell, the console, and the phone mock the message formats
   preview into.
   ========================================================================== */

/* ---- The bell -----------------------------------------------------------
   Modelled on the theme's own notification dropdown, and sharing the View as
   menu's width so the two sit the same way under the topbar. Nothing here
   takes a z-index: it is a Bootstrap .dropdown-menu and inherits the theme's,
   which keeps it clear of the 1070-1135 band the stacked-dialog arithmetic
   owns. */
.aira-bell-menu {
    min-width: 24rem;
    max-width: calc(100vw - 1.5rem);
    overflow: hidden;
}

.aira-bell-scroll {
    max-height: 26rem;
    min-height: 6rem;
}

/* The title, All | Unread, and Mark all as read - one line that wraps on a
   phone rather than squeezing the title. */
.aira-bell-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .5rem .875rem;
}

/* A row is the link to the notification plus, beside it, its one action.
   Side by side rather than nested: a button inside a link is invalid, and a
   keyboard then tabs to the link and the action as two stops. */
.aira-bell-item {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-bottom: 1px solid var(--aira-line);
    background: transparent;
    position: relative;
}

.aira-bell-item:last-child { border-bottom: 0; }

.aira-bell-link {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: .75rem;
    align-items: flex-start;
    padding: .625rem 0 .625rem .875rem;
    color: inherit;
    text-decoration: none;
}

.aira-bell-link:hover { color: inherit; }

.aira-bell-item:hover,
.aira-bell-item:focus-within { background: var(--ins-tertiary-bg); }

/* Unread is a ground and a weight, not a colour - a tinted row reads as a
   status ("something is wrong with this one") rather than as "you have not
   looked at this yet". */
.aira-bell-item.is-unread { background: var(--aira-surface-2); }
.aira-bell-item.is-unread .aira-bell-title { font-weight: 650; }

/* Just arrived while the dropdown was open: a moment of the brand's own tint. */
.aira-bell-item.is-new { background: var(--ins-primary-bg-subtle); }

/* The dot and the row's action, stacked in a narrow column at the end. */
.aira-bell-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .625rem .625rem .625rem .375rem;
}

/* Mark as read / Mark as unread. Shown on hover and whenever the keyboard
   reaches it - opacity rather than display, so it stays in the tab order and
   the focus ring has something to draw on. Always shown where there is no
   hover at all. */
.aira-bell-action {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--aira-muted);
    opacity: 0;
}

.aira-bell-action svg { width: .9375rem; height: .9375rem; }

.aira-bell-item:hover .aira-bell-action,
.aira-bell-action:focus-visible { opacity: 1; }

.aira-bell-action:hover { background: var(--ins-secondary-bg); color: var(--aira-ink); }

@media (hover: none) {
    .aira-bell-action { opacity: 1; }
}

/* The bell rings once when something arrives - never on a read, and never
   under reduced motion (the script removes the class on a timer, so nothing
   waits on an animationend that will not fire). */
@keyframes aira-bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(9deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}

.aira-bell .dropdown-toggle.is-ringing svg {
    transform-origin: 50% 2px;
    animation: aira-bell-ring .9s ease-in-out 1;
}

@media (prefers-reduced-motion: reduce) {
    .aira-bell .dropdown-toggle.is-ringing svg { animation: none; }
}

.aira-bell-icon {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.aira-bell-icon svg { width: 1rem; height: 1rem; }

/* min-width:0 is load-bearing on a flex child: without it a long customer name
   pushes the row wider than the menu instead of wrapping inside it. */
.aira-bell-body { flex: 1 1 auto; min-width: 0; }

.aira-bell-title {
    display: block;
    font-size: .8125rem;
    color: var(--aira-ink);
    line-height: 1.35;
}

/* The body is operator-authored template text whose line breaks are part of
   the message - the same breaks that reach the phone. Four lines in the
   dropdown: a ten-line daily report must not push everything else below the
   fold. The whole thing is shown on the notifications page. */
.aira-bell-text {
    margin-top: .125rem;
    font-size: .75rem;
    color: var(--aira-ink-2);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aira-bell-meta {
    display: block;
    margin-top: .1875rem;
    font-size: .6875rem;
    color: var(--aira-muted);
}

.aira-bell-dot {
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    margin-top: .375rem;
    border-radius: 50%;
    background: var(--ins-primary);
}

.aira-bell-state {
    padding: 2rem 1.25rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--aira-ink-2);
}

.aira-bell-loading {
    padding: .75rem;
    text-align: center;
}

.aira-bell-foot .dropdown-item:hover { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

/* ---- The rule dialog ------------------------------------------------------
   Five short sections on the left, each shown only when the chosen
   notification can use it, and the Summary on the right - sticky from lg up,
   so the sentence and the message stay in view while the form scrolls under
   them. Below lg the two stack. No field sizes here: those are compiled
   (hard rule 10a). */
.aira-rule-section {
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.aira-rule-section:last-child { margin-bottom: 0; }

.aira-rule-section-title {
    margin-bottom: .875rem;
    font-weight: 600;
}

/* A picker sits under the box that asked for it, indented to the box's label. */
.aira-rule-picker { margin: .375rem 0 .25rem 1.75rem; }

.aira-rule-number { max-width: 14rem; }

.aira-rule-format { min-width: 12rem; }

/* 90% of the screen, from a small tablet up (the product owner's ask, 2026-09-26): the rule
   dialog's Summary carries a five-column recipient table, and at modal-xl it had about 450px.
   The message format dialog is the same width since 2026-09-28 (F12) - its preview sits beside
   the form - on both shells: #notif-modal, where openDialog sets the class per open (two dialogs
   share that element, FT10), and #notif-modal-stack, which carries it always. Below sm it is
   Bootstrap's own full-width dialog. */
@media (min-width: 576px) {
    .modal-dialog.aira-wide-dialog {
        width: 90vw;
        max-width: 90vw;
        margin-left: auto;
        margin-right: auto;
    }
}

.aira-rule-summary {
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    padding: 1rem;
    background: var(--aira-surface-2);
}

/* Sticky, and never taller than the dialog's body: a Summary longer than the screen could
   otherwise only show its end once the form beside it had been scrolled to the bottom. */
@media (min-width: 992px) {
    .aira-rule-summary {
        position: sticky;
        top: 0;
        max-height: calc(100vh - 11rem);
        overflow-y: auto;
    }
}

/* What the rule does, a label and its lines - "Sends when", "Only for", "Recipients". */
.aira-rule-lines {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .5rem 1rem;
    margin: 0 0 1rem;
}

.aira-rule-lines dt {
    font-weight: 600;
    color: var(--aira-ink-2);
}

.aira-rule-lines dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .aira-rule-lines { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .aira-rule-lines dd { margin-bottom: .625rem; }
}

.aira-rule-block { margin-bottom: 1rem; }

.aira-rule-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    margin-bottom: .5rem;
}

/* Who receives it: a fixed height of its own, scrolling inside its card - a rule addressed
   to a whole department must not push the message preview out of reach. It scrolls sideways
   on a phone, as every .table-responsive does. */
.aira-rule-recipients {
    max-height: min(18rem, 45vh);
    overflow-y: auto;
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
    margin-bottom: .375rem;
}

.aira-rule-recipients > table { min-width: 30rem; }

/* The header stays while the rows scroll. An inset shadow rather than a border: a collapsed
   border belongs to the grid and does not travel with a sticky cell (see .aira-tscroll). */
.aira-rule-recipients > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ins-tertiary-bg);
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 var(--ins-border-color);
}

/* Somebody on the list whom nothing reaches: still listed, so the admin can see why. */
.aira-rule-recipients > table > tbody > tr.aira-rule-unreached > td:not(.text-danger):not(.text-warning-emphasis) {
    color: var(--ins-secondary-color);
}

/* A phone: each person is a short block rather than a row to scroll sideways through - the
   name, then each column's answer after its own name (data-label, written by the script). */
@media (max-width: 575.98px) {
    .aira-rule-recipients > table { min-width: 0; }
    .aira-rule-recipients > table > thead { display: none; }

    .aira-rule-recipients > table > tbody > tr {
        display: block;
        padding: .5rem .75rem;
        border-bottom: 1px solid var(--ins-border-color);
    }

    .aira-rule-recipients > table > tbody > tr:last-child { border-bottom: 0; }

    .aira-rule-recipients > table > tbody > tr > td {
        display: block;
        padding: .125rem 0;
        border-bottom-width: 0;
    }

    .aira-rule-recipients > table > tbody > tr > td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--ins-secondary-color);
    }
}

.aira-rule-warnings {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.aira-rule-warnings li {
    position: relative;
    padding: .375rem .625rem .375rem 1.75rem;
    margin-bottom: .375rem;
    border-radius: var(--ins-border-radius);
    background: var(--ins-warning-bg-subtle);
    color: var(--ins-warning-text-emphasis);
}

.aira-rule-warnings li::before {
    content: "!";
    position: absolute;
    left: .625rem;
    top: .375rem;
    font-weight: 700;
}

/* The message as it will read: the wording's own line breaks, like the phone
   and the bell show them. */
.aira-rule-message {
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
    padding: .75rem;
    margin-bottom: .25rem;
}

.aira-rule-message-body {
    margin-top: .25rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--aira-ink-2);
}

/* ---- The console --------------------------------------------------------- */

/* --------------------------------------------------------------------------
   The Overview (notification-overview.md, *Target*).
   -------------------------------------------------------------------------- */

/* Right now: four status items, each a dot and two lines - the name, then the one sentence that
   says whether it is working, worked out from what happened (OV2). */
.notif-status {
    display: flex;
    gap: .625rem;
    align-items: flex-start;
    height: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--aira-line);
    border-radius: .5rem;
    background: var(--aira-surface-2);
}

.notif-status-dot {
    flex: 0 0 .625rem;
    width: .625rem;
    height: .625rem;
    margin-top: .3rem;
    border-radius: 50%;
    background: var(--ins-secondary);
}

.notif-status.is-success .notif-status-dot { background: var(--ins-success); }
.notif-status.is-warning .notif-status-dot { background: var(--ins-warning); }
.notif-status.is-danger .notif-status-dot { background: var(--ins-danger); }
.notif-status.is-danger { border-color: color-mix(in srgb, var(--ins-danger) 35%, transparent); }

.notif-status-body { flex: 1 1 auto; min-width: 0; }
.notif-status-name { display: block; font-size: .8125rem; font-weight: 650; color: var(--aira-ink); }
.notif-status-state { display: block; font-size: .75rem; color: var(--aira-ink-2); }

.notif-status-link {
    display: inline-block;
    margin-top: .125rem;
    font-size: .75rem;
    white-space: nowrap;
}

/* A figure written inside a sentence ("12 messages waiting") - a link in look, a button in kind. */
.notif-inline-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ins-link-color, var(--ins-primary));
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .15em;
    cursor: pointer;
}

/* Activity: the period sits at the head of everything it scopes. The pane's old figures stay,
   dimmed, while a period or a refresh is counted (OV16) - no skeleton, no jump. */
.notif-activity-head h5 { font-weight: 650; }

[data-overview].is-refreshing { animation: aira-dim 0s linear .18s forwards; pointer-events: none; }

/* The four tiles. A button when it opens rows, text when it does not; proportional figures, since
   a lone large number set in tabular figures reads loose. */
.notif-kpi {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    width: 100%;
    height: 100%;
    padding: .75rem .875rem;
    border: 1px solid var(--aira-line);
    border-left: 3px solid var(--aira-line-2);
    border-radius: .5rem;
    background: var(--ins-secondary-bg);
    color: inherit;
    text-align: left;
}

.notif-kpi.is-link { cursor: pointer; }
.notif-kpi.is-link:hover { border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--aira-line)); }
.notif-kpi.is-danger { border-left-color: var(--ins-danger); }

.notif-kpi-label { font-size: .75rem; font-weight: 600; color: var(--aira-muted); }
.notif-kpi-value { font-size: 1.625rem; font-weight: 700; line-height: 1.2; color: var(--aira-ink); }
/* Two lines at most, never cut short: "Mostly: They cannot open that complaint (5)" lost its count at one. */
.notif-kpi-sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: .75rem;
    color: var(--aira-ink-2);
}

/* The chart's key: a swatch in the series' own token, its word, and the period's total - the tiles'
   own figures, opening the same rows. */
.notif-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; }
.notif-legend-item { display: inline-flex; align-items: center; gap: .375rem; color: var(--aira-ink-2); }
.notif-legend-swatch { width: .625rem; height: .625rem; border-radius: 2px; }
.notif-legend-count { font-weight: 650; color: var(--aira-ink); }

.notif-overview-chart { min-height: 280px; }
.notif-overview-chart.is-drillable .apexcharts-bar-area { cursor: pointer; }

/* Not sent because: one row per reason, one hue, the count at the bar's end (OV13). The reason has its
   own line above its bar - they are sentences, and a column beside the bar cut every one of them short. */
.notif-reasons { display: flex; flex-direction: column; gap: .125rem; }

.notif-reason {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label count" "track track";
    align-items: center;
    gap: .25rem .75rem;
    width: 100%;
    padding: .375rem .5rem;
    border: 0;
    border-radius: .375rem;
    background: none;
    color: inherit;
    text-align: left;
    font-size: .8125rem;
}

.notif-reason.is-link { cursor: pointer; }
.notif-reason.is-link:hover { background: var(--aira-surface-2); }
.notif-reason-label { grid-area: label; min-width: 0; color: var(--aira-ink-2); }
.notif-reason-track { grid-area: track; display: block; height: .5rem; }
.notif-reason-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-notsent); }
.notif-reason-count { grid-area: count; font-weight: 650; color: var(--aira-ink); font-variant-numeric: tabular-nums; }

/* Needs attention: the button goes under its sentence when the card is narrow - beside it, on a phone,
   the sentence was squeezed into a column two words wide. */
.notif-attention .list-group-item { flex-wrap: wrap; }
.notif-attention .list-group-item > .flex-grow-1 { flex: 1 1 14rem; }
.notif-attention .list-group-item > .btn { margin-left: auto; }

/* By notification: counts line up, so they are tabular; a count that opens rows is a quiet link. The
   table keeps a readable width and scrolls in its own card below it (house style) - squeezed, every
   notification's name broke over three lines on a phone. */
.notif-by-type { min-width: 36rem; }
.notif-by-type th { font-size: .75rem; color: var(--aira-muted); font-weight: 600; white-space: nowrap; }
.notif-count { font-variant-numeric: tabular-nums; }

button.notif-count,
button.notif-legend-count {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: .15em;
}

button.notif-count:hover,
button.notif-legend-count:hover { text-decoration-color: currentColor; }

/* --------------------------------------------------------------------------
   The delivery log (notification-log-and-settings.md, *Target - the Delivery log*).
   -------------------------------------------------------------------------- */

/* The strip: All and each status with its count for the view - the product's segmented control
   (.aira-toggle), wrapping on a phone rather than scrolling. */
.aira-outbox-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-bottom: .5rem;
}

.aira-outbox-counts { display: flex; flex-wrap: wrap; gap: .25rem; }
.aira-outbox-count b { font-variant-numeric: tabular-nums; margin-left: .125rem; }

.aira-outbox-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    margin-right: .375rem;
    vertical-align: middle;
    background: var(--aira-line-2);
}

.aira-outbox-dot.is-success { background: var(--ins-success); }
.aira-outbox-dot.is-secondary { background: var(--ins-secondary); }
.aira-outbox-dot.is-info { background: var(--ins-info); }
.aira-outbox-dot.is-danger { background: var(--ins-danger); }
.aira-outbox-dot.is-warning { background: var(--ins-warning); }

.aira-outbox-elsewhere {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    margin-bottom: .5rem;
    font-size: .8125rem;
    color: var(--aira-ink-2);
}

/* Every column is two lines: what it is, and under it, muted, the one thing that explains it - one
   line, the whole of it in the tooltip, so a page of 25 rows is 25 rows and not 2,400px. */
.aira-outbox-line2 {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-outbox-table td { vertical-align: top; }

/* The heading is the one second line worth more room - at 1440 the eight columns and the menu fit. */
.aira-outbox-what .aira-outbox-line2 { max-width: 14rem; }
.aira-outbox-table td:last-child { width: 1%; }

/* The message dialog: What happened, a short timeline. */
.aira-outbox-steps { list-style: none; padding: 0; margin: 0 0 .25rem; }

.aira-outbox-step {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    column-gap: .5rem;
    padding: 0 0 .625rem 1.25rem;
    font-size: .8125rem;
    color: var(--aira-ink);
}

/* The thread between two steps, from one dot to the next. */
.aira-outbox-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: .25rem;
    top: .75rem;
    bottom: 0;
    border-left: 1px solid var(--aira-line-2);
}

.aira-outbox-step-dot {
    position: absolute;
    left: 0;
    top: .3125rem;
    width: .5625rem;
    height: .5625rem;
    border-radius: 50%;
    background: var(--aira-line-2);
}

.aira-outbox-step.is-success .aira-outbox-step-dot { background: var(--ins-success); }
.aira-outbox-step.is-danger .aira-outbox-step-dot { background: var(--ins-danger); }
.aira-outbox-step.is-warning .aira-outbox-step-dot { background: var(--ins-warning); }
.aira-outbox-step.is-info .aira-outbox-step-dot { background: var(--ins-info); }

.aira-outbox-step-at { color: var(--aira-muted); font-variant-numeric: tabular-nums; }
.aira-outbox-step-detail { flex-basis: 100%; color: var(--ins-danger); font-size: .75rem; }

.aira-outbox-details th {
    width: 11rem;
    font-weight: 500;
    font-size: .8125rem;
    color: var(--aira-muted);
}

.aira-outbox-details td { font-size: .8125rem; }

/* --------------------------------------------------------------------------
   The Notifications Settings tab (notification-log-and-settings.md, *Target - the Settings tab*):
   one column of full-width sections - no half-width pairing, no disclosure.
   -------------------------------------------------------------------------- */

.aira-settings-scope { font-size: .8125rem; font-weight: 400; color: var(--aira-muted); }

/* On, or paused since when and by whom - the dot says which before the words do. */
.aira-settings-state { display: flex; align-items: flex-start; gap: .5rem; color: var(--aira-ink); }

.aira-settings-dot {
    flex-shrink: 0;
    width: .625rem;
    height: .625rem;
    margin-top: .375rem;
    border-radius: 50%;
    background: var(--ins-success);
}

.aira-settings-state.is-paused .aira-settings-dot { background: var(--ins-danger); }

/* Undo and Save at the foot of the viewport while the tab is open (NS13) - they sat a screen away
   from most of the fields they save. Below the dialog layers (1055 and up), above the page. */
.aira-settings-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    margin: 0 -.25rem;
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
}

/* The token palette. Monospace, because they are typed into a message body. */
.aira-token {
    font-family: var(--ins-font-monospace, monospace);
    font-size: .6875rem;
    padding: .1875rem .375rem;
    margin: 0 .25rem .25rem 0;
    border: 1px dashed var(--aira-line-2);
}

.aira-token:hover { border-style: solid; border-color: var(--ins-primary); }

/* A rule that is on but reaches nobody is the commonest misconfiguration here,
   and it is completely silent from every other screen. */
.notif-rule-empty { color: var(--ins-danger); }

.notif-rule-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: .125rem;
    margin-right: .5rem;
    vertical-align: middle;
}

/* The message a format renders, in a list. One line, however long it is. */
.notif-preview-cell {
    max-width: 22rem;
    font-size: .75rem;
    color: var(--aira-ink-2);
}

/* The personal notifications page: the same row, unclamped, because this is
   where somebody goes to read the whole thing. The format dialog's preview,
   switched to Expanded, is that page's row - so it is this rule, never a copy. */
.aira-inbox-list .aira-bell-item { padding: .875rem 1rem; }
.aira-inbox-list .aira-bell-text,
.aira-format-bell.is-expanded .aira-bell-text { -webkit-line-clamp: unset; display: block; }

/* What you are sent - only what reaches the person, a switch only where it changes something (notification-preferences.md). */
.pref-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    padding: .5rem .75rem;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
    background: var(--aira-surface-2);
    border-radius: var(--ins-border-radius);
}
.pref-note svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: .125rem; }

.pref-section {
    margin: 1rem 0 .25rem;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ins-secondary-color);
}

.pref-list { list-style: none; margin: 0; padding: 0; }
.pref-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px dashed var(--ins-border-color);
}
.pref-row:last-child { border-bottom: 0; }
.pref-main { min-width: 0; }
.pref-name { font-weight: 500; }
.pref-when { font-size: .75rem; color: var(--ins-secondary-color); }
.pref-how { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex: 0 0 auto; }
.pref-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .0625rem .5rem;
    font-size: .6875rem;
    white-space: nowrap;
    color: var(--ins-secondary-color);
    border: 1px solid var(--ins-border-color);
    border-radius: 1rem;
}
.pref-chip svg { width: 12px; height: 12px; }
.pref-how .form-check-label { font-size: .75rem; }

html[data-bs-theme="dark"] .pref-note { background: var(--ins-tertiary-bg); }

/* ==========================================================================
   AUDIT LOG
   One feed of sentences (C14, audit.md): a day heading, then a row per thing
   somebody did - the time, the category's icon, the sentence, and a chevron
   where there is a before and after to read.
   ========================================================================== */

.audit-person-pick { min-width: 16rem; }

.audit-day {
    padding: .5rem 1rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--aira-ink-2);
    background: var(--ins-tertiary-bg);
    border-bottom: 1px solid var(--aira-line);
}

.audit-row { border-bottom: 1px solid var(--aira-line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row:has([data-audit-expand]) { cursor: pointer; }
.audit-row.is-open { background: var(--ins-tertiary-bg); }

.audit-row-main {
    display: grid;
    grid-template-columns: 5.25rem 1.75rem minmax(0, 1fr) auto;
    align-items: start;
    gap: .5rem;
    padding: .625rem 1rem;
}

.audit-time {
    font-size: .8125rem;
    color: var(--aira-ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-top: .0625rem;
}

.audit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: .875rem;
    color: var(--ins-primary);
    background: var(--ins-primary-bg-subtle);
}

.audit-sentence { margin: 0; padding-top: .125rem; overflow-wrap: anywhere; }
.audit-person-link, .audit-ticket { font-weight: 600; }

.audit-expand { padding: .125rem .375rem; line-height: 1; }
.audit-expand[aria-expanded="true"] svg { transform: rotate(90deg); }

/* Under the sentence, lined up with it rather than with the time. */
.audit-details { padding: 0 1rem .75rem calc(1rem + 5.25rem + 1.75rem + 1rem); cursor: auto; }
.audit-note { white-space: pre-line; color: var(--aira-ink-2); }
.audit-changes { max-width: 48rem; background: transparent; }
.audit-changes > :not(caption) > * > * { background: transparent; }
.audit-changes thead th { font-size: .75rem; font-weight: 600; color: var(--aira-ink-2); }
.audit-changes .audit-label { font-weight: 600; width: 30%; }
.audit-changes .audit-before { color: var(--aira-ink-2); text-decoration: line-through; text-decoration-color: var(--aira-line-2); }

/* The Person view's five figures, each a toggle that narrows the feed to exactly its count. */
.audit-person-head { margin-bottom: .75rem; }
.audit-figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.audit-figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .125rem;
    text-align: left;
    border: 1px solid var(--aira-line-2);
}
.audit-figure-count { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.audit-figure-label { font-size: .75rem; }

@media (max-width: 767.98px) {
    /* The phone reads a row as its time over its sentence. */
    .audit-row-main { grid-template-columns: 1.75rem minmax(0, 1fr) auto; grid-template-areas: "icon time more" "icon text more"; column-gap: .625rem; row-gap: .125rem; }
    .audit-time { grid-area: time; }
    .audit-icon { grid-area: icon; }
    .audit-sentence { grid-area: text; }
    .audit-expand { grid-area: more; }
    .audit-details { padding-left: calc(1rem + 1.75rem + .625rem); }

    /* Label, then before over after - a three-column table does not fit a phone. */
    .audit-changes thead { display: none; }
    .audit-changes tr { display: grid; grid-template-columns: 1fr; padding: .25rem 0; }
    .audit-changes tr > *, .audit-changes .audit-label { border: 0; padding: .0625rem 0; width: auto; }
    .audit-changes .audit-before::before { content: "Before: "; color: var(--aira-ink-2); text-decoration: none; display: inline-block; margin-right: .25rem; }
    .audit-changes .audit-after::before { content: "After: "; color: var(--aira-ink-2); margin-right: .25rem; }

    .audit-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .audit-person-pick { min-width: 0; flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   App full screen (app/js/aira-fullscreen.js; ubold-ui.md, *App full screen*).
   The tab's document hosts the app in this frame and puts the frame in native
   full screen, so a navigation - which happens inside it - never leaves full
   screen. Out of full screen the frame stays over the whole window until the
   next navigation, so work in progress survives. No backdrop-filter (hard rule
   10b). html.fullscreen-enable has one job left: the theme's topbar icons.
   -------------------------------------------------------------------------- */
.aira-fs-frame {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--ins-body-bg);
    z-index: var(--aira-z-app-frame);
}

/* The host page behind the frame gets no scrollbar of its own - nor a workspace page's reserved
   gutter, which a fixed frame does not cover: out of full screen it was an empty strip beside it. */
html[data-aira-fs-host] { overflow: hidden; scrollbar-gutter: auto; }


/* --------------------------------------------------------------------------
   The details field - Aira.tokenField, app/js/aira-token-field.js
   (notification-formats.md, FD1-FD3; ubold-ui.md, *The details field*).

   The message format dialog's Heading, Message, Subject, Header and Footer: a
   .form-control hosting Quill's editor, with every detail a pill - "Regarding"
   where the stored text says {{FollowUp.Regarding}}. The real control is the
   visually hidden input or textarea right after it; that is what posts, what
   the dirty guard snapshots and what the validation engine paints under.
   -------------------------------------------------------------------------- */

.aira-token-field {
    /* The theme's own field at the field's own size (hard rule 10a): its compiled padding and one
       line of the editor inside make it exactly as tall as the text box beside it. */
    height: auto;
    cursor: text;
}

/* Quill's mount, inside the field. Its own rule gives it Helvetica at 13px; it inherits the
   field's font and size instead - the one declaration of both, compiled from the brand. */
.aira-token-field .ql-container {
    font: inherit;
    height: auto;
}

.aira-token-field .ql-editor {
    padding: 0;
    min-height: 1.5em;
    /* The field's own line, not the theme's: app.min.css ships `.ql-editor { line-height: 2
       !important }`, which beats a plain declaration and made every one-line field 7px taller
       than the text box beside it. */
    line-height: inherit !important;
    color: var(--aira-ink);
    overflow-y: visible;
    /* Long words and URLs wrap inside the box rather than widening the dialog. */
    overflow-wrap: anywhere;
}

/* The message is the long one: about the height of the textarea it replaces, and it grows. */
.aira-token-field:not(.is-one-line) .ql-editor { min-height: 12rem; }

/* The box carries the field's focus, exactly as .form-control:focus draws it - the inner editor
   is borderless, so its own :focus would say nothing. The second place a container mirrors a
   field, after the search bar (filters.md T8); FocusRingTests pins both. */
.aira-token-field:focus-within {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px var(--ins-primary-bg-subtle);
}

.aira-token-field .ql-editor:focus { outline: 0; }

.aira-token-field .ql-editor.ql-blank::before {
    left: 0;
    right: 0;
    font-style: normal;
    color: var(--ins-secondary-color);
}

/* A refused field: the control is invisible, so its red is carried here (the engine's sentence
   still lands right under the box, after the control). */
.aira-token-field.is-invalid { border-color: var(--ins-danger); }
.aira-token-field.is-invalid:focus-within {
    border-color: var(--ins-danger);
    box-shadow: 0 0 0 3px var(--ins-danger-bg-subtle);
}

/* The real control: posts, is judged, occupies nothing. Not display:none - the engine skips a
   field it cannot see, and this one it must judge. */
.aira-token-value {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- The pill ------------------------------------------------------------- */

/* In the editor the pill is the NON-editable span inside Quill's blot (.aira-detail), which also
   holds a guard character either side of it - and the caret beside a detail lives in a guard. With
   the pill drawn on the blot itself, that caret was drawn inside the pill's border. */
.aira-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    margin: 0 .0625rem;
    padding: 0 .5rem;
    border: 1px solid var(--ins-primary-border-subtle);
    border-radius: 999px;
    background: var(--ins-primary-bg-subtle);
    color: var(--ins-primary-text-emphasis);
    font-size: .85em;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    /* Top, not baseline or middle: the smaller text aligned to the line's baseline (or its
       middle) pushed the line box a pixel past the text box beside it. At 1.5 x .85em the pill is
       shorter than the line, so top keeps it inside. */
    vertical-align: top;
    cursor: pointer;
    user-select: none;
}

.aira-pill .aira-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* An optional part's two ends: dashed, and quieter than a detail - they are not words. */
.aira-pill.is-block {
    border-style: dashed;
    background: transparent;
    color: var(--aira-ink-2);
    border-color: var(--ins-border-color);
}

.aira-pill.is-open .aira-pill-text::after { content: " \25B8"; }
.aira-pill.is-close .aira-pill-text::before { content: "\25C2  "; }

/* A detail this notification cannot fill - pasted, or left behind by a change of notification -
   is visible before Save refuses it. */
.aira-pill.is-unknown {
    border-color: var(--ins-danger-border-subtle);
    border-style: solid;
    background: var(--ins-danger-bg-subtle);
    color: var(--ins-danger-text-emphasis);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.aira-pill-static { cursor: default; }

/* A field somebody may read but not change - a disabled fieldset's: the theme's disabled field, and no pill opens its panel. */
.aira-token-field.is-disabled { background-color: var(--ins-tertiary-bg); cursor: default; }
.aira-token-field.is-disabled .aira-pill { cursor: default; }

/* ---- Places (crm/92): the chips under a field of places ------------------------
   Each chip is the pill it puts at the caret, with a plus - the same face, so what is
   pressed is what lands. A button, so the theme's own button look is reset to the pill's. */
.aira-token-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-top: .5rem;
}

.aira-token-chip {
    font-family: inherit;
    line-height: 1.75;
    vertical-align: middle;
}

/* The pill's own ground, its border the brand - readable on any brand colour, in both themes. */
.aira-token-chip:hover:not(:disabled) { border-color: var(--ins-primary); }

.aira-token-chip:disabled { opacity: .6; cursor: default; }

/* ---- The layers: the detail picker and a pill's own panel ------------------- */

.aira-token-layer {
    position: fixed;
    /* Opens from inside a dialog - two deep over a rule - so it has to clear the whole stack. */
    z-index: var(--aira-z-panel);
    display: flex;
    flex-direction: column;
    padding: .5rem;
    background: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    box-shadow: var(--aira-shadow-2);
    /* Shortened to the room beside a caret's line rather than cover it (KS3): nothing spills out. */
    overflow: hidden;
    /* It fades in and out (KS5): transparent, a few pixels off its line, and taking no pointer -
       so a press where a closing layer still shows lands on what is under it. The script sets
       [hidden] when the fade ends. No backdrop-filter: nothing over the dialog is blurred (10b). */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.aira-token-layer.is-above { transform: translateY(4px); }

/* A shown layer says so itself, never through an animation's fill (hard rule 10b). */
.aira-token-layer.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.aira-token-layer[hidden] { display: none; }

.aira-token-picker-head { padding: 0 0 .5rem; }

/* "Show the words only if this has a value" - what picking does from *Show only if*. */
.aira-token-picker-prompt {
    padding: 0 .125rem .5rem;
    font-weight: 600;
    color: var(--aira-ink);
}

.aira-token-picker-prompt[hidden] { display: none; }

.aira-token-picker-list {
    position: relative;
    max-height: 20rem;
    overflow-y: auto;
}

.aira-token-picker-group + .aira-token-picker-group { margin-top: .375rem; }

.aira-token-picker-title {
    padding: .25rem .4375rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}

.aira-token-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .3125rem .4375rem;
    border-radius: var(--ins-border-radius-sm);
    cursor: pointer;
}

.aira-token-option:hover,
.aira-token-option.is-active { background: var(--aira-option-hover-bg); color: var(--aira-option-hover-ink); }

.aira-token-option-sample {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-token-picker-empty {
    padding: .375rem .4375rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-pill-panel { gap: .5rem; padding: .75rem; }

.aira-pill-panel-title { font-weight: 600; color: var(--aira-ink); }

.aira-pill-panel-sample { font-size: .8125rem; color: var(--aira-muted); }

.aira-pill-panel-row[hidden],
.aira-pill-panel-sample[hidden] { display: none; }

.aira-pill-panel-row .form-label { margin-bottom: .25rem; }

.aira-pill-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}


/* --------------------------------------------------------------------------
   The message format dialog - Views/Notifications/_TemplateEditor.cshtml
   (notification-formats.md, *Target - the format dialog*).

   The format on the left; the PULSE card and the bell row on the right, sticky,
   updating as the admin types - the part being edited outlined in them. The
   sections reuse the rule dialog's (.aira-rule-section, .aira-rule-section-title).
   -------------------------------------------------------------------------- */

/* A field's label with its Insert detail button at the other end of the line. */
.aira-format-label {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .25rem .5rem;
}

.aira-format-label .form-label { margin-bottom: .5rem; }
.aira-format-label > .btn,
.aira-format-label > span > .btn { margin-bottom: .375rem; }

/* "212 of 1,200 characters with sample values": amber near the ceiling, red past it. */
.aira-format-meter {
    margin-top: .375rem;
    font-size: .75rem;
    color: var(--aira-muted);
}

.aira-format-meter.is-near { color: var(--ins-warning-text-emphasis); }
.aira-format-meter.is-over { color: var(--ins-danger-text-emphasis); font-weight: 600; }

/* Category: the installation's, shown and not offered. */
.aira-format-readonly {
    padding: .375rem 0;
    color: var(--aira-ink);
}

/* ---- Icon and colour: the pictures themselves, as radio buttons -------------- */

.aira-icon-grid,
.aira-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.aira-icon-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
    border: 1px solid var(--ins-border-color);
    color: var(--aira-ink-2);
    background: var(--ins-secondary-bg);
}

.aira-icon-choice svg { width: 1.125rem; height: 1.125rem; }

.aira-icon-choice:hover { background: var(--ins-tertiary-bg); color: var(--aira-ink); }

.btn-check:checked + .aira-icon-choice {
    border-color: var(--ins-primary);
    background: var(--ins-primary-bg-subtle);
    color: var(--ins-primary-text-emphasis);
}

.aira-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
}

.aira-swatch-dot {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
}

.btn-check:checked + .aira-swatch { border-color: var(--ins-primary); box-shadow: inset 0 0 0 2px var(--ins-secondary-bg); }

/* ---- The preview column -------------------------------------------------------- */

.aira-format-preview {
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    padding: 1rem;
    background: var(--aira-surface-2);
}

/* Sticky and never taller than the dialog's body, as the rule dialog's Summary is: typing in the
   message at the bottom of the form must still show the card. */
@media (min-width: 992px) {
    .aira-format-preview {
        position: sticky;
        top: 0;
        max-height: calc(100vh - 13rem);
        overflow-y: auto;
    }
}

.aira-format-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

/* The bell row, drawn by the bell's own classes on a surface like the bell's dropdown. */
.aira-format-bell {
    border: 1px solid var(--aira-line);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    overflow: hidden;
}

.aira-format-bell .aira-bell-item { border-bottom: 0; cursor: default; }

/* The part being edited, outlined where it lands. A box-shadow, not an outline: the focus ring
   is outline, declared once (rule 10c), and this is not focus - it is "this is what you are
   changing". */
[data-format-preview] [data-part].is-editing {
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--ins-primary);
}

/* ---- The action bar, pinned to the bottom of the dialog's body ---------------------- */

.aira-format-actions {
    position: sticky;
    bottom: calc(var(--ins-modal-padding) * -1);
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin: 1.5rem calc(var(--ins-modal-padding) * -1) calc(var(--ins-modal-padding) * -1);
    padding: .75rem var(--ins-modal-padding);
    border-top: 1px solid var(--ins-border-color);
    background: var(--ins-secondary-bg);
}

.aira-format-meta {
    font-size: .8125rem;
    color: var(--aira-muted);
}

/* --------------------------------------------------------------------------
   The PULSE card - Views/Notifications/_PulseCard.cshtml + Aira.pulseCard
   (notification-formats.md, FD12).

   PULSE's own light card in both colour modes: it imitates the phone app, not a
   panel of this product, so its colours are the app's and are constants - the
   reason the old dark mock's were. The lines follow the product owner's photos:
   the category as the screen's title, the bold subject, the blue pill, the clock
   line, the grey header, the message, the italic footer, the file row.
   -------------------------------------------------------------------------- */

.aira-pulse {
    max-width: 22.5rem;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #d7dce4;
    border-radius: 1.25rem;
    background: #f2f4f8;
    color: #1f2733;
    box-shadow: var(--aira-shadow-2);
    font-size: .875rem;
    line-height: 1.5;
}

.aira-pulse-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem .875rem;
    background: #ffffff;
    border-bottom: 1px solid #e3e7ee;
}

.aira-pulse-back {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: #1f2733;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aira-pulse-category {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.aira-pulse-screen { padding: .75rem; }

.aira-pulse-card {
    padding: .875rem 1rem;
    border-radius: .875rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, .08), 0 1px 2px rgba(17, 24, 39, .04);
}

.aira-pulse-subject {
    font-size: .9375rem;
    font-weight: 700;
    color: #111827;
    overflow-wrap: anywhere;
}

.aira-pulse-pill {
    display: inline-block;
    margin-top: .375rem;
    padding: .0625rem .5rem;
    border-radius: 999px;
    background: #e5efff;
    color: #1d5fd1;
    font-size: .75rem;
    font-weight: 600;
}

.aira-pulse-time {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-top: .375rem;
    font-size: .75rem;
    color: #6b7280;
}

.aira-pulse-time svg {
    width: .8125rem;
    height: .8125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.aira-pulse-header {
    margin-top: .625rem;
    font-weight: 600;
    color: #4b5563;
    overflow-wrap: anywhere;
}

/* pre-wrap: a format's line breaks ARE the message. */
.aira-pulse-body {
    margin-top: .375rem;
    color: #1f2733;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.aira-pulse-footer {
    margin-top: .625rem;
    font-style: italic;
    color: #6b7280;
    overflow-wrap: anywhere;
}

.aira-pulse-header[hidden],
.aira-pulse-footer[hidden],
.aira-pulse-file[hidden] { display: none; }

.aira-pulse-file {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-top: .75rem;
    padding: .5rem .625rem;
    border: 1px solid #e3e7ee;
    border-radius: .625rem;
    background: #f8fafc;
}

.aira-pulse-file-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .375rem;
    background: #d03b3b;
    color: #ffffff;
    font-size: .625rem;
    font-weight: 800;
}

.aira-pulse-file-text { display: flex; flex-direction: column; min-width: 0; }
.aira-pulse-file-name { font-size: .75rem; font-weight: 600; color: #1f2733; overflow-wrap: anywhere; }
.aira-pulse-file-hint { font-size: .6875rem; color: #6b7280; }

/* PULSE's own control, as the phone draws it: a hairline above, the label, a chevron that turns
   once the card is open. Hidden where PULSE offers none - on any short message. */
.aira-pulse-more {
    display: flex;
    align-items: center;
    gap: .25rem;
    width: 100%;
    margin-top: .75rem;
    padding: .5rem 0 0;
    border: 0;
    border-top: 1px solid #e3e7ee;
    background: none;
    color: #1d5fd1;
    font-size: .8125rem;
    font-weight: 600;
    text-align: left;
}

.aira-pulse-more[hidden] { display: none; }

.aira-pulse-chevron {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aira-pulse-more[aria-expanded="true"] .aira-pulse-chevron { transform: rotate(180deg); }

/* Collapsed, as PULSE lists it: the server's listed lines (PulseLayout), clamped to the phone's two
   screen lines. The header, the footer and the file row stay, as they do on the phone. */
.aira-pulse-listed,
.aira-pulse.is-collapsed .aira-pulse-full { display: none; }

.aira-pulse.is-collapsed .aira-pulse-listed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* --------------------------------------------------------------------------
   The Message formats list - Views/Notifications/_TemplatesTab.cshtml
   (notification-formats.md, *Target - the Message formats page*).
   -------------------------------------------------------------------------- */

/* Seven columns in the card's width at 1440 beside the sidebar. The name has a floor, so
   "Complaint sent to Customer Care" does not stand one word to a line; the notification wraps. */
.aira-format-name { min-width: 12.5rem; }
.aira-format-event { min-width: 9rem; }

/* The scroll box is the containing block of what is absolutely placed inside it - the lock's and the
   actions header's .visually-hidden words. Without it they escaped the box and widened the whole
   page: at 390 it scrolled sideways to 1,117px. Here and not on every .table-responsive: elsewhere a
   dropdown placed absolutely in a table escapes the box on purpose, and would be clipped by it. */
#templates-card .table-responsive { position: relative; }

/* A section's band, in the mode's own tone. The theme's .table-light is light in both modes, so
   in dark it was a bright stripe with the muted label all but gone on it. */
.aira-format-section { --ins-table-bg: var(--ins-tertiary-bg); }

/* Reads as: the heading and the first line, one line each, the full text in the tooltip. A cell
   needs a width of its own before .text-truncate inside it can cut anything. */
.aira-format-reads {
    min-width: 13rem;
    max-width: 19rem;
}


/* --------------------------------------------------------------------------
   The company dialog's logo - Views/Companies/_CompanyForm.cshtml (crm/05 §2.2).
   -------------------------------------------------------------------------- */

/* The logo is the print's whole letterhead - a wide banner - so the frame is wide and short, and
   the image is shown whole rather than cropped: what the operator sees is what prints. */
.aira-company-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20rem;
    max-width: 100%;
    min-height: 5rem;
    padding: .5rem;
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.aira-company-logo-frame img {
    max-width: 100%;
    max-height: 7rem;
    object-fit: contain;
}

/* While the upload is on its way: the file input cannot be used twice, and the frame says so. */
.aira-company-logo.is-busy { pointer-events: none; opacity: .6; }

/* The register's thumbnail of that letterhead (crm/42 CD5) - a wide banner, so a short wide box shown whole; a company
   with none shows the building, the No logo badge beside the name saying what that costs. */
.aira-company-thumb {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 2rem;
    overflow: hidden;
    color: var(--ins-secondary-color);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-sm);
    background: var(--ins-tertiary-bg);
}

.aira-company-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* The company dialog's sections (crm/42 CD6) - each a group under its label, the house's section rule between them. */
.company-dialog-section + .company-dialog-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ins-border-color);
}

/* The company switcher's name on the topbar - a company name can be long, and the bar's other controls keep their
   places (crm/05 §2.5). */
.aira-company-switch-name { max-width: 11rem; vertical-align: middle; }

/* --------------------------------------------------------------------------
   Terms & Conditions - a clause's body in Quill (crm/06 §4). The theme styles the toolbar and the container for both
   colour modes; this gives the editor room to write a clause in and the bottom corners its own radius.
   -------------------------------------------------------------------------- */
.aira-terms-clause .ql-container.ql-snow {
    border: 1px solid var(--ins-border-color);
    border-top: 0;
    border-radius: 0 0 var(--ins-border-radius) var(--ins-border-radius);
}

.aira-terms-clause .ql-editor { min-height: 6rem; }

/* --------------------------------------------------------------------------
   A quotation's items (crm/09 §5). The card's chevron turns as its sizes open; the eye beside the product code opens Item
   details (crm/56). Wording for this quotation only (crm/26 §6) is drawn by class - bold, italic, underline, and one class
   per colour of the print's two fixed lists - so a posted range can never paint anything the editor does not offer. The
   colours are the print's own, not the brand's: a quotation prints the same whoever's theme it was formatted in.
   -------------------------------------------------------------------------- */
.aira-collapse-toggle:not(.collapsed) svg { transform: rotate(90deg); }

.aira-item-details-eye { padding: 0 .25rem; line-height: 1; vertical-align: -.125rem; color: var(--ins-primary); }

/* ---- Item details (crm/56 D4-D5) --------------------------------------------------------------------------------------
   The card's eye: the product, then each title and each quoted variance as the features dialog's tables, a Status column, and
   every row coloured by where its words come from - an edge and a faint tint per state, a badge saying it, the legend naming
   only what the item has. The print's own red stays on words written for this quotation, so this never contradicts the PDF. */
.aira-item-details-product { margin-bottom: .75rem; }
.aira-item-details-chain { font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ins-secondary-color); }
.aira-item-details-description { margin-top: .375rem; padding-left: .5rem; border-left: 2px solid var(--ins-border-color); font-size: .8125rem; font-style: italic; color: var(--ins-secondary-color); }
/* Both names of a renamed item (crm/83 §2.2): this quotation's, which prints, then the product master's. */
.aira-item-details-names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .25rem 1rem; margin: .5rem 0 0; font-size: .8125rem; }
.aira-item-details-names dt { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--ins-secondary-color); }
.aira-item-details-names dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .aira-item-details-names { grid-template-columns: minmax(0, 1fr); } }
.aira-item-details-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem 1.25rem;
    margin-bottom: 1rem;
    padding: .5rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
    font-size: .75rem;
    color: var(--ins-body-color);
}
.aira-item-details-key { display: inline-flex; align-items: center; gap: .375rem; }
.aira-item-details-same { color: var(--ins-secondary-color); }
.aira-item-details-swatch { display: inline-block; width: .875rem; height: .875rem; border: 1px solid var(--ins-border-color); border-left-width: 3px; border-radius: 2px; background: var(--ins-body-bg); }
.aira-item-details-swatch.is-edited { border-left-color: var(--ins-warning); background: rgba(var(--ins-warning-rgb), .14); }
.aira-item-details-swatch.is-added { border-left-color: var(--ins-success); background: rgba(var(--ins-success-rgb), .14); }
.aira-item-details-swatch.is-formatted { border-left-color: var(--ins-info); background: rgba(var(--ins-info-rgb), .1); }
.aira-item-details-swatch.is-removed { border-left-color: var(--ins-secondary); background: var(--ins-tertiary-bg); }
.aira-item-details-heading {
    margin: 0 0 .5rem;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}
.aira-item-details-group + .aira-item-details-heading { margin-top: 1.25rem; }
.aira-item-details-sizes { font-size: .75rem; color: var(--ins-secondary-color); }
.aira-item-details-col-status { width: 1%; white-space: nowrap; text-align: right; }
.aira-item-details-col-status .badge + .badge { margin-left: .25rem; }
.aira-item-details-words { overflow-wrap: anywhere; }
.aira-item-details-was { margin-top: .125rem; font-size: .6875rem; color: var(--ins-secondary-color); overflow-wrap: anywhere; }
.aira-item-details-table > tbody > tr.is-edited > td { background-color: rgba(var(--ins-warning-rgb), .07); }
.aira-item-details-table > tbody > tr.is-added > td { background-color: rgba(var(--ins-success-rgb), .07); }
.aira-item-details-table > tbody > tr.is-removed > td { background-color: var(--ins-tertiary-bg); }
.aira-item-details-table > tbody > tr.is-edited > td:first-child { box-shadow: inset 3px 0 0 var(--ins-warning); }
.aira-item-details-table > tbody > tr.is-added > td:first-child { box-shadow: inset 3px 0 0 var(--ins-success); }
.aira-item-details-table > tbody > tr.is-formatted > td:first-child { box-shadow: inset 3px 0 0 var(--ins-info); }
.aira-item-details-table > tbody > tr.is-removed > td:first-child { box-shadow: inset 3px 0 0 var(--ins-secondary); }
.aira-item-details-table > tbody > tr.is-removed > td.aira-features-name,
.aira-item-details-table > tbody > tr.is-removed > td.aira-item-details-words { color: var(--ins-secondary-color); text-decoration: line-through; opacity: .75; }

/* ---- Features for this quotation (crm/55 FT6, §14) -------------------------------------------------------------------
   The item dialog's section (crm/56 D1) - what was done, counted, and Edit features - and the dialog stacked over it (Views/Quotations/_FeaturesDialog, pages/quotation-features.js): one bordered table per title and per chosen
   variance, as the print reads in Preview; in Edit every row its grip, its two cells and its actions, one toolbar under the
   head. Every colour a token but the print's own palette. */
.aira-item-features {
    padding: .75rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}
.aira-item-features.is-invalid { border-color: var(--ins-danger); }
.aira-item-features-head { display: flex; align-items: center; gap: .625rem; }

/* A field's label with a small action beside it - the size row's variance and its features icon. */
/* The label's own margin below (the compiled $form-label-margin-bottom), moved to the row that holds it. */
.aira-label-row { display: flex; align-items: center; gap: .25rem; margin-bottom: .25rem; }
.aira-label-row > .form-label { margin-bottom: 0; }
.aira-size-features { margin-left: auto; padding: 0 .25rem; line-height: 1; color: var(--ins-primary); }
.aira-size-features:disabled { color: var(--ins-secondary-color); opacity: .55; }

.aira-features-dialog .modal-content { max-height: calc(100vh - 3.5rem); }
.aira-features-header { flex-wrap: wrap; gap: .5rem .75rem; padding-top: .75rem; padding-bottom: .75rem; }
.aira-features-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* One toolbar while editing - it formats the description the cursor is in, its hint saying why when it cannot. */
.aira-features-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem .75rem;
    padding: .375rem 1.25rem;
    border-bottom: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
}
.aira-features-toolbar .btn-group .btn.active { color: var(--ins-primary); background-color: rgba(var(--ins-primary-rgb), .14); }
.aira-features-toolbar-hint { flex: 1 1 14rem; min-width: 0; font-size: .75rem; text-align: right; color: var(--ins-secondary-color); }
.aira-features-palette { display: inline-flex; align-items: center; gap: .25rem; }
.aira-features-palette-label { margin-right: .125rem; font-size: .6875rem; font-weight: 600; text-transform: uppercase; color: var(--ins-secondary-color); }
.aira-features-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--ins-border-color);
    border-radius: 50%;
    background: var(--ins-body-bg);
    --aira-focus-ring-offset: 1px;
}
.aira-features-swatch:hover:not(:disabled) { border-color: var(--ins-secondary-color); }
.aira-features-swatch:disabled { opacity: .4; }
.aira-features-swatch.is-on { border-color: var(--ins-primary); box-shadow: 0 0 0 2px rgba(var(--ins-primary-rgb), .35); }
.aira-features-swatch-dot { display: block; width: .875rem; height: .875rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
.aira-w-dot-0070c0 { background-color: #0070C0; }
.aira-w-dot-00812e { background-color: #00812E; }
.aira-w-dot-b45309 { background-color: #B45309; }
.aira-w-dot-6d28d9 { background-color: #6D28D9; }
.aira-w-dot-111827 { background-color: #111827; }

.aira-features-body { padding: .875rem 1.25rem; }

/* A title or a variance - a band naming it over a bordered table, as the live Item Details draws one. */
.aira-features-group {
    margin-bottom: .75rem;
    overflow: hidden;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}
.aira-features-group:last-child { margin-bottom: 0; }
.aira-features-group.is-lit { box-shadow: 0 0 0 .2rem rgba(var(--ins-primary-rgb), .35); }
.aira-features-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    padding: .4375rem .75rem;
    border-bottom: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
}
.aira-features-kind { font-size: .625rem; }
.aira-features-group-title { margin: 0; min-width: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ins-emphasis-color); overflow-wrap: anywhere; }
.aira-features-group-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-left: auto; font-size: .75rem; color: var(--ins-secondary-color); }
.aira-features-group-changed { font-weight: 600; color: var(--ins-primary); }
.aira-features-reset { font-size: .75rem; }
.aira-features-group-foot { padding: .3125rem .75rem; border-top: 1px solid var(--ins-border-color); }

/* A table folds shut from its head (crm/64 AF2): the head is the button, its chevron the sign. A folded table is its head alone -
   kind, code, product, how many features and how many changed - so the operator sees what each holds without opening it. */
.aira-features-group-head { cursor: pointer; }
.aira-features-toggle { flex: none; width: 1.5rem; height: 1.5rem; padding: 0; color: var(--ins-secondary-color); }
.aira-features-group-head:hover .aira-features-toggle { color: var(--ins-primary); }
.aira-features-group.is-collapsed > .aira-features-group-head { border-bottom: 0; }
.aira-features-subtitle { min-width: 0; font-size: .75rem; color: var(--ins-secondary-color); overflow-wrap: anywhere; }

/* An accessory's table wears the warning colour at its left, so it never reads as the product's own (AF1). */
.aira-features-group.is-accessory { border-left: 3px solid var(--ins-warning); }

/* The heading that names a part of the dialog - Product, Accessories (n). */
.aira-features-part {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .5rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--ins-border-color);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}
.aira-features-group + .aira-features-part { margin-top: 1rem; }

.aira-features-table { font-size: .8125rem; }
.aira-features-table > thead > tr > * {
    padding: .375rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-emphasis-color);
    background: var(--ins-body-bg);
}
.aira-features-table > tbody > tr > td { padding: .3125rem .75rem; vertical-align: top; }
.aira-features-table > tbody > tr:last-child > td { border-bottom-width: 0; }
.aira-features-col-name { width: 32%; }
.aira-features-col-grip { width: 1.75rem; }
.aira-features-col-actions { width: 1%; }
.aira-features-name { font-weight: 500; color: var(--ins-emphasis-color); overflow-wrap: anywhere; }
.aira-features-table .aira-features-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.aira-features-none > td { font-size: .8125rem; color: var(--ins-secondary-color); }

/* Edit - every row its cells: plain text until pointed at, a field when it has the cursor; a changed row marked at its edge. */
.aira-features-table.is-editing > tbody > tr > td { padding: .25rem .375rem; }
.aira-features-table.is-editing > tbody > tr.aira-features-row:hover > td { background-color: rgba(var(--ins-primary-rgb), .03); }
.aira-features-table.is-editing > tbody > tr.is-changed > td:first-child { box-shadow: inset 3px 0 0 var(--ins-primary); }
.aira-features-table.is-editing > tbody > tr.is-added > td:first-child { box-shadow: inset 3px 0 0 var(--ins-success); }
.aira-features-field {
    display: block;
    width: 100%;
    min-height: 1.875rem;
    padding: .25rem .5rem;
    font: inherit;
    line-height: 1.5;
    color: var(--ins-body-color);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ins-border-radius-sm);
}
input.aira-features-field { font-weight: 500; color: var(--ins-emphasis-color); }
.aira-features-field:hover { border-color: var(--ins-border-color); background: var(--ins-body-bg); }
/* A field: the glow of every other field in the product, never a ring of its own (hard rule 10c). */
.aira-features-field:focus {
    outline: 0;
    border-color: rgba(var(--ins-primary-rgb), .6);
    background: var(--ins-body-bg);
    box-shadow: 0 0 0 .15rem rgba(var(--ins-primary-rgb), .15);
}
.aira-features-field.is-invalid { border-color: var(--ins-danger); background: rgba(var(--ins-danger-rgb), .04); }
.aira-features-field.aira-wording-override { color: #C00000; }
.aira-features-field::placeholder { font-style: normal; color: var(--ins-secondary-color); opacity: .7; }
.aira-features-editable { white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.aira-features-editable:empty::before { content: attr(data-placeholder); font-style: normal; color: var(--ins-secondary-color); opacity: .7; pointer-events: none; }
.aira-features-was { margin: .125rem .5rem 0; font-size: .6875rem; white-space: normal; color: var(--ins-secondary-color); overflow-wrap: anywhere; }

.aira-features-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.875rem;
    border-radius: var(--ins-border-radius-sm);
    color: var(--ins-secondary-color);
    cursor: grab;
    opacity: .55;
}
.aira-features-row:hover .aira-features-grip,
.aira-features-grip:focus-visible { opacity: 1; }
.aira-features-grip:hover { color: var(--ins-emphasis-color); background: var(--ins-tertiary-bg); }
.aira-features-grip:active { cursor: grabbing; }
.aira-features-buttons { display: flex; justify-content: flex-end; gap: .125rem; white-space: nowrap; }

/* A master feature removed from this quotation - kept in its place, struck, until it is put back. */
.aira-features-table.is-editing > tbody > tr.is-hidden > td { background-color: var(--ins-tertiary-bg); }
.aira-features-struck { display: block; padding: .25rem .5rem; white-space: pre-wrap; color: var(--ins-secondary-color); text-decoration: line-through; opacity: .7; }

/* A row in flight: hidden where it was, a gap of its height where it would land, and nothing under it taking the drop. */
.aira-features-row.is-drag-source { display: none; }
.aira-features-slot > td { padding: 0; background-color: rgba(var(--ins-primary-rgb), .06); box-shadow: inset 0 0 0 1px rgba(var(--ins-primary-rgb), .45); }
.is-dragging .aira-features-field { pointer-events: none; }
.aira-features-drag-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem .75rem .375rem .25rem;
    font-size: .8125rem;
    color: var(--ins-body-color);
    background: var(--ins-body-bg);
    border: 1px solid rgba(var(--ins-primary-rgb), .45);
    border-radius: var(--ins-border-radius);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
}
.aira-features-drag-preview > .aira-features-grip { opacity: 1; }
.aira-features-drag-preview > strong { flex: 0 0 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ins-emphasis-color); }
.aira-features-drag-preview > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ins-secondary-color); }

.aira-features-legend { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .75rem; color: var(--ins-secondary-color); }
.aira-features-legend-sample {
    flex: 0 0 auto;
    padding: 0 .375rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-sm);
    background: var(--ins-body-bg);
    font-weight: 600;
}
.aira-features-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2rem 1rem;
    font-size: .875rem;
    color: var(--ins-secondary-color);
}

@media (max-width: 767.98px) {
    .aira-features-body { padding: .625rem; }
    .aira-features-toolbar { padding: .375rem .625rem; }
    .aira-features-toolbar-hint { text-align: left; }
    .aira-features-col-name { width: 38%; }
}

/* A terms set edited for this quotation (crm/55 FT10) - the note that the master set stays as it is. */
.aira-term-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .375rem .625rem;
    border-radius: var(--ins-border-radius);
    background: rgba(var(--ins-info-rgb), .1);
    color: var(--ins-info-text-emphasis);
    font-size: .8125rem;
}

.aira-w-b { font-weight: 700; }
.aira-w-i { font-style: italic; }
.aira-w-u { text-decoration: underline; }
.aira-w-c-0070c0 { color: #0070C0; }
.aira-w-c-00812e { color: #00812E; }
.aira-w-c-b45309 { color: #B45309; }
.aira-w-c-6d28d9 { color: #6D28D9; }
.aira-w-c-111827 { color: #111827; }
.aira-w-bg-fff3a3, .aira-w-bg-c8e6c9, .aira-w-bg-bbdefb, .aira-w-bg-ffcdd2, .aira-w-bg-e1bee7, .aira-w-bg-ffe0b2 {
    color: #111827;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.aira-w-bg-fff3a3 { background-color: #FFF3A3; }
.aira-w-bg-c8e6c9 { background-color: #C8E6C9; }
.aira-w-bg-bbdefb { background-color: #BBDEFB; }
.aira-w-bg-ffcdd2 { background-color: #FFCDD2; }
.aira-w-bg-e1bee7 { background-color: #E1BEE7; }
.aira-w-bg-ffe0b2 { background-color: #FFE0B2; }
.aira-wording-override { font-style: italic; color: #C00000; }

/* Black text on the dark theme's ground would vanish on screen - it reads in the body colour there; the print is untouched. */
html[data-bs-theme="dark"] .aira-w-c-111827 { color: var(--ins-body-color); }

/* The charges section's totals (crm/09 §6) - label and amount in two columns, the grand total set apart; and a terms set or
   a clause switched off (kept on the quotation, left out of the print - crm/09 §8), drawn quieter than what prints. */
.aira-quotation-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .25rem 1rem;
    font-size: .875rem;
}
.aira-quotation-totals dt { font-weight: 400; color: var(--ins-secondary-color); }
.aira-quotation-totals dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.aira-quotation-totals .aira-quotation-grand {
    padding-top: .375rem;
    border-top: 1px solid var(--ins-border-color);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ins-body-color);
}
.aira-term-off { opacity: .65; }
.aira-quotation-clauses { font-size: .8125rem; }
.aira-quotation-clauses > li + li { margin-top: .5rem; }
.aira-quotation-clause-body > :last-child { margin-bottom: 0; }

/* The item sheet's refusals (crm/13 §4) - one line a row, scrolled inside the dialog rather than stretching it. */
.aira-import-messages { max-height: 16rem; overflow-y: auto; }
.aira-import-messages > li + li { margin-top: .25rem; }

/* ==========================================================================
   The Party Account dialog (crm/28 §3) - 90% of the screen, tabs on the left, the change history on the right, the
   footer always in view. The body is a column of three: the head, the work (the tab's pane scrolls on its own, as
   does the history), the footer. Below 1200px the history goes under the work and the whole middle scrolls.
   ========================================================================== */
/* modal-record: the same frame for any record edited in one dialog - the Product Master's (crm/32 §5.1). */
.modal-dialog.modal-party,
.modal-dialog.modal-record {
    width: 90vw;
    max-width: 90vw;
}

.modal-party .modal-content,
.modal-record .modal-content { height: 90vh; }

.modal-party .modal-body,
.modal-record .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.party-dialog {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.party-dialog-head {
    flex: 0 0 auto;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.party-dialog-main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.party-dialog-work {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.party-tabs {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    padding: .25rem 1.25rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.party-tabs .nav-link {
    position: relative;
    white-space: nowrap;
}

/* ---- A tab strip whose chosen tab carries the brand (crm/30 R1; ubold-ui.md *Tabs*) ----------------------------
   On any `nav nav-tabs`. The theme draws its chosen tab as a folder - the card's own white, a grey hairline - which in
   a white dialog tells it apart from its neighbours by almost nothing. Here it is the brand: its words, icon and count
   in the primary colour, the colour's subtle tint behind, and a bar of it on the strip's rule.

   The theme's own tab variables, not overridden properties, so Bootstrap's states stay its own; every colour a token,
   never a hex - the brand is a runtime setting (branding.md), and a colour saved in Settings re-colours the chosen tab
   with no rebuild. The bar is a ::after INSIDE the tab and the focus ring is pulled in: a strip that scrolls sideways
   (.party-tabs) clips anything drawn outside a tab. The ring itself is aira.css's one rule (hard rule 10c). */
.aira-tabs {
    --ins-nav-tabs-link-active-color: var(--ins-primary);
    --ins-nav-tabs-link-active-bg: var(--ins-primary-bg-subtle);
    --ins-nav-tabs-link-active-border-color: transparent;
    --ins-nav-tabs-link-hover-border-color: transparent;
    --aira-tab-ink: var(--ins-primary);
    gap: .125rem;
}

/* The brand itself is too dark to read on the dark ground; its lifted tint is the readable one. */
html[data-bs-theme="dark"] .aira-tabs {
    --ins-nav-tabs-link-active-color: var(--ins-primary-text-emphasis);
    --aira-tab-ink: var(--ins-primary-text-emphasis);
}

.aira-tabs .nav-link {
    position: relative;
    font-weight: 500;
    --aira-focus-ring-offset: -2px;
}

.aira-tabs .nav-link:not(.active):hover {
    color: var(--aira-tab-ink);
    background-color: rgba(var(--ins-primary-rgb), .06);
}

.aira-tabs .nav-link::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background-color: var(--ins-primary);
    transform: scaleX(0);
    pointer-events: none;
}

.aira-tabs .nav-link.active::after { transform: scaleX(1); }

/* A tab's count: its own colours, because the theme's bg-light / text-body are !important and no chosen-tab rule
   could ever have coloured them. */
.aira-tabs .aira-tab-count {
    background-color: var(--ins-tertiary-bg);
    color: var(--ins-body-color);
}

.aira-tabs .nav-link.active .aira-tab-count {
    background-color: var(--ins-primary);
    color: var(--aira-brand-contrast);
}

/* A tab holding a refusal after a save - the eye goes to it before the pane is opened. */
.party-tab-flag {
    position: absolute;
    top: .4rem;
    right: .3rem;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--ins-danger);
}

.party-dialog-panes {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem;
    overflow-y: auto;
}

/* The change history docked beside the work (crm/29 C2), as a timeline (crm/31 H2): a third of the dialog's middle by
   default - 22rem to 40rem - and its left edge a separator that widens or narrows it (aira-history.js, remembered). The
   column does not scroll: its head and its chips stay put, and only the timeline under them scrolls. */
.party-dialog-history {
    position: relative;
    display: flex;
    flex: 0 0 var(--aira-history-width, clamp(22rem, 30%, 40rem));
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: .75rem;
    overflow: hidden;
    border-left: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
}

.party-dialog-history .card {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
}

.party-dialog-history .aira-history-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.party-dialog-history .aira-history-body[hidden] { display: none; }

.party-dialog-history .aira-history-chips { padding: .75rem 1rem .5rem; }

/* No top padding: a sticky day heading sticks at the padding's edge, and the saves would show through the gap above it. */
.party-dialog-history .aira-history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 1rem 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* The column's edge - a thin hit area over its left rule, a brand line while it is hovered, focused or dragged. */
.aira-history-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: .5rem;
    cursor: col-resize;
    touch-action: none;
    --aira-focus-ring-offset: -2px;
}

.aira-history-resizer::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    width: 3px;
    content: "";
    background: transparent;
}

.aira-history-resizer:hover::after,
.aira-history-resizer:focus-visible::after,
.party-dialog-history.is-resizing .aira-history-resizer::after { background: var(--ins-primary); }

.party-dialog-history.is-resizing { user-select: none; }
.party-dialog-history.is-collapsed .aira-history-resizer { display: none; }

/* The history folded (crm/31 H1): the column is the strip - no card inside it, nothing that can run past its edges. The
   open button, the number of changes and a vertical HISTORY, and the whole strip one target: the toggle's ::after
   stretched over it. A new party has no column at all. */

.party-dialog-history.is-collapsed {
    flex-basis: 3rem;
    padding: 0;
}

.party-dialog-history.is-collapsed:hover { background: color-mix(in srgb, var(--ins-primary) 6%, var(--ins-tertiary-bg)); }

.party-dialog-history.is-collapsed .aira-history-rail {
    position: relative;
    height: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.party-dialog-history.is-collapsed .aira-history-head {
    flex-direction: column;
    align-items: center;
    gap: .625rem;
    height: 100%;
    min-height: 0;
    padding: .75rem 0;
    overflow: hidden;
    border-bottom: 0 !important;
    background: transparent;
}

.party-dialog-history.is-collapsed .aira-history-title {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}

.party-dialog-history.is-collapsed .aira-history-icon { order: 1; }
.party-dialog-history.is-collapsed .aira-history-count { order: 2; }
.party-dialog-history.is-collapsed .aira-history-title { order: 3; }

.party-dialog-history.is-collapsed [data-history-toggle] { position: static; order: 0; }
.party-dialog-history.is-collapsed [data-history-toggle]::after {
    position: absolute;
    inset: 0;
    content: "";
}

.aira-history-rail.is-docked .aira-history-when-closed,
.aira-history-rail.is-docked.is-collapsed .aira-history-when-open { display: none; }
.aira-history-rail.is-docked.is-collapsed .aira-history-when-closed { display: inline-block; }

/* ---- The rail's own parts, docked or on a record page (crm/31 H2) ---------------------------------------------- */
.aira-history-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-top: .625rem;
    padding-bottom: .625rem;
}

.aira-history-icon { flex: none; width: 1rem; height: 1rem; color: var(--ins-secondary-color); }
.aira-history-title { flex: 1 1 auto; min-width: 0; }

.aira-history-count {
    flex: none;
    min-width: 1.5rem;
    padding: .125rem .4375rem;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--ins-primary-text-emphasis);
    background: var(--ins-primary-bg-subtle);
    border-radius: 999px;
}

.aira-history-toggle { flex: none; }

/* A record page's rail folds to its bar (crm/48 H1): one horizontal line - the icon, History, the count and the chevron -
   and the whole bar is the button, the toggle's ::after stretched over it as the docked strip's. The chevron points the
   way the rail will go: down while folded, up while open. */
.aira-history-rail:not(.is-docked):not(.is-collapsed) .aira-history-chevron { transform: rotate(180deg); }

.aira-history-rail.is-collapsed:not(.is-docked) { position: relative; }
.aira-history-rail.is-collapsed:not(.is-docked) .aira-history-head { border-bottom: 0 !important; }
.aira-history-rail.is-collapsed:not(.is-docked) [data-history-toggle] { position: static; }

.aira-history-rail.is-collapsed:not(.is-docked) [data-history-toggle]::after {
    position: absolute;
    inset: 0;
    content: "";
    border-radius: inherit;
}

.aira-history-rail.is-collapsed:not(.is-docked):hover { background: color-mix(in srgb, var(--ins-primary) 5%, var(--ins-secondary-bg)); }
.aira-history-rail.is-collapsed:not(.is-docked):hover .aira-history-title { color: var(--ins-primary-text-emphasis); }

.aira-history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    padding-bottom: .5rem;
}

.aira-history-chips:empty { display: none; }

/* On a record page the timeline scrolls inside its card, never stretching the page beside it. */
.aira-history-rail:not(.is-docked) .aira-history-scroll {
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.aira-history-rail { container-type: inline-size; }

.aira-history-empty {
    margin: .5rem 0 0;
    padding: 1.25rem 1rem;
    font-size: .8125rem;
    text-align: center;
    color: var(--ins-secondary-color);
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

/* The timeline's rail is drawn only under days; an empty list or one still loading has none. */
.aira-history-list:not(:has(.tl-day))::before { display: none; }

/* What each save did, as its marker's colour - theme tokens only, so dark mode and the brand follow by themselves. */
.aira-history-item { --tl-color: var(--ins-primary); }
.aira-history-item.is-created,
.aira-history-item.is-added { --tl-color: var(--ins-success); }
.aira-history-item.is-removed { --tl-color: var(--ins-danger); }
.aira-history-item.is-status { --tl-color: var(--ins-warning); }
.aira-history-item.is-files { --tl-color: var(--ins-info); }
.aira-history-item.is-request { --tl-color: var(--ins-indigo); }

/* ---- An entry (crm/54 H3) - read top down as an audit row: WHAT happened (the title and the row it was about), WHO and how
   long ago, WHEN exactly (the date over the time, at the right), WHERE IT CAME FROM on its own line, then the fields. The
   research behind it (54 §3): a specific action as the title, never a bare "Updated"; the actor and an exact stamp always in
   view; before -> after for a change; the context a change came from shown; days as headings that stay put. ---- */
.aira-history-list.tl::before { left: calc(.75rem - 1px); }

.aira-history-item {
    grid-template-columns: 1.5rem minmax(0, 1fr);
    column-gap: .625rem;
    padding-bottom: .75rem;
}

.aira-history-item .tl-marker {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .5rem;
    box-shadow: 0 0 0 3px var(--ins-secondary-bg);
}

.aira-history-item .tl-marker svg { width: .8125rem; height: .8125rem; }

.aira-hx-card { padding: .625rem .75rem .6875rem; }

/* The head: the title and the who-line on the left, the stamp spanning both at the right. */
.aira-hx-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "what when" "who when";
    gap: .1875rem .75rem;
    align-items: start;
}

.aira-hx-title {
    grid-area: what;
    padding-top: 0;
    gap: .25rem .375rem;
    line-height: 1.45;
}

.aira-hx-what {
    font-weight: 600;
    color: var(--ins-emphasis-color);
    overflow-wrap: anywhere;
}

/* The row the save was about - a contact, a location, an item - as a pill after the title; whole, never cut. */
.aira-history-subject {
    max-width: 100%;
    padding: 0 .5rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ins-body-color);
    overflow-wrap: anywhere;
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
}

.aira-history-when {
    grid-area: when;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: .0625rem;
    font-size: .75rem;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.aira-history-when .aira-stamp-day { font-weight: 600; color: var(--ins-body-color); }
.aira-history-when .aira-stamp-time { font-size: .6875rem; color: var(--ins-secondary-color); }

.aira-hx-who {
    grid-area: who;
    min-width: 0;
    margin: 0;
    gap: .25rem .375rem;
    line-height: 1.4;
}

.aira-hx-who .tl-avatar { width: 1.25rem; height: 1.25rem; font-size: .5625rem; }
.aira-hx-who .tl-avatar svg { width: .75rem; height: .75rem; }
.aira-hx-who .tl-actor { font-weight: 600; color: var(--ins-body-color); }
.aira-hx-who .badge { font-size: .625rem; }
.aira-hx-dot { color: var(--ins-secondary-color); }
.aira-hx-tag { font-style: italic; }

/* Where it came from - a revision's source, an amendment's original, a reason, an import's run: its own line, whole. A
   creation's origin wears the marker's colour; any other note is quiet. */
.aira-hx-note {
    display: flex;
    align-items: flex-start;
    gap: .4375rem;
    margin: .5rem 0 0;
    padding: .375rem .5625rem;
    font-size: .75rem;
    line-height: 1.5;
    color: var(--ins-body-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--ins-tertiary-bg);
    border-radius: var(--ins-border-radius);
}

.aira-hx-note svg { flex: none; width: .875rem; height: .875rem; margin-top: .125rem; color: var(--ins-secondary-color); }
.aira-hx-note.is-origin { font-weight: 500; background: color-mix(in srgb, var(--tl-color) 10%, var(--ins-secondary-bg)); }
.aira-hx-note.is-origin svg { color: var(--tl-color); }

.aira-hx-body { margin: .5rem 0 0; }

/* The fields - a quiet list, the label then its values, a dashed hairline between, no box and no ground band. A change is
   before (struck) -> after; a creation's or an added row's values are plain: nothing stood before them. */
.aira-history-diff {
    grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
    font-size: .8125rem;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.aira-history-diff dt,
.aira-history-diff dd {
    padding: .3125rem 0;
    border-top: 1px dashed var(--ins-border-color);
}

.aira-history-diff dt {
    padding-right: .75rem;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ins-secondary-color);
    background: none;
}

.aira-history-diff dd { gap: .1875rem .375rem; }
.aira-history-diff .tl-val { padding: 0 .3125rem; border-radius: .1875rem; }
.aira-history-diff .tl-val.is-new { font-weight: 600; }
.aira-history-diff .tl-val.is-value { padding: 0; color: var(--ins-body-color); white-space: pre-wrap; overflow-wrap: anywhere; }
.aira-history-diff .tl-val.is-blank { padding: 0; }
.aira-history-diff .tl-arrow { flex: none; width: .75rem; height: .75rem; color: var(--ins-secondary-color); }

.aira-history-item .tl-more {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-top: .375rem;
}

.aira-history-item .tl-more svg { width: .875rem; height: .875rem; }

/* A day is a heading that stays at the top of the timeline while its saves scroll under it - the date is always in view. */
.aira-history-list .tl-day-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: .375rem;
    margin: 0 0 .5rem;
    padding: .375rem 0;
    letter-spacing: .06em;
    color: var(--ins-emphasis-color);
    background: var(--ins-secondary-bg);
    border: 0;
    border-radius: 0;
}

.aira-history-list .tl-day-head::after {
    flex: 1 1 auto;
    align-self: center;
    height: 1px;
    content: "";
    background: var(--ins-border-color);
}

/* A file as a tile - the attachments' own (.attach-tile), its thumbnail opening the file viewer. */
.aira-history-files {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aira-history-file { padding: .375rem .5rem; }
.aira-history-file .attach-meta { flex-wrap: wrap; white-space: normal; }

.aira-history-file-state { font-weight: 600; }
.aira-history-file-state.is-kept { color: var(--ins-success-text-emphasis); }
.aira-history-file-state.is-removed { color: var(--ins-danger-text-emphasis); }
.aira-history-file-state.is-gone { font-weight: 400; font-style: italic; }

/* A removed file is still a file: dimmed, never struck - it opens like any other. */
.aira-history-file.is-removed { border-style: dashed; background: var(--ins-tertiary-bg); }
.aira-history-file.is-removed .attach-thumb { opacity: .75; filter: grayscale(.6); }

/* A tile with nothing to open - no right to the category, or a row older than the files it names: its kind as an icon. */
.attach-thumb.is-unlinked {
    color: var(--ins-secondary-color);
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
}

.attach-thumb.is-unlinked svg { width: 1.125rem; height: 1.125rem; }

.attach-thumb.is-word { background: #2b579a; }
.attach-thumb.is-excel { background: #217346; }

/* A narrow rail - a record page's side column at a laptop's width, the docked column at its narrowest, a phone (crm/48 H2,
   crm/54 H3). Beside the stamp the title had a few words' width, so the stamp leaves the title's side for its own line under
   the who-line - date and time on one line - and the title owns the card's width. Narrower still, a field's label sits over
   its values. */
@container (max-width: 24rem) {
    .aira-hx-head {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "what" "who" "when";
    }

    .aira-history-when {
        flex-direction: row;
        align-items: baseline;
        gap: .375rem;
        padding-top: 0;
        text-align: start;
    }

    .aira-history-when .aira-stamp-day { font-weight: 500; }
    .aira-history-when .aira-stamp-time { font-size: .75rem; }
}

@container (max-width: 20rem) {
    .aira-history-diff { grid-template-columns: minmax(0, 1fr); }
    .aira-history-diff dt { padding-bottom: 0; }
    .aira-history-diff dd { padding-top: .125rem; border-top: 0; }
}

.party-dialog-foot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--ins-border-color);
    background: var(--ins-secondary-bg);
}

.party-pane-title {
    margin-bottom: .75rem;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--aira-ink);
}

.party-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.party-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* An imported party's gap (P18) - amber until it is filled, never red: nothing refuses it. */
.form-control.is-missing,
.form-select.is-missing { border-color: var(--ins-warning); }

.party-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.party-toolbar .form-select-sm { width: auto; min-width: 9rem; }

.party-toolbar-search { width: 17rem; max-width: 100%; }

.party-table-wrap {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.party-table td { vertical-align: top; }

.party-cell-wrap {
    max-width: 18rem;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.party-row-removed td { opacity: .55; text-decoration: line-through; }
.party-row-removed td:last-child { opacity: 1; text-decoration: none; }
.party-row-error td { background: color-mix(in srgb, var(--ins-danger) 6%, transparent); }

.party-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--aira-muted);
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.party-editor { border-color: color-mix(in srgb, var(--ins-primary) 35%, var(--ins-border-color)); }

.party-team {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: .5rem;
}

.party-member {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    padding: .5rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

.party-member.is-inactive { opacity: .7; }

.party-member-avatar {
    display: inline-flex;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ins-primary);
    border-radius: 50%;
    background: color-mix(in srgb, var(--ins-primary) 14%, transparent);
}

.party-member-text { flex: 1 1 auto; min-width: 0; }

.party-gst { padding-right: 2.25rem; }

.party-gst-state {
    position: absolute;
    top: 50%;
    right: .625rem;
    display: inline-flex;
    transform: translateY(-50%);
    pointer-events: none;
}

.party-gst-state.is-good { color: var(--ins-success); }
.party-gst-state.is-bad { color: var(--ins-danger); }

/* A party's tag, the software's (crm/103): read-only in the Details as tall as the fields beside it (form-control-plaintext's
   padding), and a smaller chip on a register row, where it sits beside the party's code. */
.party-tier-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem .5rem;
}

.stage-chip.party-tier-chip {
    padding: 0 .45rem;
    font-size: .6875rem;
    vertical-align: middle;
}

/* The number's country beside the number - the enhanced select takes a fixed share of the group, the number the
   rest; a refusal wraps to its own line under both rather than taking a share of the row. */
.party-phone > .aira-sel { flex: 0 0 9.5rem; min-width: 0; }
.party-phone > .aira-sel .aira-sel-trigger { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.party-phone > .form-control { flex: 1 1 0; min-width: 7rem; }
.party-phone > .invalid-feedback { flex: 0 0 100%; }

.aira-suggest-body { min-width: 0; }

.aira-suggest-detail {
    font-size: .75rem;
    color: var(--aira-muted);
    white-space: normal;
}

.btn.is-busy { opacity: .75; pointer-events: none; }

@media (max-width: 1199.98px) {
    .party-dialog-main { flex-direction: column; overflow-y: auto; }
    .party-dialog-work { min-height: auto; }
    .party-dialog-panes { overflow: visible; }
    .aira-history-resizer { display: none; }

    /* A frame with a docked history keeps it at its right (crm/54 N3) - under the work it was a screen's scroll away, and on
       a laptop a party's history was simply not in view. Folded, the 3rem strip as at full width; open, over the work's right
       edge rather than beside it, its own button or a click on the work putting it away (aira-history.js). */
    .party-dialog-main:has(> .party-dialog-history) {
        position: relative;
        flex-direction: row;
        overflow: hidden;
    }

    .party-dialog-main:has(> .party-dialog-history) > .party-dialog-work { min-height: 0; }
    .party-dialog-main:has(> .party-dialog-history) .party-dialog-panes { overflow-y: auto; }

    .party-dialog-history:not(.is-collapsed) {
        position: absolute;
        z-index: 5;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(26rem, calc(100% - 3rem));
        box-shadow: -.75rem 0 2rem rgba(0, 0, 0, .18);
    }
}

@media (max-width: 767.98px) {
    .modal-dialog.modal-party,
    .modal-dialog.modal-record { width: auto; max-width: none; margin: .5rem; }
    .modal-party .modal-content,
    .modal-record .modal-content { height: calc(100vh - 1rem); }
    .party-dialog-panes { padding: 1rem; }
}

/* ==========================================================================
   The Product Master dialog (crm/32 §5) - the party dialog's frame (.party-dialog*, crm/32 §14) with the product's own
   pieces: its information above the tabs, and its titles and variances as cards that open to the print's two-column
   grid, edited one at a time in an editor at the top of their tab. Theme tokens only - the brand is a runtime setting.
   ========================================================================== */
.product-info {
    flex: 0 0 auto;
    padding: 1rem 1.25rem 1.125rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.product-tabs { padding-top: .5rem; }

/* A window up to 1000px tall - a laptop, or 1080p with the browser's own bars: the information scrolls away with the
   lists rather than leave them a sliver, and the tab strip stays at the top of the column (crm/32 §5.1). */
@media (max-height: 1000px) and (min-width: 1200px) {
    .product-work { overflow-y: auto; }
    .product-work .party-dialog-panes { flex: 0 0 auto; overflow: visible; }
    .product-work .product-tabs {
        position: sticky;
        top: 0;
        z-index: 3;
        background: var(--ins-secondary-bg);
    }
}

.product-pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.product-toolbar { margin-bottom: .75rem; }
.product-toolbar .form-select-sm { width: auto; min-width: 9rem; }

.product-cards { display: flex; flex-direction: column; gap: .5rem; }

.product-card {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg, var(--ins-border-radius));
    background: var(--ins-secondary-bg);
}

.product-card.is-open { box-shadow: var(--ins-box-shadow-sm, none); }
.product-card.is-editing { border-color: color-mix(in srgb, var(--ins-primary) 55%, var(--ins-border-color)); }
.product-card.is-error { border-color: var(--ins-danger); }
.product-card.is-removed .product-card-name,
.product-card.is-removed .product-card-summary { text-decoration: line-through; opacity: .6; }

.product-card-head {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .75rem;
    cursor: pointer;
}

.product-card-toggle { padding: .125rem .25rem; color: var(--aira-muted); }

.product-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 12%, transparent);
}

.product-card-main { flex: 1 1 auto; min-width: 0; }

.product-card-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
}

.product-card-name {
    font-weight: 600;
    font-size: .9375rem;
    color: var(--aira-ink);
    overflow-wrap: anywhere;
}

.product-card-summary {
    margin-top: .125rem;
    overflow: hidden;
    font-size: .75rem;
    color: var(--aira-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-card-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .25rem;
}

.product-card-actions .form-switch { padding-left: 2.5em; }

.product-card-body {
    padding: .25rem .75rem .75rem 3.75rem;
    border-top: 1px solid var(--ins-border-color);
}

/* The print's two-column grid (crm/26 §3): a parameter, then its value - each a band, the value allowed to wrap. */
.product-spec-grid {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    padding-top: .5rem;
}

.product-spec-row {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
    gap: 1rem;
    padding: .5rem .875rem;
    font-size: .8125rem;
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.product-spec-param { font-weight: 600; color: var(--aira-ink); text-transform: uppercase; }
.product-spec-value { color: var(--ins-body-color); overflow-wrap: anywhere; white-space: pre-line; }

.product-editor { border-color: color-mix(in srgb, var(--ins-primary) 35%, var(--ins-border-color)); }

.product-spec-table td { padding-top: .375rem; padding-bottom: .375rem; }
.product-spec-table tr.is-warning td { background: color-mix(in srgb, var(--ins-warning) 10%, transparent); }

@media (max-width: 767.98px) {
    .product-card-body { padding-left: .75rem; }
    .product-spec-row { grid-template-columns: minmax(0, 1fr); gap: .125rem; }
    .product-card-head { flex-wrap: wrap; }
}

/* The Product Master panel: the name truncated in its column, its whole self in its title. */
.product-register-name { max-width: 26rem; }

/* ==========================================================================
   The Product Library dialog (crm/33 §3.3) - the party dialog's frame (.party-dialog*, crm/32 §14) at a document's size:
   a new document's narrow dialog (modal-document) and a saved one's, wide enough for its history docked beside it
   (modal-document-record - configuration.js asks for it when it opens a saved record, so nothing widens under the
   operator). Its one file is a tile or the drop zone, never both. Theme tokens only - the brand is a runtime setting.
   ========================================================================== */
.modal-dialog.modal-document { max-width: min(46rem, calc(100vw - 2rem)); }

.modal-dialog.modal-document-record {
    width: min(76rem, 92vw);
    max-width: min(76rem, 92vw);
}

.modal-document .modal-content { max-height: 90vh; }
.modal-document-record .modal-content { height: min(46rem, 90vh); }

.modal-document .modal-body,
.modal-document-record .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.library-file {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.library-tile {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

.library-tile[hidden],
.library-zone[hidden] { display: none; }

/* Chosen and not yet sent - the brand's tint, so it does not read as the stored file. */
.library-tile.is-staged {
    border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--ins-border-color));
    background: color-mix(in srgb, var(--ins-primary) 5%, var(--ins-secondary-bg));
}

.library-tile.is-invalid,
.library-zone.is-invalid { border-color: var(--ins-danger); }

.library-tile-icon {
    display: inline-flex;
    flex: 0 0 2.75rem;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    color: var(--aira-muted);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.library-tile-pdf { color: var(--ins-danger); background: color-mix(in srgb, var(--ins-danger) 12%, transparent); }
.library-tile-image { color: var(--ins-info); background: color-mix(in srgb, var(--ins-info) 14%, transparent); }

.library-tile-text { flex: 1 1 auto; min-width: 0; }

.library-tile-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: .25rem;
}

.library-zone {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--aira-muted);
    cursor: pointer;
    border: 1.5px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.library-zone:hover,
.library-zone.is-over {
    color: var(--ins-primary);
    border-color: var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 6%, transparent);
}

/* While a save is sending, nothing new can be chosen (Aira.attachments.wireDrop reads .is-busy). */
.library-dialog.is-busy .library-zone,
.library-dialog.is-busy .library-tile-actions { pointer-events: none; opacity: .6; }

/* The panel: the name and the file truncated in their columns, their whole selves in their titles. */
.library-register-name { max-width: 24rem; }

.library-file-link {
    display: inline-flex;
    align-items: center;
    max-width: 18rem;
    font-size: .8125rem;
}

@media (max-width: 575.98px) {
    .library-tile { flex-wrap: wrap; }
    .library-tile-actions { width: 100%; justify-content: flex-end; }
}

/* The product's one picture (crm/106) - the library's tile and zone, shared and named after their first user, with the picture itself where the
   library draws a file's icon. The picture is fitted whole on the tile's own ground, never cropped: a valve drawn tall reads as one. */
.product-image .library-tile { padding: .5rem; }
.product-image-thumb {
    display: inline-flex;
    flex: 0 0 3.5rem;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    overflow: hidden;
    cursor: zoom-in;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}
.product-image-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-image-zone { padding: .75rem 1rem; }
.product-image-removed { justify-content: space-between; }
.product-head-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid var(--ins-border-color);
    border-radius: 50%;
    background: var(--ins-body-bg);
}
/* While a save is sending, no new picture can be chosen (Aira.attachments.wireDrop reads .is-busy). */
.product-dialog.is-busy .product-image .library-zone,
.product-dialog.is-busy .product-image .library-tile-actions { pointer-events: none; opacity: .6; }

/* ==========================================================================
   The Configuration masters' dialogs (crm/34 §3) - a width for the master's shape (QD3), the fields in a grid, the
   switches as tiles, the footer always in view. The body scrolls on its own between a fixed nothing and a fixed
   footer - the party dialog's frame, without its head. Theme tokens only.
   ========================================================================== */
.modal-dialog.modal-master-sm { max-width: min(36rem, calc(100vw - 1rem)); }
.modal-dialog.modal-master-md { max-width: min(52rem, calc(100vw - 1rem)); }

.modal-dialog.modal-master-xl {
    width: 86vw;
    max-width: 86vw;
}

.modal-master-sm .modal-body,
.modal-master-md .modal-body,
.modal-master-xl .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.master-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.master-form-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
}

/* A master with a badge colour keeps it beside its fields; under 1200 px it goes below them. */
.master-form.has-side .master-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem);
    gap: 1.5rem;
    align-items: start;
}

.master-form-foot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-top: 1px solid var(--ins-border-color);
    background: var(--ins-secondary-bg);
}

/* The compact form (crm/62 §9): a group's label sits close to the fields it heads. */
.master-section-label {
    margin: .75rem 0 .375rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}

/* A switch as a tile: the whole tile is its label, so the target is the tile, not the knob. */
.master-switch {
    display: flex;
    align-items: center;
    gap: .625rem;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: .5rem .75rem;
    cursor: pointer;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}

.master-switch:hover { border-color: color-mix(in srgb, var(--ins-primary) 40%, var(--ins-border-color)); }
.master-switch:has(.form-check-input:checked) {
    border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--ins-border-color));
    background: color-mix(in srgb, var(--ins-primary) 5%, var(--ins-body-bg));
}

.master-switch .form-check {
    display: flex;
    flex: 0 0 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.master-switch .form-check .form-check-input {
    float: none;
    margin: 0;
}

.master-switch-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}

.master-switch.is-locked {
    cursor: default;
    background: var(--ins-tertiary-bg);
}

.master-switch.is-locked:hover { border-color: var(--ins-border-color); }
.master-switch[hidden] { display: none; }

/* A lock says why a field cannot change, a tip what a save means - in their tooltips, never a line under the field (QD4). */
.master-lock,
.master-tip {
    display: inline-flex;
    margin-left: .25rem;
    vertical-align: -.125em;
    color: var(--ins-secondary-color);
    cursor: help;
}

.master-lock svg,
.master-tip svg {
    width: .875rem;
    height: .875rem;
}

/* ---- A status badge's colour (crm/34 §7.2) ---------------------------------------------------------------------- */
.master-badge {
    padding: 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

.master-badge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.master-badge-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .875rem;
    padding: 1rem;
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}

.stage-chip.status-badge-lg {
    gap: .5rem;
    padding: .3rem .95rem;
    font-size: .9375rem;
}

.stage-chip.status-badge-lg::before { width: 8px; height: 8px; }

.master-badge-grounds {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
}

/* A light page and a dark one, whatever the theme - what the chip will look like on each (literal grounds on purpose:
   they stand for the two themes' cards, BadgeColours' LightPage and DarkPage). */
.master-badge-ground {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    padding: .625rem .5rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.master-badge-ground .stage-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.master-badge-ground.is-light { background: #fff; }
.master-badge-ground.is-dark { background: #1e1f27; }
.master-badge-ground-label { font-size: .6875rem; }
.master-badge-ground.is-light .master-badge-ground-label { color: #6b7280; }
.master-badge-ground.is-dark .master-badge-ground-label { color: #9ca3af; }

.master-palette {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: .5rem;
    margin: 1rem 0;
}

.master-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 100%;
    max-width: 2.25rem;
    aspect-ratio: 1;
    padding: 0;
    color: #fff;
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
    --aira-focus-ring-offset: 3px;
}

.master-swatch svg { width: 1rem; height: 1rem; opacity: 0; }

.master-swatch.is-chosen {
    box-shadow: 0 0 0 2px var(--ins-secondary-bg), 0 0 0 4px var(--swatch);
}

.master-swatch.is-chosen svg { opacity: 1; }
.master-swatch:disabled { cursor: default; opacity: .5; }

@media (prefers-reduced-motion: no-preference) {
    .master-swatch:hover:not(:disabled) { transform: scale(1.08); }
}

.master-colour-picker {
    flex: 0 0 3rem;
    max-width: 3rem;
    padding: .25rem;
}

/* The chip a master's colour draws (Partials/_StatusBadge) - its ink computed per theme by BadgeColours, so any colour
   reads; the dot and the border keep the colour itself. */
.stage-chip.status-badge {
    color: var(--stage-ink, var(--stage-color));
    background: color-mix(in srgb, var(--stage-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--stage-color) 28%, transparent);
}

.stage-chip.status-badge::before { background: var(--stage-color); }

html[data-bs-theme="dark"] .stage-chip.status-badge,
.master-badge-ground.is-dark .stage-chip.status-badge {
    color: var(--stage-ink-dark, var(--stage-color));
    background: color-mix(in srgb, var(--stage-color) 20%, transparent);
    border-color: color-mix(in srgb, var(--stage-color) 40%, transparent);
}

html[data-bs-theme="dark"] .master-badge-ground.is-light .stage-chip.status-badge {
    color: var(--stage-ink, var(--stage-color));
    background: color-mix(in srgb, var(--stage-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--stage-color) 28%, transparent);
}

/* ---- A new US$ rate (crm/34 §9.2) ------------------------------------------------------------------------------- */
.master-rate-now {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .375rem;
    margin-bottom: 1rem;
    padding: .625rem .75rem;
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.master-rate-change {
    min-height: 1.25rem;
    margin-top: .375rem;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
}

.master-rate-change.is-up { color: var(--ins-success); }
.master-rate-change.is-down { color: var(--ins-danger); }
.master-rate-confirm { border-color: var(--ins-warning); background: color-mix(in srgb, var(--ins-warning) 8%, var(--ins-body-bg)); }

/* ---- Currencies and rates (crm/119 MC3): a card per currency, as many to a row as fit ----------------------------- */
.aira-currency-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: .75rem;
}

.aira-currency-card.is-inactive { opacity: .7; }

.aira-currency-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .375rem;
    font-size: calc(14px * var(--aira-type-scale, 1));
}

/* ---- A quotation's rate in its read's head (crm/119 MC8): the figure, and where it came from under it --------------- */
.aira-qv-rate-warn { color: var(--ins-danger); }

/* ==========================================================================
   Terms & Conditions (crm/34 §8.1) - the record frame (.party-dialog*): the set's head, then the clauses and the set as
   it prints side by side, each scrolling on its own; under 1200 px one over the other.
   ========================================================================== */
.party-dialog-main.terms-main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.terms-dialog.is-reading .party-dialog-main.terms-main { grid-template-columns: minmax(0, 1fr); }

.terms-work,
.terms-preview {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.terms-preview {
    border-left: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
}

.terms-dialog.is-reading .terms-preview { border-left: 0; }

.terms-pane-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .5rem;
    min-height: 3rem;
    padding: .5rem 1.25rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.terms-pane-title {
    display: inline-flex;
    align-items: center;
    font-size: .875rem;
    font-weight: 600;
}

.terms-pane-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

/* A clause row - in the master and in a quotation's own copy of a set (Views/Terms/_TermsClause). */
.aira-terms-clause {
    margin-bottom: .625rem;
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}

.aira-terms-clause-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.aira-terms-clause-no {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    font-size: .8125rem;
    font-weight: 600;
    border-radius: 50%;
    color: var(--ins-primary);
    background: var(--ins-primary-bg-subtle);
}

.aira-terms-clause-off { display: none; }
.aira-terms-clause.is-off { border-style: dashed; background: var(--ins-tertiary-bg); }
.aira-terms-clause.is-off .aira-terms-clause-off { display: inline-flex; }
.aira-terms-clause.is-off .aira-rich-editor,
.aira-terms-clause.is-off .form-control { opacity: .6; }
.aira-terms-clause.is-off .aira-terms-clause-no { color: var(--ins-secondary-color); background: var(--ins-secondary-bg); }

/* The set on paper - the print's own look whatever the theme (crm/26 §3.14, QuotationPrintWriter.Terms): its typeface,
   its greys, its 28 px number column. Literal colours on purpose - they are the paper the customer is sent. */
@font-face { font-family: "Aira Print Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans/nunito-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Aira Print Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/nunito-sans/nunito-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Aira Print Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/nunito-sans/nunito-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Aira Print Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans/nunito-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Aira Print Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans/nunito-sans-latin-400-italic.woff2") format("woff2"); }

.terms-paper {
    max-width: 46rem;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 1.5rem;
    font-family: "Aira Print Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .75rem;
    line-height: 1.49;
    color: #31374a;
    border-radius: .25rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .08);
}

.terms-paper-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6b7280;
}

.terms-paper-rule { flex: 1 1 auto; border-top: 1px solid #e5e7eb; }
.terms-paper-box { padding: .75rem; border: 1px solid #d1d5db; border-radius: .25rem; }
.terms-paper-set { border: 1px solid #e5e7eb; border-radius: .375rem; }

.terms-paper-title {
    padding: .5rem .75rem;
    font-weight: 500;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    border-radius: .375rem .375rem 0 0;
    background: #f9fafb;
    overflow-wrap: anywhere;
}

.terms-paper-body {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 1rem;
    padding: .75rem;
}

.terms-paper-clause {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
}

.terms-paper-no { font-weight: 600; line-height: 1.625; color: #111827; }
.terms-paper-clause-heading { margin-bottom: .25rem; font-weight: 600; color: #111827; overflow-wrap: anywhere; }
.terms-paper-rich { line-height: 1.625; color: #374151; overflow-wrap: anywhere; }
.terms-paper-rich p { margin: 0 0 .5rem; line-height: 1.25rem; }
.terms-paper-rich ul { margin: 0 0 .5rem; padding-left: 1rem; list-style: disc; }
.terms-paper-rich ol { margin: 0 0 .5rem; padding-left: 1rem; list-style: decimal; }
.terms-paper-rich li { margin-bottom: .25rem; }
.terms-paper-rich > :last-child { margin-bottom: 0; }
.terms-paper-rich a { color: #2563eb; text-decoration: underline; }

.terms-paper-empty {
    display: flex;
    align-items: center;
    margin-top: .75rem;
    padding: .5rem .75rem;
    font-size: .75rem;
    color: #92400e;
    border-radius: .25rem;
    background: #fef3c7;
}

.terms-paper-empty[hidden] { display: none; }

@media (max-width: 1199.98px) {
    .master-form.has-side .master-form-grid { grid-template-columns: minmax(0, 1fr); }
    .party-dialog-main.terms-main { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
    .terms-preview { border-top: 1px solid var(--ins-border-color); border-left: 0; }
    .terms-pane-scroll { overflow: visible; }
}

@media (max-width: 575.98px) {
    .modal-dialog.modal-master-xl { width: auto; max-width: none; margin: .5rem; }
    .master-palette { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ==========================================================================
   The quotation's create step and its page (crm/35) - quotation-scoped, theme tokens only. The rail is the house tabs
   (.aira-tabs), the files the shared zone and tiles (.attach-*); what is here is only what the quotation adds to them.
   ========================================================================== */

/* The header form's groups (§3.1): a fieldset each, its legend the masters' section label. */
.aira-quotation-group {
    min-width: 0;
    margin: 0 0 .75rem;
    padding: 0;
    border: 0;
}

.aira-quotation-group > legend {
    float: none;
    width: auto;
    margin: 0 0 .5rem;
    padding: 0;
    line-height: inherit;
}

.aira-quotation-header-grid > [class*="col-"] { min-width: 0; }

/* A block that holds a condition for its columns and is no box of its own (crm/62 §4) - the columns stay the row's. Bootstrap's
   [hidden] { display: none !important } still wins, which is what lets the block put them away. */
.aira-grid-contents { display: contents; }

/* Its columns are not the row's own children, so Bootstrap's .row > * never gives them the gutter - they sat a gutter high and
   flush against their neighbours (the owner's Select mode, 31/10/2026). The same declarations, at no specificity, so the
   columns' own .col-* widths still win. */
:where(.row > .aira-grid-contents) > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    margin-top: var(--ins-gutter-y);
    padding-right: calc(var(--ins-gutter-x) * .5);
    padding-left: calc(var(--ins-gutter-x) * .5);
}

/* A field of the quotation header (crm/62 §4) - a third of the row at xl, a half at md, the whole of it below: its share is its
   minimum, so a row takes as many as fit, and the free space a short last row leaves is shared out by flex-grow. The header
   shows 10 to 14 fields by what is answered (the party once Quotation for is, a customer's mode and Customer through), so a fixed
   column could not avoid a hole; this never leaves one. A field an answer puts away ([hidden]) takes no share. */
.aira-quotation-header-grid > .aira-qf-field,
.aira-quotation-header-grid > .aira-grid-contents > .aira-qf-field {
    flex: 1 1 0%;
    min-width: 100%;
}

@media (min-width: 768px) {
    .aira-quotation-header-grid > .aira-qf-field,
    .aira-quotation-header-grid > .aira-grid-contents > .aira-qf-field { min-width: 50%; }
}

@media (min-width: 1200px) {
    .aira-quotation-header-grid > .aira-qf-field,
    .aira-quotation-header-grid > .aira-grid-contents > .aira-qf-field { min-width: 33.333%; }
}

/* Remarks: a row of its own at every width (crm/70 §3). The fields above it share what their last row leaves, so that row has no hole. */
.aira-quotation-header-grid > .aira-qf-field.aira-qf-field-wide { min-width: 100%; }

/* A field with a button at its end - the quotation party's eye (crm/62 §6). The button is the field's height (.btn-field), and
   the field's refusal stays under the field, never under the button. */
.aira-field-action {
    display: flex;
    align-items: flex-start;
    gap: .375rem;
}

.aira-field-action-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* A figure the form works out and never posts - Valid until, a size's Price and Total: read-only, and seen to be. */
.form-control.aira-quotation-derived,
.form-control.aira-quotation-derived:focus {
    border-style: dashed;
    background-color: var(--ins-tertiary-bg);
    box-shadow: none;
}

/* Save and Cancel stay at the foot of the window while the form is longer than it - out to the card's edges and down to
   its foot, as .perm-actions does in a card. */
.aira-quotation-header-actions {
    position: sticky;
    z-index: 5;
    bottom: 0;
    margin-inline: calc(-1 * var(--ins-card-spacer-x));
    margin-bottom: calc(-1 * var(--ins-card-spacer-y));
    padding: .75rem var(--ins-card-spacer-x);
    border-top: 1px solid var(--ins-border-color);
    border-radius: 0 0 var(--ins-card-inner-border-radius) var(--ins-card-inner-border-radius);
}

/* The section rail (§3.2): in a card of its own that stays under the topbar while the page scrolls. Seven sections need
   some 1,100 px and the column beside the history has 650-850 at a desktop's width, so from a tablet up the strip wraps
   onto a second row - every section in sight, none behind an edge; at phone width it scrolls sideways, never the page. */
.aira-quotation-nav-card {
    position: sticky;
    z-index: 8;
    top: var(--ins-topbar-height);
}

html[data-aira-focus] .aira-quotation-nav-card { top: 0; }

.aira-quotation-tabs {
    flex-wrap: wrap;
    row-gap: .125rem;
    padding: .375rem .75rem 0;
    border-bottom: 0;
}

.aira-quotation-tabs .nav-link {
    padding-inline: .75rem;
    white-space: nowrap;
}

/* A section Send needs (crm/09 §7) while it is empty - the count says so before Send is pressed. */
.aira-quotation-tabs .aira-tab-count.is-missing,
.aira-quotation-tabs .nav-link.active .aira-tab-count.is-missing {
    color: var(--ins-warning-text-emphasis);
    background-color: var(--ins-warning-bg-subtle);
}

.aira-quotation-workspace [data-quotation-panel] { min-width: 0; }

/* The files chosen and not yet uploaded (§6), under the shared zone. */
.aira-quotation-queue { margin-top: .75rem; }

.aira-quotation-queue-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.aira-quotation-queue .attach-grid { margin-top: .5rem; }

/* A size row of the item editor (§3.3) - a work surface of its own; its grid never wider than the dialog. */
.aira-quotation-size { background: var(--ins-tertiary-bg); }
.aira-quotation-size .row > [class*="col-"] { min-width: 0; }

/* The item editor on the one form's page (crm/62 §7) - a card in the Items section, its foot kept in view while its sizes
   scroll by the window, on its card's own ground, out to the card's edges. Its own ground (crm/63 §4) sets it apart from the items
   around it; its head a step deeper; its size rows keep their tertiary ground inside it, so a row still reads as a row. */
.aira-qf-item-editor {
    border-color: var(--ins-primary-border-subtle, var(--ins-border-color)) !important;
    background: var(--aira-qf-editor-bg);
}

.aira-qf-item-editor > .card-header { background: var(--aira-qf-editor-head-bg); }
.aira-qf-item-editor .aira-item-features { background: var(--ins-secondary-bg); }

@media (min-width: 1200px) {
    .aira-qf-item-editor .aira-quotation-item-foot {
        position: sticky;
        z-index: 3;
        bottom: 0;
        margin-inline: calc(-1 * var(--ins-card-spacer-x));
        margin-bottom: calc(-1 * var(--ins-card-spacer-y));
        padding: .5rem var(--ins-card-spacer-x);
        background: var(--aira-qf-editor-bg);
        border-radius: 0 0 var(--ins-card-inner-border-radius) var(--ins-card-inner-border-radius);
    }
}

/* An item dragged into place (crm/64 DO1-DO2): the card's grip, the gap that follows the pointer, and the picked-up card put away.
   The gap is the card's own height, dashed in the brand, so the operator sees exactly where it will land. */
.aira-item-grip {
    flex: none;
    padding: .25rem .125rem;
    color: var(--ins-secondary-color);
    cursor: grab;
    touch-action: none;
}
.aira-item-grip:hover { color: var(--ins-primary); }
.aira-item-grip:active { cursor: grabbing; }
.aira-quotation-item.is-drag-source { display: none; }
.aira-item-slot {
    border: 2px dashed var(--ins-primary);
    border-radius: var(--ins-border-radius);
    background: color-mix(in srgb, var(--ins-primary) 8%, transparent);
}
.is-dragging-items { cursor: grabbing; }
.aira-item-drag-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 28rem;
    max-width: 90vw;
    padding: .5rem .75rem;
    border: 1px solid var(--ins-primary);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    color: var(--ins-body-color);
    box-shadow: var(--aira-shadow-2);
}

/* A transaction form's sections (crm/63 §5) - Quotation, Lead and OA: each card's head on a ground of its own with the brand's rule at
   its left, so a section reads as a section. The item editor's head is its own (above). */
.aira-qf-sections .card > .card-header:not(.aira-qf-item-editor > .card-header),
.card > .card-header.aira-section-head {
    background: var(--aira-section-head-bg);
    border-bottom-color: var(--aira-section-head-rule) !important;
    box-shadow: inset 3px 0 0 var(--ins-primary);
}

/* A section's count (crm/64 §3): the brand's pill with its contrast ink, so it reads on the section's own ground. Outside
   .aira-tabs this class had no colour at all - the number was there and invisible. Shown only above zero: the form's scripts and
   the server both set hidden, and [hidden] wins over .badge's display. */
.badge.aira-tab-count {
    min-width: 1.375rem;
    padding: .2rem .45rem;
    border-radius: 999px;
    background-color: var(--ins-primary);
    color: var(--aira-brand-contrast);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.badge.aira-tab-count[hidden] { display: none !important; }

/* The item editor's foot stays in view while the sizes scroll. A sticky box sticks at the scroll container's padding
   edge, so it reaches out over .modal-body's padding, as .perm-actions does. */
.modal-body .aira-quotation-item-foot {
    position: sticky;
    z-index: 3;
    bottom: calc(-1 * var(--ins-modal-padding));
    margin-inline: calc(-1 * var(--ins-modal-padding));
    margin-bottom: calc(-1 * var(--ins-modal-padding));
    padding-inline: var(--ins-modal-padding);
    padding-bottom: .875rem;
    background: var(--ins-modal-bg, var(--ins-secondary-bg));
}

@media (max-width: 767.98px) {
    .aira-quotation-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }
}

@media (max-width: 575.98px) {
    .aira-quotation-header-actions { flex-wrap: wrap; }
    .aira-quotation-header-actions .me-auto { flex-basis: 100%; }
    .aira-quotation-tabs { padding-inline: .5rem; }
}

/* ==========================================================================
   The quotation's one form (crm/36) - the sections on the left, a summary that stays in view on the right; below 1200 px
   one column, the totals in the Charges card and Save in a foot that stays at the window's bottom. Tokens only.
   ========================================================================== */
.aira-qf-sections {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.aira-qf .card-header .card-title { font-size: 1rem; }

/* The head - across the whole work area, kept under the topbar while the page scrolls, so the clock is in view in every
   section (crm/37 §6). The page's own ground behind and around it, so the cards slide under it rather than show through.
   pages/quotation-form.js measures it into --aira-qf-head-h for the summary below it and the page's scroll-padding. */
.aira-qf-head {
    position: sticky;
    top: var(--ins-topbar-height);
    z-index: 6;
    margin-top: -.75rem;
    padding: .75rem 0;
    background: var(--ins-body-bg);
}

html[data-aira-focus] .aira-qf-head { top: 0; }

/* New quotation's bar: the number's note, then what changes as the operator works - one line. No title: the topbar's
   is the page's, and the bar restating it read "New quotation" twice, one above the other. */
/* One line at every width: the note gives way with an ellipsis before the clock would wrap under it. */
.aira-qf-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem .75rem;
    padding-block: .5rem;
}

.aira-qf-bar > .badge,
.aira-qf-bar > .aira-qf-dirty-note { flex-shrink: 0; white-space: nowrap; }

.aira-qf-bar-note {
    display: flex;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    margin-right: auto;
}

.aira-qf-bar-note > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* A fact on the record's head (crm/70 H1): a label and its value on one line, on the head's left part - never beside its Save. The label gives
   way on a phone, the value never does. */
.aira-qf-bar-fact {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: .3125rem;
    font-size: .8125rem;
    color: var(--ins-secondary-color);
    white-space: nowrap;
}

.aira-qf-bar-fact > svg, .aira-qf-bar-fact > i { flex: 0 0 auto; width: .875rem; height: .875rem; }

.aira-qf-bar-fact-value { font-weight: 600; color: var(--ins-body-color); }

@media (max-width: 575.98px) {
    .aira-qf-bar-fact-label { display: none; }
}

.aira-qf-clock {
    font-size: .875rem;
    padding: .375rem .625rem;
    font-variant-numeric: tabular-nums;
}

/* A saved quotation's head (_PageHead) on this page only: what it says and the workflow's buttons on one band, the
   standing note under them - the quotation's own page keeps the roomier head. */
/* A row, said outright: a .card is already a column flexbox, and the head's basis below would be read as a height. */
.aira-qf-head [data-quotation-head] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 0 !important;
}

.aira-qf-head [data-quotation-head] > .card-body { padding-block: .625rem; }

.aira-qf-head [data-quotation-head] > .card-body:first-child { flex: 1 1 32rem; min-width: 0; }

.aira-qf-head [data-quotation-head] > [data-quotation-moves] {
    flex: 0 1 auto;
    align-items: center;
    border-top: 0 !important;
}

.aira-qf-head [data-quotation-head] > .card-footer { flex: 1 0 100%; padding-block: .5rem; }

/* The side panel (crm/51) - the summary and the history beside the work, ONE open at a time and the other its one-line bar;
   hiding the open one folds the panel sideways into a strip held at the right, as the Party Account dialog's history folds
   (crm/31 H1), and the work takes the width. Everything here reads the page root's data-side-state (summary | history |
   folded), set by aira-side-panel.js - one attribute, no :has() over the page.
   Kept under the head while the sections scroll, capped at the window below it (crm/48 H1: before, the history scrolled up
   behind a summary that stuck alone). A window too short for what is open scrolls the panel itself, never the page under it. */
.aira-qf-rail {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.aira-qf-rail > .card { margin-bottom: 0; }

/* A section's head - its icon, its name, its figure and its button, as the history's (crm/51 S3). */
.aira-qf-section-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-top: .625rem;
    padding-bottom: .625rem;
}

.aira-qf-section-icon { flex: none; width: 1rem; height: 1rem; color: var(--ins-secondary-color); }
.aira-qf-section-title { flex: 1 1 auto; min-width: 0; }
.aira-qf-section-toggle { flex: none; }

/* Open, the button puts the panel away to the right; closed, it is a chevron - the section opens here, in the other's place. */
.aira-qf-section .aira-side-when-closed,
.aira-qf-section.is-collapsed .aira-side-when-open { display: none; }
.aira-qf-section.is-collapsed .aira-side-when-closed { display: inline-block; }

/* A closed section is its bar, and the whole bar is its button: the toggle's ::after stretched over the card. Only a closed
   bar - an open section's head must not fold the panel on a stray click on Preview or the count. */
.aira-qf-section.is-collapsed { position: relative; }
.aira-qf-section.is-collapsed > .card-header { border-bottom: 0 !important; }
.aira-qf-section.is-collapsed [data-side-toggle] { position: static; }

.aira-qf-section.is-collapsed [data-side-toggle]::after {
    position: absolute;
    inset: 0;
    content: "";
    border-radius: var(--ins-card-border-radius, var(--ins-border-radius));
}

.aira-qf-section.is-collapsed:hover { background: color-mix(in srgb, var(--ins-primary) 5%, var(--ins-secondary-bg)); }
.aira-qf-section.is-collapsed:hover .card-title { color: var(--ins-primary-text-emphasis); }

/* The folded strip - only ever beside the work, at 1200 px and wider (S7). */
.aira-side-strip {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    min-height: 0;
    margin-bottom: 0;
    padding: .375rem;
    overflow: hidden;
}

/* A tab as the party strip draws its history: the icon, the count, the name set vertically in small capitals. */
.aira-side-tab {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: .625rem;
    min-height: 0;
    padding: .75rem 0;
    overflow: hidden;
    color: var(--ins-secondary-color);
    background: transparent;
    border: 0;
    border-radius: var(--ins-border-radius);
    --aira-focus-ring-offset: -2px;
}

.aira-side-tab:hover,
.aira-side-tab:focus-visible {
    color: var(--ins-primary-text-emphasis);
    background: color-mix(in srgb, var(--ins-primary) 8%, transparent);
}

.aira-side-tab-icon { flex: none; width: 1rem; height: 1rem; }

.aira-side-tab-label {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* The head is ONE card (crm/52 P6): the row is the card - a .card is a column flexbox, so it is said a row - the record's own head
   inside it without a second border or shadow. Its Save moved to the foot bar (crm/83 §5). No overflow clip: the head's own menus
   open over the page. */
.aira-qf-head-row {
    flex-direction: row;
    align-items: stretch;
    margin-bottom: 0;
}

/* Centred in the card, so a one-line head's own buttons share the Save's middle when the Save column is the taller (crm/56 D8). */
.aira-qf-head-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.aira-qf-head-row .aira-qf-head-main .card {
    background: transparent;
    border: 0;
    box-shadow: none;
}

@media (min-width: 1200px) {
    .aira-qf-rail {
        --aira-qf-rail-h: calc(100vh - var(--ins-topbar-height) - var(--aira-qf-head-h, 1rem) - 1rem);
        position: sticky;
        top: calc(var(--ins-topbar-height) + var(--aira-qf-head-h, 1rem));
        z-index: 2;
        max-height: var(--aira-qf-rail-h);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    html[data-aira-focus] .aira-qf-rail {
        --aira-qf-rail-h: calc(100vh - var(--aira-qf-head-h, 1rem) - 1rem);
        top: var(--aira-qf-head-h, 1rem);
    }

    .aira-qf-rail > .aira-qf-summary { flex: none; }

    /* Closed, the history is only its bar. Open, it fills the window below the head - the summary's bar over it - and only
       its timeline scrolls, never less than a few entries' worth. */
    .aira-qf-rail-history {
        display: flex;
        flex: none;
        flex-direction: column;
        min-height: 0;
    }

    .aira-qf[data-side-state="history"] .aira-qf-rail { height: var(--aira-qf-rail-h); }
    .aira-qf[data-side-state="history"] .aira-qf-rail-history { flex: 1 1 auto; min-height: 15rem; }

    .aira-qf-rail-history > .aira-history-rail { flex: 1 1 auto; min-height: 0; margin-bottom: 0; }

    .aira-qf-rail-history .aira-history-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .aira-qf-rail-history .aira-history-body[hidden] { display: none; }

    .aira-qf-rail-history .aira-history-rail:not(.is-docked) .aira-history-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    /* Folded (S2): the side column is the strip and its gutter, the work column everything else - out-ranking the grid's
       .col-xl-9 (75 %) - and the strip the window's height below the head. */
    .aira-qf[data-side-state="folded"] .aira-qf-main {
        flex: 1 1 0;
        width: auto;
        max-width: none;
    }

    .aira-qf[data-side-state="folded"] .aira-qf-side {
        flex: 0 0 auto;
        width: calc(3rem + var(--ins-gutter-x));
    }

    .aira-qf[data-side-state="folded"] .aira-qf-rail {
        height: var(--aira-qf-rail-h);
        overflow: hidden;
    }

    .aira-qf[data-side-state="folded"] .aira-qf-rail > .aira-qf-summary,
    .aira-qf[data-side-state="folded"] .aira-qf-rail > .aira-qf-rail-history { display: none; }
    .aira-qf[data-side-state="folded"] .aira-side-strip { display: flex; }
}

/* A side panel's timeline needs its width more than a card's roomy padding (crm/54 H3). */
.aira-qf-rail-history .aira-history-body { padding: .75rem; }

/* Narrower than 1200 px (crm/54 N1) - a laptop at 125 %, a tablet, a phone. Before, the panel was display: none and a saved
   record had no history on screen at all. Now: no summary - its totals are Charges and totals', its Save the foot bar's - and
   the history a tab held at the window's right edge under the head, opening as a drawer over the page from the topbar down;
   its own button, Escape or a click outside puts it away (aira-side-panel.js). The work keeps a gutter the tab's width, so the
   tab never covers a control. Above the page's sticky head and foot (6, 5), under the topbar (1001) and every dialog. */
@media (max-width: 1199.98px) {
    .aira-qf-has-history .aira-qf-main { padding-right: calc(var(--ins-gutter-x) * .5 + 2.5rem); }

    .aira-qf-side {
        position: fixed;
        z-index: 1000;
        top: calc(var(--ins-topbar-height) + var(--aira-qf-head-h, 0px) + .5rem);
        right: 0;
        width: 2.5rem;
        margin: 0;
        padding: 0;
    }

    .aira-qf-rail > .aira-qf-summary,
    .aira-qf-rail > .aira-qf-rail-history,
    .aira-side-tab[data-side-open="summary"] { display: none; }

    .aira-side-strip {
        display: flex;
        padding: .25rem;
        border-right: 0;
        border-radius: var(--ins-border-radius) 0 0 var(--ins-border-radius);
        box-shadow: var(--ins-box-shadow);
    }

    .aira-qf[data-side-state="history"] .aira-qf-side {
        top: var(--ins-topbar-height);
        bottom: 0;
        width: min(28rem, calc(100vw - 2.5rem));
    }

    .aira-qf[data-side-state="history"] .aira-qf-rail { height: 100%; }
    .aira-qf[data-side-state="history"] .aira-side-strip { display: none; }

    .aira-qf[data-side-state="history"] .aira-qf-rail > .aira-qf-rail-history {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .aira-qf-rail-history > .aira-history-rail {
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 0;
        border-width: 0 0 0 1px;
        border-radius: 0;
        box-shadow: -.75rem 0 2rem rgba(0, 0, 0, .18);
    }

    .aira-qf-rail-history .aira-history-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .aira-qf-rail-history .aira-history-rail:not(.is-docked) .aira-history-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

/* The totals at the foot of Charges and totals (crm/52 P5), at every width - the summary's preview copied at the form's start
   and painted live by the same code. A panel at the card's right, where a quotation's sum is looked for. */
.aira-qf-charges-totals {
    max-width: 26rem;
    margin: 1.25rem 0 0 auto;
    padding: .875rem 1rem;
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-qf-charges-totals:empty { display: none; }
.aira-qf-charges-totals .aira-qf-totals { font-size: .875rem; }

.aira-qf-totals {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .375rem .75rem;
    font-size: .8125rem;
}

.aira-qf-totals dt { font-weight: 400; color: var(--ins-secondary-color); }
.aira-qf-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-qf-totals [hidden] { display: none; }

.aira-qf-totals .aira-qf-grand {
    padding-top: .5rem;
    border-top: 1px solid var(--ins-border-color);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ins-body-color);
}

.aira-qf-needs li { display: flex; align-items: center; padding: .125rem 0; color: var(--ins-secondary-color); }
.aira-qf-needs li.is-done { color: var(--ins-success-text-emphasis); }

/* "Unsaved changes" says so only while there are some - the dirty guard's own class on the form. */
.aira-qf-dirty-note { visibility: hidden; color: var(--ins-warning-text-emphasis); }
.aira-qf.is-dirty .aira-qf-dirty-note { visibility: visible; }

/* A chosen terms set or catalog: its place, its name, its actions on one line. */
.aira-qf-rows { display: flex; flex-direction: column; gap: .375rem; }

.aira-qf-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .5rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-body-bg);
}

.aira-qf-row.is-invalid { border-color: var(--ins-danger); }

.aira-qf-row-no {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 50%;
    color: var(--ins-primary);
    background: var(--ins-primary-bg-subtle);
}

/* An item the save refused, until it is corrected in its dialog. */
.aira-quotation-item.is-invalid { border-color: var(--ins-danger) !important; }

/* A stored file marked to go with the save - kept on screen, struck, with its undo. */
.attach-tile.is-removing { border-style: dashed; opacity: .7; }
.attach-tile.is-removing .attach-name { text-decoration: line-through; }

.aira-qf .attach-drop.aira-qf-drop { min-height: 4.25rem; }

/* The form's one Save (crm/83 §5): the foot bar, held at the window's foot at every width while the sections scroll - the head above
   is the record's, never a second Save. aira-form-save.js gives the page its height as scroll-padding-bottom, so nothing focused hides
   under it. Its ground is every foot bar's (crm/54 B3, below). */
.aira-qf-foot {
    position: sticky;
    z-index: 5;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0 1rem;
    padding: .625rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}
.aira-qf-foot-key { white-space: nowrap; }
.aira-qf-foot-key kbd {
    padding: .0625rem .3125rem;
    font-size: .6875rem;
    color: var(--ins-body-color);
    background: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: .25rem;
    box-shadow: none;
}

@media (max-width: 575.98px) {
    .aira-qf-foot .aira-qf-dirty-note { flex-basis: 100%; }
    .aira-qf-foot .btn { flex: 1 1 0; }
    .aira-qf-row { padding: .5rem; }
}

/* --------------------------------------------------------------------------
   Settings -> Software: the section menu (appearance.md §5.1).

   UBold's vertical pills, beside the chosen section; below 992 px one row of pills that scrolls sideways, with no
   second component. The chosen row is the brand - filled, with the ink that reads on it, and a gradient brand's paint
   (§5.3's closed list). Variables only, so a colour saved in Settings re-colours it with no rebuild.
   -------------------------------------------------------------------------- */
.aira-section-menu {
    gap: .25rem;
}

.aira-section-menu .nav-link {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .875rem;
    border-radius: var(--ins-border-radius);
    color: var(--ins-body-color);
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    --aira-focus-ring-offset: -2px;
}

.aira-section-menu .nav-link svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.aira-section-menu .nav-link:not(.active):hover {
    background-color: color-mix(in srgb, var(--aira-brand-400) 9%, transparent);
    color: var(--ins-emphasis-color);
}

.aira-section-menu .nav-link.active {
    background-color: var(--ins-primary);
    background-image: var(--aira-brand-paint-image, none);
    color: var(--aira-brand-contrast);
}

@media (max-width: 991.98px) {
    .aira-section-menu {
        overflow-x: auto;
        scrollbar-width: thin;
    }
}

/* --------------------------------------------------------------------------
   Settings -> Software -> Appearance (appearance.md §5.2).

   Tiles are radio groups (the badge palette's pattern): a solid is a round swatch, a gradient a wider tile that draws
   itself and carries its name. The chosen one is ringed. Nothing here explains itself - the names are on the tiles.
   -------------------------------------------------------------------------- */
.aira-appearance .card-body > .aira-surface + .aira-appearance-sample-row { border-top: 1px dashed var(--ins-border-color); padding-top: 1rem; }

.aira-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
}

.aira-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: #fff;
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
    --aira-focus-ring-offset: 3px;
}

/* Brand deep is the brand, shaded 55 % - drawn from the brand field the form keeps in --aira-appearance-anchor. */
.aira-swatch.is-brand-deep { --swatch: color-mix(in srgb, var(--aira-appearance-anchor, #1b56a0) 45%, #000); }

.aira-swatch svg { width: 1rem; height: 1rem; opacity: 0; }
.aira-swatch.is-chosen { box-shadow: 0 0 0 2px var(--ins-secondary-bg), 0 0 0 4px var(--ins-primary); }
.aira-swatch.is-chosen svg { opacity: 1; }

.aira-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: .75rem;
}

.aira-tile {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ins-body-color);
    text-align: left;
    cursor: pointer;
    --aira-focus-ring-offset: 3px;
}

.aira-tile-paint {
    display: grid;
    place-items: center;
    height: 2.75rem;
    border-radius: var(--ins-border-radius);
    background: var(--tile);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.aira-tile-paint svg { width: 1rem; height: 1rem; opacity: 0; }
.aira-tile.is-chosen .aira-tile-paint { box-shadow: 0 0 0 2px var(--ins-secondary-bg), 0 0 0 4px var(--ins-primary); }
.aira-tile.is-chosen .aira-tile-paint svg { opacity: 1; }

/* In forced colours (Windows high contrast) the browser drops backgrounds - and a tile's colour is what it says. Kept, with the
   chosen one still marked by the system's own highlight. */
@media (forced-colors: active) {
    .aira-swatch,
    .aira-tile-paint { forced-color-adjust: none; }
    .aira-swatch.is-chosen,
    .aira-tile.is-chosen .aira-tile-paint { box-shadow: 0 0 0 2px Canvas, 0 0 0 4px Highlight; }
}

.aira-tile-name {
    font-size: .75rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
    .aira-swatch:hover,
    .aira-tile:hover .aira-tile-paint { transform: scale(1.06); }
}

.aira-surface-custom {
    margin-top: 1rem;
}

.aira-surface-stops {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.aira-surface-stop {
    flex: 0 1 13rem;
    min-width: 0;
}

.aira-surface-stop[hidden] { display: none; }

.aira-surface-picker {
    flex: 0 0 3rem;
    max-width: 3rem;
    padding: .25rem;
}

.aira-head-modes {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* The verdicts beside a choice - the server's words (§5.2). */
.aira-checks {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.aira-check {
    display: inline-flex;
    align-items: center;
    padding: .125rem .5rem;
    border-radius: 50rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--ins-success-text-emphasis);
    background: var(--ins-success-bg-subtle);
}

.aira-check.is-failing {
    color: var(--ins-danger-text-emphasis);
    background: var(--ins-danger-bg-subtle);
}

.aira-appearance-sample-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    pointer-events: none;
}

/* The type areas: area, font, size, state. One column each below 768 px. */
.aira-type-grid {
    display: grid;
    /* The size column holds a whole stepper - minus, field, px, plus - on one line. */
    grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) 13rem 4.5rem;
    gap: .75rem 1rem;
    align-items: center;
}

.aira-type-row { display: contents; }

.aira-type-head {
    font-size: .75rem;
    font-weight: 600;
    color: var(--aira-ink-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.aira-type-state [hidden] { display: none; }

/* Bootstrap's input group wraps; a stepper whose plus drops to a second line reads as two controls. */
.aira-stepper { flex-wrap: nowrap; }
.aira-stepper .form-control { min-width: 3.5rem; }

@media (max-width: 767.98px) {
    .aira-type-grid { grid-template-columns: minmax(0, 1fr) auto; }
    .aira-type-head { display: none; }
    .aira-type-label { grid-column: 1 / -1; margin-top: .5rem; }
    .aira-type-font { grid-column: 1 / -1; }
    .aira-type-size { grid-column: 1; }
}

.aira-type-sample {
    padding: 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

/* The row over all the others (crm/71 §5): set apart by its rule, and each row under it may say what it is shown at. */
.aira-type-row--overall > * {
    padding-bottom: .75rem;
    border-bottom: 1px dashed var(--ins-border-color);
}

.aira-type-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 .5rem;
}

.aira-type-shown { flex-basis: 100%; }

/* The action bar stays in reach while the form scrolls - one Save for the four cards (crm/36's rule). */
.aira-appearance-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

@media (max-width: 575.98px) {
    .aira-appearance-actions .btn { flex: 1 1 auto; }
    .aira-appearance-actions .me-auto { flex-basis: 100%; }
}

/* ==========================================================================
   Leads (crm/39) - the register, the one form and Detail. The form wears the
   quotation form's classes (.aira-qf-*: the head under the topbar, the summary
   rail, the sticky foot) so the two cannot drift; what is here is the lead's
   own: the requirement's two lines, the duplicates panel, the follow-up cards,
   the read-only cards' rows.
   ========================================================================== */
/* Settings → Software → Numbering (crm/61 NF3.7): the number a format makes today. Its parts are pills and chips - Aira.tokenField's
   places (crm/92), drawn by the details field's own rules. */

.aira-numbering-preview {
    padding: .625rem .875rem;
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}

.aira-numbering-preview.is-invalid {
    border-color: var(--ins-danger-border-subtle);
    background: var(--ins-danger-bg-subtle);
}

.aira-numbering-preview.is-invalid [data-numbering-preview] { color: var(--ins-danger-text-emphasis); }

#numbering-settings-form > fieldset > .card { margin-bottom: 1rem; }

/* The version history (crm/61 §12): each version's format as the pills it is, and the version in force picked out. */
.aira-numbering-format {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .125rem;
}

.aira-numbering-versions tr.is-current > td { background-color: var(--ins-primary-bg-subtle); }

/* Room for a format's pills to read as one line - the table scrolls in its own box below it (a table never leaves its card). */
.aira-numbering-versions .aira-numbering-format-cell { min-width: 22rem; }

/* The register's Status cell (crm/61 NF1): the status and the priority one row, as wide as the two chips. A phone's register
   scrolls in its own cell, so there the pair may wrap rather than widen the row past the screen. */
.aira-lead-status {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .375rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .aira-lead-status { flex-wrap: wrap; row-gap: .25rem; white-space: normal; }
}

.aira-lead-views .btn { white-space: nowrap; }

.aira-lead-dial { flex: 0 0 6.5rem; max-width: 6.5rem; }

/* The form's files sit beside its notes (crm/68 §4.1): the zone already says there are none, and a line under it was only height. */
.aira-lead [data-lf-section="attachments"] [data-qf-file-empty] { display: none; }

.aira-lead .text-pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The follow-up cards (crm/12 §2.4) - a row each: when, what, what may be done. */
.aira-followups { display: flex; flex-direction: column; gap: .5rem; }
.aira-followup {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: start;
    padding: .625rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-left-width: 3px;
    border-radius: var(--ins-border-radius);
}
.aira-followup.is-overdue { border-left-color: var(--ins-danger); }
.aira-followup.is-duetoday { border-left-color: var(--ins-warning); }
.aira-followup.is-open { border-left-color: var(--ins-primary); }
.aira-followup.is-done,
.aira-followup.is-cancelled { border-left-color: var(--ins-border-color); color: var(--ins-secondary-color); }

/* Detail's cards read as rows of facts, not as a disabled form. */
.aira-lead-read dt { font-weight: 400; color: var(--ins-secondary-color); margin-bottom: .375rem; }
.aira-lead-read dd { margin-bottom: .375rem; overflow-wrap: anywhere; }

/* A saved lead's head carries its moves beside its chips - they wrap to a row of their own when the width runs out, where the
   quotation form's one-line bar (nowrap) has nothing to wrap. */
.aira-lead [data-lead-head] .aira-qf-bar { flex-wrap: wrap; }

/* New quotation opened from a lead (crm/39 §8.1): the lead's link beside the number's note on the bar; on a phone it takes a row
   of its own rather than both notes giving way to an ellipsis. */
@media (max-width: 767.98px) {
    .aira-qf-bar.has-lead { flex-wrap: wrap; }
    .aira-qf-bar.has-lead > .aira-qf-bar-lead { order: 9; flex-basis: 100%; margin-right: 0; }
    /* ...and the number's note gives way before the clock does, so the two keep the first row. */
    .aira-qf-bar.has-lead > .aira-qf-bar-note:not(.aira-qf-bar-lead) { flex: 1 1 0; }
}

/* A closed lead's facts - a left accent. */
.aira-lead-closed { padding: .25rem 0 .25rem .75rem; border-left: 3px solid var(--ins-secondary-color); }
.aira-lead-closed.is-converted { border-left-color: var(--ins-success); }

/* The follow-ups dialog's four facts (crm/65 §5.3). */
.aira-lead-tile {
    padding: .5rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
    height: 100%;
    min-width: 0;
}
.aira-lead-tile-label {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: .125rem;
    font-size: .75rem;
    color: var(--ins-secondary-color);
}

/* A lead read (crm/68 §5) - UBold's order details: a main column and an aside, one card each, the sections inside them under quiet
   heads rather than a band and a box per section. */
.aira-lead-sheet { display: flex; flex-direction: column; gap: 1rem; }
.aira-lead-sheet-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    padding-bottom: .375rem;
    border-bottom: 1px dashed var(--ins-border-color);
}
.aira-lead-sheet-head h6 { margin: 0; font-weight: 600; }
.aira-lead-sheet-head > svg, .aira-lead-sheet-head > i { flex: 0 0 auto; width: 1rem; height: 1rem; color: var(--ins-primary); }
/* The lead's four facts in one row of equal parts, each a label over its value. */
.aira-lead-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem .75rem;
    padding: .5rem .75rem;
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}
.aira-lead-facts dt {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: .125rem;
    font-size: .75rem;
    font-weight: 400;
    color: var(--ins-secondary-color);
}
.aira-lead-facts dt > svg, .aira-lead-facts dt > i { flex: 0 0 auto; width: .75rem; height: .75rem; }
.aira-lead-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .aira-lead-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.aira-lead-dialog .modal-body { background: var(--ins-body-bg); }
.aira-lead-dialog .text-pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.aira-lead-dialog .aira-lead-section .card-header { border-radius: var(--ins-border-radius) var(--ins-border-radius) 0 0; }
/* The details and the follow-ups: 90 % of the screen (crm/66 §5) - not modal-record, whose body has no padding, built for a dialog's own panes. */
.modal-dialog.aira-lead-wide { width: 90vw; max-width: 90vw; }
@media (max-width: 575.98px) {
    .modal-dialog.aira-lead-wide { width: auto; max-width: none; margin: .5rem; }
}

/* A contact (crm/68 §4.3), the form's and the details' one card: the initials, the name, then each way to reach them as a line whose
   icon holds its own column - the words truncate beside it and never wrap under it. Phone and e-mail share a line while they fit. */
.aira-lead-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .5rem; }
.aira-lead-contacts.is-column { grid-template-columns: minmax(0, 1fr); }
.aira-lead-contact {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    padding: .375rem .625rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}
.aira-lead-contact-lines { display: flex; flex-wrap: wrap; gap: 0 .875rem; min-width: 0; font-size: .8125rem; }
/* The person's post (crm/83 C3), under the name and over the ways to reach them. */
.aira-lead-contact-post { font-size: .75rem; color: var(--ins-secondary-color); line-height: 1.25; }
.aira-lead-contact-line { display: inline-flex; align-items: center; gap: .3125rem; min-width: 0; max-width: 100%; }
.aira-lead-contact-line > svg, .aira-lead-contact-line > i { flex: 0 0 auto; width: .8125rem; height: .8125rem; color: var(--ins-secondary-color); }

/* The contact cards' section (crm/70 §5), the lead's and the quotation's: the typed person's edit and remove, a refusal on its card, the tile
   that adds another and the one editor under the grid. */
.aira-lead-contact.is-editing { border-color: var(--ins-primary); }
.aira-lead-contact.is-invalid { border-color: var(--ins-danger); }
.aira-lead-contact-error { margin-top: .125rem; font-size: .75rem; color: var(--ins-danger); }
.aira-lead-contact-actions { display: flex; flex: 0 0 auto; gap: .25rem; margin-left: auto; }
.aira-contact-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-height: 3.25rem;
    padding: .375rem .625rem;
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: transparent;
    font-size: .8125rem;
    color: var(--ins-primary);
}
.aira-contact-add:hover { border-color: var(--ins-primary); }
.aira-contact-add > svg, .aira-contact-add > i { flex: 0 0 auto; width: .875rem; height: .875rem; }
.aira-contact-editor {
    margin-top: .5rem;
    padding: .625rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}
.aira-contact-cards [data-cc-hint]:not([hidden]) { margin-top: .5rem; }
.aira-contact-cards [data-cc-error]:not([hidden]) { display: block; }


/* ==========================================================================
   A record's follow-ups (crm/85) - the plan, the Remind fields and the history, one look on the lead's dialog and the quotation's tab.
   ========================================================================== */

/* The plan (FP1-FP2): only what is planned, each step a block of facts and its reminders. */
.aira-fu-empty { display: flex; align-items: center; gap: .5rem; padding: .875rem 1rem; color: var(--aira-muted); }
.aira-fu-step { padding: .5rem 1rem; border-top: 1px solid var(--ins-border-color); }
.aira-fu-steps > .aira-fu-step:first-child { border-top: 0; }
.aira-fu-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; }
/* Each step one folded row (crm/93 FE1): the row a button - date, standing, subject, with whom and who it reminds - opening the facts and reminders. */
.aira-fu-step-toggle {
    display: flex;
    flex: 1 1 24rem;
    align-items: center;
    gap: .375rem .5rem;
    min-width: 0;
    padding: .25rem .375rem;
    border: 0;
    border-radius: var(--ins-border-radius);
    background: transparent;
    color: inherit;
    text-align: left;
}
.aira-fu-step-toggle:hover { background: var(--ins-tertiary-bg); }
.aira-fu-step.is-open .aira-fu-step-toggle { background: var(--ins-primary-bg-subtle); }
.aira-fu-step-chevron { flex-shrink: 0; width: 1rem; height: 1rem; color: var(--aira-muted); }
.aira-fu-step.is-open .aira-fu-step-chevron { transform: rotate(90deg); }
.aira-fu-step-line { flex: 1 1 auto; min-width: 0; font-size: calc(.8125rem * var(--aira-type-scale, 1)); white-space: nowrap; }
.aira-fu-step-body { padding: 0 .375rem .25rem 1.875rem; }
/* The log form's person (FE2): the list as wide as a name and its number; a party contact's number shown beside it, read, never typed. */
.aira-fu-field.is-contact { width: 20rem; }
.aira-fu-field.is-phone { width: 9.5rem; }
.aira-fu-contact-number { display: flex; align-items: center; min-height: calc(1.5em + .75rem + 2px); font-variant-numeric: tabular-nums; }
.aira-fu-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .25rem 1rem; margin: .5rem 0 0; }
.aira-fu-facts > div,
.aira-fh-grid > div { min-width: 0; }
.aira-fu-facts dt,
.aira-fh-grid dt {
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--aira-muted);
}
.aira-fu-facts dd,
.aira-fh-grid dd { margin: 0; overflow-wrap: anywhere; }
.aira-fu-subhead {
    display: flex;
    align-items: center;
    margin-bottom: .25rem;
    font-size: calc(.75rem * var(--aira-type-scale, 1));
    font-weight: 600;
    color: var(--aira-label-ink);
}
.aira-fu-step-reminders { margin-top: .625rem; padding: .5rem .625rem; border-radius: var(--ins-border-radius); background: var(--ins-tertiary-bg); }

/* One reminder still to come: when · what · to whom and how · its outlook (FP3). */
.aira-fu-reminders { display: grid; gap: .25rem; }
.aira-fu-reminder {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
    align-items: baseline;
    gap: .125rem .625rem;
    font-size: calc(.8125rem * var(--aira-type-scale, 1));
}
.aira-fu-reminder.is-quiet { color: var(--aira-muted); }
.aira-fu-reminder-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-fu-reminder-name,
.aira-fu-reminder-to { min-width: 0; overflow-wrap: anywhere; }
.aira-fu-reminder-state { justify-self: end; white-space: normal; text-align: right; }
.aira-fu-forecast-none { display: flex; align-items: center; font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }
.aira-fu-sent { font-size: calc(.8125rem * var(--aira-type-scale, 1)); margin-top: .375rem; }
.aira-fu-sent th { font-weight: 600; color: var(--aira-muted); white-space: nowrap; }
.aira-fu-sent td, .aira-fu-sent th { padding: .25rem .375rem; background: transparent; }

/* The editors (FP4) open under their step, framed so the eye goes to them. */
.aira-fu-editor { margin: 0 1rem .75rem; padding: .75rem; border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); background: var(--ins-secondary-bg); }
.card-header + .aira-fu-editor { margin-top: .75rem; }

/* The section one column (the owner, 07/11/2026): the plan, the log form and the history one under the other, each the whole width. */
.aira-fu-stack { display: flex; flex-direction: column; gap: 1rem; }

/* A field only as wide as what it holds - a date a date's width, a name a name's - in rows that wrap as the width runs out; on a phone every
   field the whole line. The log form fills its card (below). */
.aira-fu-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem 1rem; }
.aira-fu-field { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.aira-fu-field.is-about { width: 22rem; }
.aira-fu-field.is-date { width: 10.5rem; }
.aira-fu-field.is-person { width: 16rem; }
.aira-fu-field.is-number { width: 12rem; }
.aira-fu-field.is-text { width: 31.25rem; }
.aira-fu-field.is-switch { flex: 0 0 auto; }
.aira-fu-field.is-days { width: 12rem; }
.aira-fu-field.is-whom { width: 22rem; }
.aira-fu-log-form { display: flex; flex-direction: column; gap: .75rem; }
/* Add a follow-up fills its card at every width (the owner, 16/11/2026 - it was one 63.5rem block, which left the right of a wide tab
   or dialog empty). The fields that hold words share what each line has left - About, the person, a typed name, Remind whom - from
   their own widths; a date, the switch, a number and the days keep theirs. The two textareas halve their line, each its own line
   under 18rem. The next-date box and the Save row are the card's width; Save at its right. */
.aira-fu-log-form .aira-fu-field.is-about,
.aira-fu-log-form .aira-fu-field.is-contact,
.aira-fu-log-form .aira-fu-field.is-person,
.aira-fu-log-form .aira-fu-field.is-whom { flex: 1 1 auto; }
.aira-fu-log-form .aira-fu-field.is-text { flex: 1 1 0; width: auto; min-width: min(18rem, 100%); }
/* The switch under its label, centred on a field's height so it sits level with the lists beside it. */
.aira-fu-switch { display: flex; align-items: center; min-height: calc(1.5em + .75rem + 2px); margin: 0; }
.aira-fu-switch > .form-check-input { margin-top: 0; }
@media (max-width: 575.98px) {
    .aira-fu-field:not(.is-switch) { width: 100%; }
}

/* The Remind fields (RM1, RM4, RM5): their wrapper is no box, so the switch, the lists and the live line stand in the caller's row beside the
   date; waiting for a next date on the log form; the live line the row's last line, gone while it says nothing. */
.aira-fu-next { padding: .75rem; border: 1px dashed var(--ins-border-color); border-radius: var(--ins-border-radius); }
.aira-fu-remind { display: contents; }
.aira-fu-remind[hidden] { display: none; }
.aira-fu-remind.is-waiting .form-label { color: var(--aira-muted); }
.aira-fu-forecast { flex: 0 0 100%; }
.aira-fu-forecast:empty { display: none; }
.aira-fu-forecast:not(:empty) { padding: .5rem .625rem; border-radius: var(--ins-border-radius); background: var(--ins-tertiary-bg); }

/* The history (FH6-FH7): one folded row per contact or cancelled step, a labelled grid when open. */
.aira-fh-list { display: grid; gap: .375rem; }
.aira-fh-entry { border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); background: var(--ins-secondary-bg); }
.aira-fh-entry.is-open { border-color: var(--ins-primary-border-subtle); }
.aira-fh-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-width: 0;
    padding: .5rem .625rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}
.aira-fh-row:hover { background: var(--ins-tertiary-bg); }
.aira-fh-entry.is-open > .aira-fh-row { background: var(--ins-primary-bg-subtle); }
.aira-fh-chevron { flex-shrink: 0; color: var(--aira-muted); }
.aira-fh-entry.is-open .aira-fh-chevron { transform: rotate(90deg); }
.aira-fh-when { flex-shrink: 0; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--aira-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-fh-person { flex-shrink: 0; max-width: 11rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aira-fh-gist { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ins-secondary-color); }
.aira-fh-tail { display: flex; flex-shrink: 0; align-items: center; gap: .375rem; margin-left: auto; }
.aira-fh-count { display: inline-flex; align-items: center; gap: .125rem; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }
.aira-fh-subject { flex-shrink: 1; min-width: 0; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aira-fh-body { padding: .25rem .875rem .75rem 2.25rem; border-top: 1px solid var(--ins-border-color); }

/* The person a follow-up is with (crm/93 FE2, crm/99 C8): no box of its own - the list and the number it shows stand in the caller's row; the
   editor that adds a person to the party takes a line of its own under them, and its door sits under the list. */
.aira-fu-person { display: contents; }
.aira-fu-field.is-add { flex: 1 1 100%; width: 100%; }
.aira-fu-field.is-add .aira-fu-subhead { margin-bottom: .5rem; }
.aira-fu-add-open { display: inline-flex; align-items: center; margin-top: .25rem; text-decoration: none; }

/* ==========================================================================
   An item's status by size and quantity (crm/93 §6) - the read's Item status tab and its Update status dialog
   ========================================================================== */

/* The strip is the read's tiles (.aira-qv-tiles, crm/94 US1). The bar in the card's head says what is chosen and acts on it (US2). */
.aira-os-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.aira-os-bar-text { font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); }
.aira-os-bar.has-choice .aira-os-bar-text { font-weight: 600; color: var(--ins-primary); }

/* The table: an item a group head on the neutral ground - never the chosen tint (US3); its sizes under it; a chosen size tinted and ruled at
   its left (US4); the figures in columns that line up, a zero a muted dash (US5). */
.aira-os-table td, .aira-os-table th { font-variant-numeric: tabular-nums; }
/* A heading and a figure's small line on one line each - the table scrolls in its box rather than stack them three high. */
.aira-os-table > thead > tr > th, .aira-os-table td > div.text-muted { white-space: nowrap; }
.aira-os-table .aira-os-pick { width: 2.75rem; text-align: center; }
.aira-os-table .aira-os-expand { width: 1%; text-align: end; white-space: nowrap; }
/* A size's own Update status beside its History - History keeps the right edge on every row (crm/94 §6). */
.aira-os-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .25rem; }
.aira-os-table > tbody > tr.aira-os-item-row > td { background: var(--ins-tertiary-bg); border-top: 1px solid var(--ins-border-color); }
.aira-os-table > tbody > tr.aira-os-size-row > td.aira-os-size { padding-left: 1.75rem; }
.aira-os-table > tbody > tr.is-choosable { cursor: pointer; }
.aira-os-table > tbody > tr.aira-os-size-row.is-choosable:hover > td { background: color-mix(in srgb, var(--ins-primary) 4%, transparent); }
.aira-os-table > tbody > tr.aira-os-size-row.is-picked > td,
.aira-os-table > tbody > tr.aira-os-size-row.is-picked:hover > td { background: color-mix(in srgb, var(--ins-primary) 10%, transparent); }
.aira-os-table > tbody > tr.aira-os-size-row.is-picked > td:first-child { box-shadow: inset 3px 0 0 var(--ins-primary); }
/* The item's name flows as one line of words - the column wide enough to read it, never three words high. */
.aira-os-item-title { min-width: 16rem; }
.aira-os-item-name { display: inline; line-height: 1.6; }
.aira-os-item-row.is-choosable .aira-os-item-name { cursor: pointer; }
.aira-os-item-product { color: var(--ins-secondary-color); }
.aira-os-done { display: inline-flex; vertical-align: middle; color: var(--ins-success); cursor: help; }
.aira-os-size-row .aira-os-done { color: var(--aira-muted); }
.aira-os-undecided { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.aira-os-zero { font-weight: 400; color: var(--aira-muted); }
.aira-os-toggle { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.aira-os-toggle.is-open .aira-os-toggle-chevron { transform: rotate(180deg); }

/* A size's entries, opened under it: one line each - its chip, how many, its PO or reason, who and when - then its note; a withdrawn one struck. */
.aira-os-table > tbody > tr.aira-os-entries > td { background: var(--ins-tertiary-bg); }
.aira-os-entry-list { display: grid; gap: .375rem; padding: .25rem 0; }
.aira-os-entry { padding: .375rem .5rem; border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); background: var(--ins-secondary-bg); }
.aira-os-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; }
.aira-os-entry-note { margin-top: .25rem; font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); overflow-wrap: anywhere; }
.aira-os-entry-withdrawn { margin-top: .25rem; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }
.aira-os-entry.is-withdrawn > .aira-os-entry-head > span:not(.status-badge) { text-decoration: line-through; color: var(--aira-muted); }
.aira-os-withdraw { margin-top: .5rem; padding: .625rem; border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); background: var(--ins-body-bg); }

/* The dialog (crm/94 §4): its form no box (the scrolling body and the foot stay the modal's own children); sections as cards with the house head
   (UD2); the status as wide as a status's name, what it records said under it (UD3); the rows grouped under their item (UD4); the foot saying
   what Save will do (UD5). A section not asked is hidden - over the card's own display. */
.aira-os-formbox { display: contents; }
.aira-os-sec[hidden] { display: none !important; }
.aira-os-sec > .card-body { padding: .875rem 1rem; }
.aira-fu-field.is-status { width: 24rem; }
/* 80 % of the screen (crm/94 §10, the owner) - a phone's own width below sm, as the lead's wide dialogs. */
.modal-dialog.aira-os-dialog { width: 80vw; max-width: 80vw; }
@media (max-width: 575.98px) {
    .modal-dialog.aira-os-dialog { width: auto; max-width: none; margin: .5rem; }
}
/* The PO's number and date sit in the status's own row as two more fields: the wrapper is no box, and hidden is gone whole. */
.aira-os-po { display: contents; }
.aira-os-po[hidden] { display: none !important; }
.aira-os-explain { display: flex; align-items: flex-start; gap: .5rem; margin-top: .75rem; font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); }
.aira-os-explain[hidden] { display: none; }
.aira-os-explain > svg { margin-top: .1875rem; color: var(--ins-primary); }
.aira-os-form-table td, .aira-os-form-table th { font-variant-numeric: tabular-nums; }
.aira-os-form-table > :not(caption) > tr > :first-child { padding-inline-start: 1rem; }
.aira-os-form-table > :not(caption) > tr > :last-child { padding-inline-end: 1rem; }
.aira-os-form-table > tbody > tr.aira-os-form-item > td { padding-block: .5rem .375rem; background: var(--ins-tertiary-bg); }
.aira-os-form-table > tbody > tr > td.aira-os-form-size { padding-inline-start: 1.75rem; }
.aira-os-qty-cell { width: 12rem; }
.aira-os-qty-group { width: 10.5rem; margin-inline-start: auto; flex-wrap: nowrap; }
.aira-os-qty-group[hidden] { display: none; }
.aira-os-qty-group > .input-group-text { font-size: calc(.8125rem * var(--aira-type-scale, 1)); white-space: nowrap; }
.aira-os-all { font-weight: 600; }
.aira-os-all[hidden] { display: none; }
.aira-os-form-table tfoot th { border-bottom: 0; padding-block: .625rem; }
.aira-os-summary { min-width: 0; font-size: calc(.8125rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); }
.aira-os-summary.is-set { font-weight: 600; color: var(--aira-ink); }
.aira-fh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; margin: .5rem 0 0; }
.aira-fh-grid > .is-wide { grid-column: 1 / -1; }
.aira-fh-entry.is-cancelled .aira-fh-gist { text-decoration: line-through; }
.aira-fh-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.aira-fh-chip-name { display: inline-block; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

@media (max-width: 575.98px) {
    .aira-fu-reminder { grid-template-columns: minmax(0, 1fr) auto; }
    .aira-fu-reminder-to { grid-column: 1 / -1; }
    .aira-fh-grid { grid-template-columns: minmax(0, 1fr); }
    .aira-fh-gist { display: none; }
    .aira-fh-body { padding-left: .875rem; }
}

@media (max-width: 575.98px) {
    .aira-followup { grid-template-columns: minmax(0, 1fr); }
    /* The head's moves take their own row under the chips rather than a column beside them. */
    .aira-lead [data-lead-moves] { flex-basis: 100%; margin-left: 0 !important; }
}

/* ==========================================================================
   OA Received (crm/40 §10-§12) - the one form's lines, its summary rail, Add items
   and Detail. The form is the quotation form's (.aira-qf); these are only what an
   OA adds to it.
   ========================================================================== */
.aira-oa-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; margin: 0; }
.aira-oa-totals dt { font-weight: 400; color: var(--ins-secondary-color); }
.aira-oa-totals dd { margin: 0; text-align: end; font-weight: 600; white-space: nowrap; }
/* A flex item's minimum is its content's, and the items' table has a wide one: without this the work column took the whole row at 1440 and the side strip wrapped below the page. */
.aira-oa .aira-qf-main { min-width: 0; }

/* An OA's items (crm/79 §4): one table, a tbody per quotation item - its head on a ground of its own, its sizes, a row under each for what is not money, and its accessories. */
.aira-oa-lines { font-size: calc(.8125rem * var(--aira-type-scale, 1)); }
.aira-oa-lines td { vertical-align: top; }
/* Twelve columns have to fit at 1440: the side padding is what they can give up. A cell's first and last keep the card's own. */
.aira-oa-lines > * > tr > td, .aira-oa-lines > * > tr > th { padding-inline: .3125rem; }
.aira-oa-lines > * > tr > :first-child { padding-inline-start: .5rem; }
.aira-oa-lines > * > tr > :last-child { padding-inline-end: .5rem; }
.aira-oa-lines td input.form-control { min-width: 4.25rem; padding-inline: .5rem; }
.aira-oa-lines td[data-label] input[type="number"] { font-variant-numeric: tabular-nums; }
/* A number breaks at no character: read whole, or it reads as another number. */
.aira-oa-lines td.aira-oa-ref { white-space: normal; }
.aira-oa-ref .font-monospace, .aira-oa-lead-no { font-size: calc(.6875rem * var(--aira-type-scale, 1)); white-space: nowrap; }
.aira-oa-lines tr.aira-oa-item-head > td { padding: .375rem .5rem; background-color: var(--ins-tertiary-bg); white-space: normal; vertical-align: middle; }
.aira-oa-item-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.aira-oa-item-title { flex-basis: 16rem; }
.aira-oa-item-name { color: var(--ins-secondary-color); }
.aira-oa-item-amount { min-width: 6.5rem; }
.aira-oa-item.is-collapsed > tr:not(.aira-oa-item-head) { display: none; }
.aira-oa-item.is-drag-source { display: none; }
.aira-oa-item-slot > tr > td {
    padding: 0;
    border: 2px dashed var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 8%, transparent);
}
.aira-oa-lines tr.aira-oa-line-more > td { padding-top: 0; white-space: normal; }
.aira-oa-more-fields { display: grid; grid-template-columns: repeat(3, minmax(9rem, 12rem)) minmax(14rem, 1fr); align-items: end; gap: .5rem .75rem; }
.aira-oa-more-fields .form-label { margin-bottom: .125rem; }
.aira-oa-more-source { grid-column: 1 / -1; }
.aira-oa-lines tr.aira-oa-item-acc > td { white-space: normal; }

/* ---- An item's table headed under its product (crm/84 TH1-TH4) -----------------------------------------------------------
   Each item draws its own column heading as the row under its product row - above item 1 the one heading named item 1's
   product bar. The table's <thead> stays for the Columns control and a screen reader's table, taking no room (TH2). The
   product row's parts carry captions (TH3). An open item wears the brand's tint - its product row the stronger with a rule
   at its start, its heading and sizes the lighter - over whatever ground the card has, so dark mode and a brand picked in
   Appearance tint alike (TH4). */
:root {
    --aira-item-open-head-bg: color-mix(in srgb, var(--ins-primary) 10%, transparent);
    --aira-item-open-bg: color-mix(in srgb, var(--ins-primary) 4%, transparent);
    --aira-item-open-rule: var(--ins-primary);
}
html[data-bs-theme="dark"] {
    --aira-item-open-head-bg: color-mix(in srgb, var(--ins-primary) 24%, transparent);
    --aira-item-open-bg: color-mix(in srgb, var(--ins-primary) 9%, transparent);
    --aira-item-open-rule: var(--ins-primary-text-emphasis);
}
.aira-thead-under > tr > th {
    height: 0;
    padding-block: 0 !important;
    border: 0 !important;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}
tr.aira-item-colhead > th {
    padding-block: .3125rem;
    border-bottom: 1px solid var(--ins-border-color);
    color: var(--ins-secondary-color);
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: bottom;
}
.aira-item-cap {
    display: block;
    margin-bottom: .0625rem;
    color: var(--ins-secondary-color);
    font-size: calc(.625rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}
.aira-oa-item-status, .aira-oa-item-vs { min-width: 6rem; }
.aira-oa-item-vs { text-align: end; }
/* The OA form's group folds by its tbody's class; the read's and the trace's by Bootstrap's collapse on the tbody after the head. */
tbody.aira-oa-item[data-oa-item]:not(.is-collapsed) > tr.aira-oa-item-head > td,
tbody.aira-oa-item:has(+ tbody.collapse.show) > tr.aira-oa-item-head > td {
    background-color: var(--aira-item-open-head-bg);
    box-shadow: inset 3px 0 0 var(--aira-item-open-rule);
}
tbody.aira-oa-item[data-oa-item]:not(.is-collapsed) > tr:not(.aira-oa-item-head) > td,
tbody.aira-oa-item[data-oa-item]:not(.is-collapsed) > tr.aira-item-colhead > th,
tbody.aira-item-rows.collapse.show > tr > td,
tbody.aira-item-rows.collapse.show > tr > th {
    background-color: var(--aira-item-open-bg);
}
tbody.aira-oa-item[data-oa-item]:not(.is-collapsed) > tr:not(.aira-oa-item-head) > td:first-child,
tbody.aira-oa-item[data-oa-item]:not(.is-collapsed) > tr.aira-item-colhead > th:first-child,
tbody.aira-item-rows.collapse.show > tr > td:first-child,
tbody.aira-item-rows.collapse.show > tr > th:first-child {
    box-shadow: inset 3px 0 0 var(--aira-item-open-rule);
}
/* The read's tiles (crm/94 TR1, US1) - the Orders and Item status tabs' strips in one look: a caption, the figure, a muted line. The tile
   that leads the strip (what an OA can take now) carries the brand's rule. */
.aira-qv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.aira-qv-tile { min-width: 0; padding: .5rem .75rem; border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); background: var(--ins-secondary-bg); }
.aira-qv-tile.is-lead { border-color: color-mix(in srgb, var(--ins-primary) 40%, var(--ins-border-color)); box-shadow: inset 3px 0 0 var(--ins-primary); }
.aira-qv-tile-label,
.aira-qv-tile-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aira-qv-tile-label {
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--aira-muted);
}
.aira-qv-tile-value { margin-top: .125rem; font-size: calc(1rem * var(--aira-type-scale, 1)); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aira-qv-tile-note { margin-top: .0625rem; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); }
.aira-qv-tile-meter { display: flex; height: 4px; margin-top: .375rem; overflow: hidden; border-radius: 2px; background-color: color-mix(in srgb, var(--aira-muted) 22%, transparent); }
.aira-qv-tile-meter > span { background-color: var(--ins-success); }

/* An item's share order received, by quantity (crm/98) - the figure over a thin meter, beside its status chip (Quotations/_ReceivedShare). */
.aira-received-share { display: inline-flex; flex-direction: column; gap: .1875rem; min-width: 5.5rem; vertical-align: middle; }
.aira-received-share-figure { font-size: calc(12px * var(--aira-type-scale, 1)); font-weight: 600; color: var(--ins-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-received-share-bar { display: block; height: 4px; overflow: hidden; border-radius: 2px; background-color: color-mix(in srgb, var(--aira-muted) 22%, transparent); }
.aira-received-share-bar > span { display: block; height: 100%; border-radius: 2px; background-color: var(--ins-primary); }
/* The dialog's line under an item - what share of it the quantities typed make (pages/quotation-outcomes.js). */
.aira-os-form-share { font-size: calc(12px * var(--aira-type-scale, 1)); color: var(--aira-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-os-form-share.is-moving { color: var(--ins-primary); font-weight: 600; }

/* The Orders tab (crm/94 §2): an item's head - product, status, six figures in fixed columns so they line up item under item - and the bar
   over what was quoted, its parts named once in the legend. What was never received is the track. */
.aira-qv-part { display: inline-block; flex: 0 0 auto; }
.aira-qv-part.is-booked { background-color: var(--ins-success); }
.aira-qv-part.is-waiting { background-color: var(--ins-warning); }
.aira-qv-part.is-held { background-color: color-mix(in srgb, var(--ins-warning) 45%, transparent); }
.aira-qv-part.is-ready { background-color: var(--ins-primary); }
.aira-qv-part.is-closed { background-color: var(--aira-muted); }
.aira-qv-part.is-gone { background-color: color-mix(in srgb, var(--ins-danger) 70%, transparent); }
.aira-qv-part.is-open { background-color: color-mix(in srgb, var(--aira-muted) 22%, transparent); }
.aira-qv-trace-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    padding: .625rem 1.25rem 0;
    font-size: calc(.75rem * var(--aira-type-scale, 1));
    color: var(--ins-secondary-color);
}
.aira-qv-trace-legend > span { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; }
.aira-qv-trace-legend .aira-qv-part { width: .625rem; height: .625rem; border-radius: 2px; }
.aira-qv-trace-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.aira-qv-trace-product { flex: 1 1 16rem; min-width: 0; }
/* A product's name runs to two lines beside its figures, the whole of it in its title. */
.aira-qv-trace-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.aira-qv-trace-status { flex: 0 0 auto; min-width: 7.5rem; }
.aira-qv-trace-figures { display: grid; flex: 0 0 auto; grid-template-columns: repeat(5, minmax(4.5rem, max-content)) minmax(6.5rem, max-content); gap: 0 .75rem; margin: 0; }
.aira-qv-trace-figures > div { text-align: end; }
.aira-qv-trace-figures .aira-item-cap { text-align: end; }
.aira-qv-trace-figures dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.aira-qv-trace-figures dd.is-zero { font-weight: 500; color: var(--aira-muted); }
.aira-qv-trace-meter { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.aira-qv-trace-bar { display: flex; flex: 1 1 auto; min-width: 6rem; height: 6px; overflow: hidden; border-radius: 3px; background-color: color-mix(in srgb, var(--aira-muted) 22%, transparent); }
.aira-qv-trace-bar > .aira-qv-part { height: 100%; }
.aira-qv-trace-caption { flex: 0 1 auto; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--ins-secondary-color); white-space: nowrap; }
/* An item with no OA line (TR4): one row - what comes next, and the way to it - never twelve headings over nothing. */
.aira-qv-trace tr.aira-qv-trace-empty > td { padding: .625rem .75rem; white-space: normal; }
.aira-qv-trace-next { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .625rem; color: var(--ins-secondary-color); }
.aira-qv-trace-next-icon { flex-shrink: 0; color: var(--aira-muted); }
.aira-qv-trace-next-icon.is-ready { color: var(--ins-primary); }

/* A list of long words (crm/84 SF6) - a product feature's description runs to 500 characters: two lines an option, broken anywhere a word
   is longer than the list, the whole words in its title; the panel no wider than the bar's, so it never runs off the screen. */
.aira-ms[data-ms-long] .aira-ms-opt { align-items: flex-start; }
.aira-ms[data-ms-long] .aira-ms-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.aira-ms[data-ms-long] .aira-ms-panel { max-width: min(36rem, calc(100vw - 2rem)); }
.aira-search-group-head.is-sub { margin-top: .5rem; }
a.aira-qv-trace-oa { color: var(--ins-primary); text-decoration: none; }
a.aira-qv-trace-oa:hover { text-decoration: underline; }
/* A quotation's item card (form, read, the lead's Product Selection): open, its head tinted and ruled, its body the lighter. */
.aira-quotation-item:has(> .collapse.show) { border-color: color-mix(in srgb, var(--ins-primary) 45%, var(--ins-border-color)) !important; }
.aira-quotation-item:has(> .collapse.show) > div.aira-quotation-item-head {
    background-color: var(--aira-item-open-head-bg);
    box-shadow: inset 3px 0 0 var(--aira-item-open-rule);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}
.aira-quotation-item > .collapse.show > div.aira-quotation-item-body { background-color: var(--aira-item-open-bg); box-shadow: inset 3px 0 0 var(--aira-item-open-rule); }
.aira-quotation-item-head .aira-item-cap { margin-bottom: 0; }
.aira-oa-acc-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .25rem .75rem; padding: .25rem 0; }
.aira-oa-acc-line.is-out .aira-oa-acc-name, .aira-item-accessory-line.is-out { color: var(--aira-muted); text-decoration: line-through; }
.aira-oa-acc-rate { width: 9rem; }
.aira-oa-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.aira-oa-panel .aira-item-details-heading:not(:first-of-type) { margin-top: 1.5rem; }
.aira-oa-panel-on > td { background-color: color-mix(in srgb, var(--ins-primary) 6%, transparent); }
.aira-oa-charges td { vertical-align: top; }
.aira-oa-charges td input.form-control { width: 7.5rem; margin-inline-start: auto; }
.aira-oa-charges [data-oa-charge-note] { text-align: end; }
/* The trail of a line (crm/79 §11): lead, quotation, OAs - a step each, what this line is marked. */
.aira-oa-trail-step { display: flex; gap: .75rem; padding-bottom: .75rem; }
.aira-oa-trail-mark {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ins-primary) 12%, transparent);
    color: var(--ins-primary);
}
.aira-oa-trail-mark > svg { width: .875rem; height: .875rem; }
.aira-oa-trail-label { color: var(--aira-muted); font-size: calc(.6875rem * var(--aira-type-scale, 1)); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.aira-oa-trail-row { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .5rem; padding: .125rem .375rem; margin-inline: -.375rem; border-radius: var(--ins-border-radius); }
.aira-oa-trail-row.is-this { background-color: color-mix(in srgb, var(--ins-primary) 7%, transparent); }
.aira-oa-trail-row.is-muted { color: var(--aira-muted); }
/* Select quotation items (crm/78 §7): the quotations down the side, the chosen one's rows filling the rest, each scrolling in its own box. */
.aira-oa-pick { display: flex; flex: 1 1 auto; min-height: 0; }
.aira-oa-pick-side { display: flex; flex-direction: column; flex: 0 0 22rem; min-height: 0; border-inline-end: 1px solid var(--ins-border-color); background: var(--ins-tertiary-bg); }
.aira-oa-pick-find { padding: .75rem; border-bottom: 1px solid var(--ins-border-color); }
.aira-oa-pick-find-icon { position: absolute; top: 50%; left: .625rem; width: 1rem; height: 1rem; transform: translateY(-50%); pointer-events: none; }
.aira-oa-pick-party { margin-top: .5rem; }
.aira-oa-pick-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .5rem; }
.aira-oa-pick-card {
    display: block;
    width: 100%;
    margin-bottom: .375rem;
    padding: .5rem .625rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.aira-oa-pick-card:hover { border-color: var(--ins-primary); }
.aira-oa-pick-card.active { border-color: var(--ins-primary); box-shadow: inset 3px 0 0 var(--ins-primary); }
.aira-oa-pick-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.aira-oa-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--ins-border-color); }
.aira-oa-pick-rows { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: .75rem 1rem; }
.aira-oa-pick-rows[hidden] { display: none; }
.aira-oa-pick-box { width: 2.75rem; }
.aira-oa-pick-table tr.aira-oa-pick-item > td { background-color: var(--ins-tertiary-bg); }
.aira-oa-pick-name { min-width: 0; max-width: 28rem; }
.aira-oa-pick-table tr.is-pickable { cursor: pointer; }
.aira-oa-pick-table tr.is-picked > td { background-color: color-mix(in srgb, var(--ins-primary) 7%, transparent); }
.aira-oa-pick-empty { flex: 1 1 auto; align-content: center; padding: 2.5rem 1.5rem; color: var(--aira-muted); text-align: center; }
@media (max-width: 991.98px) {
    .aira-oa-pick { flex-direction: column; overflow-y: auto; }
    .aira-oa-pick-side { flex: 0 0 auto; max-height: 45vh; border-inline-end: 0; border-bottom: 1px solid var(--ins-border-color); }
}

/* A quotation's Orders tab (crm/78 §8): each item a band with how far it has been ordered, its OA lines under it; a line that holds nothing, muted. */
.aira-qv-trace tr.aira-qv-trace-item > td { background-color: var(--ins-tertiary-bg); white-space: normal; }
.aira-qv-trace-card > .card-body { padding-top: .5rem; }
.aira-qv-trace tr.aira-qv-trace-dead > td { color: var(--aira-muted); }
.aira-oa .text-pre-wrap, .aira-qv .text-pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.aira-oa [data-oa-head] .aira-qf-bar { flex-wrap: wrap; }
/* The order's own figure closes the read's summary, as the grand total closes a quotation's. The term reaches across the column gap, so the rule over the two is one line. */
.aira-oa-totals .aira-oa-total { margin-top: .25rem; padding-top: .5rem; border-top: 1px solid var(--ins-border-color); font-weight: 600; color: var(--aira-ink); }
.aira-oa-totals dt.aira-oa-total { margin-inline-end: -.75rem; padding-inline-end: .75rem; }
/* A status's name stays on one line beside its figures; and an OA below its quotation on every line keeps its band short - the list scrolls, the head stays near. */
.aira-qv .aira-oa-lines .status-badge { white-space: nowrap; }
.aira-qv [data-oa-frozen] ul { max-height: 6.5rem; overflow-y: auto; }
.aira-item-orders { color: var(--ins-secondary-color); }

/* Below lg each line is a card (§11.1): its product, then each figure on its own labelled row - the inputs at the house size. */
@media (max-width: 991.98px) {
    .aira-oa .aira-oa-lines thead, .aira-oa .aira-oa-lines tr.aira-item-colhead { display: none !important; }
    .aira-oa .aira-oa-lines, .aira-oa .aira-oa-lines tbody, .aira-oa .aira-oa-lines tr, .aira-oa .aira-oa-lines td { display: block; width: 100%; }
    .aira-oa .aira-oa-lines .aira-oa-item.is-collapsed > tr:not(.aira-oa-item-head) { display: none; }
    .aira-oa .aira-oa-lines tr[data-oa-key] {
        border: 1px solid var(--ins-border-color); border-radius: var(--ins-border-radius); padding: .5rem .75rem; margin-bottom: .75rem;
    }
    .aira-oa .aira-oa-lines tr[data-oa-key] > td { border: 0; padding: .25rem 0; text-align: start !important; }
    .aira-oa .aira-oa-lines tr[data-oa-key] > td[data-label]:not(:first-child) { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; gap: .5rem; }
    .aira-oa .aira-oa-lines tr[data-oa-key] > td[data-label]:not(:first-child)::before { content: attr(data-label); color: var(--ins-secondary-color); font-size: .8125rem; }
    .aira-oa .aira-oa-lines tr[data-oa-key] > td:last-child { text-align: end !important; }
    .aira-oa .aira-oa-lines tr.aira-oa-item-head > td { border: 0; }
    .aira-oa .aira-oa-lines tr.aira-oa-line-more > td, .aira-oa .aira-oa-lines tr.aira-oa-item-acc > td { border: 0; padding: .25rem 0 .75rem; }
    .aira-oa-more-fields { grid-template-columns: minmax(0, 1fr); }
    .aira-oa .aira-oa-lines td input.form-control { min-width: 0; }
}
@media (max-width: 575.98px) {
    .aira-oa [data-oa-moves] { flex-basis: 100%; }
}
.aira-oa-lines .status-badge { white-space: normal; text-align: start; }

/* A drill row's preview (crm/46 DW5): the Approvals drawer's widths, docked right - a stacked dialog, not an offcanvas. */
.aira-preview-modal .modal-dialog { margin: 0 0 0 auto; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; }
@media (min-width: 768px) { .aira-preview-modal .modal-dialog { width: 60vw; max-width: 60vw; } }
@media (min-width: 1200px) { .aira-preview-modal .modal-dialog { width: 720px; max-width: 720px; } }
.aira-preview-modal .modal-content { height: 100%; border-radius: 0; }

/* A quotation's preview is the whole read (crm/46 DW5a), as in the Approvals drawer (crm/73 R4): that drawer's width from the first
   frame (.is-wide, set before the read is asked), and once it lands the read's own title and foot in place of this head (.is-full). */
.aira-preview-modal.is-wide .modal-dialog { width: 100vw; max-width: 100vw; }
@media (min-width: 992px) { .aira-preview-modal.is-wide .modal-dialog { width: min(88vw, 1320px); max-width: min(88vw, 1320px); } }
.aira-preview-modal.is-full .modal-header { display: none; }
.aira-preview-modal.is-full .modal-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.aira-preview-modal.is-full .modal-body > .aira-qv { flex: 1 1 auto; min-height: 0; }

/* The Approvals drawer (crm/41 §5): 720 px from 1200 px, 60 % from md, the whole screen below it. */
.offcanvas.offcanvas-end.aira-approvals-drawer { width: 100vw; }
@media (min-width: 768px) { .offcanvas.offcanvas-end.aira-approvals-drawer { width: 60vw; } }
@media (min-width: 1200px) { .offcanvas.offcanvas-end.aira-approvals-drawer { width: 720px; } }
.aira-approvals-table tr[data-approval-row] { cursor: pointer; }
.aira-approval-why { min-width: 9.75rem; max-width: 14rem; }

/* One reason a line, two lines at most - an OA's frozen exceptions are whole sentences; the drawer reads them in full. */
.aira-approval-why-line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   The register frame (crm/43 §4) - Leads, OA Received, Quotations and Approvals.

   One card, three bands, each control on one row and in one place: the head
   (the views as the house tab strip, sitting on the head's rule, and the
   page's one primary action), the toolbar (the compact search bar alone), and
   the table - rows per page with the summary on its first row, the rows shown
   with the pager on its last. The quick views used to be pills between the bar
   and DataTables' "25 rows", read as part of the table's toolbar (43 F1).
   ========================================================================== */
.aira-register-head {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding-top: .5rem;
    padding-bottom: 0;
}

/* The strip scrolls sideways inside the head on a narrow screen - a tab's words never wrap or truncate. */
.aira-register-views {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    border-bottom: 0;
}

.aira-register-views .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .7rem .7rem;
    white-space: nowrap;
}

.aira-register-views .aira-tab-count {
    min-width: 1.5rem;
    font-weight: 600;
}

.aira-register-action {
    flex: 0 0 auto;
    align-self: center;
    padding-bottom: .5rem;
}

/* A head with no views (a reader with one tab) keeps its height and its action at the right. */
.aira-register-head:not(:has(> .aira-register-views)) { justify-content: flex-end; padding-bottom: .5rem; }

.aira-register-toolbar {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.aira-register-toolbar .aira-filterbar { margin-bottom: 0; }

.aira-register-body { padding-top: .75rem; padding-bottom: .75rem; }

/* One line where there is room: with no rows the headings sit on one line, and rows arriving narrowed the columns until they
   wrapped, so the header grew 13 px and the page moved as the rows landed (crm/69 §12). From 1440 px every register fits, in both
   languages, with no wider a table; at 1400 Gujarati's run past the card. */
@media (min-width: 1440px) {
    .aira-register thead th { white-space: nowrap; }
}

/* An empty answer draws neither a count of nothing nor a pager with nothing to page; the rest of the foot stays, so it does not jump. */
.aira-register-grid.is-empty .dt-info,
.aira-register-grid.is-empty .dt-paging { display: none; }

.aira-register-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .75rem;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
}

.aira-register-summary [data-queue-summary] {
    color: var(--ins-body-color);
    font-weight: 500;
}

/* The actions cell: icon buttons and the ⋯ menu on one line, the column never folded. */
.aira-register-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.aira-register table.dataTable > tbody > tr > td,
.aira-register .table > tbody > tr > td { vertical-align: middle; }

/* A row opens its products (crm/82: tr[data-xrow]'s pointer); the record itself opens from its eye alone (crm/48 R1). */

@media (max-width: 767.98px) {
    .aira-register-head { gap: .5rem; }
}

/* Approvals on the frame (crm/43 §8): the kind as a small tinted square beside the number, the party its own column, the
   actions one compact line - the row read left to right without a third of it empty before three full-size buttons. */
.aira-approval-kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--ins-border-radius);
    background-color: var(--ins-primary-bg-subtle);
    color: var(--ins-primary);
}

html[data-bs-theme="dark"] .aira-approval-kind { color: var(--ins-primary-text-emphasis); }

.aira-approval-party { min-width: 8.75rem; max-width: 13rem; }

/* The chevron ahead of it took its width from here and the party: a queue of hundreds at most, and the row stays in its card at 1440 px (crm/82). */
.aira-tscroll .aira-approvals-table .sr-col {
    width: 3rem;
    min-width: 3rem;
    max-width: 3rem;
}

.aira-approvals-table .font-monospace { font-size: .8125rem; }

.aira-approvals-table .aira-register-actions .btn-soft-success,
.aira-approvals-table .aira-register-actions .btn-soft-danger { padding-inline: .6rem; }

/* A quotation's ⋯ (crm/43 §5.2): wide enough that a held move's reason reads as a line. */
.aira-row-menu { min-width: 15rem; max-width: 22rem; }
.aira-row-menu .dropdown-header { max-width: 22rem; }
.aira-row-menu .aira-row-menu-text { min-width: 0; white-space: normal; }

/* An entry that unfolds to its choices (crm/106 §9) - Print and Download PDF, Without or With product images: the choices indented under it,
   its chevron turned while open. No transition (hard rule 10e). */
.aira-row-menu .aira-row-menu-chevron { flex-shrink: 0; }
.aira-row-menu [data-row-expand][aria-expanded="true"] .aira-row-menu-chevron { transform: rotate(180deg); }
.aira-row-menu .aira-row-menu-choices > li > .dropdown-item { padding-left: calc(var(--ins-dropdown-item-padding-x) + 1.25rem); }

/* A quotation's chain (crm/43 RG8): the reason reads as a sentence, its own line breaks kept. */
.aira-revision-why { min-width: 14rem; max-width: 28rem; white-space: normal; }
.aira-revision-why .text-pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* A register fits its card at 1440 px (crm/43 §4): the theme's roomy cells tightened sideways, a party's name given two lines at
   a readable width instead of five in a sliver, the head never wrapping its action under the tabs. */
/* The theme compiles `.card-header { flex-wrap: wrap !important }` - only an !important of more weight keeps the action beside the
   tabs, the strip scrolling instead (crm/43 §4). */
.card-header.aira-register-head { flex-wrap: nowrap !important; }

.aira-register .table > :not(caption) > * > * {
    padding-inline: .55rem;
}

.aira-register .table > :not(caption) > * > *:first-child { padding-inline-start: .75rem; }
.aira-register .table > :not(caption) > * > *:last-child { padding-inline-end: .75rem; }

.aira-register td.aira-register-name { min-width: 10rem; max-width: 16rem; }

.aira-register .font-monospace.fw-semibold { font-size: .8125rem; }

/* A head with many views (the quotations' six) keeps every word on a laptop: the icons go first, the words stay. */
@media (max-width: 1599.98px) {
    .aira-register-views .nav-link > i { display: none; }
}

/* ==========================================================================
   Data import (crm/49 §6) - the three steps on the theme's wizard tabs, the upload with its guide, the progress of a job, and
   the report: the head, the verdict, the tiles (the drill dialog's .drill-stat), what can be imported as one bar, the
   problem groups and the notes, the masters' tree (crm/57), the rows and the columns, and the next step. Every colour a
   token - the brand is a runtime setting.
   ========================================================================== */
.aira-import-steps { gap: .5rem; padding-left: 0; list-style: none; }
.aira-import-steps .nav-item { flex: 1 1 0; min-width: 0; }
.aira-import-steps .nav-link { cursor: default; }
.aira-import-steps .nav-link.active {
    border-color: var(--ins-primary) !important;
    background-color: var(--ins-primary-bg-subtle);
}
.aira-import-steps .nav-link.active .aira-import-step-icon { color: var(--ins-primary); }

@media (max-width: 767.98px) {
    .aira-import-steps { flex-direction: column; }
}

.aira-import-drop { min-height: 9rem; }

/* An old run's report over the page (crm/78 §9.1): the record dialog's body is a frame that does not scroll, so this one says it does. */
.modal-record .modal-body.aira-import-report-body { display: block; padding: 1rem 1.25rem; overflow-y: auto; }
.aira-import-history-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem var(--ins-card-spacer-x, 1rem); border-bottom: 1px solid var(--ins-border-color); }
.aira-import-history-file { max-width: 24rem; }
.aira-import-history-file .text-truncate { min-width: 0; }
.aira-import-history-state { flex: 0 0 13rem; width: 13rem; }

.aira-import-guide {
    background-color: var(--ins-tertiary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    padding: 1rem 1.25rem;
}

.aira-import-columns {
    columns: 2;
    column-gap: 1.5rem;
    font-size: .8125rem;
}

.aira-import-columns > li {
    break-inside: avoid;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .375rem;
    padding: .125rem 0;
}

@media (max-width: 575.98px) {
    .aira-import-columns { columns: 1; }
}

.aira-import-rules .accordion-item { background-color: transparent; border: 0; }
.aira-import-rules .accordion-button {
    background-color: transparent;
    box-shadow: none;
    font-size: .875rem;
    font-weight: 600;
}

.aira-import-progress { max-width: 48rem; margin: 2.5rem auto; }

.aira-import-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem 1rem;
}

.aira-import-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--ins-border-radius);
    background-color: var(--ins-success-bg-subtle);
    color: var(--ins-success);
    font-size: 1.375rem;
}

.aira-import-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: auto;
}

.aira-import-tiles { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.aira-import-tile { border-top: 3px solid var(--ins-border-color); }
.aira-import-tile.is-success { border-top-color: var(--ins-success); }
.aira-import-tile.is-primary { border-top-color: var(--ins-primary); }
.aira-import-tile.is-danger { border-top-color: var(--ins-danger); }
.aira-import-tile.is-warning { border-top-color: var(--ins-warning); }
.aira-import-tile.is-danger .drill-stat-v { color: var(--ins-danger); }

.aira-import-share-bar { height: .625rem; }

.aira-import-share-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    margin-top: .5rem;
    color: var(--ins-secondary-color);
}

.aira-import-legend { display: inline-flex; align-items: center; gap: .375rem; }
.aira-import-legend > i { display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; }

.aira-import-groups > li + li { margin-top: .5rem; }

.aira-import-group {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-left: 3px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-import-group.is-danger { border-left-color: var(--ins-danger); }
.aira-import-group.is-warning { border-left-color: var(--ins-warning); }
.aira-import-group.is-info { border-left-color: var(--ins-info); }
.aira-import-group-icon { font-size: 1.125rem; line-height: 1; padding-top: .125rem; }

.aira-import-values { display: flex; flex-wrap: wrap; gap: .375rem; }

.aira-import-value {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    max-width: 100%;
    padding: .125rem .5rem;
    border-radius: 999px;
    background-color: var(--ins-tertiary-bg);
    font-size: .75rem;
}

.aira-import-value > b { font-weight: 600; color: var(--ins-secondary-color); }

.aira-import-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2rem 1rem;
    color: var(--ins-secondary-color);
}

.aira-import-empty > svg { width: 1.5rem; height: 1.5rem; }

.aira-import-search { min-width: 16rem; }
.aira-import-rowno { width: 4.5rem; }
.aira-import-record { min-width: 10rem; max-width: 18rem; }
.aira-import-problems > li + li { margin-top: .25rem; }

.aira-import-problem {
    display: flex;
    align-items: flex-start;
    gap: .375rem;
    font-size: .8125rem;
}

.aira-import-problem > svg { flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: .125rem; }

.aira-import-rows tr.aira-import-row-invalid > td { background-color: rgba(var(--ins-danger-rgb), .035); }

.aira-import-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem .25rem .75rem;
    border-radius: 999px;
    background-color: var(--ins-primary-bg-subtle);
    color: var(--ins-primary);
    font-size: .8125rem;
    font-weight: 500;
}

html[data-bs-theme="dark"] .aira-import-chip { color: var(--ins-primary-text-emphasis); }

.aira-import-chip .btn-close { width: .5em; height: .5em; padding: .25em; }

/* The notes under the problems - nothing to correct, set apart (crm/57 M5). */
.aira-import-notes-head {
    margin: 1.25rem 0 .5rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}

/* The Masters tab (crm/57 M3) - each list's masters as a tile, then their tree, a level's indent a step. */
.aira-import-master-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: .75rem;
}

.aira-import-master-total {
    padding: .75rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-top: 3px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-import-master-total.is-new { border-top-color: var(--ins-success); }

.aira-import-master-total-label {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}

.aira-import-master-total-value { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.aira-import-master-total-value > span { font-size: .8125rem; font-weight: 400; color: var(--ins-secondary-color); }
.aira-import-master-total.is-new .aira-import-master-total-value { color: var(--ins-success); }
.aira-import-master-total-sub { font-size: .75rem; color: var(--ins-secondary-color); }

.aira-import-master-name { display: flex; align-items: flex-start; gap: .25rem; min-width: 14rem; }
.aira-import-master-name.is-depth-1 { padding-left: 1.5rem; }
.aira-import-master-name.is-depth-2 { padding-left: 3rem; }
.aira-import-master-name.is-depth-3 { padding-left: 4.5rem; }
.aira-import-master-name.is-depth-4 { padding-left: 6rem; }
.aira-import-master-name.is-depth-5 { padding-left: 7.5rem; }

.aira-import-master-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    color: var(--ins-secondary-color);
}

.aira-import-master-toggle > svg { width: 1rem; height: 1rem; }

.aira-import-master-sample {
    max-width: 32rem;
    overflow: hidden;
    font-size: .75rem;
    color: var(--ins-secondary-color);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The next step stays in reach under a long page of rows. */
.aira-import-next {
    position: sticky;
    bottom: 0;
    /* Over a table's sticky head, which otherwise paints across this bar and cuts its buttons in half (crm/78 §13). */
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

/* Cancel set apart from the two that go on (crm/49 §10) - the theme's .vr paints in the text's own colour, a bar too heavy here. */
.aira-import-next-rule {
    margin: .25rem .25rem;
    background-color: var(--ins-border-color);
}

/* ==========================================================================
   Every action bar held at the window's foot (crm/54 B3) - the quotation's, lead's and OA's foot below 1200 px, a
   quotation section's Save, Settings -> Appearance's and the notification Settings' bars, the import's next step, the role
   grid's Save. One ground, opaque and set apart: the card's own ground with a breath of the brand, and a shadow cast UP over
   the rows scrolling under it. The quotation, lead and OA foot and Appearance's bar read var(--ins-card-bg) - which the theme
   defines only inside .card - so outside a card they painted nothing, and the item cards showed through the buttons.
   ThemeRenderingTests.An_action_bar_at_the_windows_foot_is_opaque pins it: no rule reads the card-only token, each bar this ground.
   ========================================================================== */
.aira-qf-foot,
.aira-quotation-header-actions,
.aira-appearance-actions,
.aira-settings-actions,
.aira-import-next,
.perm-actions,
.aira-pf-actions {
    background-color: color-mix(in srgb, var(--ins-primary) 4%, var(--ins-secondary-bg));
    box-shadow: 0 -.375rem 1.25rem -.375rem rgba(0, 0, 0, .18);
}

html[data-bs-theme="dark"] .aira-qf-foot,
html[data-bs-theme="dark"] .aira-quotation-header-actions,
html[data-bs-theme="dark"] .aira-appearance-actions,
html[data-bs-theme="dark"] .aira-pf-actions,
html[data-bs-theme="dark"] .aira-settings-actions,
html[data-bs-theme="dark"] .aira-import-next,
html[data-bs-theme="dark"] .perm-actions {
    background-color: color-mix(in srgb, var(--ins-primary) 8%, var(--ins-secondary-bg));
    box-shadow: 0 -.375rem 1.25rem -.375rem rgba(0, 0, 0, .55);
}


.aira-import-history-file { max-width: 20rem; }

/* ==========================================================================
   A date field (crm/63 §6, aira-date-input.js) - a dd-mm-yyyy text box over the browser's date input, which stays in the form
   transparent and untouchable (never display: none - the validation would skip it). The calendar button sits in the box's right
   edge; the validation's feedback follows the date input, under the box. The calendar is the theme's Flatpickr (crm/112).
   ========================================================================== */
.aira-date { position: relative; }
.aira-date-field { position: relative; }

.aira-date-text { padding-right: 2rem; }
.aira-date-text.is-invalid,
.aira-date-text.is-valid { padding-right: 2rem; background-image: none; }

.aira-date-button {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    padding: 0;
    color: var(--ins-secondary-color);
    background: transparent;
    border: 0;
}

.aira-date-button:hover:not(:disabled) { color: var(--ins-primary); }
.aira-date-button:disabled { opacity: .5; }

.aira-date-native {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

/* The calendar (crm/112): the theme's Flatpickr, placed from its field's rectangle by Aira.anchor, so fixed rather than the
   plugin's absolute; in the panels' layer, so it clears a stack of dialogs and a filter panel it opened from (--aira-z-panel). */
.flatpickr-calendar.aira-date-calendar,
.flatpickr-calendar.aira-date-calendar.open {
    position: fixed;
    z-index: var(--aira-z-panel);
}

/* A day hovers and takes the keyboard in the brand, as every option does (crm/96 §1) - the theme compiled it to a grey that
   barely moves. The chosen day keeps the theme's solid brand; a day outside the field's min / max keeps no hover. */
.aira-date-calendar .flatpickr-day:not(.selected):not(.flatpickr-disabled):hover,
.aira-date-calendar .flatpickr-day:not(.selected):not(.flatpickr-disabled):focus {
    background: var(--aira-option-hover-bg);
    border-color: var(--aira-option-hover-bg);
    color: var(--aira-option-hover-ink);
}

/* Today ringed in the brand rather than the plugin's grey - kept under the hover. */
.aira-date-calendar .flatpickr-day.today:not(.selected),
.aira-date-calendar .flatpickr-day.today:not(.selected):not(.flatpickr-disabled):hover,
.aira-date-calendar .flatpickr-day.today:not(.selected):not(.flatpickr-disabled):focus {
    border-color: var(--ins-primary);
}

/* ==========================================================================
   A table's foot and its Columns control, and a page that fits the window (crm/71 §6, §7)
   ========================================================================== */

/* A column the reader switched off, on a table DataTables does not own. */
.aira-col-off { display: none !important; }

/* One row under the rows, the same on every table: rows per page, Columns, the count, the summary - and the pager at its end. */
.dt-container > .aira-table-foot-row,
.aira-table-foot {
    margin-top: .625rem;
    align-items: center;
}

.aira-table-foot-row > .dt-layout-start,
.aira-table-foot-row > .dt-layout-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem .875rem;
}

.aira-table-foot-row .dt-layout-cell,
.aira-table-foot-row .dt-info,
.aira-table-foot-row .dt-length { padding: 0; margin: 0; }

.aira-table-foot-row .dt-info,
.aira-table-count {
    color: var(--ins-secondary-color);
    font-size: .8125rem;
}

.aira-table-foot-row .pagination { margin: 0; }

.aira-table-foot {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem .875rem;
}

.aira-cols-button {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    white-space: nowrap;
}

.aira-cols-count {
    color: var(--ins-secondary-color);
    font-variant-numeric: tabular-nums;
}

/* The panel: fixed, placed by Aira.anchor, in its dialog or on <body>. */
.aira-cols-panel {
    position: fixed;
    z-index: var(--aira-z-panel);
    display: flex;
    flex-direction: column;
    width: 21rem;
    max-width: calc(100vw - 1rem);
    overflow: hidden;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}

.aira-cols-panel[hidden] { display: none; }

.aira-cols-head {
    flex: 0 0 auto;
    padding: .625rem .875rem;
    border-bottom: 1px solid var(--ins-border-color);
    color: var(--ins-secondary-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.aira-cols-list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: .25rem 0;
    overflow-y: auto;
    list-style: none;
}

.aira-cols-row {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .125rem .5rem;
}

.aira-cols-row.is-dragging {
    background: var(--ins-tertiary-bg);
    box-shadow: inset 2px 0 0 var(--ins-primary);
}

.aira-cols-row.is-locked .aira-cols-name { color: var(--ins-secondary-color); cursor: default; }

.aira-cols-grip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.625rem;
    color: var(--ins-secondary-color);
    cursor: grab;
    /* A finger on the grip moves the row, not the list. */
    touch-action: none;
}

.aira-cols-row.is-dragging .aira-cols-grip { cursor: grabbing; }
.aira-cols-grip.is-off { cursor: default; opacity: .7; touch-action: auto; }

.aira-cols-name {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    margin: 0;
    font-size: .8125rem;
    cursor: pointer;
}

.aira-cols-name > .form-check-input { flex: 0 0 auto; margin: 0; }
.aira-cols-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.aira-cols-move {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0;
    color: var(--ins-secondary-color);
}

.aira-cols-foot {
    flex: 0 0 auto;
    padding: .25rem .5rem;
    border-top: 1px solid var(--ins-border-color);
}

/* Actions stays at the end of a table that scrolls sideways (§7.3). Opaque, so the row does not show through; the theme's hover is
   an inset shadow, which paints over this ground. The edge is its own element: a collapsed border does not travel with a sticky cell. */
.aira-tscroll--pin-end > table > * > tr > :last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--ins-secondary-bg);
}

.aira-tscroll--pin-end > table > thead > tr > :last-child {
    z-index: 4;
    background: var(--ins-tertiary-bg);
}

.aira-tscroll--pin-end > table > * > tr > :last-child::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: var(--ins-border-color);
}

/* The cell whose ⋯ menu is open goes over the pinned cells of the other rows and over the heading: a sticky cell is a layer of
   its own, and the menu inside it can rise no higher than that layer (crm/71 §15). */
.aira-tscroll > table > tbody > tr > td.aira-menu-open { z-index: 5; }

/* A table the page's own .table-responsive holds: the box inside scrolls, and this one must not as well (§7.2). */
.table-responsive.aira-tnest { overflow: visible; }

/* A page that fits the window (§7.1): flex from the page's container down to the box, so anything that grows above it - a chip, a
   wrapped head - takes room from the rows with no script running. Only the box scrolls. Under 768 px wide or 600 px high the page
   scrolls instead (FT4): a phone's filter bar would leave a row or two. Every rule is under data-aira-fit, which aira-columns.js decides. */
@media (min-width: 768px) and (min-height: 600px) {
    html[data-aira-fit] .content-page {
        height: calc(100dvh - var(--ins-topbar-height));
        min-height: 0;
    }

    html[data-aira-fit][data-aira-focus] .wrapper > .content-page { height: 100dvh; min-height: 0; }

    html[data-aira-fit] .content-page > .container-fluid {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding-bottom: .75rem;
    }

    html[data-aira-fit] .content-page > .container-fluid > *,
    html[data-aira-fit] .aira-pfill > * { flex: 0 0 auto; }

    html[data-aira-fit] .aira-pfill:not(.tab-pane):not([hidden]),
    html[data-aira-fit] .tab-content > .tab-pane.active.aira-pfill {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* The links of the chain. A grid or a row of columns only passes its height on, or its own layout is lost (trap T2). */
    html[data-aira-fit] .content-page > .container-fluid > .aira-pfill,
    html[data-aira-fit] .content-page > .container-fluid > .aira-pfill-keep,
    html[data-aira-fit] .aira-pfill > .aira-pfill,
    html[data-aira-fit] .aira-pfill > .aira-pfill-keep,
    html[data-aira-fit] .aira-pfill > .aira-tfill,
    html[data-aira-fit] .aira-pfill > .aira-tscroll {
        flex: 1 1 auto;
        min-height: 0;
    }

    /* One line: a wrapping row's line is as tall as its content, and its column would grow past the window whatever the row's own height. */
    html[data-aira-fit] .row.aira-pfill-keep { flex-wrap: nowrap; }
    html[data-aira-fit] .aira-pfill-keep > * { min-height: 0; }
    html[data-aira-fit] .aira-config.aira-pfill-keep { grid-template-rows: minmax(0, 1fr); }
    /* A fitted page gives the rail its row, ending with the register's card - the sticky rule's figure is only for a page that scrolls. */
    html[data-aira-fit] .aira-config-rail { align-self: stretch; height: auto; }

    /* A master's head on one line where there is room, its words beside its actions: two lines of it were two rows of records. */
    html[data-aira-fit] .aira-config-panel .card-header.flex-wrap { flex-wrap: nowrap !important; }
    html[data-aira-fit] .aira-config-panel .card-header.flex-wrap > .flex-grow-1 { flex: 1 1 0; min-width: 0 !important; }
    html[data-aira-fit] .aira-config-panel .card-header.flex-wrap > :last-child { flex: 0 0 auto; }
    html[data-aira-fit] .aira-config-panel .card-body > .d-flex.mb-3 { margin-bottom: .5rem !important; }

    /* The box takes what is left, with a floor: unusually tall content above lets the page scroll, rather than the rows vanish (FT5). */
    html[data-aira-fit] .content-page .aira-tfill > .aira-tscroll,
    html[data-aira-fit] .aira-pfill > .aira-tscroll {
        flex: 1 1 auto;
        min-height: 12rem;
        max-height: none;
        margin-inline: 0;
    }
}

/* ==========================================================================
   Settings -> Print format (crm/72 §8): sections that fold and say what they hold, beside the page itself.
   The choices are native radios, so a reset and the dirty guard need nothing of their own; a checked one
   wears the pressed toggle (the same variables as .aira-toggle[aria-pressed="true"]).
   ========================================================================== */
.btn-check:checked + .aira-toggle {
    --ins-btn-color: var(--aira-brand-contrast);
    --ins-btn-bg: var(--ins-primary);
    --ins-btn-border-color: var(--ins-primary);
    --ins-btn-hover-color: var(--aira-brand-contrast);
    --ins-btn-hover-bg: var(--aira-brand-600);
    --ins-btn-hover-border-color: var(--aira-brand-600);
    --ins-btn-active-color: var(--aira-brand-contrast);
    --ins-btn-active-bg: var(--aira-brand-600);
    --ins-btn-active-border-color: var(--aira-brand-600);
    background-image: var(--aira-brand-paint-image);
}

.aira-pf {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.aira-pf-form { min-width: 0; }

.aira-pf-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

.aira-pf-find {
    position: relative;
    flex: 1 1 12rem;
    min-width: 0;
}

.aira-pf-find-icon {
    position: absolute;
    top: 50%;
    left: .75rem;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: var(--ins-secondary-color);
    pointer-events: none;
}

.aira-pf-find .form-control { padding-left: 2.25rem; }

.aira-pf-sections { min-width: 0; }

.aira-pf-section {
    margin-bottom: .5rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

.aira-pf-section-head {
    display: flex;
    align-items: stretch;
}

.aira-pf-toggle {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    padding: .625rem .75rem;
    border: 0;
    background: transparent;
    color: var(--ins-body-color);
    text-align: left;
}

.aira-pf-toggle:hover { color: var(--ins-primary); }

.aira-pf-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--ins-primary);
}

.aira-pf-title {
    flex: none;
    font-weight: 600;
}

.aira-pf-mark {
    flex: none;
    width: .4375rem;
    height: .4375rem;
    border-radius: 50%;
    background: var(--ins-primary);
}

.aira-pf-mark[hidden] { display: none; }

/* What is chosen, in the heading - a closed section still shows its result (D12). */
.aira-pf-summary {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: var(--ins-secondary-color);
    font-size: .8125rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aira-pf-summary-mix {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.aira-pf-summary-chips {
    display: inline-flex;
    gap: .125rem;
}

.aira-pf-summary-chips > span {
    width: .75rem;
    height: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: .1875rem;
}

.aira-pf-caret {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--ins-secondary-color);
}

[aria-expanded="true"] > .aira-pf-caret { rotate: 180deg; }

.aira-pf-reset {
    flex: none;
    width: 2.25rem;
    border: 0;
    border-left: 1px solid var(--ins-border-color);
    background: transparent;
    color: var(--ins-secondary-color);
}

.aira-pf-reset:hover { color: var(--ins-primary); }
.aira-pf-reset[hidden] { display: none; }
.aira-pf-reset svg, .aira-pf-reset i { width: .875rem; height: .875rem; }

.aira-pf-body {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    padding: .875rem .75rem;
    border-top: 1px solid var(--ins-border-color);
}

.aira-pf-body [hidden] { display: none !important; }
.aira-pf-filtered { display: none !important; }
.is-finding .aira-pf-note, .is-finding .aira-pf-body > .form-text, .is-finding [data-pf-field] ~ .form-text { display: none; }

.aira-pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: .75rem;
}

.aira-pf-switches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .5rem .75rem;
}

.aira-pf-field { min-width: 0; }
.aira-pf-switch { margin: 0; }

/* A block shown by one choice keeps the section's own rhythm (crm/86 §8). */
.aira-pf-stack {
    display: flex;
    flex-direction: column;
    gap: .875rem;
}

/* The opening note: a few lines of a letter, every place in it a pill (crm/92) - shorter than a message's field, and it grows. */
.aira-pf-field .aira-token-field.aira-pf-paragraphs .ql-editor {
    min-height: 7.5rem;
    line-height: 1.5 !important;
}

.aira-pf-subhead {
    margin-top: .25rem;
    color: var(--ins-secondary-color);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.aira-pf-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    font-size: .8125rem;
}

.aira-pf-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .375rem .5rem;
    border: 1px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: transparent;
    color: var(--ins-body-color);
    font-size: .8125rem;
}

.aira-pf-more:hover { color: var(--ins-primary); }

/* A picture */
.aira-pf-picture {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem;
}

.aira-pf-picture-tile {
    display: flex;
    flex: 0 0 8.5rem;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    padding: .25rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: #fff;
    overflow: hidden;
}

.aira-pf-picture-tile img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* A colour: one row, a palette under it */
.aira-pf-colours {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

.aira-pf-colour {
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-pf-colour-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .375rem .5rem;
    border: 0;
    background: transparent;
    color: var(--ins-body-color);
    text-align: left;
}

.aira-pf-chip-now {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--ins-border-color);
    border-radius: .25rem;
}

.aira-pf-colour-name {
    flex: none;
    font-size: .8125rem;
    font-weight: 600;
}

.aira-pf-colour-hint {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--ins-secondary-color);
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aira-pf-colour-hex {
    flex: none;
    margin-left: auto;
    color: var(--ins-secondary-color);
    font-family: var(--ins-font-monospace, monospace);
    font-size: .75rem;
}

.aira-pf-colour-panel {
    padding: .5rem;
    border-top: 1px solid var(--ins-border-color);
}

.aira-pf-chips {
    display: grid;
    grid-template-columns: repeat(10, 1.5rem);
    gap: .25rem;
    margin-bottom: .5rem;
}

.aira-pf-chip {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--ins-border-color);
    border-radius: .25rem;
}

.aira-pf-chip.is-chosen {
    outline: 2px solid var(--ins-primary);
    outline-offset: 1px;
}

.aira-pf-colour-pair { max-width: 14rem; }

.aira-pf-colour-pair .form-control-color {
    flex: 0 0 3rem;
    max-width: 3rem;
}

/* A palette */
.aira-pf-palettes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: .375rem;
}

.aira-pf-palette {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    padding: .375rem .5rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: transparent;
    color: var(--ins-body-color);
    font-size: .75rem;
    text-align: left;
}

.aira-pf-palette[aria-pressed="true"] {
    border-color: var(--ins-primary);
    box-shadow: inset 0 0 0 1px var(--ins-primary);
}

.aira-pf-palette-chips {
    display: flex;
    gap: .125rem;
}

.aira-pf-palette-chips > span {
    width: 1rem;
    height: .75rem;
    border-radius: .125rem;
}

.aira-pf-mark-row {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

/* An escalation contact */
.aira-pf-rows {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

.aira-pf-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr) auto;
    gap: .375rem;
}

.aira-pf-row-remove {
    width: 2.25rem;
    padding: 0;
}

.aira-pf-readonly {
    margin: .75rem 0;
    padding: .625rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}

/* Its ground is the foot bars' one rule above: never var(--ins-card-bg) outside a card (crm/54). */
.aira-pf-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
    padding: .625rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
}

.aira-pf-actions-end {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

/* The page */
.aira-pf-preview {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.aira-pf-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .625rem .75rem;
    border-bottom: 1px solid var(--ins-border-color);
}

.aira-pf-preview-title {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    min-width: 0;
    margin-right: auto;
}

.aira-pf-preview-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
}

.aira-pf-preview-tools > select { width: auto; max-width: 15rem; }
.aira-pf-preview-real { width: 15rem; max-width: 100%; }
.aira-pf-zoom-now { min-width: 3.25rem; }

.aira-pf-stage {
    display: flex;
    flex: 1 1 auto;
    min-height: 34rem;
    background: var(--ins-tertiary-bg);
    --aira-skel-h: 34rem;
}

.aira-pf-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
}

.aira-pf-state {
    margin: auto;
    padding: 1.5rem;
    text-align: center;
}

/* The real PDF, page by page on the stage's ground, as the live page's sheet is - its own scroll, the frame's height below xl.
   A page wider than the box (zoomed in) starts at its left edge rather than centring off it, so all of it can be scrolled to. */
.aira-pf-pages {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    max-height: 34rem;
    padding: 16px;
    overflow: auto;
}

.aira-pf-page {
    flex: none;
    margin-inline: auto;
    background: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, .14);
    line-height: 0;
}

.aira-pf-page > canvas { display: block; }

/* Without pdf.js, the browser's own viewer fills the box. */
.aira-pf-pages-native {
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.aira-pf-pages-native > .aira-pf-frame { min-height: 34rem; }

/* A setting only a page shows (crm/72 §8): its mark beside the label, the sentence in its title. */
.aira-pf-paper {
    display: inline-block;
    margin-left: .375rem;
    padding: 0 .3rem;
    border: 1px solid var(--ins-border-color);
    border-radius: .25rem;
    color: var(--ins-secondary-color);
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.5;
    vertical-align: middle;
    cursor: help;
}

.aira-pf-preview-foot {
    padding: .5rem .75rem;
    border-top: 1px solid var(--ins-border-color);
}

/* A PDF on screen that no longer matches the form while its successor is made (crm/113 PE10): dimmed from 180 ms, as every wait is (10e). */
.aira-pf-pages.is-stale { animation: aira-dim 0s linear .18s forwards; }

/* The PDF engine's line (crm/113 PE8): its state a mark, its words, Check, and what the server said under a fold. */
.aira-pf-engine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    padding: .5rem .75rem;
    border-top: 1px solid var(--ins-border-color);
}

.aira-pf-engine-mark {
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--ins-secondary-color);
}

.aira-pf-engine[data-state="ready"] .aira-pf-engine-mark { background: var(--ins-success); }
.aira-pf-engine[data-state="failing"] .aira-pf-engine-mark,
.aira-pf-engine[data-state="none"] .aira-pf-engine-mark { background: var(--ins-danger); }

.aira-pf-engine-line { flex: 1 1 12rem; min-width: 0; color: var(--ins-secondary-color); }
.aira-pf-engine[data-state="failing"] .aira-pf-engine-line,
.aira-pf-engine[data-state="none"] .aira-pf-engine-line { color: var(--ins-danger); }

.aira-pf-engine-detail { flex: 1 1 100%; min-width: 0; }
.aira-pf-engine-detail > summary { cursor: pointer; color: var(--ins-secondary-color); }

.aira-pf-engine-detail > pre {
    max-height: 12rem;
    margin: .375rem 0 0;
    padding: .5rem;
    overflow: auto;
    border-radius: .25rem;
    background: var(--ins-tertiary-bg);
    font-size: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

.aira-pf-none { padding: .5rem .75rem; }

/* Beside the form from xl, the page stays in view while the sections scroll. */
@media (min-width: 1200px) {
    .aira-pf { grid-template-columns: minmax(24rem, 34rem) minmax(0, 1fr); align-items: start; }

    .aira-pf-preview {
        position: sticky;
        top: calc(var(--ins-topbar-height, 70px) + 1rem);
        height: calc(100vh - var(--ins-topbar-height, 70px) - 2rem);
    }

    .aira-pf-stage { min-height: 0; }

    .aira-pf-pages { max-height: none; }

    .aira-pf-pages-native > .aira-pf-frame { min-height: 0; }
}

@media (max-width: 575.98px) {
    .aira-pf-row { grid-template-columns: minmax(0, 1fr) auto; }
    .aira-pf-summary { display: none; }
    .aira-pf-chips { grid-template-columns: repeat(auto-fill, 1.5rem); }
}

/* ==========================================================================
   A quotation's print preview (crm/72 D15): the PDF framed on a neutral ground, as paper is shown.
   The frame is the browser's own viewer; a phone gets a card.
   ========================================================================== */
.aira-qprint-stage {
    display: flex;
    min-height: 0;
    padding: .75rem;
    background: var(--ins-tertiary-bg);
    --aira-skel-h: 100%;
}

.aira-qprint-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 1px solid var(--ins-border-color);
    border-radius: .25rem;
    background: #fff;
}

/* The pages drawn in the dialog (crm/119 §7): a column of sheets on the neutral ground, scrolled by the wheel and the keyboard. */
.aira-qprint-pages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding-block: .25rem;
}

.aira-qprint-page {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid var(--ins-border-color);
    border-radius: .125rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.aira-qprint-page > canvas { display: block; }

/* The frame Print prints the PDF from - out of sight, never display: none, which would leave the browser's viewer unloaded. */
.aira-qprint-printer {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border: 0;
    visibility: hidden;
}

.aira-qprint-state {
    max-width: 32rem;
    margin: auto;
    padding: 1.5rem;
    text-align: center;
}

/* ==========================================================================
   crm/73 - a size row's reference quotations, the quotation read, the journey
   ========================================================================== */

/* A size row's zone is a step of the row, not a section of its own: the shared zone at a row's height, its tiles under it. */
.aira-size-files { display: flex; flex-direction: column; gap: .375rem; border-radius: var(--ins-border-radius); }
.aira-size-files.is-invalid { outline: 1px solid var(--ins-danger); outline-offset: 2px; }
.aira-size-files-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; }
.aira-size-files-bar .attach-field { flex: 1 1 24rem; min-width: 0; }
.aira-size-files [data-size-file-error]:not([hidden]) { display: block; margin-top: 0; }
/* At a field's height (crm/75 E2): a step of the row, its words on one line where the width allows. */
.aira-size-drop {
    height: 100%;
    min-height: 0;
    padding: .375rem .75rem;
    border-radius: var(--ins-border-radius);
}
.aira-size-drop:not(:hover):not(.is-over) {
    border-color: color-mix(in srgb, var(--ins-primary) 40%, var(--ins-border-color));
    background: var(--ins-secondary-bg);
}
.aira-size-drop .attach-drop-idle { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: .125rem .5rem; padding: 0; }
.aira-size-drop .attach-drop-icon { display: inline-flex; margin: 0; }
.aira-size-drop .attach-drop-icon svg { width: 1rem; height: 1rem; }
.aira-size-files-read { max-width: 60rem; }

/* A size row's fields (crm/75 E1): one grid of 24, so the three lines share their edges and Source, Type and Description give the
   room their short answers do not need. The tag takes the first line's end until a source asks for a reference number, then shares it
   (.has-reference, quotation-items.js). */
.aira-size-fields { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: .25rem .5rem; }
.aira-size-cell { grid-column: span 4; min-width: 0; }
.aira-size-cell.is-type,
.aira-size-cell.is-desc { grid-column: span 3; }
.aira-size-cell.is-tag { grid-column: span 10; }
.has-reference .aira-size-cell.is-tag { grid-column: span 4; }
.aira-size-cell.is-ref { grid-column: span 6; }
.aira-size-cell.is-serial { grid-column: span 8; }
.aira-size-cell.is-remark { grid-column: span 16; }
.aira-size-cell.is-files { grid-column: 1 / -1; margin-top: .25rem; }
@media (max-width: 1199.98px) {
    .aira-size-cell,
    .aira-size-cell.is-type,
    .aira-size-cell.is-desc,
    .aira-size-cell.is-tag,
    .has-reference .aira-size-cell.is-tag,
    .aira-size-cell.is-ref,
    .aira-size-cell.is-serial { grid-column: span 8; }
    .aira-size-cell.is-remark { grid-column: span 16; }
}
@media (max-width: 767.98px) {
    .aira-size-cell,
    .aira-size-cell.is-type,
    .aira-size-cell.is-desc,
    .aira-size-cell.is-tag,
    .has-reference .aira-size-cell.is-tag,
    .aira-size-cell.is-ref,
    .aira-size-cell.is-serial { grid-column: span 12; }
    .aira-size-cell.is-remark { grid-column: 1 / -1; }
}

/* The item's accessories (crm/75 A1) - a section under the sizes, on their ground. The first row's labels read as the list's headings;
   the others stay labels for a screen reader and for a narrow window, where each row stands alone. */
.aira-item-accessories {
    margin-top: .5rem;
    padding: .625rem .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-tertiary-bg);
}
.aira-item-accessories.is-invalid { border-color: var(--ins-danger); }
.aira-item-accessories-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .625rem; margin-bottom: .375rem; }
/* # · Accessory · Rate / unit · MU % · Price / unit · Amount · remove (crm/83 §3.2, §9) - the accessory's chosen text names its product, so
   no column repeats it; a lead's row is the accessory alone. */
.aira-accessory-row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 4fr) minmax(7rem, 1fr) minmax(4.5rem, .6fr) minmax(7rem, 1fr) minmax(4.5rem, .6fr) minmax(7rem, 1fr) auto;
    align-items: start;
    gap: .25rem .5rem;
    margin-bottom: .25rem;
}
.aira-item-accessories-switches { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.aira-accessory-row [data-accessory-markup].is-off,
.aira-accessory-row [data-accessory-discount].is-off { color: var(--aira-muted); }

/* The product's name for this quotation (crm/83 §2): the master's name under the field, and the field marked while it differs. */
.aira-item-name-reset { padding: 0; font-size: calc(.75rem * var(--aira-type-scale, 1)); }
.aira-item-name-master { margin-top: .125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aira-item-name.is-renamed .form-control { border-color: var(--ins-warning-border-subtle); background-color: var(--ins-warning-bg-subtle); }

/* Wherever an item is read, a written name is its name and the master's sits under it (crm/83 §2.2). */
.aira-item-master-name { display: block; font-size: calc(.75rem * var(--aira-type-scale, 1)); font-weight: 400; color: var(--aira-muted); }
.aira-item-renamed { vertical-align: middle; }
/* A label and a heading alike, so every cell's control starts on one line. */
.aira-accessory-row .form-label { display: block; }
.aira-accessory-remove .btn { display: block; margin-top: .09375rem; }
.aira-accessory-no-value { text-align: center; color: var(--aira-muted); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
    .aira-accessory-row:not(:first-child) .form-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
@media (max-width: 767.98px) {
    .aira-accessory-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: .5rem; border-bottom: 1px solid var(--ins-border-color); }
    .aira-accessory-no { display: none; }
    .aira-accessory-row > .min-w-0:first-of-type { grid-column: 1 / -1; }
}
.aira-item-accessories-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.aira-item-accessories-totals {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin-left: auto;
    font-size: calc(.8125rem * var(--aira-type-scale, 1));
}

/* An item's card: its accessories once each, under its sizes. */
.aira-item-accessory-lines { padding-top: .375rem; border-top: 1px dashed var(--ins-border-color); font-size: calc(.8125rem * var(--aira-type-scale, 1)); }
.aira-item-accessory-title { margin-bottom: .125rem; font-weight: 600; color: var(--aira-ink); }
.aira-item-accessory-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .5rem; padding: .125rem 0; }
.aira-item-accessory-amount { min-width: 6.5rem; text-align: right; }

/* The product chain (crm/75 E4): a type's and a category's names, a series' short code, and the rest for the product. */
@media (min-width: 1200px) {
    .aira-item-chain > .is-named { width: 19%; }
    .aira-item-chain > .is-coded { width: 13%; }
    .aira-item-chain > .is-product { width: 49%; }
}

/* A list that reads whole (data-select-wrap, crm/75 E4): the field grows a line rather than cut what was chosen, and the list runs wider and
   wraps. Its prompt stays on one line - only an answer earns a second. */
.aira-sel.is-wrap .aira-sel-trigger { height: auto; }
.aira-sel.is-wrap .aira-sel-summary:not(.is-empty) { overflow: visible; overflow-wrap: anywhere; white-space: normal; text-overflow: clip; }
.aira-sel-panel.is-wrap { max-width: min(60rem, calc(100vw - 2rem)); }
.aira-sel-panel.is-wrap .aira-sel-text { overflow: visible; overflow-wrap: anywhere; white-space: normal; text-overflow: clip; }

/* ---- The quotation read ---------------------------------------------------- */

.modal-dialog.aira-qv-dialog { width: 90vw; max-width: 90vw; }
.aira-qv-dialog .modal-content { height: 90vh; overflow: hidden; }
.aira-qv-dialog [data-qv-host] > .aira-qv { height: 100%; }
@media (max-width: 575.98px) {
    .modal-dialog.aira-qv-dialog { width: auto; max-width: none; margin: .5rem; }
    .aira-qv-dialog .modal-content { height: calc(100vh - 1rem); }
}

.aira-qv { display: flex; flex-direction: column; min-height: 0; }
.aira-qv-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-bottom: 1px solid var(--ins-border-color);
    flex-shrink: 0;
}

/* The read between its title and its foot (crm/75 V2): the history's column and the work, each scrolling on its own. On the full page
   the frame is the window's height, so the same holds there. */
.aira-qv-main { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.aira-qv-page .aira-qv { height: calc(100vh - 9rem); min-height: 34rem; }
.aira-qv-body { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; }
.aira-qv-body > .card-footer { padding: .5rem 1rem; border-radius: 0; }

/* The head (crm/75 V1): one band of the facts, cut by hairlines, and the route at its end in the same height. It measures itself rather
   than the window, because the history's column and the Approvals drawer take the room too. */
.aira-qv-head {
    container-type: inline-size;
    padding: .5rem 1rem;
    border-bottom: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
}
.aira-qv-band { display: flex; align-items: center; gap: 1rem; }
.aira-qv-keys {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(12rem, 2fr) repeat(3, minmax(max-content, 1fr));
    min-width: 0;
}
/* An international quotation's head has a fifth key, its exchange rate (crm/119 MC8). */
.aira-qv-keys.has-rate { grid-template-columns: minmax(12rem, 2fr) repeat(4, minmax(max-content, 1fr)); }
.aira-qv-key { min-width: 0; padding-inline: 1rem; border-left: 1px solid var(--ins-border-color); }
.aira-qv-key:first-child { padding-left: 0; border-left: 0; }
.aira-qv-key dd { line-height: 1.35; }
.aira-qv-sub { font-size: calc(.75rem * var(--aira-type-scale, 1)); line-height: 1.3; color: var(--aira-muted); }
.aira-qv-figure { font-size: calc(1rem * var(--aira-type-scale, 1)); font-weight: 600; color: var(--aira-ink); }
.aira-qv-key dt, .aira-qv-label, .aira-qv-facts dt {
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
    margin-bottom: .125rem;
}
.aira-qv-key dd, .aira-qv-facts dd { margin: 0; }

.aira-qv-route {
    flex: 0 1 28rem;
    min-width: 0;
    margin: 0;
    padding: .1875rem 0 .125rem 1rem;
    border-bottom: 0;
    border-left: 1px solid var(--ins-border-color);
}
@container (max-width: 60rem) {
    .aira-qv-band { flex-direction: column; align-items: stretch; gap: .5rem; }
    .aira-qv-route { flex: 0 0 auto; padding: .5rem 0 0; border-top: 1px solid var(--ins-border-color); border-left: 0; }
}
@container (max-width: 42rem) {
    .aira-qv-keys, .aira-qv-keys.has-rate { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: .5rem; }
    .aira-qv-key.is-wide { grid-column: 1 / -1; }
    .aira-qv-key:nth-child(2n) { padding-left: 0; border-left: 0; }
}

/* An item folded (crm/75 V3): its whole head opens it. */
.aira-qv [data-item-head] { border-radius: inherit; cursor: pointer; }
.aira-qv [data-item-head]:hover { background: var(--ins-tertiary-bg); }

.aira-qv-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-inline: 1rem;
    background: var(--ins-secondary-bg);
    border-bottom: 1px solid var(--ins-border-color);
}
.aira-qv-pane { padding: 1rem; }

.aira-qv-section {
    padding: .875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    background: var(--ins-secondary-bg);
}
.aira-qv-pane .row > [class*="col-"] > .aira-qv-section:last-child { margin-bottom: 0; }
.aira-qv-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .75rem;
    font-weight: 600;
    color: var(--aira-ink);
}
.aira-qv-section-title svg { width: 1rem; height: 1rem; color: var(--ins-primary); flex-shrink: 0; }
.aira-qv-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .75rem 1.25rem;
}
.aira-qv-chain { margin-top: 1rem; }
.aira-qv-catalog {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    padding: .5rem 0;
    border-top: 1px solid var(--ins-border-color);
}
.aira-qv-catalog:first-child { border-top: 0; padding-top: 0; }
.aira-qv-catalog svg { width: 1rem; height: 1rem; margin-top: .125rem; }

/* Opaque, every foot action bar (crm/54) - never the card's own translucent ground. */
.aira-qv-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .625rem 1rem;
    border-top: 1px solid var(--ins-border-color);
    background: var(--ins-tertiary-bg);
    flex-shrink: 0;
}
.aira-qv-page .aira-qv-foot { position: sticky; bottom: 0; z-index: 4; }
.aira-qv-held { opacity: .65; }

/* ---- The journey: one record's stage timeline ------------------------------- */

.aira-journey { display: flex; flex-direction: column; gap: 1rem; container-type: inline-size; }
.aira-journey-route { margin: 0; padding: .25rem 0 .75rem; }

.aira-journey-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
/* Beside the history four tiles are too thin for a status's name, which ran out of its tile: two by two. */
@container (max-width: 56rem) { .aira-journey-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 24rem) { .aira-journey-facts { grid-template-columns: minmax(0, 1fr); } }
.aira-journey-fact-value > * { max-width: 100%; white-space: normal; }
/* The read's head already draws the route (crm/73 §4.3) - one rail on a screen. */
.aira-qv .aira-journey-route { display: none; }
.aira-journey-fact {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid var(--ins-border-color);
    border-radius: var(--ins-border-radius);
    min-width: 0;
}
.aira-journey-fact-label {
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}
.aira-journey-fact-value { margin-top: .125rem; font-weight: 600; color: var(--aira-ink); overflow-wrap: anywhere; }
.aira-journey-fact-under { margin-top: .0625rem; font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }
.aira-journey-fact.is-danger .aira-journey-fact-value { color: var(--ins-danger); }
.aira-journey-fact.is-success .aira-journey-fact-value { color: var(--ins-success); }

.aira-journey-caption {
    margin-bottom: .375rem;
    font-size: calc(.6875rem * var(--aira-type-scale, 1));
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--aira-muted);
}
.aira-journey-time .aira-timeline-strip { height: .625rem; border-radius: 999px; }
.aira-journey-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: .5rem; font-size: calc(.8125rem * var(--aira-type-scale, 1)); }
.aira-journey-legend li { display: inline-flex; align-items: center; gap: .375rem; }
.aira-journey-legend-dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--stage-color, var(--ins-primary)); }
.aira-journey-legend-time { color: var(--aira-muted); font-variant-numeric: tabular-nums; }

/* The theme's timeline (pages-timeline) keeps its layout and its dashed line; the dot takes the stage's colour, which only the server names. */
.aira-journey-list .timeline-time { width: 6.5rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.aira-journey-day { color: var(--aira-ink); font-weight: 600; }
.aira-journey-dot { background: var(--stage-color, var(--ins-primary)); color: #fff; }
.aira-journey-stay.is-open .aira-journey-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color, var(--ins-primary)) 28%, transparent); }
.aira-journey-note {
    margin: .375rem 0 0;
    padding: .25rem .625rem;
    border-inline-start: 3px solid var(--ins-border-color);
    font-size: calc(.8125rem * var(--aira-type-scale, 1));
    color: var(--ins-secondary-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.aira-journey-spent { flex-shrink: 0; text-align: end; min-width: 7rem; }
.aira-journey-time-value { font-weight: 600; color: var(--aira-ink); font-variant-numeric: tabular-nums; }
.aira-journey-time-under { font-size: calc(.75rem * var(--aira-type-scale, 1)); color: var(--aira-muted); }
.aira-journey-stay.is-final .aira-journey-time-value { font-weight: 400; color: var(--aira-muted); }
@media (max-width: 575.98px) {
    .aira-journey-list .timeline-time { width: 5rem; }
    .aira-journey-spent { text-align: start; min-width: 0; width: 100%; }
}

/* ---- One reference file, many rows (crm/73 R1) ------------------------------- */

.aira-ref-offers { width: min(32rem, 90vw); max-height: 18rem; overflow-y: auto; padding: .25rem; }
.aira-ref-offer { display: flex; align-items: center; gap: .625rem; padding: .5rem; border-radius: var(--ins-border-radius); }
.aira-ref-offer + .aira-ref-offer { border-top: 1px solid var(--ins-border-color); }
.aira-ref-offer-mark {
    flex-shrink: 0;
    min-width: 2.25rem;
    padding: .375rem .25rem;
    border-radius: var(--ins-border-radius);
    font-size: calc(.625rem * var(--aira-type-scale, 1));
    font-weight: 700;
    text-align: center;
    color: var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 14%, transparent);
}
.aira-ref-offer-mark.is-pdf { color: var(--ins-danger); background: color-mix(in srgb, var(--ins-danger) 14%, transparent); }
.aira-size-file-also { color: var(--ins-primary); }

.aira-file-chips { display: flex; flex-wrap: wrap; gap: .25rem .375rem; }
.aira-file-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 20rem;
    padding: .0625rem .5rem;
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
    background: var(--ins-tertiary-bg);
}
.aira-file-chip svg { width: .8125rem; height: .8125rem; flex-shrink: 0; color: var(--ins-primary); }
.aira-file-chip .attach-name { display: block; overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; font-size: calc(.75rem * var(--aira-type-scale, 1)); }

/* ---- The Approvals drawer: a quotation's is the whole read (crm/73 R4) -------- */

.offcanvas.offcanvas-end.aira-approvals-drawer.is-full { width: 100vw; }
@media (min-width: 992px) { .offcanvas.offcanvas-end.aira-approvals-drawer.is-full { width: min(88vw, 1320px); } }
.aira-approvals-drawer.is-full > .offcanvas-header,
.aira-approvals-drawer.is-full > [data-drawer-foot] { display: none !important; } /* its d-flex carries !important; the read has its own foot */
.aira-approvals-drawer.is-full > [data-drawer-body] { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.aira-approvals-drawer.is-full > [data-drawer-body] > .aira-qv { flex: 1 1 auto; min-height: 0; }

/* ---- The topbar's search: a found record ------------------------------------- */

.aira-search-menu-icon { width: 1rem; height: 1rem; color: var(--aira-muted); flex-shrink: 0; }
.aira-search-menu-hit strong { flex-shrink: 0; white-space: nowrap; }
.aira-search-menu-status { flex-shrink: 0; margin-inline-start: auto; }
.aira-search-menu-status + .aira-search-menu-module { margin-inline-start: 0; flex-shrink: 0; }
.aira-search-menu-head {
    padding: .375rem .5rem .125rem;
    color: var(--aira-muted);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.aira-search-menu mark { padding: 0; background: color-mix(in srgb, var(--ins-primary) 22%, transparent); color: inherit; border-radius: 2px; }

/* The shortcut's keys, as the helpdesk draws them: in the box while it is empty and unfocused, only where the whole placeholder still
   fits (.aira-search-roomy), and never on a touch screen with no keys to press. */
.app-search .aira-search-keys {
    position: absolute;
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
    display: inline-flex;
    gap: .1875rem;
    visibility: hidden;
    pointer-events: none;
}
.app-search .aira-search-keys kbd {
    min-width: 1.25rem;
    padding: 0 .3125rem;
    font-family: inherit;
    font-size: calc(11px * var(--aira-topbar-scale, 1));
    font-weight: 500;
    line-height: 1.6;
    text-align: center;
    color: var(--ins-secondary-color);
    background-color: var(--ins-secondary-bg);
    border: 1px solid var(--ins-border-color);
    border-radius: 4px;
}
@media (hover: hover) and (pointer: fine) {
    .app-search.aira-search-roomy .form-control:placeholder-shown:not(:focus) { padding-right: 4.5rem; }
    .app-search.aira-search-roomy .form-control:placeholder-shown:not(:focus) ~ .aira-search-keys { visibility: visible; }
    .app-search.aira-search-roomy .form-control:placeholder-shown:not(:focus)::-webkit-search-cancel-button { display: none; }
}
html[data-aira-head="custom"] .app-topbar .app-search .aira-search-keys kbd {
    color: var(--ins-topbar-item-color);
    background-color: transparent;
    border-color: var(--ins-topbar-search-border);
}

/* ==========================================================================
   A register's row that opens under itself (crm/82, aira-row-details.js): the chevron ahead of Sr No, the open row in the brand's
   wash with its mark, and the products under it - a card of the theme's in a band of its own. Nothing eases (crm/69): the chevron
   turns and the row opens in the next frame.
   ========================================================================== */
.aira-register .table > :not(caption) > * > th.aira-xrow-col,
.aira-register .table > :not(caption) > * > td.aira-xrow-col {
    width: 2.5rem;
    min-width: 2.5rem;
    padding-inline: .25rem;
    text-align: center;
}

/* A click on the row opens its products, so the pointer says so (crm/82 - crm/48 R1 still holds: only the eye opens the record). */
tr[data-xrow] { cursor: pointer; }

.aira-xrow-toggle { border-radius: 50%; }
.aira-xrow-toggle svg { width: 1.125rem; height: 1.125rem; }
.aira-xrow-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

tr[data-xrow]:hover .aira-xrow-toggle,
.aira-xrow-toggle[aria-expanded="true"] {
    color: var(--ins-primary-text-emphasis);
    background: color-mix(in srgb, var(--aira-brand-400) 14%, transparent);
}

.table > tbody > tr.is-expanded > * {
    --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 10%, transparent);
}

html[data-bs-theme="dark"] .table > tbody > tr.is-expanded > * {
    --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 18%, transparent);
}

.table-hover > tbody > tr.is-expanded > td:first-child { --aira-row-mark: var(--aira-brand-400); }

/* The row the products are in: a band under its row, never a hover of its own, and not the pinned Actions cell its one cell would
   otherwise count as - a cell that is both the first and the last child matches both of the table's positional rules. */
.table > tbody > tr.aira-xrow > td.aira-xrow-cell {
    padding: 0;
    white-space: normal;
    cursor: default;
    background: var(--ins-tertiary-bg);
    box-shadow: inset 3px 0 0 var(--aira-brand-400);
}

.table-hover > tbody > tr.aira-xrow:hover > td.aira-xrow-cell {
    --ins-table-bg-state: transparent;
    box-shadow: inset 3px 0 0 var(--aira-brand-400);
}

.aira-tscroll--pin-end > table > tbody > tr.aira-xrow > td.aira-xrow-cell {
    position: static;
    z-index: auto;
    background: var(--ins-tertiary-bg);
}

.aira-tscroll--pin-end > table > tbody > tr.aira-xrow > td.aira-xrow-cell::before { content: none; }

/* As wide as the box the table scrolls in and held at its left, so a wide table's own sideways scroll never carries the panel away. */
.aira-xrow-panel {
    position: sticky;
    left: 0;
    box-sizing: border-box;
    width: var(--aira-xrow-w, 100%);
    min-height: 5rem;
    padding: .75rem 1rem;
}

.aira-xrow-card { overflow: hidden; }

/* The theme compiles `.card-header { gap: 1.5rem !important }`: only an !important of more weight closes the head up. */
.card > .card-header.aira-xrow-head {
    gap: .5rem !important;
    padding-block: .5rem;
}

.aira-xrow-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin-inline-start: auto;
    font-size: .8125rem;
    color: var(--aira-muted);
}

.aira-xrow-facts b { color: var(--aira-ink); font-weight: 600; }

/* The table's own box: wider than the card it scrolls sideways, on its own. */
.aira-xrow-scroll { overflow-x: auto; }

/* Separate borders: a collapsed one belongs to the grid, and does not travel with a sticky cell. */
.aira-xrow-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

/* One padding for every cell: a size's row under a product's first has its variance as its first cell, and a register's first-cell
   padding read as those rows standing a few pixels off the first one's. */
.aira-xrow-table.table > :not(caption) > * > *,
.aira-xrow-table.table > :not(caption) > * > *:first-child,
.aira-xrow-table.table > :not(caption) > * > *:last-child {
    padding-inline: .75rem;
}

.aira-xrow-table > thead > tr > th {
    background: var(--ins-tertiary-bg);
    border-bottom: 1px solid var(--ins-border-color);
    white-space: nowrap;
}

.aira-xrow-table > tbody > tr > td { border-bottom: 1px solid var(--ins-border-color); }

.aira-xrow-table > tbody:last-of-type > tr:last-child > td,
.aira-xrow-table > tbody:last-of-type > tr > td[rowspan] { border-bottom: 0; }

/* The cell that says which product this is, in view at any sideways scroll. */
.aira-xrow-table.table > tbody > tr > td.aira-xrow-pin,
.aira-xrow-table.table > thead > tr > th.aira-xrow-pin {
    position: sticky;
    z-index: 1;
    background-color: var(--ins-secondary-bg);
}

.aira-xrow-table.table > thead > tr > th.aira-xrow-pin { z-index: 2; background-color: var(--ins-tertiary-bg); }

.aira-xrow-table.table > * > tr > .aira-xrow-pin.is-no { left: 0; width: 3.25rem; min-width: 3.25rem; }
.aira-xrow-table.table > * > tr > .aira-xrow-pin.is-code { left: 3.25rem; box-shadow: inset -1px 0 0 var(--ins-border-color); }

.aira-xrow-wrap { min-width: 11rem; max-width: 22rem; white-space: normal; overflow-wrap: anywhere; }
.aira-xrow-wrap.is-product { min-width: 18rem; font-weight: 500; }
.aira-xrow-wrap.is-accessories { min-width: 20rem; max-width: 28rem; }

.aira-xrow-accessory { display: flex; flex-wrap: wrap; gap: 0 .5rem; }
.aira-xrow-accessory + .aira-xrow-accessory { margin-top: .25rem; }
.aira-xrow-accessory.is-out { color: var(--aira-muted); text-decoration: line-through; }

.aira-xrow-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem 1rem;
    font-size: .8125rem;
}


/* ==========================================================================
   How a figure is worked out (crm/87, aira-calc.js). A money figure opens its calculation; at rest it looks exactly as it did -
   on hover a hand, the brand's faint wash and a dotted underline say it opens, and only once a module that explains it is on the
   page (:root[data-calc-on]), so a figure drawn where nothing explains it never pretends. A table cell takes the wash through the
   theme's own state variable (its inset shadow paints over a background). The dialog: the figure and its amount in the head, the
   values used one strip, the working one table - a line per step, the figure clicked last in the brand's tint. Nothing eases.
   ========================================================================== */
:root[data-calc-on~="quotation"] [data-calc^="quotation."],
:root[data-calc-on~="oa"] [data-calc^="oa."] {
    cursor: pointer;
}

:root[data-calc-on~="quotation"] [data-calc^="quotation."]:hover,
:root[data-calc-on~="oa"] [data-calc^="oa."]:hover {
    background-color: color-mix(in srgb, var(--aira-brand-400) 12%, transparent);
    text-decoration: underline dotted;
    text-decoration-color: color-mix(in srgb, var(--ins-primary) 65%, transparent);
    text-underline-offset: 3px;
}

:root[data-calc-on~="quotation"] td[data-calc^="quotation."]:hover,
:root[data-calc-on~="oa"] td[data-calc^="oa."]:hover {
    --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 16%, transparent);
}

/* The dialog (crm/87 §10): 70 % of the window, 90 % on a mid-size one - the working is a table and needs the width. */
.modal-dialog.aira-calc-dialog { width: min(70vw, 1600px); max-width: min(70vw, 1600px); }
@media (max-width: 1199.98px) {
    .modal-dialog.aira-calc-dialog { width: 90vw; max-width: 90vw; }
}
@media (max-width: 575.98px) {
    .modal-dialog.aira-calc-dialog { width: auto; max-width: none; margin: .5rem; }
}

/* The head is the figure - what it is, where, and its amount - so it stays in view while the working scrolls. */
.aira-calc-head { align-items: center; gap: .875rem; padding: .875rem 1.25rem; }
.aira-calc-head .btn-close { flex-shrink: 0; margin: 0; }
.aira-calc-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .625rem;
    color: var(--ins-primary-text-emphasis);
    background: color-mix(in srgb, var(--aira-brand-400) 16%, transparent);
}
.aira-calc-mark svg { width: 1.25rem; height: 1.25rem; }
.aira-calc-head-text { flex: 1 1 auto; min-width: 0; }
.aira-calc-eyebrow { font-size: .75rem; line-height: 1.4; color: var(--ins-secondary-color); }
.aira-calc-head .modal-title { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.aira-calc-hero-where { font-size: .8125rem; line-height: 1.4; color: var(--ins-secondary-color); overflow-wrap: anywhere; }
/* The figure and, under it, what it means (As quoted, Below what was quoted) in the badge the form's own chip wears. */
.aira-calc-hero-figure { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: .3125rem; }
.aira-calc-verdict { margin-inline-end: .5rem; font-size: .75rem; white-space: nowrap; }
.aira-calc-hero-amount {
    flex-shrink: 0;
    padding-inline: .5rem;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--ins-primary-text-emphasis);
}

.aira-calc-trail { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .375rem; font-size: .75rem; line-height: 1.4; }
.aira-calc-trail-link { padding: 0; border: 0; font-size: inherit; line-height: inherit; vertical-align: baseline; text-decoration: none; }
.aira-calc-trail-sep { color: var(--aira-muted); }

.aira-calc-body { padding: 1rem 1.25rem 1.25rem; }

/* The values used - one strip: its label, then each value under its name. */
.aira-calc-facts {
    display: flex;
    align-items: stretch;
    margin-bottom: 1rem;
    padding: .5rem 1rem;
    border: 1px solid var(--ins-border-color);
    border-radius: .5rem;
    background: var(--ins-tertiary-bg);
}
.aira-calc-facts-label {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--ins-border-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}
.aira-calc-facts-list { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: .375rem 1.75rem; min-width: 0; margin: 0; }
.aira-calc-fact { min-width: 0; }
.aira-calc-fact dt { font-size: .6875rem; font-weight: 500; color: var(--ins-secondary-color); }
.aira-calc-fact dd { margin: 0; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* The working - Step, Formula, Calculation, Amount; a line per step. A cell's wash is the theme's state variable (crm/87 T3). */
.aira-calc-sheet { border: 1px solid var(--ins-border-color); border-radius: .5rem; }
.aira-calc-table { table-layout: fixed; width: 100%; margin: 0; font-size: .875rem; }
.aira-calc-table > :not(caption) > * > * { padding: .5rem .875rem; vertical-align: top; }
.aira-calc-table > thead > tr > th {
    --ins-table-bg-state: var(--ins-tertiary-bg);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ins-secondary-color);
}
.aira-calc-table > thead > tr > th.aira-calc-name { width: 27%; }
.aira-calc-table > thead > tr > th.aira-calc-formula { width: 29%; }
.aira-calc-table > thead > tr > th.aira-calc-work { width: 28%; }
.aira-calc-table > thead > tr > th.aira-calc-amount { width: 16%; }
.aira-calc-table > tbody > tr:last-child > td { border-bottom-width: 0; }
.aira-calc-table .aira-calc-amount { text-align: end; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.aira-calc-table td.aira-calc-formula { color: var(--ins-secondary-color); overflow-wrap: anywhere; }
.aira-calc-table td.aira-calc-work { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aira-calc-name-text { display: block; font-weight: 600; overflow-wrap: anywhere; }
.aira-calc-name-sub { display: block; font-size: .75rem; color: var(--ins-secondary-color); overflow-wrap: anywhere; }
.aira-calc-name-fx { display: none; }
.aira-calc-op { font-weight: 700; color: var(--ins-primary-text-emphasis); }
.aira-calc-suffix { margin-left: .375rem; font-size: .75rem; font-style: italic; color: var(--ins-secondary-color); }

/* A part of a sum - an item, a size, an accessory - on a branch under its step, the step and its parts one block (no rule between
   them); one that opens is a link to its own working. The branch is drawn by the cell itself, so it follows any row's height. */
.aira-calc-table > tbody > tr.aira-calc-row.has-parts > td,
.aira-calc-table > tbody > tr.aira-calc-row.is-part:not(.is-last) > td { border-bottom-width: 0; }
.aira-calc-row.is-part > td { padding-top: .3125rem; padding-bottom: .3125rem; font-size: .8125rem; }
.aira-calc-row.is-part.is-last > td { padding-bottom: .5rem; }
.aira-calc-table > tbody > tr.aira-calc-row.is-part > td.aira-calc-name { position: relative; padding-left: 2.25rem; }
.aira-calc-table > tbody > tr.aira-calc-row.is-part > td.aira-calc-name::before,
.aira-calc-table > tbody > tr.aira-calc-row.is-part > td.aira-calc-name::after {
    content: "";
    position: absolute;
    left: 1.125rem;
    border-color: color-mix(in srgb, var(--ins-primary) 35%, var(--ins-border-color));
    border-style: solid;
    border-width: 0;
    pointer-events: none;
}
.aira-calc-table > tbody > tr.aira-calc-row.is-part > td.aira-calc-name::before { top: 0; bottom: 0; border-left-width: 1px; }
.aira-calc-table > tbody > tr.aira-calc-row.is-part > td.aira-calc-name::after { top: 0; width: .75rem; height: 1rem; border-bottom-width: 1px; }
.aira-calc-table > tbody > tr.aira-calc-row.is-part.is-last > td.aira-calc-name::before { bottom: auto; height: 1rem; }
.aira-calc-row.is-part .aira-calc-name-text { font-weight: 500; }
.aira-calc-row.is-part > td.aira-calc-work { color: var(--ins-secondary-color); }
.aira-calc-row.is-part > td.aira-calc-amount { font-weight: 500; }
.aira-calc-row.is-open { cursor: pointer; }
.aira-calc-drill.is-step { font-weight: 600; }
.aira-calc-row.is-open:hover > td { --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 8%, transparent); }
.aira-calc-drill {
    --aira-focus-ring-offset: 1px;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0;
    border: 0;
    font: inherit;
    font-weight: 600;
    text-align: start;
    color: var(--ins-primary-text-emphasis);
    background: none;
    cursor: pointer;
}
.aira-calc-drill svg { flex-shrink: 0; width: .875rem; height: .875rem; }

/* A group - a size of an item, a line of an OA item - heads its own working with its own values. */
.aira-calc-table > tbody > tr.aira-calc-group > td {
    --ins-table-bg-state: var(--aira-section-head-bg);
    padding-top: .4375rem;
    padding-bottom: .4375rem;
    border-top: 1px solid var(--aira-section-head-rule);
    border-bottom-color: var(--aira-section-head-rule);
}
.aira-calc-group-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .625rem; }
.aira-calc-group-name { font-weight: 700; color: var(--ins-primary-text-emphasis); }
.aira-calc-group-sub { font-weight: 600; }
.aira-calc-group-facts { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: .125rem 1.25rem; font-size: .75rem; color: var(--ins-secondary-color); }
.aira-calc-group-fact { display: inline-flex; gap: .3125rem; }
.aira-calc-group-value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ins-body-color); }

/* The figure clicked - the last line, in the brand's tint, its amount the head's. */
.aira-calc-table > tbody > tr.aira-calc-row.is-final > td {
    --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 14%, transparent);
    border-top: 2px solid color-mix(in srgb, var(--ins-primary) 40%, transparent);
}
.aira-calc-row.is-final .aira-calc-name-text { color: var(--ins-primary-text-emphasis); }
.aira-calc-table > tbody > tr.aira-calc-row.is-final > td.aira-calc-amount { font-size: 1rem; font-weight: 700; color: var(--ins-primary-text-emphasis); }

/* The figure in the quotation's own currency (crm/119 §7) - after the figure, in full ink on its own tint: read, never a muted aside. The head says it
   under the amount, its code a chip; the values used carry the rate it was worked at. Every colour a theme token, so dark mode reads as light. */
.aira-calc-table > tbody > tr.aira-calc-row.is-fx > td {
    --ins-table-bg-state: color-mix(in srgb, var(--ins-success) 10%, transparent);
    border-top: 1px dashed color-mix(in srgb, var(--ins-success) 45%, transparent);
    color: var(--ins-body-color);
}
.aira-calc-row.is-fx .aira-calc-name-text { color: var(--ins-success-text-emphasis); }
.aira-calc-table > tbody > tr.aira-calc-row.is-fx > td.aira-calc-formula { color: var(--ins-body-color); }
.aira-calc-table > tbody > tr.aira-calc-row.is-fx > td.aira-calc-amount { font-size: 1rem; font-weight: 700; color: var(--ins-success-text-emphasis); }
.aira-calc-hero-foreign {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding-inline: .5rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--ins-success-text-emphasis);
}
.aira-calc-hero-foreign-code {
    padding: .0625rem .375rem;
    border-radius: var(--ins-border-radius-sm, .25rem);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--ins-success-text-emphasis);
    background: var(--ins-success-bg-subtle);
}
.aira-calc-fact.is-fx dd { color: var(--ins-success-text-emphasis); }

/* Ordered against quoted - each size's line total beside its quoted value and the difference, their total in the brand's tint.
   A difference wears the colour of the form's own chip: below and told red, above blue, below by rounding amber, the same muted. */
.aira-calc-compare { margin-bottom: 1rem; }
.aira-calc-section-label {
    margin-bottom: .375rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ins-secondary-color);
}
.aira-calc-cmp-table { width: 100%; margin: 0; font-size: .875rem; }
.aira-calc-cmp-table > :not(caption) > * > * { padding: .5rem .875rem; vertical-align: top; }
.aira-calc-cmp-table > thead > tr > th {
    --ins-table-bg-state: var(--ins-tertiary-bg);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ins-secondary-color);
}
.aira-calc-cmp-table .aira-calc-cmp-num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aira-calc-cmp-table td.aira-calc-cmp-num { font-weight: 600; }
.aira-calc-cmp-table td.aira-calc-cmp-label { min-width: 11rem; }
/* A figure that opens its working keeps its column's right edge - no chevron, so it lines up with the total under it. */
.aira-calc-cmp-table td .aira-calc-drill { justify-content: flex-end; }
.aira-calc-cmp-table td .aira-calc-drill .aira-calc-drill-go { display: none; }
.aira-calc-cmp-table td .aira-calc-drill:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.aira-calc-cmp-sub { display: block; font-size: .75rem; font-weight: 500; color: var(--ins-secondary-color); }
.aira-calc-cmp-table td.is-same { color: var(--ins-secondary-color); }
.aira-calc-cmp-table td.is-up,
.aira-calc-cmp-table td.is-info { color: var(--ins-info-text-emphasis); }
.aira-calc-cmp-table td.is-down { color: var(--ins-danger-text-emphasis); }
.aira-calc-cmp-table td.is-warn { color: var(--ins-warning-text-emphasis); }
.aira-calc-cmp-table td.is-up .aira-calc-cmp-sub,
.aira-calc-cmp-table td.is-info .aira-calc-cmp-sub,
.aira-calc-cmp-table td.is-down .aira-calc-cmp-sub,
.aira-calc-cmp-table td.is-warn .aira-calc-cmp-sub { color: inherit; }
.aira-calc-cmp-table > tbody > tr:last-child > td { border-bottom-width: 0; }
.aira-calc-cmp-table > tfoot > tr > td {
    --ins-table-bg-state: color-mix(in srgb, var(--aira-brand-400) 10%, transparent);
    border-top: 2px solid color-mix(in srgb, var(--ins-primary) 30%, transparent);
    border-bottom-width: 0;
    font-weight: 700;
}
.aira-calc-cmp-table > tfoot .aira-calc-name-text { font-weight: 700; color: var(--ins-primary-text-emphasis); }

.aira-calc-notes { display: flex; flex-direction: column; gap: .25rem; margin: .75rem 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--ins-secondary-color); }
.aira-calc-notes li { display: flex; align-items: flex-start; gap: .375rem; }
.aira-calc-notes svg { flex-shrink: 0; width: .875rem; height: .875rem; margin-top: .1875rem; }

.aira-calc-empty { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; border-radius: .5rem; background: var(--ins-tertiary-bg); }

.aira-calc-foot { gap: .75rem; padding: .625rem 1.25rem; }
.aira-calc-foot > * { margin: 0; }
.aira-calc-foot-note { flex: 1 1 auto; min-width: 0; font-size: .75rem; color: var(--ins-secondary-color); }

/* A phone: the Formula column folds under each step's name; the values' label sits over them. */
@media (max-width: 767.98px) {
    .aira-calc-table th.aira-calc-formula,
    .aira-calc-table td.aira-calc-formula { display: none; }
    .aira-calc-name-fx { display: block; margin-top: .125rem; font-size: .75rem; font-weight: 400; color: var(--ins-secondary-color); }
    .aira-calc-table > thead > tr > th.aira-calc-name { width: 40%; }
    .aira-calc-table > thead > tr > th.aira-calc-work { width: 35%; }
    .aira-calc-table > thead > tr > th.aira-calc-amount { width: 25%; }
    .aira-calc-facts { flex-direction: column; }
    .aira-calc-facts-label { margin: 0 0 .375rem; padding: 0; border-right: 0; }
    .aira-calc-hero-amount { font-size: 1.25rem; }
    .aira-calc-verdict { white-space: normal; text-align: end; }
    .aira-calc-cmp-table td.aira-calc-cmp-label { min-width: 8rem; }
    .aira-calc-foot-note { flex-basis: 100%; order: -1; }
}

/* ==========================================================================
   The territory map (crm/89 §4) - Dashboard › Reports › Territory.

   Every fill is a token, read by aira-map.js at draw time (a canvas cannot
   read a variable) and again after a theme switch. The ramps were validated
   with the dataviz method's script against the card in each mode (§4.4):
   ordinal, one hue, monotone lightness, a visible step between classes, the
   lightest class at least 2:1 on the card so it is never mistaken for None.
   Dark mode is its own steps, flipped - a bigger figure is brighter on the
   dark card - never the light ramp inverted.
   ========================================================================== */
:root {
    /* Magnitude - quoted, won, open, orders, counts: the product's own blue (#2a78d6 is step 450). */
    --map-seq-1: #86b6ef;
    --map-seq-2: #5598e7;
    --map-seq-3: #2a78d6;
    --map-seq-4: #1c5cab;
    --map-seq-5: #0d366b;
    /* Lost value: the same magnitude, in the hue every lost figure wears. */
    --map-loss-1: #ee8f8e;
    --map-loss-2: #e26665;
    --map-loss-3: #cc4241;
    --map-loss-4: #a52d2c;
    --map-loss-5: #721b1b;
    /* A rate against this filter's own rate: far below, below, within 5 points, above, far above. */
    --map-div-1: #c43c3b;
    --map-div-2: #ee8f8e;
    --map-div-3: #d6d6d1;
    --map-div-4: #86b6ef;
    --map-div-5: #1c5cab;
    /* No business - receding to the card, apart from every class; home - India on the world map, out of the classes. */
    --map-none: #f1f3f6;
    --map-home: #9fa8b5;
    --map-edge: var(--ins-secondary-bg);
}

html[data-bs-theme="dark"] {
    --map-seq-1: #184f95;
    --map-seq-2: #256abf;
    --map-seq-3: #3987e5;
    --map-seq-4: #6da7ec;
    --map-seq-5: #b7d3f6;
    --map-loss-1: #9a3332;
    --map-loss-2: #bf4544;
    --map-loss-3: #e05a59;
    --map-loss-4: #ec8b8a;
    --map-loss-5: #f6c4c3;
    --map-div-1: #e66767;
    --map-div-2: #a13a39;
    --map-div-3: #4b4c52;
    --map-div-4: #2b5d9e;
    --map-div-5: #6da7ec;
    --map-none: #282a33;
    --map-home: #6b7383;
}

/* The map beside its ranking; one above the other below the width both need. */
.aira-rv-map:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1199.98px) {
    .aira-rv-map:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
}
.aira-rv-map-stage { position: relative; min-width: 0; }
.aira-rv-map-canvas { width: 100%; height: 480px; }
@media (max-width: 767.98px) {
    .aira-rv-map-canvas { height: 360px; }
}
.aira-rv-map-tools { position: absolute; top: .25rem; right: .25rem; z-index: 2; }
.aira-rv-map-tools .btn { line-height: 1; padding: .3rem .4rem; }

/* The classes, under the map: a swatch and its range each; pointing at one lights its regions. */
.aira-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem 1rem;
    margin-top: .5rem;
    font-size: calc(12px * var(--aira-type-scale, 1));
    color: var(--ins-secondary-color);
}
.aira-map-key { display: inline-flex; align-items: center; gap: .375rem; cursor: default; white-space: nowrap; }
.aira-map-key > i {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

/* The tooltip - ECharts' own element, our words in it. */
.aira-map-tip { min-width: 13rem; }
.aira-map-tip-head { font-weight: 600; margin-bottom: .25rem; font-size: calc(13px * var(--aira-type-scale, 1)); }
.aira-map-tip-home {
    font-weight: 500;
    font-size: calc(11px * var(--aira-type-scale, 1));
    color: var(--ins-secondary-color);
    border: 1px solid var(--ins-border-color);
    border-radius: 999px;
    padding: 0 .4rem;
    margin-left: .25rem;
}
.aira-map-tip-rows { display: grid; row-gap: .0625rem; }
.aira-map-tip-row { display: flex; justify-content: space-between; gap: 1rem; white-space: nowrap; }
.aira-map-tip-row > span:first-child { color: var(--ins-secondary-color); }
.aira-map-tip-row > span:last-child { font-variant-numeric: tabular-nums; }
.aira-map-tip-row.is-shown > span { font-weight: 700; color: var(--ins-body-color); }
/* The records the shown figure's click opens (crm/97) - with it, set off from the other figures. */
.aira-map-tip-row.is-records { padding-bottom: .25rem; margin-bottom: .1875rem; border-bottom: 1px solid var(--ins-border-color); }
.aira-map-tip-row.is-records > span { font-weight: 600; color: var(--ins-body-color); }
.aira-map-tip-none,
.aira-map-tip-hint { color: var(--ins-secondary-color); font-size: calc(11.5px * var(--aira-type-scale, 1)); margin-top: .25rem; }

/* The ranking: the largest places by the figure shown, then those on no map. */
.aira-rv-rank { min-width: 0; }
@media (min-width: 1200px) {
    .aira-rv-rank { border-left: 1px solid var(--ins-border-color); padding-left: 1.25rem; }
}
.aira-rv-rank-head { font-weight: 600; margin-bottom: .5rem; font-size: calc(13px * var(--aira-type-scale, 1)); }
.aira-rv-rank-head.aira-rv-rank-off { margin-top: 1rem; color: var(--ins-secondary-color); }
/* One grid for the whole list, each row on its tracks (subgrid) - with a grid per row, the value column was each row's own width and every
   bar ended somewhere else (crm/95 TA9). */
.aira-rv-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr) auto;
    column-gap: .5rem;
}
.aira-rv-rank-list > li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.aira-rv-rank-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    column-gap: .5rem;
    row-gap: .25rem;
    align-items: center;
    width: 100%;
    padding: .375rem .5rem;
    border: 0;
    border-radius: .375rem;
    background: none;
    color: inherit;
    text-align: left;
    font-size: calc(13px * var(--aira-type-scale, 1));
}
.aira-rv-rank-row:not(.is-quiet):hover { background: rgba(var(--ins-primary-rgb), .08); cursor: pointer; }
.aira-rv-rank-row.is-quiet { cursor: default; }
.aira-rv-rank-n { grid-column: 1; grid-row: 1; color: var(--ins-secondary-color); font-variant-numeric: tabular-nums; }
.aira-rv-rank-name { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aira-rv-rank-value { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aira-rv-rank-bar { grid-column: 2; grid-row: 2; height: 6px; border-radius: 3px; background: var(--aira-line, #e9ecef); overflow: hidden; }
.aira-rv-rank-bar > i { display: block; height: 100%; width: var(--share); border-radius: 3px; background: var(--map-seq-3); }
/* Not on the map: a name and its value. */
.aira-rv-rank-list.is-off { grid-template-columns: minmax(0, 1fr) auto; }
.aira-rv-rank-list.is-off .aira-rv-rank-name { grid-column: 1; }
.aira-rv-rank-list.is-off .aira-rv-rank-value { grid-column: 2; }
.aira-rv-rank-share {
    grid-column: 3;
    grid-row: 2;
    color: var(--ins-secondary-color);
    font-size: calc(11.5px * var(--aira-type-scale, 1));
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 3rem;
}
.aira-rv-rank-more,
.aira-rv-rank-empty { color: var(--ins-secondary-color); font-size: calc(12px * var(--aira-type-scale, 1)); padding: .375rem .5rem; }

/* Show - the figure a chart of alternatives draws. */
.aira-rv-pick:not([hidden]) { display: flex; align-items: center; gap: .5rem; }
.aira-rv-pick .form-label { color: var(--ins-secondary-color); white-space: nowrap; }
.aira-rv-pick .form-select { min-width: 11rem; }

/* A report's total row, under its rows. */
/* The Dashboard's Reports view and the Reports page's dialog alike (crm/95 TA8). */
tfoot > .aira-rv-total > td { font-weight: 700; border-top: 2px solid var(--ins-border-color); background: var(--aira-surface-2, transparent); }

/* --------------------------------------------------------------------------
   A range of amounts as a slider (crm/96 §3) - Aira.rangeSlider over noUiSlider: the spread as bars over the track, two
   handles, the domain's ends under it. The master bar's Refine column draws the rate with it.

   The section's head carries the range in words at its right. The slider keeps its shape from the first frame - the bars'
   height and the track are drawn while the domain is still on its way (hard rule 10e) - and its handles stay inside the
   column: the padding is half a handle.

   The section stands straight in the Refine column, which has no inset of its own - its head, Find a field and the lists'
   grid each bring the column's .875rem - so it brings the same: without it the label and the range in words sat on the
   column's edges. Inside it the slider's half-handle inset puts a handle's outer edge under the label's first letter. A
   hairline closes it off from the lists below, which are another kind of control.
   -------------------------------------------------------------------------- */
.aira-search-col > .aira-search-section.aira-range {
    margin-bottom: .75rem;
    padding: .25rem .875rem .875rem;
    border-bottom: 1px solid var(--ins-border-color);
}
/* A long range in a narrow column takes its own line, still at the right, rather than running past the edge. */
.aira-search-section.aira-range > .form-label { flex-wrap: wrap; row-gap: .125rem; }
.aira-search-section.aira-range > .form-label .aira-range-value {
    margin-inline-start: auto;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    color: var(--aira-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.aira-search-section.aira-range > .form-label .aira-range-value.is-any { font-weight: 500; color: var(--aira-muted); }

/* What the slider says when its domain could not be read sits under the label's first letter, not the track's. */
.aira-rs-note { margin-inline: -.625rem; }

.aira-rs { padding: .125rem .625rem 0; }

.aira-rs-hist {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 2.25rem;
}

.aira-rs-bar {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 2px 2px 0 0;
    background: color-mix(in srgb, var(--aira-muted) 32%, transparent);
}

.aira-rs-bar.is-in { background: color-mix(in srgb, var(--ins-primary) 55%, transparent); }

html[data-bs-theme="dark"] .aira-rs-bar.is-in { background: color-mix(in srgb, var(--aira-brand-400) 70%, transparent); }

/* The track - a plain line while it waits, noUiSlider's target once drawn; both 4px, so nothing moves when it arrives. */
.aira-rs-track,
.aira-rs .noUi-target.noUi-horizontal {
    height: 4px;
    margin-top: .375rem;
    border: 0;
    border-radius: 2px;
    background: var(--aira-line-2);
    box-shadow: none;
}

.aira-rs .noUi-connect { background: var(--ins-primary); }

.aira-rs .noUi-horizontal .noUi-handle {
    width: 18px;
    height: 18px;
    top: -7px;
    right: -9px !important;
    border: 2px solid var(--ins-primary);
    border-radius: 50%;
    background: var(--ins-secondary-bg);
    box-shadow: var(--aira-shadow-1);
    cursor: grab;
}

.aira-rs .noUi-horizontal .noUi-handle::before,
.aira-rs .noUi-horizontal .noUi-handle::after { display: none; }

.aira-rs .noUi-horizontal .noUi-handle.noUi-active { cursor: grabbing; box-shadow: 0 0 0 4px var(--ins-primary-bg-subtle); }

.aira-rs-ends {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .625rem;
    font-size: .6875rem;
    color: var(--aira-muted);
    font-variant-numeric: tabular-nums;
}

.aira-rs-note { padding: .25rem 0; font-size: .75rem; color: var(--aira-muted); }

.aira-rs.is-waiting .aira-rs-ends { visibility: hidden; }
.aira-rs.is-waiting .aira-rs-ends::before { content: "\00a0"; }

.aira-rs.is-empty .aira-rs-hist,
.aira-rs.is-empty .aira-rs-track,
.aira-rs.is-empty .aira-rs-ends { display: none; }
