/* ═══════════════════════════════════════════════════════════════════════════
   ALFRED FOUNDATION — v1.0 LOCKED (Peter, 2026-09-07)
   The Frame and the recurring component grammar every surface is composed
   from. Consumes alfred.tokens.css only — no literal colour, face, radius or
   shadow appears in this file. Composition per surface comes from its lock.
   Motion classes are declared but resting content does not move (§13); the
   Interaction pass comes after all surfaces (Peter, 2026-09-07).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.al :focus-visible { outline: none; box-shadow: var(--al-focus); border-radius: var(--al-r-control); }
.al a { color: var(--al-navy-900); text-decoration: none; }
.al .al-rail a, .al a.al-rail-item { color: var(--al-rail-text); }
.al a.al-rail-item:hover, .al a.al-rail-item[aria-current="page"] { color: var(--al-rail-text-hi); }
.al a:hover { text-decoration: underline; text-underline-offset: 2px; }
/* The rail's items are links too, but they are PLACES, not words: no underline on
   hover, ever -- the plate behind the item is the whole hover. (Specificity had
   let the rule above win; Peter felt it as "hard", 2026-09-08.) */
.al a.al-rail-item:hover, .al a.al-rail-item:focus-visible { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .al * { transition: none !important; animation: none !important; } }

/* ── Type roles (§11) ──────────────────────────────────────────────────────── */
.al-identity { font-family: var(--al-font-identity); font-weight: 500; letter-spacing: .005em; font-variant-numeric: lining-nums; }
.al-id       { font-family: var(--al-font-id); font-size: var(--v3-fs-ref); letter-spacing: -.01em; }
.al-num      { font-family: var(--al-font-id); font-variant-numeric: tabular-nums; }
.al-eyebrow  { font-size: var(--al-fs-12); font-weight: 500; letter-spacing: .02em; color: var(--al-brass-read); }
.al-label    { font-size: var(--al-fs-12); font-weight: 500; color: var(--al-text-2); }
.al-muted    { color: var(--al-text-3); }
.al-secondary{ color: var(--al-text-2); }

/* ── The Frame ─────────────────────────────────────────────────────────────── */

/* Rail — the navy shell. Selection is a luminance plate and weight, never a colour. */
/* The firm is its logotype — the calligraphic mark, never typed (brand rule).
   The light-grey SVG is the firm's own asset; it is neither recoloured nor brass. */

/* ── Surface header: eyebrow · identity title · orientation figures ────────── */
.al-surface-head { display: flex; align-items: flex-end; gap: 32px; margin-bottom: 14px; }
.al-figures { display: flex; gap: 0; margin-left: auto; }
.al-figure { padding: 0 22px; border-left: 1px solid var(--al-line); }
.al-figure:first-child { border-left: 0; }
.al-figure .al-figure-label { font-size: var(--al-fs-12); color: var(--al-text-3); margin-bottom: 2px; white-space: nowrap; }
.al-figure .al-figure-value { font-family: var(--al-font-ui); font-variant-numeric: lining-nums proportional-nums; font-size: var(--al-fs-20); font-weight: 500; color: var(--al-text); line-height: 1.1; display: flex; align-items: baseline; gap: 6px; }
.al-figure .al-figure-prov { font-family: var(--al-font-ui); font-size: var(--al-fs-11); color: var(--al-text-3); font-weight: 400; }
.al-figure .al-figure-sub { display: flex; align-items: center; gap: 6px; font-size: var(--al-fs-11); color: var(--al-text-3); margin-top: 3px; }

/* Tabs — persistent soft-blue selection, no underline (Peter, 21 Sept 2026, design
   package v1 §05 and the design review: "Peter locked Tabs, filters & status on 21
   September, after choosing persistent soft blue selection without an underline and
   rounded hover/focus surfaces." Supersedes the earlier underline treatment below;
   every surface sharing this foundation file adopts it, not just Matter. */

/* ── Regions (planes, not cards) ───────────────────────────────────────────── */

/* Arrival band — the one region a surface must act on (Tax Clients / Post-Sale precedent) */
.al-band .al-band-fig { font-family: var(--al-font-id); font-size: var(--al-fs-28); font-weight: 500; line-height: 1; color: var(--al-text); }
.al-band .al-band-text { font-size: var(--al-fs-13); color: var(--al-text-2); }
.al-band .al-band-text strong { color: var(--al-text); font-weight: 500; }
.al-band .al-band-act { margin-left: auto; }

/* ── Controls: consequence classes (Step 6 §2.6; Master Spec §9) ───────────── */

/* Search & filter wells */

/* Lens strip — filters over one population; selected is navy, categories are text */
/* the interface face + tabular-nums, not --al-font-id (F-F, 2026-09-18 review): DM Mono's
   own zero glyph is slashed by design, reserved by the locked language for
   "machine references only -- cadastral refs, invoice numbers, case IDs"
   (ALFRED_DESIGN_LANGUAGE_v1.0 s4, Identifier row). A lens count is a plain
   quantity, not a reference; tabular-nums keeps digit widths aligned
   without borrowing the identifier face. Shared by every al-lens surface. */

/* ── Table — the instrument (§19). Hairlines, alignment, no zebra. ─────────── */
.al-table { width: 100%; border-collapse: separate; border-spacing: 0 2px; }
.al-table th { text-transform: none; letter-spacing: 0; text-align: left; padding: 8px 12px; font-size: var(--al-fs-rail-label); font-weight: 700; color: var(--al-text-2); background: none; border-bottom: 1px solid var(--al-divider); white-space: nowrap; }
.al-table td { padding: 8px 12px; height: var(--al-row); border-bottom: 0; vertical-align: middle; font-size: var(--al-fs-13); color: var(--al-text); line-height: 1.35; white-space: nowrap; }
.al-table td:first-child { border-radius: var(--al-r-control) 0 0 var(--al-r-control); }
.al-table td:last-child { border-radius: 0 var(--al-r-control) var(--al-r-control) 0; }

.al-table tr:last-child td { border-bottom: 0; }
.al-table tbody tr { cursor: pointer; }
.al-table tbody tr:hover td { background: var(--al-page); }
.al-table tbody tr[aria-selected="true"] td { background: var(--al-navy-wash); }
.al-table tbody tr[aria-selected="true"] td:first-child { box-shadow: none; }
.al-table td.al-absent { white-space: normal; }  /* an absence in words wraps rather than truncating mid-word at 1440 (Dept Cockpit Stage 4) */
.al-table .al-r { text-align: right; }
.al-table .al-num { font-size: var(--al-fs-13); }
.al-cell-2 { display: flex; flex-direction: column; gap: 0; line-height: 1.25; }
.al-cell-2 .al-sub { font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-initials { width: 26px; height: 26px; border-radius: 50%; background: var(--al-inset); color: var(--al-text-2); display: grid; place-items: center; font-size: var(--al-fs-11); font-weight: 600; flex: none; }
.al-absent { color: var(--al-text-3); }

/* ── Status = dot + word. Never colour alone; never category. (§15, WCAG) ── */
.al-status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--al-fs-12); color: var(--al-text-2); white-space: nowrap; }
.al-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--al-text-3); flex: none; }
.al-status.is-ok::before { background: var(--al-success); }        .al-status.is-ok { color: var(--al-success); }
.al-status.is-attention::before { background: var(--al-attention); } .al-status.is-attention { color: var(--al-attention); }
.al-status.is-critical::before { background: var(--al-critical); }  .al-status.is-critical { color: var(--al-critical); }
.al-status.is-info::before { background: var(--al-info); }          .al-status.is-info { color: var(--al-info); }
.al-cats { color: var(--al-text-2); font-size: var(--al-fs-12); }
.al-cats span + span::before { content: " · "; color: var(--al-text-3); }

/* ── Selection detail — Work territory beside the population ──────────────── */
.al-split { display: grid; grid-template-columns: minmax(0, 1fr) 540px; gap: 16px; align-items: start; }
.al-detail { background: var(--al-card);  border-radius: var(--al-r-card); border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); position: sticky; top: calc(var(--al-topbar-h) + var(--al-gap-card)); }
.al-detail-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.al-detail-head .al-initials { width: 36px; height: 36px; font-size: var(--al-fs-12); }
.al-detail-name { font-family: var(--al-font-ui); font-weight: 550; font-size: 18px; line-height: 1.3; }
.al-detail-sub { font-size: var(--al-fs-12); color: var(--al-text-3); margin-top: 2px; }
.al-detail .al-tabs { margin: 12px 18px 0; gap: 12px; flex-wrap: wrap; row-gap: 0; }  /* a narrow pane wraps its strip rather than hiding tabs behind a scroll (Tax Clients Stage 4) */
.al-detail .al-tab { font-size: var(--al-fs-12); }
.al-detail-body { padding: 14px 18px 18px; display: grid; gap: 14px; }
.al-kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: var(--al-fs-13); }
.al-kv dt { color: var(--al-text-2); }
.al-kv dd { margin: 0; color: var(--al-text); overflow-wrap: anywhere; }
.al-kv dd.al-absent { color: var(--al-text-3); }
.al-sec-title { font-size: var(--al-fs-label); font-weight: 600; color: var(--al-text-2); margin: 0 0 8px; }
.al-actions { display: grid; gap: 6px; }
.al-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--al-line); border-radius: var(--al-r-control); background: var(--al-raised); color: var(--al-text); font-size: var(--al-fs-13); cursor: pointer; }
.al-action:hover { border-color: var(--al-line-strong); }
.al-action .al-action-sub { display: block; font-size: var(--al-fs-11); color: var(--al-text-3); margin-top: 1px; }
.al-action.is-boundary { background: var(--al-inset); color: var(--al-text-2); cursor: default; }
.al-action.is-boundary .al-action-sub { color: var(--al-text-3); }
.al-chev { color: var(--al-text-3); flex: none; }

/* ── Provenance — beside the figure, always ────────────────────────────────── */
.al-prov { display: flex; gap: 8px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--al-line); font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-prov b { font-family: var(--al-font-id); font-weight: 500; color: var(--al-text-2); }

/* ── Pagination / footer row ───────────────────────────────────────────────── */
.al-tablefoot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--al-line); font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-pages { display: flex; gap: 4px; margin-left: auto; }
.al-page { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--al-r-control); color: var(--al-text-2); font-family: var(--al-font-ui); font-variant-numeric: tabular-nums; font-size: var(--al-fs-12); }
.al-page[aria-current="page"] { background: var(--al-navy-900); color: var(--al-text-inverse); }

/* ── Composed workspace (Pattern C): regions as one continuous surface, not a
   card grid — spatial-yield contextual expansion (Firm Overview lock §12–17,
   the reusable grammar it names in §42).

   PLANE SEMANTICS (the rule that gives every surface its rhythm, 2026-09-07):
     Work plane (.al-region, bordered)  = you ACT here — an instrument: a list
                                          you select from, a table, a queue.
     Canvas (.al-region.is-plain, open) = you READ here — a masthead figure,
                                          context, a chronology.
   Boxing everything is decorative containment (§8); boxing nothing loses the
   instrument. Alternate them by role and the page composes itself. ─────── */
.al-workspace { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 24px; align-items: start; }
.al-workspace-col { display: flex; flex-direction: column; gap: 22px; }
.al-workspace.is-expanded { grid-template-columns: 0.85fr 2.3fr 0.85fr; }
.al-region-hd .al-big { margin-left: auto; font-family: var(--al-font-id); font-size: var(--al-fs-28); font-weight: 500; line-height: 1; color: var(--al-text); }
.al-region-hd .al-big + .al-meta { margin-left: 10px; }

/* Flow — a vertical list of rows inside a region body. Hairlines, no card soup. */
.al-flow { display: flex; flex-direction: column; }
.al-flow-row + .al-flow-row { margin-top: 2px; }
.al-flow-row:last-child { border-bottom: 0; }
.al-flow-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.al-flow-title { font-size: var(--al-fs-13); color: var(--al-text); }
.al-flow-meta { font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-flow-aside { font-size: var(--al-fs-12); color: var(--al-text-3); white-space: nowrap; text-align: right; flex: none; }

.al-flow.is-compact .al-flow-row { padding: 7px 9px; min-height: 0; }
.al-flow.is-compact .al-flow-title { font-size: var(--al-fs-12); color: var(--al-text-2); }
.al-flow.is-compact .al-flow-meta, .al-flow.is-compact .al-flow-aside { font-size: var(--al-fs-11); }
.al-flow-row[aria-selected="true"] { background: var(--al-navy-wash); box-shadow: none; }  /* a selectable flow row is the package soft-blue plate, never a stripe */
/* Row with a leading mono column (a date, a reference) — temporal or keyed lists */
.al-flow-row .al-flow-key { flex: none; width: 58px; font-family: var(--al-font-id); font-size: var(--al-fs-12); color: var(--al-text-2); padding-top: 1px; }

/* Distribution instrument — a set of proportional horizontal bars with the value
   beside each. A real chart, not a strip; used where a figure has a shape worth
   reading (ageing buckets, shares). Colour belongs to the datum: neutral by
   default, a semantic token only on the bucket that earns it. */
.al-bars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 8px 14px; align-items: center; }
.al-bars .al-bar-label { font-size: var(--al-fs-12); color: var(--al-text-2); white-space: nowrap; }
.al-bars .al-bar-track { height: 10px; border-radius: 5px; background: var(--al-inset); overflow: hidden; }
.al-bars .al-bar-fill { height: 100%; border-radius: 5px; background: var(--al-navy-800); }
.al-bars .al-bar-fill.is-attention { background: var(--al-attention); }
.al-bars .al-bar-value { font-family: var(--al-font-id); font-size: var(--al-fs-12); color: var(--al-text); text-align: right; white-space: nowrap; }
.al-bars .al-bar-value small { font-family: var(--al-font-ui); color: var(--al-text-3); margin-left: 6px; }

/* Hairline between stacked blocks inside one region (a masthead's sub-facts) */
.al-rule { border: 0; border-top: 1px solid var(--al-line); margin: 16px 0; }

/* The round A — identifies Alfred SYNTHESIS beside a fact, never decoration (§17,19) */
.al-a-badge { width: 20px; height: 20px; border-radius: 50%; background: var(--al-navy-900); color: var(--al-text-inverse); display: inline-grid; place-items: center; font-family: var(--al-font-identity); font-size: var(--al-fs-12); font-weight: 600; flex: none; }

/* Financial Position — headline + ageing distribution (§10). Colour belongs to
   the datum, not the category: the buckets step from structural to earned. */
.al-headline { font-family: var(--al-font-id); font-size: var(--al-fs-28); font-weight: 500; color: var(--al-text); line-height: 1; letter-spacing: -.01em; }
.al-headline-label { font-size: var(--al-fs-12); color: var(--al-text-3); margin-bottom: 6px; }
.al-aging { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 14px 0 10px; background: var(--al-inset); }
.al-aging-seg { height: 100%; }
.al-aging-key { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-aging-key b { font-family: var(--al-font-id); color: var(--al-text-2); font-weight: 500; }
.al-why { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; font: inherit; font-size: var(--al-fs-12); color: var(--al-navy-900); cursor: pointer; }
.al-why:hover { text-decoration: underline; }

/* ── Object Workspace (Pattern A): one record's own tabs + a two-column body.
   Main content left, compact metadata/actions right — never a card grid. ──── */
.al-obj-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

/* Region variant that sits directly on the canvas -- no border, no plane change.
   For the one fact per page that earns masthead treatment, not database-row
   treatment (Position/Space before Weight/Colour -- the hierarchy law itself). */
.al-region.is-plain { background: none; border: none; }
.al-region.is-plain .al-region-hd { border-bottom: none; padding-left: 0; padding-right: 0; }
.al-region.is-plain .al-region-body { padding-left: 0; padding-right: 0; }

/* Stage sequence (a Matter's journey/workstream chain). Progress is weight and
   position, never colour-as-category: done = quiet fill, current = navy, ahead =
   an open ring. No green completion circles, no brass (§ Brass Rule). The
   connector itself shows momentum -- travelled = navy, ahead = neutral -- static
   fact, not animation. */
/* Built on the SAME principle as the Financial Position ageing bar (§10): a
   solid, rounded track + fill is one designed object; a bare line threaded
   through hollow circles is not -- that was the actual defect Peter named
   ("dense grey passing through," compared unfavourably to the ageing bar), not
   a colour or a hex value to copy but the CONSTRUCTION to reuse: inset track,
   navy fill, rounded ends, dots painted on top so the track only shows in the
   gaps between them. */
.al-stepper { display: flex; position: relative; margin-top: 4px; --steps: 6; }
.al-track, .al-track-fill { position: absolute; top: 2px; height: 6px; border-radius: 3px; }
.al-track { left: calc(50% / var(--steps)); right: calc(50% / var(--steps)); background: var(--al-inset); }
.al-track-fill { left: calc(50% / var(--steps)); background: var(--al-navy-900); }
.al-step { flex: 1; position: relative; z-index: 1; text-align: center; }
/* The dot's own centre (a 10px dot at the step's top edge, y=0..10 -> centre 5)
   must equal the track's centre (top:2 + 6/2 = 5) -- verified, not assumed; a
   prior version put the line's centre 5-6px below the dots and they visibly
   floated off it (caught by Peter, 2026-09-07). Dot size is now constant across
   states -- resizing it for "current" was the root cause of that drift. */
.al-step-dot { width: 10px; height: 10px; border-radius: 50%; margin: 0 auto; background: var(--al-raised); border: 2px solid var(--al-line-strong); box-sizing: border-box; position: relative; }
.al-step-label { display: block; margin-top: 10px; font-size: var(--al-fs-12); color: var(--al-text-3); }
.al-step.is-done .al-step-dot { background: var(--al-text-3); border-color: var(--al-text-3); }
.al-step.is-current .al-step-dot { background: var(--al-navy-900); border-color: var(--al-navy-900); box-shadow: 0 0 0 3px var(--al-navy-wash); }
.al-step.is-current .al-step-label { color: var(--al-navy-900); font-weight: 500; }

/* Third plane: RECESSED (.al-region.is-recessed) = it exists, it is not today's
   work — a legacy archive, an inactive drawer. Inset luminance, no hairline. */
.al-region.is-recessed { background: var(--al-inset); border-color: transparent; }

/* ── Drawers (Pattern D, El Archivo): permission-shaped entry cards, never an
   equal grid. A drawer states what it holds as a figure, not a decoration. ── */
.al-drawers { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 16px; }
.al-drawer { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 16px; min-height: 172px; }
.al-drawer-hd { display: flex; align-items: flex-start; gap: 12px; }
.al-drawer-hd .al-glyph { width: 20px; height: 20px; flex: none; color: var(--al-text-2); margin-top: 1px; }
.al-drawer-name { font-size: var(--al-fs-16); font-weight: 500; color: var(--al-text); line-height: 1.2; }
.al-drawer-sub { font-size: var(--al-fs-12); color: var(--al-text-3); margin-top: 2px; }
.al-drawer-figs { display: flex; gap: 24px; margin-top: auto; align-items: flex-end; }
.al-drawer-fig b { display: block; font-family: var(--al-font-id); font-size: var(--al-fs-28); font-weight: 500; line-height: 1; color: var(--al-text); }
.al-drawer-fig span { display: block; font-size: var(--al-fs-12); color: var(--al-text-3); margin-top: 4px; }
.al-drawer-fig.is-attention b { color: var(--al-attention); }
.al-drawer-go { margin-top: auto; font-size: var(--al-fs-13); }
.al-doorways { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; }
.al-doorway { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
.al-doorway .al-glyph { width: 20px; height: 20px; flex: none; color: var(--al-text-2); margin-top: 2px; }
.al-doorway-name { font-size: var(--al-fs-14); font-weight: 500; color: var(--al-text); }
.al-doorway-sub { font-size: var(--al-fs-12); color: var(--al-text-2); margin-top: 3px; }

/* ── Toolbar + segmented control (Pattern E and any view-switch) ───────────── */
.al-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.al-toolbar .al-range { font-size: var(--al-fs-16); font-weight: 500; color: var(--al-text); margin: 0 8px; }

/* ── Temporal canvas (Pattern E, Calendar lock §§8–11, §24). Three epistemic
   classes must stay distinguishable, never by source colour:
     .is-event    persisted event   — raised plane, a committed thing
     .is-date     source-owned date — work plane, all-day layer, owned elsewhere
     .is-derived  derived intelligence — inset, dashed, subordinate to the booked
   Selection is the same navy plate as everywhere else. ─────────────────────── */
.al-cal-split { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 20px; align-items: start; }
.al-cal { --cal-h: 56px; --cal-gutter: 56px; border: 1px solid var(--al-line); border-radius: var(--al-r-control); background: var(--al-work); overflow: hidden; }
.al-cal-row { display: grid; grid-template-columns: var(--cal-gutter) repeat(5, minmax(0, 1fr)); }
.al-cal-days { border-bottom: 1px solid var(--al-line); }
.al-cal-day { padding: 10px 12px 8px; font-size: var(--al-fs-12); color: var(--al-text-3); border-left: 1px solid var(--al-line); }
.al-cal-day b { display: block; font-family: var(--al-font-id); font-size: var(--al-fs-16); font-weight: 500; color: var(--al-text); margin-top: 1px; }
.al-cal-day.is-today { box-shadow: inset 0 -2px 0 var(--al-navy-900); }
.al-cal-day.is-today b { color: var(--al-navy-900); }
.al-cal-gut { font-family: var(--al-font-id); font-size: var(--al-fs-11); color: var(--al-text-3); text-align: right; padding: 8px 8px 0 0; }
.al-cal-allday { border-bottom: 1px solid var(--al-line); background: var(--al-canvas); }
.al-cal-allday .al-cal-cell { border-left: 1px solid var(--al-line); padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.al-cal-allday .al-cal-cell.is-span-2 { grid-column: span 2; }
.al-cal-allday .al-cal-cell.is-span-3 { grid-column: span 3; }
.al-cal-allday .al-cal-cell.is-span-5 { grid-column: span 5; }
.al-cal-hour { height: var(--cal-h); font-family: var(--al-font-id); font-size: var(--al-fs-11); color: var(--al-text-3); text-align: right; padding: 0 8px 0 0; transform: translateY(-7px); }
.al-cal-col { position: relative; border-left: 1px solid var(--al-line); height: calc(var(--cal-h) * 10);
  background-image: repeating-linear-gradient(to bottom, var(--al-line) 0 1px, transparent 1px var(--cal-h)); }
.al-ev { position: absolute; left: 4px; right: 4px; padding: 6px 8px; border-radius: var(--al-r-control); font-size: var(--al-fs-12); overflow: hidden; line-height: 1.3; }
.al-ev.is-static { position: static; }
.al-ev.is-event { background: var(--al-raised); border: 1px solid var(--al-line-strong); border-left: 3px solid var(--al-navy-800); }
.al-ev.is-date { background: var(--al-work); border: 1px solid var(--al-line-strong); }
.al-ev.is-derived { background: var(--al-inset); border: 1px dashed var(--al-line-strong); color: var(--al-text-2); }
.al-ev[aria-selected="true"] { background: var(--al-navy-wash); border-color: var(--al-navy-900); box-shadow: inset 3px 0 0 var(--al-navy-900); }
.al-ev .al-ev-title { display: block; font-weight: 500; color: var(--al-text); }
.al-ev .al-ev-meta { display: block; color: var(--al-text-3); font-size: var(--al-fs-11); margin-top: 1px; }
.al-ev .al-ev-meta .al-status { font-size: var(--al-fs-11); }
.al-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-family: var(--al-font-id); font-size: var(--al-fs-12); }
.al-mini .al-mini-h { font-family: var(--al-font-ui); font-size: var(--al-fs-11); color: var(--al-text-3); padding: 4px 0 6px; }
.al-mini .al-mini-d { height: 28px; line-height: 28px; border-radius: var(--al-r-control); color: var(--al-text-2); }
.al-mini .al-mini-d.is-out { color: var(--al-text-3); opacity: .55; }
.al-mini .al-mini-d.is-today { background: var(--al-navy-900); color: var(--al-text-inverse); font-weight: 500; }
.al-mini .al-mini-d.is-sel { background: var(--al-navy-wash); color: var(--al-navy-900); }
.al-mini .al-mini-d.is-week { box-shadow: inset 0 -2px 0 var(--al-line-strong); }

/* ── Conversation (Ask Alfred, Composition A): the answer is composed editorial
   working text on the canvas, not a bubble; citations are claim-level marks;
   evidence opens in the ONE desk on the right (~45%), never a second panel. ── */
.al-door { display: flex; align-items: center; gap: 14px; font-size: var(--al-fs-12); color: var(--al-text-3); margin-bottom: 26px; }
.al-door b { color: var(--al-text-2); font-weight: 500; }
.al-door .al-sep { color: var(--al-line-strong); }
.al-door .al-right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.al-chip .al-count { font-family: var(--al-font-id); color: var(--al-text); }
.al-chip[aria-pressed="true"] { background: var(--al-navy-900); color: var(--al-text-inverse); border-color: var(--al-navy-900); }  /* a pressed filter chip paints; the × glyph alone was the only tell (Dept Cockpit Stage 4) */
.al-q { display: flex; gap: 12px; align-items: flex-start; max-width: 72ch; margin-bottom: 22px; }
.al-q .al-initials { width: 28px; height: 28px; overflow: hidden; }
.al-q .al-initials img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-q p { margin: 3px 0 0; font-size: var(--al-fs-14); color: var(--al-text); line-height: 1.5; }
.al-answer { display: flex; gap: 12px; align-items: flex-start; max-width: 76ch; }
.al-answer .al-a-badge { margin-top: 5px; }
.al-answer-body { font-size: var(--al-fs-14); line-height: 1.6; color: var(--al-text); }
.al-answer-body p { margin: 0 0 12px; }
.al-answer-body p:last-child { margin-bottom: 0; }
.al-cite { display: inline-block; font-family: var(--al-font-id); font-size: var(--al-fs-11); color: var(--al-navy-900); border: 1px solid var(--al-line-strong); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; line-height: 16px; cursor: pointer; background: var(--al-raised); }
.al-cite[aria-selected="true"] { background: var(--al-navy-900); color: var(--al-text-inverse); border-color: var(--al-navy-900); }
.al-caveat { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin: 10px 0 12px; background: var(--al-inset); border-radius: var(--al-r-control); font-size: var(--al-fs-12); color: var(--al-text-2); }
.al-sources { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0 32px; }
.al-source { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 8px; border: 1px solid var(--al-line); border-radius: var(--al-r-control); background: var(--al-work); font-size: var(--al-fs-12); color: var(--al-text-2); cursor: pointer; }
.al-source .al-glyph { width: 14px; height: 14px; color: var(--al-text-3); }
.al-source b { color: var(--al-text); font-weight: 500; }
.al-source[aria-selected="true"] { border-color: var(--al-navy-900); background: var(--al-navy-wash); }
.al-consequences { display: flex; gap: 10px; align-items: center; margin: 22px 0 0 32px; }
.al-btn .al-btn-sub { display: block; font-size: var(--al-fs-11); font-weight: 400; color: var(--al-text-3); margin-top: -1px; }
.al-btn.is-scope { flex-direction: column; align-items: flex-start; height: auto; padding: 6px 14px; line-height: 1.25; border-style: dashed; }
.al-composer { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 8px; margin-top: 34px; max-width: 76ch; background: var(--al-raised); border: 1px solid var(--al-line-strong); border-radius: var(--al-r-control); }
.al-composer .al-a { width: 26px; height: 26px; border-radius: 50%; background: var(--al-navy-900); color: var(--al-text-inverse); display: grid; place-items: center; font-family: var(--al-font-identity); font-size: var(--al-fs-14); font-weight: 600; }
.al-composer input { flex: 1; border: 0; background: transparent; font: inherit; font-size: var(--al-fs-14); color: var(--al-text); outline: none; }
.al-composer input::placeholder { color: var(--al-text-3); }
.al-desk { background: var(--al-raised); border: 1px solid var(--al-line); border-radius: var(--al-r-control); box-shadow: var(--al-shadow-raised); position: sticky; top: calc(var(--al-topbar-h) + 16px); }
.al-desk-hd { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--al-line); }
.al-desk-hd .al-glyph { width: 18px; height: 18px; color: var(--al-text-2); margin-top: 2px; flex: none; }
.al-desk-kind { font-size: var(--al-fs-12); font-weight: 500; color: var(--al-text-3); }
.al-desk-title { font-size: var(--al-fs-16); font-weight: 500; color: var(--al-text); margin-top: 2px; line-height: 1.3; }
.al-desk-body { padding: 16px 18px 18px; font-size: var(--al-fs-13); line-height: 1.6; color: var(--al-text); }
.al-desk-body .al-law { border-left: 2px solid var(--al-line-strong); padding-left: 14px; color: var(--al-text-2); margin: 12px 0; }
.al-desk-body .al-law b { color: var(--al-text); }
.al-desk-foot { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--al-line); }

/* ── Checklist (a workstream's steps): done / current / ahead by weight ────── */
.al-check { display: flex; flex-direction: column; }
.al-check-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--al-line); font-size: var(--al-fs-13); color: var(--al-text-2); }
.al-check-row:last-child { border-bottom: 0; }
.al-check-row .al-step-dot { margin: 0; }
.al-check-row.is-done { color: var(--al-text-3); }
.al-check-row.is-done .al-step-dot { background: var(--al-text-3); border-color: var(--al-text-3); }
.al-check-row.is-current { color: var(--al-text); font-weight: 500; }
.al-check-row.is-current .al-step-dot { background: var(--al-navy-900); border-color: var(--al-navy-900); box-shadow: 0 0 0 3px var(--al-navy-wash); }
.al-check-row .al-check-meta { margin-left: auto; font-size: var(--al-fs-12); color: var(--al-text-3); font-weight: 400; }

/* ── Compact width (1440×900): tighten, never collapse the rail (Step 7.1) ── */
@media (max-width: 1500px) {
  .al-main { padding: 18px 22px 96px; }
  .al-split { grid-template-columns: minmax(0, 1fr) 400px; }
  .al-figure { padding: 0 16px; }
  /* Client and Categories truncate first (Tax Clients lock §Responsive). Cells stay
     table cells: truncate with max-width + overflow, never by changing display. */
  .al-table td.al-cats, .al-table td.al-absent { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .al-table .al-cell-2 { max-width: 128px; }
  .al-table .al-cell-2 span { display: block; overflow: hidden; text-overflow: ellipsis; }
  .al-band .al-band-text { max-width: 58ch; }
  .al-workspace { grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; }
  .al-workspace-col { gap: 16px; }
  .al-workspace.is-expanded { grid-template-columns: 0.85fr 2.1fr 0.85fr; }
  .al-obj-body { grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
  .al-cal-split { grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
  .al-cal { --cal-h: 44px; }
  .al-drawers { gap: 12px; }
  .al-drawer-fig b { font-size: var(--al-fs-20); }
  .al-ask-split.is-desk-open { grid-template-columns: minmax(0, 52fr) minmax(480px, 48fr); }
  .al-sources, .al-consequences { margin-left: 0; }
}

/* ═══ COMPONENT VOCABULARY, brand pack v2 (RULES.md sections 1 to 4). One definition of each. ═══ */
body.al {
  margin: 0; min-height: 100vh; background: var(--al-page); color: var(--al-text);
  font-family: var(--al-font-ui); font-size: var(--al-fs-ui); line-height: var(--al-lh-ui); font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11" 1;
}
.al-title { font-family: var(--al-font-ui); font-weight: 800; font-size: var(--al-fs-title); line-height: 1.25; color: var(--al-text); margin: 0; letter-spacing: 0; }

/* Cards (v3.1): white, a 1px line, 6px corners, the card shadow; padding 24; the title has no rule under it, 12px of space after it */
.al-region { background: var(--al-card); border: 1px solid var(--al-divider); border-radius: var(--al-r-card); box-shadow: var(--al-shadow-card); }
.al-region-hd { display: flex; align-items: baseline; gap: 12px; padding: var(--al-pad-card) var(--al-pad-card) var(--al-gap-title); border-bottom: 0; }
.al-region-hd .al-label { color: var(--al-text); font-size: var(--al-fs-card); font-weight: 700; }
.al-region-hd .al-meta { margin-left: auto; font-size: var(--al-fs-label); color: var(--al-text-2); }
.al-region-body { padding: 0 var(--al-pad-card) var(--al-pad-card); }
.al-well { background: var(--al-page); border-radius: var(--al-r-control); }
.al-band { display: flex; align-items: center; gap: 24px; padding: 0; margin-bottom: var(--al-gap-card); background: none; color: var(--al-attention); }
.al-band .al-band-fig { font-size: 28px; font-weight: 600; line-height: 1; color: var(--al-text); font-variant-numeric: tabular-nums; }
.al-band .al-band-text { font-size: var(--al-fs-ui); color: var(--al-text-2); }
.al-band .al-band-text strong { color: var(--al-text); font-weight: 600; }
.al-band .al-band-act { margin-left: auto; }
.al-note { padding: 12px 14px; background: var(--al-page); border-radius: var(--al-r-control); font-size: var(--al-fs-label); color: var(--al-text-2); }

/* Tabs: the selected plate + action text 600 (one look for tabs, rows, sub-sections, side lists) */
.al-tabs { display: flex; gap: 4px; align-items: center; margin-bottom: var(--al-gap-card); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.al-tabs::-webkit-scrollbar { display: none; }
.al-tab { height: 36px; padding: 0 12px; font-size: var(--al-fs-ui); color: var(--al-text); white-space: nowrap; flex: none; border: 0; border-radius: var(--al-r-control); cursor: pointer; background: none; font-family: inherit; transition: background-color var(--al-t-hover) var(--al-ease); }
.al-tab:hover { background: var(--al-card); }
.al-tab:focus-visible { outline: none; box-shadow: var(--al-focus); }
.al-tab[aria-selected="true"] { color: var(--al-action); font-weight: 600; background: var(--al-selected); }
.al-tab .al-count { margin-left: 6px; font-size: var(--al-fs-label); color: var(--al-text-2); font-weight: 400; font-variant-numeric: tabular-nums; }

/* Buttons: 40px, 8px corners; ONE filled primary per area, every other button outlined (inset 1px line-control) or plain */
.al-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--al-control-h); min-height: var(--al-control-h); padding: 0 16px; border: 0; border-radius: var(--al-r-control); font-family: inherit; font-size: var(--al-fs-ui); font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color var(--al-t-hover) var(--al-ease), box-shadow var(--al-t-hover) var(--al-ease); background: var(--al-card); color: var(--al-action); box-shadow: inset 0 0 0 1px var(--al-line-control); }
.al-btn:hover { box-shadow: inset 0 0 0 1px var(--al-action); text-decoration: none; }
.al-btn:active { background: var(--al-selected); }
.al-btn-strong { background: var(--al-action); color: var(--al-text-inverse); box-shadow: none; }
.al-btn-strong:hover { background: var(--al-action-hover); box-shadow: none; }
.al-btn-standard { background: var(--al-card); color: var(--al-action); box-shadow: inset 0 0 0 1px var(--al-line-control); }
.al-btn-quiet { background: transparent; color: var(--al-action); box-shadow: none; }
.al-btn-quiet:hover { background: var(--al-selected); box-shadow: none; }
.al-btn-destructive { background: var(--al-card); color: var(--al-critical); box-shadow: inset 0 0 0 1px var(--al-critical); }
.al-btn-destructive:hover { background: var(--al-critical-wash); box-shadow: inset 0 0 0 1px var(--al-critical); }
.al-btn[disabled], .al-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.al-iconbtn { width: var(--al-control-h); height: var(--al-control-h); display: grid; place-items: center; border: 0; background: var(--al-card); box-shadow: inset 0 0 0 1px var(--al-line-control); border-radius: var(--al-r-control); color: var(--al-action); cursor: pointer; }
.al-iconbtn:hover { box-shadow: inset 0 0 0 1px var(--al-action); }
.al-search { display: flex; align-items: center; gap: 8px; height: var(--al-control-h); padding: 0 12px; background: var(--al-field); box-shadow: inset 0 0 0 1px var(--al-line-control); border-radius: var(--al-r-control); color: var(--al-text-2); min-width: 240px; }
.al-search:focus-within { box-shadow: var(--al-focus); }
.al-search input { border: 0; background: transparent; font: inherit; font-size: var(--al-fs-read); color: var(--al-text); width: 100%; outline: none; }
.al-search input::placeholder { color: var(--al-text-2); }
.al-search input:focus, .al-search input:focus-visible, .al-field .al-search input:focus { box-shadow: none; border: 0; outline: none; }  /* one ring: the field's own (gb09) */

/* Lens strip: counts as one card, the selected lens is the plate */
.al-lenses { display: flex; background: var(--al-card); border-radius: var(--al-r-card); border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); margin-bottom: var(--al-gap-card); overflow: hidden; }
.al-lens { flex: 1; padding: 12px 16px; border: 0; background: none; font: inherit; text-align: left; color: var(--al-text-2); cursor: pointer; transition: background-color var(--al-t-hover) var(--al-ease); }
.al-lens:hover { background: var(--al-page); }
.al-lens[aria-pressed="true"] { background: var(--al-selected); color: var(--al-action); font-weight: 600; }
.al-lens .al-lens-name { display: block; font-size: var(--al-fs-label); }
.al-lens .al-lens-count { display: block; font-variant-numeric: lining-nums proportional-nums; font-size: var(--al-fs-card); font-weight: 600; margin-top: 2px; color: var(--al-text); }
.al-lens[aria-pressed="true"] .al-lens-count, .al-lens[aria-pressed="true"] .al-lens-name { color: var(--al-action); }

/* Chips and the two-way switch */
.al-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--al-chip-h); padding: 0 12px; border-radius: var(--al-r-chip); background: var(--al-card); box-shadow: inset 0 0 0 1px var(--al-line-control); font-size: var(--al-fs-label); font-weight: 500; color: var(--al-action); }
.al-chip[aria-pressed="true"] { background: var(--al-selected); box-shadow: inset 0 0 0 1px var(--al-action); color: var(--al-action); font-weight: 600; }
.al-seg { display: inline-flex; border-radius: var(--al-r-control); overflow: hidden; background: var(--al-card); box-shadow: inset 0 0 0 1px var(--al-line-control); }
.al-seg button { height: calc(var(--al-control-h) - 2px); padding: 0 16px; border: 0; background: none; font: inherit; font-size: var(--al-fs-ui); font-weight: 500; color: var(--al-action); cursor: pointer; }
.al-seg button[aria-pressed="true"] { background: var(--al-action); color: var(--al-text-inverse); font-weight: 600; }

/* Rows: 52px (64 for two lines, 44 compact); a selectable row is the selected plate, never a stripe */
.al-flow-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; min-height: var(--al-row); border-radius: var(--al-r-control); }

/* ── Legacy screens under brand pack v2: one rule set until each screen is rebuilt (controls 40/32/30, cards on the shadow, one mono face) ── */
.al-main input:not([type]), .al-main input[type="text"], .al-main input[type="search"], .al-main input[type="email"], .al-main input[type="number"], .al-main input[type="date"], .al-main input[type="tel"], .al-main input[type="password"], .al-main select:not(.al-chip) { min-height: var(--al-control-h); }
.al-main select.al-chip, .al-main .al-chip { min-height: var(--al-chip-h); height: var(--al-chip-h) !important; }
.al-main .btn-sm, .al-main .aa-x, .al-main .alfred-dictate-pill { min-height: 32px; font-size: var(--al-fs-label); }
.al-main .oi-filter-btn { min-height: var(--al-chip-h); font-size: var(--al-fs-label); }
.al-main .stat-card, .al-main .oi-card{  border-radius: var(--al-r-card); border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); }
.al-main code, .al-main pre, .al-main kbd, .al-main samp { font-family: var(--al-font-id); }
.al-main .stat-value { font-family: var(--al-font-ui); }
.al-main #ec-back-btn, .al-main .fi-link { min-height: 32px; }
.al-main .fi-wrap, .al-main .fi-card {  border: 1px solid var(--al-divider); box-shadow: var(--al-shadow-card); }
.al-main .oi-btn-primary, .al-main .oi-btn-approve, .al-main .oi-btn-ghost { min-height: 32px; font-size: var(--al-fs-label); }
.al-main #view-ficha, .al-main .fi-wrap { min-width: 0; max-width: 100%; }
.al-main .al-surface-head { flex-wrap: wrap; }
.al-main .al-figures { flex-wrap: wrap; }
.al-main #view-ficha, .al-main #view-tax-register { overflow-x: auto; }
.al-main #view-ficha, .al-main #view-tax-register { max-width: calc(100vw - var(--al-rail-w) - 48px); }
