/* ============================================================
   BlossomERP panel stylesheet — one home (Manual §51).
   Sections by class-family prefix, in cascade order.
   ============================================================ */

/* ---- Layout: content width (P-4/D1, §49; inset B4, §69) — .fi-main ----
   The panel content is full width (->maxContentWidth(Full));
   this block owns the content container's side padding in
   ONE place. P-4/D1 set slim margins; B4 (Manual §69) adds
   a modest inset at tablet/desktop widths for a better
   aspect ratio — padding on the CONTAINER only: no width
   cap is set here or on any inner content, so full-span
   surfaces (360 views and their tabs included) keep the
   whole padded width. Mobile keeps the slim 1rem so
   small screens lose nothing. */
.fi-main {
    padding-inline: 1rem;
    /* §279 item 2: bottom clearance for the fixed
       bottom-right pills (.sc-chip / .mp-fab dock 1.25rem
       off the corner and stand ~3rem tall). Without it,
       the foot of a long page — a form's Save actions,
       the dashboard builder's Cancel, a workspace's
       helper text — can come to rest UNDER a pill with
       no way to scroll it clear. The clearance is one
       seam here, not per-surface nudges: every page
       gains scroll room equal to the pill zone. */
    padding-bottom: 5.5rem;
}
@media (min-width: 48rem) {
    .fi-main {
        padding-inline: 2rem;
    }
}
@media (min-width: 64rem) {
    .fi-main {
        padding-inline: 2.5rem;
    }
}

/* ---- Stock-count worksheet (B1, §69) — .sc-worksheet ----
   The count-entry grid on the stock-count view: a plain
   table whose counted-qty inputs read as form fields.
   Scoped entirely under .sc-worksheet so nothing else in
   the panel inherits it. */
.sc-worksheet-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.sc-worksheet-table th { text-align: left; padding: .5rem .75rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; border-bottom: 1px solid #e5e7eb; }
.sc-worksheet-table td { padding: .45rem .75rem; border-bottom: 1px solid #f3f4f6; color: #1f2937; vertical-align: middle; }
.sc-worksheet-table .sc-num { text-align: right; }
.sc-worksheet-table th.sc-num { text-align: right; }
.sc-worksheet .sc-sub { display: block; font-size: .75rem; color: #6b7280; }
.sc-worksheet-input { width: 7.5rem; max-width: 100%; padding: .4rem .55rem; border: 1px solid #d1d5db; border-radius: .5rem; background: #fff; color: #111827; text-align: right; font-size: .875rem; }
.sc-worksheet-input:focus { outline: 2px solid #f59e0b; outline-offset: 0; border-color: #f59e0b; }
.sc-worksheet .sc-error { display: block; margin-top: .25rem; font-size: .75rem; color: #b91c1c; }
.sc-worksheet-foot { display: flex; align-items: center; gap: 1rem; padding-top: .85rem; flex-wrap: wrap; }
.sc-worksheet-save { padding: .5rem 1.1rem; border-radius: .5rem; background: #f59e0b; color: #fff; font-weight: 600; font-size: .875rem; border: none; cursor: pointer; }
.sc-worksheet-save:hover { background: #d97706; }
.sc-worksheet-save[disabled] { opacity: .55; cursor: wait; }
.sc-worksheet-note { font-size: .8rem; color: #6b7280; }

/* ---- Relation-manager & schema tabs — .fi-tabs / .fi-sc-tabs ----
   More prominent tabs (Contacts, Dunning History, …):
   compact flaps, bolder labels, an unmistakable active
   state. P-4 (D2, §49): strips WRAP instead of scrolling —
   Filament ships .fi-tabs with overflow-x: auto; the wrap
   rules are not media-gated, so they hold at desktop,
   tablet and mobile widths alike. The bare .fi-tabs rule
   reaches every strip outside the schema tabs component:
   list-page tabs and cluster sub-navigation strips. */
.fi-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
}
.fi-sc-tabs .fi-tabs {
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border-radius: 0.75rem;
    flex-wrap: wrap;
    overflow-x: visible;
}
.dark .fi-sc-tabs .fi-tabs {
    background: #1f2937;
}
.fi-sc-tabs .fi-tabs-item {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.5rem;
    color: #4b5563;
    border: 1px solid transparent;
}
.dark .fi-sc-tabs .fi-tabs-item {
    color: #9ca3af;
}
.fi-sc-tabs .fi-tabs-item:hover {
    color: #111827;
    background: #e5e7eb;
}
.dark .fi-sc-tabs .fi-tabs-item:hover {
    color: #f3f4f6;
    background: #374151;
}
.fi-sc-tabs .fi-tabs-item.fi-active {
    color: var(--primary-800);
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.dark .fi-sc-tabs .fi-tabs-item.fi-active {
    color: var(--primary-400);
    background: #374151;
    border-color: #4b5563;
}

/* ---- Notifications bell (P-5.3, §51) ----
   One behaviour on every page. Filament's icon-button
   emits wire:loading.class="fi-disabled" with NO wire
   target, so while ANY Livewire request is in flight the
   bell fades to 70% and takes pointer-events: none — on
   heavy list/record pages (tables, relation managers,
   Cube-backed header widgets) that left the bell looking
   disabled and unclickable most of the time, while the
   light dashboard settled instantly. The bell is exempted
   from the global loading fade: it renders identically,
   and stays clickable, on every page. */
.fi-icon-btn.fi-topbar-database-notifications-btn.fi-disabled:not(.fi-force-enabled):not([x-tooltip]) {
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

/* ---- Auth & brand surfaces (P-5.9, §51) — .fi-simple-* ----
   The login page carries the product treatment: a soft
   amber glow behind the card, tinted from the panel's
   primary palette variable so it follows the palette,
   and the blossom mark above the form (the panel's
   brandLogo). The card itself keeps Filament's surface. */
.fi-simple-layout {
    background:
        radial-gradient(60rem 30rem at 50% -10%, color-mix(in oklab, var(--primary-500) 14%, transparent), transparent 70%),
        radial-gradient(40rem 24rem at 85% 110%, color-mix(in oklab, var(--primary-600) 10%, transparent), transparent 70%);
}
.dark .fi-simple-layout {
    background:
        radial-gradient(60rem 30rem at 50% -10%, color-mix(in oklab, var(--primary-500) 18%, transparent), transparent 70%),
        radial-gradient(40rem 24rem at 85% 110%, color-mix(in oklab, var(--primary-600) 12%, transparent), transparent 70%);
}

/* ---- Widget loading skeletons (P-5.7, §51) — .skl-* ----
   Dashboard and cockpit widgets are lazy Livewire
   components; Filament's stock placeholder is an empty
   8rem section, so first paint flashed blank cards and
   empty chart frames. Widgets with the
   HasSkeletonPlaceholder trait render the .skl- shape of
   their content instead: same card surface, quiet bars
   standing in for the heading, stats and chart body. */
.skl {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.dark .skl {
    border-color: #374151;
    background: #1f2937;
}
.skl-bar {
    height: 0.75rem;
    border-radius: 9999px;
    background: #e5e7eb;
    animation: skl-pulse 1.4s ease-in-out infinite;
}
.dark .skl-bar {
    background: #374151;
}
.skl-bar-title { width: 38%; height: 0.875rem; }
.skl-bar-short { width: 55%; }
.skl-chart-body { height: 11rem; border-radius: 0.5rem; }
.skl-row { display: flex; gap: 1rem; }
.skl-stat { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.skl-stat .skl-bar-value { height: 1.375rem; width: 70%; }
@keyframes skl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
    .skl-bar { animation: none; }
}

/* ---- Report tables — .rpt-* ----
   The shared generated-report renderer (App\Filament\Tables\
   ReportTable): statements, aging reports, VAT return,
   analysis pivots. Relocated from ReportTable::styles(),
   which used to emit this block inline with every table. */
.rpt-card{border:1px solid #e5e7eb;border-radius:.75rem;background:#fff;box-shadow:0 1px 2px rgb(0 0 0/.05);overflow:hidden}
.rpt-card-head{padding:16px 24px;border-bottom:1px solid #e5e7eb}
.rpt-card-title{margin:0;font-size:1rem;font-weight:600;color:#111827}
.rpt-card-desc{margin:4px 0 0;font-size:.875rem;color:#6b7280}
.rpt-scroll{overflow-x:auto}
.rpt-table{width:100%;border-collapse:collapse;font-size:.875rem;line-height:1.4;table-layout:fixed}
.rpt-table th{padding:10px 24px;text-align:left;font-size:.72rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:#6b7280;border-bottom:1px solid #e5e7eb;white-space:nowrap}
.rpt-table th.rpt-right{text-align:right}
.rpt-table th.rpt-center{text-align:center}
.rpt-table td{padding:13px 24px;border-bottom:1px solid #f3f4f6;color:#374151;vertical-align:top;overflow-wrap:break-word}
.rpt-table tbody tr:last-child td{border-bottom:0}
.rpt-table td.rpt-right{text-align:right}
.rpt-table td.rpt-center{text-align:center}
.rpt-table .rpt-num{font-variant-numeric:tabular-nums;white-space:nowrap}
.rpt-table .rpt-nowrap{white-space:nowrap}
.rpt-table .rpt-bold{font-weight:600;color:#111827}
.rpt-table tr.rpt-totals td{border-top:2px solid #e5e7eb;border-bottom:0;font-weight:600;color:#111827;background:#f9fafb}
.rpt-empty{padding:32px 24px;text-align:center;color:#9ca3af}
.dark .rpt-card{border-color:rgb(255 255 255/.1);background:#111827}
.dark .rpt-card-head{border-bottom-color:rgb(255 255 255/.1)}
.dark .rpt-card-title{color:#fff}
.dark .rpt-card-desc{color:#9ca3af}
.dark .rpt-table th{color:#9ca3af;border-bottom-color:rgb(255 255 255/.1)}
.dark .rpt-table td{color:#d1d5db;border-bottom-color:rgb(255 255 255/.05)}
.dark .rpt-table .rpt-bold{color:#fff}
.dark .rpt-table tr.rpt-totals td{border-top-color:rgb(255 255 255/.1);color:#fff;background:rgb(255 255 255/.02)}
.dark .rpt-empty{color:#6b7280}
/* ---- Report accordion — .rpt-acc-* (§116) ----
   The financial reports' fold behaviour: section heads
   carry their subtotal and a chevron toggle; content rows
   are x-show-gated by ReportTable's Alpine state. */
.rpt-acc-controls{display:flex;gap:8px;padding:12px 24px 0}
.rpt-acc-all{font-size:.8rem;font-weight:600;color:#4b5563;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;padding:5px 12px;cursor:pointer}
.rpt-acc-all:hover{background:#e5e7eb;color:#111827}
.rpt-acc-toggle{display:inline-flex;align-items:center;justify-content:center;width:1.35rem;height:1.35rem;margin-right:6px;border:1px solid #d1d5db;border-radius:.375rem;background:#f9fafb;color:#4b5563;cursor:pointer;vertical-align:-.3rem}
.rpt-acc-toggle:hover{background:#e5e7eb;color:#111827}
.rpt-acc-chev{display:inline-block;font-size:.7rem;line-height:1;transition:transform .15s ease}
.rpt-acc-toggle[aria-expanded="true"] .rpt-acc-chev{transform:rotate(90deg)}
.rpt-hidden-note{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 24px;font-size:.85rem;color:#6b7280;border-top:1px solid #f3f4f6}
.rpt-hidden-note button{font-weight:600;color:#b45309;background:none;border:0;padding:0;cursor:pointer;text-decoration:underline}
.dark .rpt-acc-all{color:#d1d5db;background:rgb(255 255 255/.05);border-color:rgb(255 255 255/.12)}
.dark .rpt-acc-all:hover{background:rgb(255 255 255/.12);color:#fff}
.dark .rpt-acc-toggle{border-color:rgb(255 255 255/.15);background:rgb(255 255 255/.05);color:#d1d5db}
.dark .rpt-hidden-note{color:#9ca3af;border-top-color:rgb(255 255 255/.05)}

/* ---- Statement tabs — .stmt-* ----
   The customer/supplier statement tabs on the 360° views. */
.stmt-wrap { font-size: 0.875rem; }
.stmt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.stmt-note { color: #6b7280; margin: 0; }
.dark .stmt-note { color: #9ca3af; }
.stmt-link { font-size: 0.875rem; font-weight: 600; color: var(--primary-700); text-decoration: none; }
.stmt-link:hover { color: var(--primary-800); }
.dark .stmt-link { color: var(--primary-400); }
.stmt-table-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 0.5rem; }
.dark .stmt-table-wrap { border-color: #374151; }
.stmt-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.stmt-table th { text-align: left; padding: 0.5rem 1rem; font-weight: 600; background: #f9fafb; white-space: nowrap; }
.dark .stmt-table th { background: #1f2937; }
.stmt-table td { padding: 0.5rem 1rem; border-top: 1px solid #e5e7eb; vertical-align: top; }
.dark .stmt-table td { border-top-color: #374151; }
.stmt-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stmt-table .nowrap { white-space: nowrap; }
.stmt-balance-row td { font-weight: 700; background: rgba(249, 250, 251, 0.6); }
.dark .stmt-balance-row td { background: rgba(31, 41, 55, 0.6); }
.stmt-empty { text-align: center; color: #6b7280; padding: 1.5rem 1rem !important; }
.dark .stmt-empty { color: #9ca3af; }

/* ---- 360° Details cards — .dtl-* ----
   The Details tabs on the customer/supplier/product 360°
   views. P-5.4: long values (emails, URLs) wrap
   gracefully — a row whose value cannot sit beside its
   label wraps the value onto its own full-width line
   instead of squeezing it into a mid-domain break, and
   the value itself breaks only when a single token is
   longer than the card (overflow-wrap: anywhere, which
   prefers soft break points; the old word-break:
   break-word chopped tokens at the flex squeeze point).
   P-5.5: .dtl-subhead groups inside one card (the
   Customer 360's Ship-to / Bill-to groups in its single
   Addresses card, matching the Supplier's one-card
   address treatment). */
.dtl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.dtl-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; background: #ffffff; }
.dark .dtl-card { border-color: #374151; background: #1f2937; }
.dtl-card h4 { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.05em; }
.dark .dtl-card h4 { color: #d1d5db; }
.dtl-subhead { font-size: 0.75rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin: 0.75rem 0 0.25rem; }
.dtl-subhead:first-of-type { margin-top: 0; }
.dark .dtl-subhead { color: #9ca3af; }
.dtl-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.375rem 0; border-top: 1px solid #f3f4f6; font-size: 0.875rem; flex-wrap: wrap; }
.dark .dtl-row { border-top-color: #374151; }
.dtl-row:first-of-type { border-top: none; }
.dtl-label { color: #6b7280; flex-shrink: 0; }
.dark .dtl-label { color: #9ca3af; }
.dtl-value { text-align: right; color: #111827; overflow-wrap: anywhere; min-width: 0; }
.dark .dtl-value { color: #f3f4f6; }

/* ---- Activity timeline (360° views) — .act-* ---- */
.act-wrap { display: flex; flex-direction: column; gap: 1.25rem; }
.act-composer { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; background: #ffffff; }
.dark .act-composer { border-color: #374151; background: #1f2937; }
.act-editing-banner { font-size: 0.8125rem; font-weight: 600; color: #b45309; margin-bottom: 0.5rem; display: flex; justify-content: space-between; }
.act-textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; background: transparent; color: inherit; }
.dark .act-textarea { border-color: #4b5563; }
.act-composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.act-field { font-size: 0.8125rem; color: #6b7280; display: inline-flex; align-items: center; gap: 0.375rem; }
.dark .act-field { color: #9ca3af; }
.act-date { border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.25rem 0.5rem; font-size: 0.8125rem; background: transparent; color: inherit; }
.dark .act-date { border-color: #4b5563; }
.act-check { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; cursor: pointer; }
.act-mentions summary { font-size: 0.8125rem; color: #6b7280; cursor: pointer; }
.act-mentions-list { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; max-height: 10rem; overflow-y: auto; }
.act-btn { margin-left: auto; background: var(--primary-500); color: #111827; font-weight: 600; font-size: 0.8125rem; padding: 0.5rem 1rem; border-radius: 0.375rem; border: none; cursor: pointer; }
.act-btn:hover { background: var(--primary-600); }
.act-empty { color: #6b7280; font-size: 0.875rem; }
.act-timeline { display: flex; flex-direction: column; }
.act-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid #f3f4f6; }
.dark .act-item { border-top-color: #374151; }
.act-item:first-child { border-top: none; }
.act-dot { flex-shrink: 0; width: 0.625rem; height: 0.625rem; border-radius: 9999px; margin-top: 0.375rem; background: #9ca3af; }
.act-dot-note { background: #f59e0b; }
.act-dot-order { background: #3b82f6; }
.act-dot-invoice { background: #8b5cf6; }
.act-dot-receipt, .act-dot-payment { background: #10b981; }
.act-dot-movement { background: #14b8a6; }
.act-dot-dunning { background: #ef4444; }
.act-dot-audit { background: #9ca3af; }
.act-dot-waybill, .act-dot-goods_receipt { background: #0ea5e9; }
.act-dot-deposit, .act-dot-prepayment { background: #059669; }
.act-dot-credit { background: #ef4444; }
.act-item-body { flex: 1; min-width: 0; }
.act-item-head { display: flex; justify-content: space-between; gap: 1rem; }
.act-item-title { font-size: 0.875rem; font-weight: 600; color: #111827; }
.dark .act-item-title { color: #f3f4f6; }
.act-item-title a { color: inherit; text-decoration: underline; }
.act-item-date { font-size: 0.75rem; color: #6b7280; flex-shrink: 0; }
.act-item-detail { font-size: 0.8125rem; color: #6b7280; margin-top: 0.125rem; }
.dark .act-item-detail { color: #9ca3af; }
.act-note-body { font-size: 0.875rem; color: #374151; margin-top: 0.25rem; white-space: pre-wrap; word-break: break-word; }
.dark .act-note-body { color: #d1d5db; }
.act-note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-top: 0.5rem; }
.act-badge { font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; background: #f3f4f6; color: #4b5563; }
.dark .act-badge { background: #374151; color: #d1d5db; }
.act-badge-pin { background: #fef3c7; color: #92400e; }
.act-badge-follow { background: #dbeafe; color: #1e40af; }
.act-badge-overdue { background: #fee2e2; color: #991b1b; }
.act-badge-mention { background: #ede9fe; color: #5b21b6; }
.act-link-btn { font-size: 0.75rem; color: #2563eb; background: none; border: none; cursor: pointer; padding: 0; }
.act-link-btn:hover { text-decoration: underline; }
.act-danger { color: #dc2626; }
.act-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.act-search { flex: 1; min-width: 12rem; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; background: transparent; color: inherit; }
.dark .act-search { border-color: #4b5563; }
.act-kind-chips { display: inline-flex; gap: 0.25rem; }
.act-kind-chip { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 9999px; border: 1px solid #d1d5db; background: transparent; color: #4b5563; cursor: pointer; }
.dark .act-kind-chip { border-color: #4b5563; color: #d1d5db; }
.act-kind-chip-active { background: var(--primary-500); border-color: var(--primary-500); color: #111827; }
.act-audit-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-size: 0.8125rem; color: #6b7280; padding-top: 0.125rem; }
.dark .act-audit-line { color: #9ca3af; }
.act-audit-date { font-size: 0.75rem; flex-shrink: 0; }
.act-audit-link { color: inherit; text-decoration: none; }
.act-audit-link:hover { text-decoration: underline; }
.act-note-head { font-size: 0.75rem; font-weight: 600; color: #6b7280; }
.dark .act-note-head { color: #9ca3af; }
.act-quote { font-size: 0.75rem; color: #6b7280; background: #f9fafb; border-left: 3px solid #d1d5db; padding: 0.375rem 0.625rem; margin-top: 0.375rem; border-radius: 0 0.25rem 0.25rem 0; }
.dark .act-quote { background: #111827; border-left-color: #4b5563; color: #9ca3af; }
.act-replies { margin-top: 0.75rem; margin-left: 1rem; padding-left: 1rem; border-left: 2px solid #e5e7eb; display: flex; flex-direction: column; gap: 0.75rem; }
.dark .act-replies { border-left-color: #374151; }
.act-mention-wrap { position: relative; }
.act-mention-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 0.25rem; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 0.375rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); list-style: none; padding: 0.25rem; }
.dark .act-mention-menu { background: #1f2937; border-color: #374151; }
.act-mention-menu button { display: block; width: 100%; text-align: left; font-size: 0.875rem; padding: 0.375rem 0.5rem; border-radius: 0.25rem; background: none; border: none; cursor: pointer; color: inherit; }
.act-mention-menu button:hover { background: #f3f4f6; }
.dark .act-mention-menu button:hover { background: #374151; }
.act-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.act-chip-x { background: none; border: none; cursor: pointer; font-size: 0.75rem; line-height: 1; padding: 0; color: inherit; }

/* ---- Documents UI (Attachments tab + library) — .doc-* ---- */
.doc-wrap { display: flex; flex-direction: column; gap: 1rem; }
.doc-lib { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.doc-side { width: 16rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }
.doc-main { flex: 1; min-width: 20rem; display: flex; flex-direction: column; gap: 1rem; }
.doc-tree { display: flex; flex-direction: column; gap: 0.125rem; }
.doc-tree-row { display: flex; align-items: center; gap: 0.375rem; }
.doc-tree-item { font-size: 0.875rem; font-weight: 600; color: #4b5563; background: none; border: none; cursor: pointer; padding: 0.375rem 0.5rem; border-radius: 0.375rem; text-align: left; }
.dark .doc-tree-item { color: #d1d5db; }
.doc-tree-item:hover { background: #f3f4f6; }
.dark .doc-tree-item:hover { background: #374151; }
.doc-tree-active { background: var(--primary-100); color: var(--primary-800); }
.dark .doc-tree-active { background: #374151; color: var(--primary-400); }
.doc-newfolder { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; background: #ffffff; }
.dark .doc-newfolder { border-color: #374151; background: #1f2937; }
.doc-newfolder h4 { margin: 0; font-size: 0.8125rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.05em; }
.dark .doc-newfolder h4 { color: #d1d5db; }
.doc-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.doc-search { flex: 1; min-width: 12rem; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; background: transparent; color: inherit; }
.dark .doc-search { border-color: #4b5563; }
.doc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; background: #ffffff; }
.dark .doc-upload { border-color: #374151; background: #1f2937; }
.doc-file { font-size: 0.875rem; }
.doc-file-hidden { display: none; }
label.doc-btn { display: inline-block; }
.doc-field { font-size: 0.8125rem; color: #6b7280; display: inline-flex; align-items: center; gap: 0.375rem; }
.dark .doc-field { color: #9ca3af; }
.doc-select, .doc-input { border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.375rem 0.5rem; font-size: 0.8125rem; background: transparent; color: inherit; }
.dark .doc-select, .dark .doc-input { border-color: #4b5563; }
.doc-btn { background: var(--primary-500); color: #111827; font-weight: 600; font-size: 0.8125rem; padding: 0.5rem 1rem; border-radius: 0.375rem; border: none; cursor: pointer; }
.doc-btn:hover { background: var(--primary-600); }
.doc-note { font-size: 0.75rem; color: #6b7280; margin: 0; }
.dark .doc-note { color: #9ca3af; }
.doc-empty { color: #6b7280; font-size: 0.875rem; }
.doc-table-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 0.5rem; }
.dark .doc-table-wrap { border-color: #374151; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.doc-table th { text-align: left; padding: 0.5rem 1rem; font-weight: 600; background: #f9fafb; white-space: nowrap; }
.dark .doc-table th { background: #1f2937; }
.doc-table td { padding: 0.5rem 1rem; border-top: 1px solid #e5e7eb; vertical-align: top; }
.dark .doc-table td { border-top-color: #374151; }
.doc-table .nowrap { white-space: nowrap; }
.doc-link { font-weight: 600; color: var(--primary-700); text-decoration: none; }
.doc-link:hover { color: var(--primary-800); text-decoration: underline; }
.dark .doc-link { color: var(--primary-400); }
.doc-badge { font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; background: #ede9fe; color: #5b21b6; margin-right: 0.25rem; }
.doc-flag { font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; background: #fef3c7; color: #92400e; margin-right: 0.25rem; white-space: nowrap; }
.dark .doc-flag { background: #78350f; color: #fde68a; }
.dark .doc-badge { background: #374151; color: #d1d5db; }
.doc-link-btn { font-size: 0.75rem; color: #2563eb; background: none; border: none; cursor: pointer; padding: 0; white-space: nowrap; }
.doc-link-btn:hover { text-decoration: underline; }
.doc-danger { color: #dc2626; }
.doc-inline-form { display: inline-flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.doc-panel { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; background: #ffffff; }
.dark .doc-panel { border-color: #374151; background: #1f2937; }
.doc-panel h4 { margin: 0; font-size: 0.8125rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.05em; }
.dark .doc-panel h4 { color: #d1d5db; }
.doc-retention-label { font-size: 0.8125rem; min-width: 12rem; }
.doc-retention-input { width: 6rem; }
/* §236: the folded tree, breadcrumb, pane folder rows, row menus, settings page */
.doc-chevron { font-size: 0.75rem; color: #6b7280; background: none; border: none; cursor: pointer; padding: 0.25rem; width: 1.25rem; flex-shrink: 0; }
.doc-chevron-spacer { width: 1.25rem; flex-shrink: 0; }
.doc-row-menu { position: relative; }
.doc-row-menu summary { list-style: none; cursor: pointer; font-size: 0.875rem; color: #6b7280; padding: 0.125rem 0.375rem; border-radius: 0.375rem; }
.doc-row-menu summary::-webkit-details-marker { display: none; }
.doc-row-menu summary:hover { background: #f3f4f6; }
.dark .doc-row-menu summary:hover { background: #374151; }
.doc-row-menu-items { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 0.375rem 0.25rem; }
.doc-crumb { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; font-size: 0.875rem; margin: 0; }
.doc-crumb-sep { color: #9ca3af; }
.doc-crumb-current { font-weight: 600; }
.doc-folder-rows { display: flex; flex-direction: column; gap: 0.375rem; }
.doc-folder-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; font-size: 0.875rem; font-weight: 600; color: inherit; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.625rem 0.75rem; background: #ffffff; cursor: pointer; }
.dark .doc-folder-row { border-color: #374151; background: #1f2937; }
.doc-folder-row:hover { background: #f9fafb; }
.dark .doc-folder-row:hover { background: #111827; }
.doc-settings { display: flex; flex-direction: column; gap: 1rem; max-width: 56rem; }
/* §237: name-click viewer, listing thumbnails and type tiles */
.doc-name-btn { background: none; border: none; cursor: pointer; padding: 0; font: inherit; text-align: left; }
.doc-thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: 0.375rem; border: 1px solid #e5e7eb; vertical-align: middle; margin-right: 0.5rem; background: #f9fafb; }
.dark .doc-thumb { border-color: #374151; background: #1f2937; }
.doc-thumb-tile { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 0.375rem; border: 1px solid #e5e7eb; background: #f3f4f6; color: #6b7280; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.05em; vertical-align: middle; margin-right: 0.5rem; }
.dark .doc-thumb-tile { border-color: #374151; background: #374151; color: #d1d5db; }
.doc-thumb-tile-large { width: 6rem; height: 6rem; font-size: 1rem; margin-right: 0; }
.doc-viewer-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.doc-viewer { background: #ffffff; border-radius: 0.75rem; width: 100%; max-width: 72rem; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.dark .doc-viewer { background: #1f2937; }
.doc-viewer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; }
.dark .doc-viewer-head { border-bottom-color: #374151; }
.doc-viewer-title { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.doc-viewer-body { padding: 1rem; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.doc-viewer-frame { width: 100%; height: 70vh; border: 1px solid #e5e7eb; border-radius: 0.5rem; background: #ffffff; }
.doc-viewer-image { max-width: 100%; max-height: 70vh; object-fit: contain; }
.doc-viewer-media { width: 100%; max-height: 70vh; background: #000000; border-radius: 0.5rem; }
.doc-viewer-audio { width: 100%; }
.doc-viewer-text { width: 100%; white-space: pre-wrap; word-break: break-word; font-size: 0.8125rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; margin: 0; }
.dark .doc-viewer-text { background: #111827; border-color: #374151; }
.doc-viewer-tile { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2rem 0; }

/* ---- Document detail drawer (§238) — .doc-drawer* ---- */
.doc-detail-btn { font-size: 0.75rem; font-weight: 600; color: #2563eb; background: none; border: none; cursor: pointer; padding: 0 0.25rem; }
.dark .doc-detail-btn { color: #93c5fd; }
.doc-drawer-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.6); z-index: 55; display: flex; justify-content: flex-end; }
.doc-drawer { background: #ffffff; width: 100%; max-width: 34rem; height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: -0.5rem 0 1.5rem rgba(17, 24, 39, 0.25); }
.dark .doc-drawer { background: #1f2937; }
.doc-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; }
.dark .doc-drawer-head { border-bottom-color: #374151; }
.doc-drawer-body { padding: 1rem; overflow: auto; display: flex; flex-direction: column; gap: 1rem; }
.doc-meta { display: flex; flex-direction: column; gap: 0.375rem; margin: 0; font-size: 0.8125rem; }
.doc-meta > div { display: flex; gap: 0.75rem; }
.doc-meta dt { flex: 0 0 6.5rem; font-weight: 600; color: #6b7280; }
.dark .doc-meta dt { color: #9ca3af; }
.doc-meta dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---- Filing suggestion chips (§239) — .doc-chip ---- */
.doc-chip { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600; padding: 0.375rem 0.625rem; border-radius: 9999px; border: 1px solid #6ee7b7; background: #ecfdf5; color: #065f46; cursor: pointer; margin-bottom: 0.375rem; text-align: left; }
.doc-chip:hover { background: #d1fae5; }
.dark .doc-chip { border-color: #065f46; background: #064e3b; color: #a7f3d0; }
.dark .doc-chip:hover { background: #065f46; }
.doc-chip-blocked { border-color: #fcd34d; background: #fffbeb; color: #92400e; cursor: not-allowed; }
.doc-chip-blocked:hover { background: #fffbeb; }
.dark .doc-chip-blocked { border-color: #92400e; background: #451a03; color: #fde68a; }
.dark .doc-chip-blocked:hover { background: #451a03; }

/* ---- SaaS banners & platform console — .saas-* ---- */
.saas-banner { padding: 0.625rem 1rem; font-size: 0.875rem; text-align: center; }
.saas-banner-impersonation { background: #fef3c7; color: #92400e; border-bottom: 1px solid #f59e0b; }
.dark .saas-banner-impersonation { background: #78350f; color: #fde68a; }
.saas-banner-model { background: #ede9fe; color: #5b21b6; border-bottom: 1px solid #8b5cf6; }
.dark .saas-banner-model { background: #4c1d95; color: #ddd6fe; }
.saas-banner-suspended { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #ef4444; }
.dark .saas-banner-suspended { background: #7f1d1d; color: #fecaca; }
.saas-banner-trial { background: #dbeafe; color: #1e40af; border-bottom: 1px solid #3b82f6; }
.dark .saas-banner-trial { background: #172554; color: #bfdbfe; }
.saas-banner-pastdue { background: #fef3c7; color: #92400e; border-bottom: 1px solid #f59e0b; }
.dark .saas-banner-pastdue { background: #78350f; color: #fde68a; }
.saas-banner-btn { font-weight: 600; text-decoration: underline; background: none; border: none; cursor: pointer; color: inherit; font-size: inherit; }
.saas-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.saas-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; background: #ffffff; }
.dark .saas-card { border-color: #374151; background: #1f2937; }
.saas-stat { font-size: 1.5rem; font-weight: 700; }
.saas-stat-label { font-size: 0.75rem; color: #6b7280; }
.dark .saas-stat-label { color: #9ca3af; }
.saas-heading { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
.saas-warn { color: #b45309; font-weight: 600; }
.dark .saas-warn { color: #fbbf24; }
.saas-over { color: #dc2626; font-weight: 700; }
.saas-overrides { margin-top: 0.5rem; }
.saas-overrides summary { font-size: 0.75rem; color: #2563eb; cursor: pointer; }
.saas-override-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 0.75rem; padding: 0.5rem 0; font-size: 0.8125rem; }
.saas-bar { height: 0.5rem; border-radius: 9999px; background: #f3f4f6; overflow: hidden; margin-top: 0.5rem; }
.dark .saas-bar { background: #374151; }
.saas-bar-fill { height: 100%; border-radius: 9999px; background: #10b981; }
.saas-bar-fill.saas-warn { background: #f59e0b; }
.saas-bar-fill.saas-over { background: #ef4444; }
.saas-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.75rem; }
.saas-plan-card { display: flex; flex-direction: column; gap: 0.5rem; }
.saas-plan-current { border-color: var(--primary-500); box-shadow: 0 0 0 1px var(--primary-500); }
.saas-price { font-size: 1.375rem; font-weight: 700; }
.saas-offer-lines { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; }
.saas-offer-lines li { padding: 0.125rem 0; }
.saas-confirm { border: 1px solid #fcd34d; background: #fffbeb; border-radius: 0.5rem; padding: 0.75rem; font-size: 0.8125rem; }
.dark .saas-confirm { border-color: #92400e; background: #451a03; }
.saas-confirm p { margin: 0 0 0.5rem; }

/* ---- BI dashboard widget grid — .bi-widget-* ---- */
.bi-widget-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; width: 100%; }
@media (min-width: 768px) {
    .bi-widget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bi-widget-span-1 { grid-column: span 1 / span 1; }
    .bi-widget-span-2 { grid-column: span 2 / span 2; }
    .bi-widget-span-3 { grid-column: span 3 / span 3; }
}
/* Contain Filament widgets inside grid items: prevent blowout and overlap. */
.bi-widget-grid > div { min-width: 0; min-height: 0; }
.bi-widget-grid > div > [wire\:id] { display: block; min-width: 0; }
/* Tables scroll horizontally inside their card instead of overflowing it. */
.bi-widget-grid .fi-ta-content, .bi-widget-grid table { max-width: 100%; }
.bi-widget-grid > div { overflow: hidden; }
.bi-widget-empty { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; padding: 3rem 1.5rem; text-align: center; }
.dark .bi-widget-empty { border-color: rgba(255, 255, 255, 0.1); background: #111827; }
.bi-widget-empty p { margin: 0; font-size: 0.875rem; color: #6b7280; }
.dark .bi-widget-empty p { color: #9ca3af; }

/* ---- BI dashboard AI insights + Ask AI — .bi-insights / .bi-ask ---- */
.bi-insights { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; padding: 1.5rem; }
.dark .bi-insights { border-color: rgba(255, 255, 255, 0.1); background: #111827; }
.bi-insights-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; color: #030712; }
.dark .bi-insights-title { color: #fff; }
.bi-insights-subtitle { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 500; color: #030712; }
.dark .bi-insights-subtitle { color: #fff; }
.bi-insights-narrative { font-size: 0.875rem; line-height: 1.5; color: #374151; }
.dark .bi-insights-narrative { color: #d1d5db; }
.bi-insights-alerts { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bi-insights-alert { border-radius: 0.5rem; border: 1px solid #fde68a; background: #fffbeb; padding: 0.75rem; font-size: 0.875rem; color: #92400e; }
.dark .bi-insights-alert { border-color: #92400e; background: #451a03; color: #fde68a; }
.bi-insights-empty { margin: 0; font-size: 0.875rem; color: #6b7280; }
.dark .bi-insights-empty { color: #9ca3af; }
.bi-ask { margin-top: 1.5rem; border-top: 1px solid #f3f4f6; padding-top: 1rem; }
.dark .bi-ask { border-top-color: rgba(255, 255, 255, 0.1); }
.bi-ask-form { display: flex; gap: 0.5rem; }
/* min-width: 0 lets the input shrink inside the flex row —
   without it the field keeps its intrinsic width and the
   Ask button clips the placeholder text. */
.bi-ask-input { flex: 1 1 auto; min-width: 0; border-radius: 0.5rem; border: 1px solid #d1d5db; background: #fff; padding: 0.5rem 0.75rem; font-size: 0.875rem; color: #111827; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.dark .bi-ask-input { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.05); color: #fff; }
.bi-ask-input:focus { border-color: var(--primary-500); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500) 25%, transparent); }
.bi-ask-button { flex: 0 0 auto; border: none; border-radius: 0.5rem; background: var(--primary-600); padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; color: #fff; cursor: pointer; }
.bi-ask-button:hover { background: var(--primary-500); }
.bi-ask-answer { margin-top: 1rem; border-radius: 0.5rem; border: 1px solid rgba(3, 7, 18, 0.05); background: #f9fafb; padding: 1rem; font-size: 0.875rem; line-height: 1.5; color: #374151; }
.dark .bi-ask-answer { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.05); color: #d1d5db; }
/* §170: the answer element always exists (it is the stream target); while it holds nothing it takes no space. */
.bi-ask-answer:empty { display: none; }
/* §169: Explore drill-path breadcrumb — the walked path above a drilled result. (Carried in the published file since §169; composed here since the Group 3 gate fix so the composition stays the single source.) */
.xp-crumbs{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center}
.xp-crumb{border:1px solid #d1d5db;border-radius:9999px;padding:.25rem .7rem;font-size:.78rem;color:#374151;background:#f9fafb}
button.xp-crumb{cursor:pointer}
button.xp-crumb:hover{background:#eef2ff}
.xp-crumb-current{background:#111827;color:#f9fafb;border-color:#111827;font-weight:600}
.dark .xp-crumb{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.dark .xp-crumb-current{background:#f9fafb;color:#111827;border-color:#f9fafb}
.xp-crumb-sep{color:#9ca3af}
/* §174: the CRM pipeline board (R-3) — one accent-topped column per stage, a card per opportunity; the accent is per-column data (won green, lost red, open stages from the page's palette). */
.crm-board-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.crm-board-select{border:1px solid #d1d5db;border-radius:.5rem;background:#fff;padding:.4rem .6rem;font-size:.85rem;color:#111827}
.dark .crm-board-select{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.crm-board-chip{border:1px solid #d1d5db;border-radius:9999px;padding:.25rem .7rem;font-size:.78rem;color:#374151;background:#f9fafb}
.dark .crm-board-chip{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.crm-board-btn{border:none;border-radius:.5rem;background:var(--primary-600);padding:.4rem .8rem;font-size:.8rem;font-weight:600;color:#fff;cursor:pointer}
.crm-board-btn:hover{background:var(--primary-500)}
.crm-board{display:flex;gap:1rem;align-items:flex-start;overflow-x:auto;padding-bottom:.5rem}
.crm-board-col{flex:0 0 17rem;border:1px solid #e5e7eb;border-top:4px solid var(--crm-accent);border-radius:.75rem;background:#f9fafb;padding:.75rem;display:flex;flex-direction:column;gap:.6rem}
.dark .crm-board-col{border-color:rgb(255 255 255/.12);background:#111827}
.crm-board-col-head{border-bottom:1px solid #e5e7eb;padding-bottom:.5rem}
.dark .crm-board-col-head{border-color:rgb(255 255 255/.12)}
.crm-board-col-title{display:flex;justify-content:space-between;align-items:baseline;font-weight:700;color:#111827}
.dark .crm-board-col-title{color:#f9fafb}
.crm-board-col-prob{font-size:.75rem;font-weight:600;color:var(--crm-accent)}
.crm-board-col-count{font-size:.75rem;color:#6b7280}
.crm-board-col-total{font-size:.82rem;font-weight:600;color:#111827;margin-top:.25rem}
.dark .crm-board-col-total{color:#f9fafb}
.crm-board-col-weighted{font-weight:400;font-size:.75rem;color:#6b7280}
.crm-board-col-empty{border:1px dashed #d1d5db;border-radius:.5rem;padding:.9rem .6rem;font-size:.8rem;color:#6b7280;text-align:center}
.dark .crm-board-col-empty{border-color:rgb(255 255 255/.2)}
.crm-board-empty-board{border:1px dashed #d1d5db;border-radius:.75rem;padding:1.5rem;text-align:center;color:#374151;background:#f9fafb}
.dark .crm-board-empty-board{border-color:rgb(255 255 255/.2);background:#111827;color:#d1d5db}
.crm-card{border:1px solid #e5e7eb;border-radius:.6rem;background:#fff;padding:.65rem .7rem;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.dark .crm-card{border-color:rgb(255 255 255/.12);background:#1f2937}
.crm-card-top{display:flex;justify-content:space-between;align-items:center}
.crm-card-code{font-size:.75rem;font-weight:700;color:var(--primary-600);text-decoration:none}
.crm-card-status{font-size:.68rem;font-weight:700;border-radius:9999px;padding:.1rem .5rem;background:#e5e7eb;color:#374151}
.crm-card-status-won{background:#dcfce7;color:#166534}
.crm-card-status-lost{background:#fee2e2;color:#991b1b}
.crm-card-status-converted{background:#e0e7ff;color:#3730a3}
.crm-card-title{font-weight:600;color:#111827;margin-top:.15rem}
.dark .crm-card-title{color:#f9fafb}
.crm-card-party{font-size:.8rem;color:#4b5563}
.dark .crm-card-party{color:#9ca3af}
.crm-card-value{font-weight:700;color:#111827;margin-top:.3rem}
.dark .crm-card-value{color:#f9fafb}
.crm-card-meta{display:flex;justify-content:space-between;font-size:.72rem;color:#6b7280;margin-top:.2rem}
.crm-card-owner{font-size:.72rem;color:#6b7280;margin-top:.15rem}
.crm-card-move{display:flex;gap:.4rem;margin-top:.55rem}
.crm-card-move-select{flex:1 1 auto;min-width:0}
.crm-card-draggable{cursor:grab}
.crm-card-draggable:active{cursor:grabbing}
.crm-board-col-drop-target{outline:2px dashed var(--crm-accent);outline-offset:-6px;background:#eef2ff}
.dark .crm-board-col-drop-target{background:#1e293b}
/* Q-1 (§68): example chips + planning note + the planned answer's provenance line. */
.bi-ask-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.bi-ask-chip { border: 1px solid #d1d5db; border-radius: 9999px; background: #fff; padding: 0.25rem 0.625rem; font-size: 0.75rem; color: #374151; cursor: pointer; }
.bi-ask-chip:hover { border-color: var(--primary-500); color: var(--primary-600); }
.dark .bi-ask-chip { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.05); color: #d1d5db; }
.dark .bi-ask-chip:hover { border-color: var(--primary-400); color: var(--primary-300); }
.bi-ask-note { margin: 0 0 0.75rem; font-size: 0.8125rem; line-height: 1.5; color: #92400e; }
.dark .bi-ask-note { color: #fcd34d; }
.bi-ask-provenance { margin-top: 0.5rem; font-size: 0.75rem; letter-spacing: 0.01em; color: #6b7280; }
.dark .bi-ask-provenance { color: #9ca3af; }
.bi-ask-act-card { margin-top: 1rem; border-radius: 0.5rem; border: 1px solid var(--primary-300); background: #fffbeb; padding: 1rem; font-size: 0.875rem; line-height: 1.5; color: #374151; }
.dark .bi-ask-act-card { border-color: var(--primary-500); background: rgba(255, 255, 255, 0.05); color: #d1d5db; }
.bi-ask-act-title { margin: 0 0 0.25rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: #92400e; }
.dark .bi-ask-act-title { color: #fcd34d; }
.bi-ask-act-summary { margin: 0; }
.bi-ask-act-lines { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.bi-ask-act-actions { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.bi-ask-sources { margin-top: 1rem; border-top: 1px solid #f3f4f6; padding-top: 0.75rem; }
.dark .bi-ask-sources { border-top-color: rgba(255, 255, 255, 0.1); }
.bi-ask-sources-title { margin: 0; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: #6b7280; }
.dark .bi-ask-sources-title { color: #9ca3af; }
.bi-ask-sources ul { margin: 0.25rem 0 0; padding-left: 1.25rem; font-size: 0.875rem; color: #4b5563; }
.dark .bi-ask-sources ul { color: #d1d5db; }
.bi-ask-sources a { color: var(--primary-600); text-decoration: underline; }

/* ---- §187: Ask as a conversation — .ak-* (the makeover the
   manager panel proved in §185, applied to the shared Ask
   widget: a thread with first-line anchoring + the ↓ pill,
   a clarification card with tap-target candidates, the
   Answering bar, ONE chip row with dashed ⚡ command chips,
   sources folded behind a per-answer ⓘ toggle, and the
   page home's slim header / narrative card / alerts strip.
   The dashboard home keeps its compact blocks above.) ---- */
.ak-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.75rem; }
.ak-head-t { font-size: 1rem; font-weight: 700; color: #030712; }
.dark .ak-head-t { color: #fff; }
.ak-head-c { font-size: 0.8125rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .ak-head-c { color: #9ca3af; }
.ak-alerts { margin-bottom: 0.75rem; border: 1px solid #fde68a; background: #fffbeb; border-radius: 0.5rem; padding: 0.45rem 0.75rem; }
.dark .ak-alerts { border-color: #92400e; background: #451a03; }
.ak-alerts-line { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; font-size: 0.8125rem; color: #92400e; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .ak-alerts-line { color: #fde68a; }
.ak-alerts-full { display: none; margin-top: 0.4rem; font-size: 0.8125rem; color: #92400e; }
.dark .ak-alerts-full { color: #fde68a; }
.ak-alerts-full.ak-alerts-open { display: block; }
.ak-narr { margin-bottom: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.55rem 0.75rem; background: #fcfcfd; font-size: 0.84375rem; }
.dark .ak-narr { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); }
.ak-narr-h { display: flex; justify-content: space-between; align-items: center; }
.ak-narr-tgl { background: none; border: 0; padding: 0; font-weight: 600; color: #111827; cursor: pointer; font-size: 0.84375rem; }
.dark .ak-narr-tgl { color: #f9fafb; }
.ak-narr-x { background: none; border: 0; color: #6b7280; cursor: pointer; font-size: 1rem; line-height: 1; }
.ak-narr-body { display: none; margin-top: 0.35rem; color: #374151; line-height: 1.5; }
.dark .ak-narr-body { color: #d1d5db; }
.ak-narr-body.ak-narr-open { display: block; }
.ak-convowrap { position: relative; }
.ak-thread { max-height: 26rem; overflow-y: auto; padding: 0.25rem 0.125rem; scroll-behavior: smooth; }
.ak-msg { max-width: 94%; border-radius: 0.875rem; padding: 0.55rem 0.7rem; margin: 0 0 0.55rem; font-size: 0.875rem; line-height: 1.5; color: #111827; overflow-wrap: anywhere; }
.dark .ak-msg { color: #f9fafb; }
.ak-msg-u { background: #eef4ff; border: 1px solid #dbe7ff; margin-left: auto; }
.dark .ak-msg-u { background: #172554; border-color: rgba(255, 255, 255, 0.12); }
.ak-msg-a { background: #f6f7f9; border: 1px solid #e5e7eb; margin-right: auto; white-space: pre-line; }
.dark .ak-msg-a { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); }
.ak-msg-a.ak-flash { animation: ak-fl 1.6s ease-out; }
@keyframes ak-fl { 0% { background: #fff7d6; } 100% { background: #f6f7f9; } }
.ak-stream:empty { display: none; }
.ak-body { white-space: pre-line; }
.ak-msg .mp-code, .ak-help .mp-code { background: #eef2ff; border-radius: 0.3125rem; padding: 0.05rem 0.3rem; font-size: 0.8125rem; }
.dark .ak-msg .mp-code, .dark .ak-help .mp-code { background: rgba(255, 255, 255, 0.1); }
.ak-src { margin-top: 0.35rem; font-size: 0.6875rem; color: #6b7280; white-space: normal; }
.ak-src a { color: #6b7280; text-decoration: none; cursor: pointer; }
.ak-src a:hover { text-decoration: underline; }
.ak-src-full { display: none; }
.ak-src-full.ak-src-open { display: block; margin-top: 0.25rem; }
.ak-src-list { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.ak-src-list a { color: var(--primary-600); text-decoration: underline; }
.ak-clar { background: #fffdf5; border-color: #fde68a; }
.dark .ak-clar { background: rgba(245, 158, 11, 0.08); border-color: #92400e; }
.ak-clar-q { margin-bottom: 0.5rem; }
.ak-opts { margin-top: 0.25rem; }
.ak-cand { display: block; width: 100%; text-align: left; border: 1px solid #d1d5db; background: #fff; border-radius: 0.5625rem; padding: 0.5rem 0.65rem; margin: 0.35rem 0; font-size: 0.875rem; color: #111827; cursor: pointer; }
.dark .ak-cand { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.18); color: #f9fafb; }
.ak-cand:hover { border-color: var(--primary-500); }
.ak-clar-hint { color: #6b7280; font-size: 0.75rem; margin-top: 0.35rem; }
.ak-help { background: #f5f8ff; border-color: #c7dbff; }
.dark .ak-help { background: rgba(37, 99, 235, 0.1); border-color: rgba(255, 255, 255, 0.16); }
.ak-has-card .bi-ask-act-card { margin-top: 0.6rem; }
.ak-jump { position: absolute; right: 0.625rem; bottom: 0.5rem; background: var(--primary-600); color: #fff; border: 0; border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.78125rem; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgb(20 25 40/.3); opacity: 0; pointer-events: none; transition: opacity .18s; white-space: nowrap; z-index: 4; }
.ak-jump.ak-jump-on { opacity: 1; pointer-events: auto; }
.ak-pending { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; padding: 0.45rem 0.75rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 0.5rem; font-size: 0.8125rem; color: #92400e; }
.dark .ak-pending { background: #451a03; border-color: #92400e; color: #fde68a; }
.ak-pending button { margin-left: auto; flex: none; border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: 0.15rem 0.65rem; font-size: 0.75rem; color: #111827; cursor: pointer; }
.dark .ak-pending button { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #f9fafb; }
.ak-chips { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.5rem 0.125rem 0.125rem; scrollbar-width: none; }
.ak-chips::-webkit-scrollbar { display: none; }
.ak-chip { flex: none; border: 1px solid #d1d5db; background: #fff; border-radius: 9999px; padding: 0.3rem 0.7rem; font-size: 0.78125rem; color: #374151; cursor: pointer; white-space: nowrap; }
.dark .ak-chip { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.05); color: #d1d5db; }
.ak-chip:hover { border-color: var(--primary-500); color: var(--primary-600); }
.ak-chip-cmd { border-style: dashed; background: #f5f8ff; }
.dark .ak-chip-cmd { background: rgba(37, 99, 235, 0.12); }
.ak-fillhint { display: none; padding: 0.4rem 0.125rem 0; font-size: 0.75rem; color: var(--primary-600); }
.ak-fillhint.ak-fillhint-on { display: block; }
.ak-foot { position: relative; margin-top: 0.6rem; }
.ak-atbtn { flex: none; border: 1px solid #d1d5db; background: #fff; border-radius: 999px; width: 2.375rem; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.dark .ak-atbtn { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.15); }
.ak-atbtn:hover { border-color: var(--primary-500); }

/* ---- Setup Progress page — .sp-* ---- */
.sp-wrap { display: flex; flex-direction: column; gap: 1.5rem; }
.sp-card { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; padding: 1.5rem; }
.sp-card-sm { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; padding: 1rem; }
.sp-head { display: flex; align-items: center; justify-content: space-between; }
.sp-title { font-size: 1.125rem; font-weight: 600; color: #030712; margin: 0; }
.sp-sub { font-size: 0.875rem; color: #6b7280; margin: 0.25rem 0 0; }
.sp-pct { font-size: 1.5rem; font-weight: 700; color: #030712; }
.sp-bar { margin-top: 1rem; height: 0.5rem; overflow: hidden; border-radius: 9999px; background: #f3f4f6; }
.sp-bar-fill { height: 100%; border-radius: 9999px; background: var(--primary-500); transition: width 0.3s; }
.sp-next { border-radius: 0.75rem; border: 1px solid var(--primary-300); background: var(--primary-50); padding: 1rem; }
.sp-next p { font-size: 0.875rem; font-weight: 500; color: #030712; margin: 0; }
.sp-next a { display: inline-block; margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--primary-600); }
.sp-done { border-radius: 0.75rem; border: 1px solid #a7f3d0; background: #ecfdf5; padding: 1rem; }
.sp-done p { font-size: 0.875rem; font-weight: 500; color: #030712; margin: 0; }
.sp-list { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; overflow: hidden; }
.sp-list ul { list-style: none; margin: 0; padding: 0; }
.sp-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.sp-list li:last-child { border-bottom: none; }
.sp-row-left { display: flex; align-items: center; gap: 0.75rem; }
.sp-badge { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 9999px; font-size: 0.875rem; flex-shrink: 0; }
.sp-badge.ok { background: #d1fae5; color: #059669; }
.sp-badge.todo { background: #f3f4f6; color: #9ca3af; }
.sp-label { font-size: 0.875rem; font-weight: 500; color: #030712; margin: 0; }
.sp-desc { font-size: 0.75rem; color: #6b7280; margin: 0.125rem 0 0; }
.sp-opt { margin-left: 0.5rem; border-radius: 9999px; background: #f3f4f6; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 400; color: #6b7280; }
.sp-open { flex-shrink: 0; font-size: 0.875rem; font-weight: 500; color: var(--primary-600); text-decoration: none; }
.sp-open:hover { text-decoration: underline; }
.sp-note { font-size: 0.75rem; color: #9ca3af; margin: 0; }
.dark .sp-card, .dark .sp-card-sm, .dark .sp-list { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }
.dark .sp-title, .dark .sp-pct, .dark .sp-label, .dark .sp-next p, .dark .sp-done p { color: #fafafa; }
.dark .sp-sub, .dark .sp-desc { color: #a1a1aa; }
.dark .sp-bar { background: rgba(255,255,255,0.1); }
.dark .sp-next { border-color: color-mix(in oklab, var(--primary-500) 25%, transparent); background: color-mix(in oklab, var(--primary-500) 8%, transparent); }
.dark .sp-next a, .dark .sp-open { color: var(--primary-400); }
.dark .sp-done { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.08); }
.dark .sp-list li { border-bottom-color: rgba(255,255,255,0.08); }
.dark .sp-badge.ok { background: rgba(16,185,129,0.15); color: #34d399; }
.dark .sp-badge.todo { background: rgba(255,255,255,0.08); color: #71717a; }
.dark .sp-opt { background: rgba(255,255,255,0.08); color: #a1a1aa; }
.dark .sp-note { color: #71717a; }

/* ---- My Timesheet grid — .ts-* ---- */
.ts-wrap { overflow-x: auto; }
.ts-grid { border-collapse: collapse; width: 100%; min-width: 760px; }
.ts-grid th, .ts-grid td { border: 1px solid #e5e7eb; padding: 0.4rem 0.5rem; text-align: center; }
.ts-grid th { background: #f9fafb; font-size: 0.75rem; font-weight: 600; color: #4b5563; }
.ts-grid th.ts-proj, .ts-grid td.ts-proj { text-align: left; min-width: 220px; }
.ts-grid td.ts-total { font-weight: 700; background: #f9fafb; }
.ts-grid input[type=number] { width: 4.5rem; padding: 0.25rem; border: 1px solid #d1d5db; border-radius: 0.375rem; text-align: center; }
.ts-grid input[type=number]:focus { outline: 2px solid var(--primary-500); border-color: var(--primary-500); }
.ts-hours { font-weight: 600; }
.ts-st-draft { color: #6b7280; }
.ts-st-submitted { color: #b45309; }
.ts-st-approved { color: #15803d; }
.ts-st-billed { color: #1d4ed8; }
.ts-legend { display: flex; gap: 1rem; font-size: 0.75rem; color: #6b7280; margin-top: 0.75rem; flex-wrap: wrap; }
.ts-legend span::before { content: "● "; }
.ts-addrow { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.ts-addrow select { padding: 0.4rem; border: 1px solid #d1d5db; border-radius: 0.375rem; min-width: 16rem; }
.ts-addrow button { padding: 0.4rem 0.9rem; background: var(--primary-500); color: #fff; border: none; border-radius: 0.375rem; cursor: pointer; font-weight: 600; }
.ts-note { font-size: 0.8rem; color: #6b7280; margin-top: 0.75rem; }
.dark .ts-grid th, .dark .ts-grid td { border-color: #3f3f46; }
.dark .ts-grid th, .dark .ts-grid td.ts-total { background: #27272a; color: #d4d4d8; }
.dark .ts-grid td { background: #18181b; color: #fafafa; }
.dark .ts-grid input[type=number] { background: #27272a; border-color: #52525b; color: #fafafa; }
.dark .ts-addrow select { background: #27272a; border-color: #52525b; color: #fafafa; }
.dark .ts-legend, .dark .ts-note { color: #a1a1aa; }

/* ---- Async first paint (Fix W, QA note #7) — .fi-sr-only / .fi-sc-wizard-header ----
   Two vendor behaviours the panel must not depend on
   the vendor theme asset for:
   (1) Every "Loading..." string in a vendor render is
   screen-reader text inside an .fi-sr-only element —
   the vendor tables' loading announcement, the lazy
   widget loading section, the result-count live
   region. It becomes a VISIBLE stray line above
   loaded tables the moment nothing hides the class,
   so the estate's own stylesheet carries the utility
   (same declaration as the vendor's) and hiding never
   depends on the theme asset loading.
   (2) The vendor wizard header is a single-row
   auto-column grid with overflow-x:auto and
   max-content step labels — a 7-step wizard's steps
   06–07 sit off-viewport. The header wraps instead:
   steps flow onto a second row rather than out of
   the viewport. */
.fi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0;}
.fi-sc-wizard-header{display:flex;flex-wrap:wrap;grid-auto-flow:initial;overflow-x:visible;row-gap:0.25rem;}

/* ---- Setup Wizard review grid — .rv-* ---- */
.rv-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem 2rem;margin:0;}
.rv-grid dt{font-size:0.75rem;font-weight:500;color:#6b7280;margin-bottom:0.25rem;}
.rv-grid dd{font-size:0.875rem;color:#111827;margin:0;}
.dark .rv-grid dt{color:#a1a1aa;}
.dark .rv-grid dd{color:#fafafa;}

/* ---- Product Prices page switch — .pp-* ---- */
.pp-switch { display: inline-flex; gap: 0.25rem; padding: 0.25rem; margin-bottom: 1rem; border-radius: 0.75rem; background: #f3f4f6; }
.pp-switch-btn { border: 0; background: transparent; padding: 0.375rem 0.875rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #4b5563; cursor: pointer; }
.pp-switch-btn:hover { color: #111827; }
.pp-switch-btn-active { background: #fff; color: var(--primary-700); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.pp-switch-btn-active:hover { color: var(--primary-700); }
.dark .pp-switch { background: rgba(255, 255, 255, 0.06); }
.dark .pp-switch-btn { color: #a1a1aa; }
.dark .pp-switch-btn:hover { color: #fafafa; }
.dark .pp-switch-btn-active { background: rgba(255, 255, 255, 0.1); color: var(--primary-400); box-shadow: none; }
.dark .pp-switch-btn-active:hover { color: var(--primary-400); }
.pp-lookup-actions { margin-top: 1rem; }

/* ---- Budget Grid — .bgrid-* ---- */
.bgrid-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem}
.bgrid-field{display:flex;flex-direction:column;gap:.25rem;font-size:.75rem;font-weight:500;color:#6b7280}
.bgrid-select,.bgrid-input{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.bgrid-input-sm{width:5.5rem}
.dark .bgrid-select,.dark .bgrid-input{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.dark .bgrid-field{color:#a1a1aa}
.bgrid-note{font-size:.8rem;color:#6b7280;align-self:center}
.dark .bgrid-note{color:#a1a1aa}
.bgrid-spacer{flex:1}
.bgrid-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .9rem;font-size:.875rem;font-weight:500;background:#fff;color:#374151;cursor:pointer}
.bgrid-btn:hover{color:#111827}
.bgrid-btn-primary{background:var(--primary-600);border-color:var(--primary-600);color:#fff}
.bgrid-btn-primary:hover{color:#fff;background:var(--primary-700)}
.dark .bgrid-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.dark .bgrid-btn-primary{background:var(--primary-600);border-color:var(--primary-600);color:#fff}
.bgrid-tabs{display:inline-flex;gap:.25rem;padding:.25rem;margin-bottom:1rem;border-radius:.75rem;background:#f3f4f6;flex-wrap:wrap}
.bgrid-tab{border:0;background:transparent;padding:.375rem .875rem;border-radius:.5rem;font-size:.875rem;font-weight:500;color:#4b5563;cursor:pointer;display:inline-flex;gap:.5rem;align-items:center}
.bgrid-tab:hover{color:#111827}
.bgrid-tab-active{background:#fff;color:var(--primary-700);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.dark .bgrid-tabs{background:rgba(255,255,255,.06)}
.dark .bgrid-tab{color:#a1a1aa}
.dark .bgrid-tab:hover{color:#fafafa}
.dark .bgrid-tab-active{background:rgba(255,255,255,.1);color:var(--primary-400);box-shadow:none}
.bgrid-tab-group{display:inline-flex;gap:.45rem;align-items:baseline;padding:.375rem .25rem .375rem .75rem;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#6b7280}
.bgrid-tab-group-total{font-weight:600;text-transform:none;letter-spacing:0;color:#9ca3af}
.dark .bgrid-tab-group{color:#a1a1aa}
.dark .bgrid-tab-group-total{color:#71717a}
.bgrid-status{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding:.1rem .45rem;border-radius:999px;background:#e5e7eb;color:#4b5563}
.bgrid-status-approved{background:#dcfce7;color:#166534}
.bgrid-status-locked{background:#e0e7ff;color:#3730a3}
.dark .bgrid-status{background:rgba(255,255,255,.12);color:#d1d5db}
.bgrid-banner{border:1px solid #e5e7eb;border-radius:.75rem;padding:.75rem 1rem;margin-bottom:1rem;font-size:.875rem;color:#374151;background:#f9fafb;display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}
.bgrid-banner-draft{border-color:#fde68a;background:#fffbeb}
.bgrid-banner-ok{border-color:#bbf7d0;background:#f0fdf4}
.bgrid-banner-warn{border-color:#fde68a;background:#fffbeb}
.bgrid-banner-info{border-color:#bfdbfe;background:#eff6ff}
.bgrid-banner-muted{border-color:#e5e7eb;background:#f3f4f6}
.dark .bgrid-banner{border-color:rgb(255 255 255/.12);background:#1f2937;color:#d1d5db}
.bgrid-scroll{overflow-x:auto;border:1px solid #e5e7eb;border-radius:.75rem;background:#fff}
.dark .bgrid-scroll{border-color:rgb(255 255 255/.12);background:#111827}
.bgrid-table{border-collapse:separate;border-spacing:0;width:100%;font-size:.85rem}
.bgrid-table th,.bgrid-table td{padding:.4rem .6rem;border-bottom:1px solid #f3f4f6;white-space:nowrap}
.dark .bgrid-table th,.dark .bgrid-table td{border-bottom-color:rgb(255 255 255/.06)}
.bgrid-table thead th{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:#6b7280;text-align:right;background:#f9fafb}
.bgrid-table thead th.bgrid-acct{text-align:left}
.dark .bgrid-table thead th{background:#1f2937;color:#a1a1aa}
.bgrid-acct{position:sticky;left:0;background:#fff;min-width:16rem;max-width:22rem;white-space:normal}
.dark .bgrid-acct{background:#111827}
.bgrid-table thead th.bgrid-acct{z-index:2;background:#f9fafb}
.dark .bgrid-table thead th.bgrid-acct{background:#1f2937}
.bgrid-code{font-weight:600;color:#111827}
.dark .bgrid-code{color:#f9fafb}
.bgrid-tag{font-size:.65rem;font-weight:600;text-transform:uppercase;padding:.05rem .4rem;border-radius:999px;background:#fef3c7;color:#92400e;margin-left:.4rem}
.dark .bgrid-tag{background:rgba(251,191,36,.2);color:#fbbf24}
.bgrid-num{text-align:right;font-variant-numeric:tabular-nums;color:#374151}
.dark .bgrid-num{color:#d1d5db}
.bgrid-year-col{font-weight:600;background:#f9fafb}
.dark .bgrid-year-col{background:#1f2937}
.bgrid-cell{width:6.5rem;border:1px solid #e5e7eb;border-radius:.375rem;padding:.3rem .5rem;font-size:.85rem;text-align:right;background:#fff;color:#111827;font-variant-numeric:tabular-nums}
.bgrid-cell:focus{outline:2px solid var(--primary-500);outline-offset:0;border-color:transparent}
.bgrid-cell-annual{width:5.5rem}
.dark .bgrid-cell{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.bgrid-act{text-align:left;min-width:13rem}
.bgrid-mini{border:1px solid #d1d5db;border-radius:.375rem;padding:.3rem .55rem;font-size:.75rem;font-weight:500;background:#fff;color:#374151;cursor:pointer;margin-left:.25rem}
.bgrid-mini:hover{color:#111827}
.dark .bgrid-mini{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.bgrid-subtotal td{font-weight:600;background:#f9fafb;border-top:1px solid #e5e7eb}
.bgrid-total td{font-weight:700;background:#f3f4f6;border-top:2px solid #d1d5db}
.dark .bgrid-subtotal td{background:#1f2937}
.dark .bgrid-total td{background:#1f2937}

/* ---- Objectives Grid — .ogrid-* ---- */
.ogrid-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem}
.ogrid-field{display:flex;flex-direction:column;gap:.25rem;font-size:.75rem;font-weight:500;color:#6b7280}
.ogrid-select,.ogrid-input{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.ogrid-input-sm{width:8rem}
.dark .ogrid-select,.dark .ogrid-input{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.dark .ogrid-field{color:#a1a1aa}
.ogrid-note{font-size:.8rem;color:#6b7280;align-self:center}
.dark .ogrid-note{color:#a1a1aa}
.ogrid-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .9rem;font-size:.875rem;font-weight:500;background:#fff;color:#374151;cursor:pointer;align-self:flex-end}
.ogrid-btn:hover{color:#111827}
.ogrid-btn-primary{background:var(--primary-600);border-color:var(--primary-600);color:#fff}
.ogrid-btn-primary:hover{color:#fff;background:var(--primary-700)}
.dark .ogrid-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.dark .ogrid-btn-primary{background:var(--primary-600);border-color:var(--primary-600);color:#fff}
.ogrid-mini{border:1px solid #d1d5db;border-radius:.375rem;padding:.3rem .55rem;font-size:.75rem;font-weight:500;background:#fff;color:#374151;cursor:pointer}
.ogrid-mini:hover{color:#111827}
.dark .ogrid-mini{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.ogrid-banner{border:1px solid #fde68a;background:#fffbeb;border-radius:.75rem;padding:.75rem 1rem;margin-bottom:1rem;font-size:.875rem;color:#374151}
.dark .ogrid-banner{border-color:rgb(255 255 255/.12);background:#1f2937;color:#d1d5db}
.ogrid-card{border:1px solid #e5e7eb;border-radius:.75rem;background:#fff;padding:1rem;margin-bottom:1rem}
.dark .ogrid-card{border-color:rgb(255 255 255/.12);background:#111827}
.ogrid-card-title{font-size:.9rem;font-weight:600;color:#111827;margin-bottom:.75rem}
.dark .ogrid-card-title{color:#f9fafb}
.ogrid-form{display:flex;gap:.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:.5rem}
.ogrid-check{display:inline-flex;gap:.45rem;align-items:center;font-size:.85rem;color:#374151;padding:.35rem 0}
.dark .ogrid-check{color:#d1d5db}
.ogrid-node{border:1px solid #e5e7eb;border-radius:.75rem;background:#fff;padding:.8rem 1rem;margin-bottom:.75rem}
.dark .ogrid-node{border-color:rgb(255 255 255/.12);background:#111827}
.ogrid-node-head{display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap;margin-bottom:.5rem}
.ogrid-node-label{font-weight:600;color:#111827;font-size:.95rem}
.dark .ogrid-node-label{color:#f9fafb}
.ogrid-node-at{color:#6b7280;font-size:.85rem}
.dark .ogrid-node-at{color:#a1a1aa}
.ogrid-member{font-size:.72rem;color:#9ca3af;font-variant-numeric:tabular-nums}
.ogrid-badge{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding:.1rem .45rem;border-radius:999px;background:#fef3c7;color:#92400e}
.ogrid-badge-driver{background:#e0e7ff;color:#3730a3}
.dark .ogrid-badge{background:rgba(251,191,36,.2);color:#fbbf24}
.dark .ogrid-badge-driver{background:rgba(99,102,241,.25);color:#a5b4fc}
.ogrid-horizon{font-size:.78rem;color:#6b7280;margin-bottom:.5rem;font-style:italic}
.dark .ogrid-horizon{color:#a1a1aa}
.ogrid-figures{display:flex;gap:1.5rem;flex-wrap:wrap;align-items:flex-end}
.ogrid-fig{display:flex;flex-direction:column;gap:.2rem}
.ogrid-fig-label{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#6b7280}
.dark .ogrid-fig-label{color:#a1a1aa}
.ogrid-fig-value{font-size:.95rem;font-weight:600;color:#111827;font-variant-numeric:tabular-nums}
.dark .ogrid-fig-value{color:#f9fafb}
.ogrid-target-edit{display:inline-flex;gap:.4rem;align-items:center}
.ogrid-unavailable{font-size:.8rem;color:#b45309}
.dark .ogrid-unavailable{color:#fbbf24}
.ogrid-actions{display:flex;gap:.4rem;margin-left:auto;align-items:center}
.ogrid-children{margin-top:.75rem}
.ogrid-drivers{margin-top:.75rem}
.ogrid-drivers-head{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#6b7280;margin-bottom:.5rem}
.dark .ogrid-drivers-head{color:#a1a1aa}
.ogrid-valve{border:1px dashed #d1d5db;border-radius:.5rem;padding:.5rem .75rem;font-size:.82rem;color:#4b5563;background:#f9fafb;margin-bottom:.75rem}
.dark .ogrid-valve{border-color:rgb(255 255 255/.2);background:#1f2937;color:#d1d5db}
.ogrid-table{border-collapse:separate;border-spacing:0;width:100%;font-size:.85rem;margin-bottom:.75rem}
.ogrid-table th,.ogrid-table td{padding:.4rem .6rem;border-bottom:1px solid #f3f4f6;text-align:left}
.dark .ogrid-table th,.dark .ogrid-table td{border-bottom-color:rgb(255 255 255/.06)}
.ogrid-table thead th{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:#6b7280;background:#f9fafb}
.dark .ogrid-table thead th{background:#1f2937;color:#a1a1aa}
.ogrid-num{text-align:right;font-variant-numeric:tabular-nums;color:#374151}
.dark .ogrid-num{color:#d1d5db}
.ogrid-sens{margin:.25rem 0 .6rem;padding:.5rem .65rem;border:1px dashed #cbd5e1;border-radius:.5rem;background:#f8fafc;font-size:.82rem;color:#334155}
.dark .ogrid-sens{border-color:rgb(255 255 255/.2);background:#1f2937;color:#d1d5db}
.ogrid-sens-badge{display:inline-block;padding:.05rem .45rem;border-radius:999px;font-size:.68rem;font-weight:700;letter-spacing:.04em}
.ogrid-sens-badge-declared{background:#e0e7ff;color:#3730a3}
.ogrid-sens-badge-estimated{background:#dcfce7;color:#166534}
.ogrid-sens-prov{color:#64748b;font-size:.74rem}
.dark .ogrid-sens-prov{color:#9ca3af}
.ogrid-sens-bar{display:flex;gap:.75rem;margin-top:.35rem}
.ogrid-sens-form{display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end;margin-top:.45rem}
.ogrid-sens-history{margin-top:.5rem;border-top:1px solid #e2e8f0}
.dark .ogrid-sens-history{border-top-color:rgb(255 255 255/.1)}
.ogrid-sens-hrow{padding:.4rem 0;border-bottom:1px solid #eef2f7;font-size:.8rem}
.dark .ogrid-sens-hrow{border-bottom-color:rgb(255 255 255/.06)}
.ogrid-sens-status{font-weight:600}
.ogrid-sens-note{margin-top:.2rem;color:#475569}
.dark .ogrid-sens-note{color:#d1d5db}
.ogrid-sens-evidence{margin-top:.2rem;color:#64748b;font-size:.74rem}
.dark .ogrid-sens-evidence{color:#9ca3af}
.ogrid-recon{margin:.5rem 0 .75rem;padding:.55rem .7rem;border:1px solid #e5e7eb;border-left:4px solid #94a3b8;border-radius:.5rem;background:#fcfcfd;font-size:.83rem;color:#334155}
.dark .ogrid-recon{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.ogrid-recon-reconciled{border-left-color:#16a34a}
.ogrid-recon-gap{border-left-color:#dc2626;background:#fef7f7}
.dark .ogrid-recon-gap{background:#1f2937}
.ogrid-recon-incomplete{border-left-color:#d97706}
.ogrid-recon-head{margin-bottom:.3rem}
.ogrid-recon-line{margin:.15rem 0}
.ogrid-recon-rows{margin:.3rem 0;padding-left:1.1rem;font-size:.8rem}
.ogrid-scen{margin:.5rem 0 .75rem;padding:.55rem .7rem;border:1px solid #e5e7eb;border-left:4px solid #6366f1;border-radius:.5rem;background:#fcfcfd;font-size:.83rem;color:#334155}
.dark .ogrid-scen{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.ogrid-scen-head{margin-bottom:.35rem}
.ogrid-scen-table{border-collapse:collapse;margin:.35rem 0;font-size:.82rem}
.ogrid-scen-table th,.ogrid-scen-table td{border:1px solid #e2e8f0;padding:.3rem .55rem;text-align:right;vertical-align:top}
.dark .ogrid-scen-table th,.dark .ogrid-scen-table td{border-color:rgb(255 255 255/.12)}
.ogrid-scen-table th:first-child,.ogrid-scen-table td:first-child{text-align:left}
.ogrid-scen-table thead th{background:#eef2ff}
.dark .ogrid-scen-table thead th{background:#312e81;color:#e0e7ff}
.ogrid-scen-varied{display:inline-block;margin-left:.35rem;padding:.02rem .4rem;border-radius:999px;background:#e0e7ff;color:#3730a3;font-size:.66rem;font-weight:700;letter-spacing:.04em}
.ogrid-scen-outcome td{font-weight:600}
.ogrid-scen-block{margin-top:.5rem;border-top:1px solid #e2e8f0;padding-top:.45rem}
.dark .ogrid-scen-block{border-top-color:rgb(255 255 255/.1)}
.ogrid-scen-assump{margin:.35rem 0;white-space:pre-line}
.ogrid-scen-form{display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end;margin-top:.45rem}
.ogrid-scen-new{margin-top:.6rem;border-top:1px dashed #cbd5e1;padding-top:.5rem}
.dark .ogrid-scen-new{border-top-color:rgb(255 255 255/.2)}
.ogrid-scen-new-head{font-weight:600;margin-bottom:.3rem}

/* ---- 13-week cash outlook — .cashout-* ---- */
.cashout-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:1rem}
.cashout-note{font-size:.85rem;color:#475569;max-width:70ch}
.dark .cashout-note{color:#9ca3af}
.cashout-banner{border:1px solid #f59e0b;background:#fffbeb;color:#92400e;border-radius:.5rem;padding:.7rem .9rem;font-size:.88rem;margin-bottom:1rem}
.dark .cashout-banner{background:#451a03;color:#fcd34d;border-color:#b45309}
.cashout-btn{border:1px solid #7c3aed;border-radius:.5rem;padding:.4rem .9rem;font-size:.82rem;background:#7c3aed;color:#fff;cursor:pointer}
.cashout-btn:hover{background:#6d28d9}
.cashout-field{display:flex;flex-direction:column;gap:.3rem;font-size:.8rem;color:#374151}
.dark .cashout-field{color:#d1d5db}
.cashout-select,.cashout-input{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.dark .cashout-select,.dark .cashout-input{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.cashout-meta{font-size:.88rem;color:#334155;margin-bottom:.6rem}
.dark .cashout-meta{color:#d1d5db}
.cashout-table{width:100%;border-collapse:collapse;font-size:.83rem;margin-bottom:1rem}
.cashout-table th,.cashout-table td{border:1px solid #e5e7eb;padding:.35rem .5rem;text-align:right}
.cashout-table th:first-child,.cashout-table td:first-child{text-align:left}
.cashout-table th{background:#f5f3ff;color:#4c1d95}
.dark .cashout-table th,.dark .cashout-table td{border-color:rgb(255 255 255/.12)}
.dark .cashout-table th{background:#312e81;color:#e0e7ff}
.cashout-negative td{color:#b91c1c}
.dark .cashout-negative td{color:#fca5a5}
.cashout-cols{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
@media (max-width:900px){.cashout-cols{grid-template-columns:1fr}}
.cashout-panel{border:1px solid #e5e7eb;border-radius:.5rem;padding:.7rem .9rem;background:#fcfcfd}
.dark .cashout-panel{border-color:rgb(255 255 255/.15);background:#1f2937}
.cashout-h{font-size:.85rem;font-weight:700;margin:.2rem 0 .5rem;color:#4c1d95}
.dark .cashout-h{color:#c4b5fd}
.cashout-line{font-size:.82rem;color:#334155;margin:.25rem 0}
.dark .cashout-line{color:#d1d5db}
.cashout-form{margin-top:1rem}
.cashout-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem;margin-bottom:.75rem}

/* ---- Replenishment worklist — .rpl-* ---- */
.rpl-toolbar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.rpl-input,.rpl-select{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.dark .rpl-input,.dark .rpl-select{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.rpl-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.35rem .8rem;font-size:.8rem;background:#fff;color:#374151;cursor:pointer}
.rpl-btn:hover{background:#f3f4f6}
.dark .rpl-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.rpl-hint{color:#6b7280;font-size:.78rem}
.rpl-dismiss-form{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;padding:.5rem 0}

/* ---- Due Counts worklist — .dc-* ---- */
.dc-toolbar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.dc-input,.dc-select{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.dark .dc-input,.dark .dc-select{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.dc-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.35rem .8rem;font-size:.8rem;background:#fff;color:#374151;cursor:pointer}
.dc-btn:hover{background:#f3f4f6}
.dark .dc-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.dc-hint{color:#6b7280;font-size:.78rem}
.dc-badge{display:inline-block;border-radius:9999px;padding:.05rem .55rem;font-size:.75rem;font-weight:600;background:#eef2ff;color:#3730a3}
.dc-badge-due{background:#fef2f2;color:#b91c1c}
.dc-badge-ok{background:#f0fdf4;color:#15803d}
.dark .dc-badge{background:#312e81;color:#c7d2fe}
.dark .dc-badge-due{background:#450a0a;color:#fca5a5}
.dark .dc-badge-ok{background:#052e16;color:#86efac}

/* ---- Cockpit page chrome — .ckt-* ---- */
.ckt-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.ckt-chip{border:1px solid #d1d5db;border-radius:9999px;padding:.3rem .8rem;font-size:.78rem;color:#374151;background:#f9fafb}
.dark .ckt-chip{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.ckt-select{border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.dark .ckt-select{border-color:rgb(255 255 255/.15);background:#1f2937;color:#f9fafb}
.ckt-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.4rem .8rem;font-size:.8rem;background:#fff;color:#374151;cursor:pointer}
.ckt-btn:hover{background:#f3f4f6}
.dark .ckt-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.ckt-charts{display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.ckt-chart{flex:1 1 26rem;min-width:min(26rem,100%)}
.ckt-filterbar{display:flex;gap:.75rem;align-items:center;border:1px solid #f59e0b;background:#fffbeb;border-radius:.5rem;padding:.5rem .9rem;font-size:.85rem;color:#92400e;margin-bottom:1rem}
.dark .ckt-filterbar{background:#1f2937;color:#fbbf24}

/* ---- Cockpit banner widget — .ckb-* ---- */
.ckb-panel{border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem 1.25rem;background:linear-gradient(135deg,var(--primary-50),#ffffff);margin-bottom:1rem}
.dark .ckb-panel{border-color:rgb(255 255 255/.12);background:#1f2937}
.ckb-head{display:flex;align-items:center;gap:.5rem;font-weight:600;font-size:.9rem;color:var(--primary-800);margin-bottom:.5rem}
.dark .ckb-head{color:var(--primary-400)}
.ckb-ai{font-size:.85rem;color:#374151;background:rgb(255 255 255/.55);border-radius:.5rem;padding:.6rem .8rem;margin-bottom:.5rem;white-space:pre-line}
.dark .ckb-ai{color:#d1d5db;background:rgb(0 0 0/.25)}
.ckb-line{display:flex;gap:.75rem;align-items:flex-start;padding:.45rem 0;border-top:1px dashed #e5e7eb}
.dark .ckb-line{border-color:rgb(255 255 255/.12)}
.ckb-line:first-of-type{border-top:none}
.ckb-sev{flex:none;font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:9999px;padding:.15rem .55rem;margin-top:.15rem}
.ckb-sev-critical{background:#fee2e2;color:#991b1b}
.ckb-sev-warning{background:#fef3c7;color:#92400e}
.ckb-sev-info{background:#e0e7ff;color:#3730a3}
.ckb-text{flex:1;font-size:.875rem;color:#374151}
.dark .ckb-text{color:#d1d5db}
.ckb-actions{flex:none;display:flex;gap:.4rem}
.ckb-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.3rem .7rem;font-size:.78rem;background:#fff;color:#374151;cursor:pointer}
.ckb-btn:hover{background:#f3f4f6}
.ckb-btn-primary{background:var(--primary-700);border-color:var(--primary-700);color:#fff}
.ckb-btn-primary:hover{background:var(--primary-800)}
.dark .ckb-btn{border-color:rgb(255 255 255/.15);background:#111827;color:#d1d5db}
.ckb-clear{font-size:.875rem;color:#6b7280}
.dark .ckb-clear{color:#9ca3af}

/* ---- Manager residence widget (M-1, §70) — .mgr-* ----
   The AI manager's panel inside its module cockpit:
   findings, duties with accuracy, recommendations,
   reports and the scoped Ask entry. Scoped entirely
   under .mgr-panel so nothing else inherits it. */
.mgr-panel{border:1px solid #ddd6fe;border-radius:.75rem;padding:1rem 1.25rem;background:linear-gradient(135deg,#f5f3ff,#ffffff);margin-bottom:1rem}
.dark .mgr-panel{border-color:rgb(255 255 255/.12);background:#1f2937}
.mgr-head{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-weight:600;font-size:.9rem;color:#5b21b6;margin-bottom:.5rem}
.dark .mgr-head{color:#c4b5fd}
.mgr-badge{font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:9999px;padding:.15rem .55rem;background:#ede9fe;color:#5b21b6}
.dark .mgr-badge{background:#4c1d95;color:#ede9fe}
.mgr-budget{margin-left:auto;font-size:.75rem;font-weight:400;color:#6b7280}
.dark .mgr-budget{color:#9ca3af}
.mgr-line{display:flex;gap:.75rem;align-items:flex-start;padding:.45rem 0;border-top:1px dashed #e5e7eb}
.dark .mgr-line{border-color:rgb(255 255 255/.12)}
.mgr-sev{flex:none;font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:9999px;padding:.15rem .55rem;margin-top:.15rem}
.mgr-sev-critical{background:#fee2e2;color:#991b1b}
.mgr-sev-warning{background:#fef3c7;color:#92400e}
.mgr-sev-info{background:#e0e7ff;color:#3730a3}
.mgr-text{flex:1;font-size:.875rem;color:#374151}
.dark .mgr-text{color:#d1d5db}
.mgr-actions{flex:none;display:flex;gap:.4rem;align-items:center}
.mgr-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.3rem .7rem;font-size:.78rem;background:#fff;color:#374151;cursor:pointer}
.mgr-btn:hover{background:#f3f4f6}
.mgr-btn-primary{background:#6d28d9;border-color:#6d28d9;color:#fff}
.mgr-btn-primary:hover{background:#5b21b6}
.dark .mgr-btn{border-color:rgb(255 255 255/.15);background:#111827;color:#d1d5db}
.dark .mgr-btn-primary{background:#6d28d9;border-color:#6d28d9;color:#fff}
.mgr-section{margin-top:.9rem;border-top:1px solid #ede9fe;padding-top:.7rem}
.dark .mgr-section{border-color:rgb(255 255 255/.12)}
.mgr-title{font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#5b21b6;margin-bottom:.45rem}
.dark .mgr-title{color:#c4b5fd}
.mgr-empty{font-size:.85rem;color:#6b7280}
.dark .mgr-empty{color:#9ca3af}
.mgr-table{width:100%;border-collapse:collapse;font-size:.85rem}
.mgr-table th{text-align:left;padding:.35rem .5rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#6b7280;border-bottom:1px solid #e5e7eb}
.dark .mgr-table th{border-color:rgb(255 255 255/.12);color:#9ca3af}
.mgr-table td{padding:.35rem .5rem;color:#374151;border-bottom:1px solid #f3f4f6;vertical-align:top}
.dark .mgr-table td{color:#d1d5db;border-color:rgb(255 255 255/.08)}
.mgr-right{text-align:right !important}
.mgr-paused{color:#b91c1c;font-weight:600}
.dark .mgr-paused{color:#fca5a5}
.mgr-hint{font-size:.75rem;color:#6b7280}
.dark .mgr-hint{color:#9ca3af}
.mgr-reports{font-size:.85rem;color:#374151;list-style:none}
.dark .mgr-reports{color:#d1d5db}
.mgr-ask{display:flex;gap:.5rem}
.mgr-input{flex:1;border:1px solid #d1d5db;border-radius:.5rem;padding:.45rem .7rem;font-size:.875rem;background:#fff;color:#111827}
.dark .mgr-input{border-color:rgb(255 255 255/.15);background:#111827;color:#f3f4f6}
.mgr-answer{margin-top:.6rem;font-size:.875rem;color:#374151;background:rgb(255 255 255/.6);border-radius:.5rem;padding:.6rem .8rem;white-space:normal}
.dark .mgr-answer{color:#d1d5db;background:rgb(0 0 0/.25)}

/* ---- BI Explore page — .xp-* ---- */
.xp-bar{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.xp-chip{border:1px solid #d1d5db;border-radius:9999px;padding:.3rem .8rem;font-size:.78rem;color:#374151;background:#f9fafb}
.dark .xp-chip{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.xp-panel{border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem 1.25rem;background:#fff;margin-top:1rem}
.dark .xp-panel{border-color:rgb(255 255 255/.12);background:#111827}
.xp-state{border-radius:.75rem;padding:1.25rem;font-size:.9rem;margin-top:1rem;border:1px solid #e5e7eb;background:#f9fafb;color:#374151}
.dark .xp-state{border-color:rgb(255 255 255/.12);background:#1f2937;color:#d1d5db}
.xp-state-refused{border-color:#fca5a5;background:#fef2f2;color:#991b1b}
.dark .xp-state-refused{border-color:#7f1d1d;background:#1f2937;color:#fca5a5}
.xp-state-unavailable{border-color:#f59e0b;background:#fffbeb;color:#92400e}
.dark .xp-state-unavailable{border-color:#f59e0b;background:#1f2937;color:#fbbf24}
.xp-tablewrap{overflow-x:auto;margin-top:1rem}
.xp-table{width:100%;border-collapse:collapse;font-size:.85rem}
.xp-table th{text-align:left;padding:.45rem .6rem;border-bottom:2px solid #e5e7eb;color:#6b7280;font-weight:600;white-space:nowrap}
.xp-table td{padding:.45rem .6rem;border-bottom:1px solid #f3f4f6;white-space:nowrap}
.xp-table td.num,.xp-table th.num{text-align:right;font-variant-numeric:tabular-nums}
.dark .xp-table th{border-color:rgb(255 255 255/.15);color:#9ca3af}
.dark .xp-table td{border-color:rgb(255 255 255/.08)}
.xp-count{font-size:.8rem;color:#6b7280;margin-top:.6rem}
.dark .xp-count{color:#9ca3af}
.xp-kpis{display:flex;gap:1rem;flex-wrap:wrap;margin-top:1rem}
.xp-kpi{border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem 1.25rem;background:#fff;min-width:14rem}
.dark .xp-kpi{border-color:rgb(255 255 255/.12);background:#111827}
.xp-kpi-label{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:#6b7280}
.dark .xp-kpi-label{color:#9ca3af}
.xp-kpi-value{font-size:1.9rem;font-weight:700;color:#111827;font-variant-numeric:tabular-nums}
.dark .xp-kpi-value{color:#f9fafb}
.xp-flux{font-size:.85rem;margin-top:.25rem}
.xp-up{color:#059669}.xp-down{color:#dc2626}
.xp-btn{border:1px solid #d1d5db;border-radius:.5rem;padding:.3rem .7rem;font-size:.8rem;background:#fff;color:#374151;cursor:pointer}
.xp-btn:hover{border-color:#9ca3af}
.dark .xp-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.xp-btn-danger{color:#b91c1c;border-color:#fca5a5}
.dark .xp-btn-danger{color:#fca5a5;border-color:#7f1d1d}
.xp-editing{border-color:#93c5fd;background:#eff6ff;color:#1e3a8a}
.dark .xp-editing{border-color:#1d4ed8;background:#1f2937;color:#bfdbfe}

/* ---- BI pivot widget — .bip-* ---- */
.bip-scroll { overflow-x: auto; padding: 0 1.5rem 1.5rem; }
.bip-table { border-collapse: collapse; font-size: 0.875rem; width: max-content; min-width: 100%; }
.bip-scroll .bip-table { max-width: none; }
.bip-table th { padding: 0.5rem 1rem 0.5rem 0; text-align: left; font-weight: 500; color: #6b7280; white-space: nowrap; border-bottom: 1px solid #e5e7eb; }
.bip-table th.bip-num { text-align: right; }
.bip-table td { padding: 0.5rem 1rem 0.5rem 0; color: #374151; white-space: nowrap; border-bottom: 1px solid #f3f4f6; }
.bip-table td.bip-num { text-align: right; font-variant-numeric: tabular-nums; }
.bip-table td.bip-row { font-weight: 500; }
.bip-table tbody tr:last-child td { border-bottom: 0; }
.bip-table td.bip-empty { padding: 1.5rem 0; text-align: center; color: #9ca3af; white-space: normal; }
.dark .bip-table th { color: #9ca3af; border-bottom-color: rgb(255 255 255 / 0.1); }
.dark .bip-table td { color: #d1d5db; border-bottom-color: rgb(255 255 255 / 0.05); }

/* ---- Welcome card (P-3, §53) — .wc-* ----
   The home page's first card: greeting + company, the
   admin-only setup summary line, tour replay. A plain
   panel surface; the actions stack under the text on
   phone widths. */
.wc-card{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1.25rem 1.5rem;box-shadow:0 1px 2px rgb(0 0 0/.05)}
.dark .wc-card{background:#1f2937;border-color:rgb(255 255 255/.1)}
.wc-greeting{font-size:1.375rem;font-weight:700;color:#111827;margin:0}
.dark .wc-greeting{color:#f9fafb}
.wc-company{color:#4b5563;margin:.25rem 0 0}
.dark .wc-company{color:#d1d5db}
.wc-setup{color:#4b5563;margin:.5rem 0 0;font-size:.875rem}
.dark .wc-setup{color:#d1d5db}
.wc-setup a{color:var(--primary-700);font-weight:600;text-decoration:none}
.dark .wc-setup a{color:var(--primary-400)}
.wc-actions{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.wc-btn{background:var(--primary-600);color:#fff;font-weight:600;font-size:.875rem;padding:.5rem 1rem;border-radius:.5rem;text-decoration:none}
.wc-btn:hover{background:var(--primary-500)}
.wc-link{color:var(--primary-700);font-weight:600;font-size:.875rem;text-decoration:none}
.dark .wc-link{color:var(--primary-400)}
@media (max-width:40rem){.wc-card{padding:1rem}.wc-actions{width:100%}}

/* ---- Floating setup card (P-3/D4, §53) — .sc-* ----
   Bottom-right on desktop; the state machine (expanded /
   chip / complete) is the component's, the geometry is
   here. At phone width the card becomes the mock §11
   bottom sheet: full width, docked to the bottom edge. */
.sc-card{position:fixed;right:1.25rem;bottom:1.25rem;width:19rem;max-width:calc(100vw - 2rem);z-index:60;background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;box-shadow:0 12px 32px rgb(0 0 0/.18);padding:1rem 1.125rem}
.dark .sc-card{background:#1f2937;border-color:rgb(255 255 255/.12)}
.sc-head{display:flex;align-items:center;justify-content:space-between}
.sc-title{font-weight:700;font-size:.9375rem;color:#111827}
.dark .sc-title{color:#f9fafb}
.sc-x{border:0;background:transparent;font-size:1.125rem;line-height:1;color:#6b7280;cursor:pointer;padding:.125rem .375rem;border-radius:.375rem}
.sc-x:hover{background:#f3f4f6;color:#111827}
.dark .sc-x{color:#9ca3af}
.dark .sc-x:hover{background:rgb(255 255 255/.08);color:#f9fafb}
.sc-bar{height:.5rem;border-radius:999px;background:#e5e7eb;overflow:hidden;margin:.625rem 0}
.dark .sc-bar{background:rgb(255 255 255/.12)}
.sc-bar-fill{height:100%;background:var(--primary-500);border-radius:999px;transition:width .3s ease}
.sc-line{font-size:.875rem;color:#374151;margin:0}
.dark .sc-line{color:#d1d5db}
.sc-next{font-size:.875rem;color:#374151;margin:.375rem 0 0}
.dark .sc-next{color:#d1d5db}
.sc-next a{color:var(--primary-700);font-weight:600;text-decoration:none}
.dark .sc-next a{color:var(--primary-400)}
.sc-actions{display:flex;align-items:center;gap:1rem;margin-top:.75rem}
.sc-btn{background:var(--primary-600);color:#fff;font-weight:600;font-size:.8125rem;padding:.4375rem .875rem;border-radius:.5rem;text-decoration:none}
.sc-btn:hover{background:var(--primary-500)}
.sc-link{color:var(--primary-700);font-weight:600;font-size:.8125rem;text-decoration:none}
.dark .sc-link{color:var(--primary-400)}
.sc-chip{position:fixed;right:1.25rem;bottom:1.25rem;z-index:60;background:var(--primary-600);color:#fff;font-weight:600;font-size:.8125rem;border:0;border-radius:999px;padding:.5rem 1rem;box-shadow:0 8px 24px rgb(0 0 0/.2);cursor:pointer}
.sc-chip:hover{background:var(--primary-500)}
@media (max-width:40rem){
    .sc-card{left:.75rem;right:.75rem;bottom:.75rem;width:auto;max-width:none;border-radius:1rem}
    .sc-chip{right:.75rem;bottom:.75rem}
}

/* ---- Manager presence (§140) — .mp-* ----
   The module managers' floating button + four-zone
   panel (Module Manager Specification §3, approved
   mock). The button docks bottom-right like the
   setup card; the panel is a right-hand sheet. At
   phone width the panel takes the full screen.
   §184: the panel is a flex column of FIXED zones —
   header, then a content-sized top zone capped at
   47% of the panel height (Right now / Needs
   attention / Duties as a slim strip) — around the
   conversation region, the panel's only long
   scroll, with the composer pinned at the foot.
   §185: conversation-first — the header is the name
   only, the top zone collapses into the one-line
   briefing bar (.mp-bar), the three zones move into
   the overlay sheet (.mp-sheet), duties render as a
   link list (.mp-duties), answers anchor by their
   first line with a flash (.mp-flash), provenance
   rides the sources toggle (.mp-src), and the chips
   form a fixed one-row strip above the composer. */
.mp-fab{position:fixed;right:1.25rem;bottom:1.25rem;z-index:65;display:flex;align-items:center;gap:.5rem;background:var(--primary-600);color:#fff;font-weight:700;font-size:.875rem;border:0;border-radius:999px;padding:.75rem 1.125rem;box-shadow:0 10px 26px rgb(0 0 0/.28);cursor:pointer}
.mp-fab:hover{background:var(--primary-500)}
.mp-badge{background:#dc2626;color:#fff;border-radius:999px;min-width:1.375rem;height:1.375rem;display:inline-flex;align-items:center;justify-content:center;font-size:.75rem;padding:0 .375rem}
.mp-panel{position:fixed;top:0;right:0;width:27rem;max-width:94vw;height:100dvh;z-index:70;background:#fff;border-left:1px solid #e5e7eb;box-shadow:-14px 0 34px rgb(0 0 0/.16);display:flex;flex-direction:column}
.dark .mp-panel{background:#1f2937;border-color:rgb(255 255 255/.12)}
.mp-head{flex:none;padding:.6rem .9rem;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center}
.dark .mp-head{border-color:rgb(255 255 255/.12)}
.mp-name{font-weight:700;font-size:.9375rem;color:#111827}
.dark .mp-name{color:#f9fafb}
.mp-x{border:0;background:transparent;font-size:1.25rem;line-height:1;color:#6b7280;cursor:pointer;padding:.125rem .375rem}
.mp-bar{flex:none;display:flex;align-items:center;gap:.5rem;padding:.42rem .9rem;background:#f8f9fb;border-bottom:1px solid #e5e7eb;font-size:.78125rem;color:#374151}
.dark .mp-bar{background:rgb(255 255 255/.03);border-color:rgb(255 255 255/.12);color:#d1d5db}
.mp-attn{color:#15803d;font-weight:600;white-space:nowrap}
.mp-attn-warn{color:#b45309}
.dark .mp-attn{color:#4ade80}
.dark .mp-attn-warn{color:#fbbf24}
.mp-next{color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dark .mp-next{color:#9ca3af}
.mp-bar-btn{margin-left:auto;flex:none;border:1px solid #d4d8de;background:#fff;border-radius:999px;padding:.18rem .6rem;font-size:.75rem;cursor:pointer;color:#374151}
.mp-bar-btn:hover{border-color:var(--primary-500);color:var(--primary-700)}
.dark .mp-bar-btn{background:transparent;border-color:rgb(255 255 255/.2);color:#d1d5db}
.mp-sheet{position:absolute;top:5.375rem;left:.5rem;right:.5rem;max-height:66%;overflow-y:auto;background:#fff;border:1px solid #d4d8de;border-radius:.75rem;box-shadow:0 14px 40px rgb(20 24 40/.22);padding:.8rem .95rem;display:none;z-index:75}
.dark .mp-sheet{background:#1f2937;border-color:rgb(255 255 255/.14)}
.mp-sheet.mp-sheet-on{display:block}
.mp-convowrap{position:relative;flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
.mp-thread{flex:1 1 auto;overflow-y:auto;min-height:0;padding:.7rem .9rem;scroll-behavior:smooth}
.mp-window-note{text-align:center;color:#8a93a1;font-size:.75rem;line-height:1.5;margin:.125rem .375rem .875rem}
.mp-window-note::before,.mp-window-note::after{content:"";display:inline-block;width:2.125rem;border-top:1px solid #e2e5ea;vertical-align:middle;margin:0 .5rem}
.dark .mp-window-note::before,.dark .mp-window-note::after{border-color:rgb(255 255 255/.15)}
.mp-jump{position:absolute;right:.75rem;bottom:.625rem;background:var(--primary-600);color:#fff;border:0;border-radius:999px;padding:.35rem .8rem;font-size:.78125rem;font-weight:600;cursor:pointer;box-shadow:0 6px 18px rgb(20 25 40/.3);opacity:0;pointer-events:none;transition:opacity .18s;white-space:nowrap}
.mp-jump.mp-jump-on{opacity:1;pointer-events:auto}
.mp-zone{margin-bottom:1.125rem}
.mp-sheet .mp-zone:last-child{margin-bottom:.25rem}
.mp-zone h3{font-size:.71875rem;letter-spacing:.07em;text-transform:uppercase;color:#6b7280;margin:0 0 .5rem;font-weight:700}
.dark .mp-zone h3{color:#9ca3af}
.mp-finding{border:1px solid #e5e7eb;border-radius:.625rem;padding:.625rem .75rem;margin-bottom:.5rem}
.dark .mp-finding{border-color:rgb(255 255 255/.12)}
.mp-t{font-weight:600;font-size:.875rem;color:#111827}
.dark .mp-t{color:#f9fafb}
.mp-e{color:#6b7280;font-size:.8125rem;margin-top:.25rem}
.dark .mp-e{color:#9ca3af}
.mp-prov{color:#6b7280;font-size:.71875rem;margin-top:.375rem;border-top:1px dashed #e5e7eb;padding-top:.3125rem}
.dark .mp-prov{border-color:rgb(255 255 255/.12)}
.mp-mgr{color:#6b7280;font-weight:600}
.mp-pill{display:inline-block;padding:.0625rem .5625rem;border-radius:999px;font-size:.71875rem;font-weight:600;margin-right:.25rem}
.mp-pill-warning{background:#fffbeb;color:#b45309}
.mp-pill-critical{background:#fef2f2;color:#b91c1c}
.mp-pill-info{background:#eff6ff;color:#1d4ed8}
.mp-subjects{font-size:.8125rem;color:#374151;margin:.375rem 0 0;padding-left:1.125rem}
.dark .mp-subjects{color:#d1d5db}
.mp-acts{margin-top:.5rem;display:flex;gap:.5rem;flex-wrap:wrap}
.mp-btn{background:var(--primary-600);color:#fff;border:0;border-radius:.5rem;padding:.375rem .75rem;font-weight:600;cursor:pointer;font-size:.8125rem;text-decoration:none;display:inline-block}
.mp-btn:hover{background:var(--primary-500)}
.mp-ghost{background:#fff;color:#111827;border:1px solid #e5e7eb}
.mp-ghost:hover{background:#f9fafb}
.dark .mp-ghost{background:transparent;color:#f9fafb;border-color:rgb(255 255 255/.2)}
.mp-chips{flex:none;display:flex;flex-wrap:nowrap;gap:.375rem;overflow-x:auto;padding:.45rem .9rem 0;scrollbar-width:none}
.mp-chips::-webkit-scrollbar{display:none}
.mp-chip{flex:none;white-space:nowrap;border:1px solid #e5e7eb;background:#fff;border-radius:999px;padding:.25rem .6875rem;font-size:.78125rem;cursor:pointer;color:#374151}
.mp-chip:hover{border-color:var(--primary-500);color:var(--primary-700)}
.dark .mp-chip{background:transparent;color:#d1d5db;border-color:rgb(255 255 255/.2)}
/* §190: a grammar ambiguity's tap targets inside the
   carrying message, the help card's tap-to-fill
   examples, and the composer's @ button — panel-scoped
   mirrors of Ask's .ak-cand / .ak-atbtn idioms. */
.mp-opts{margin-top:.5rem}
.mp-opt{display:block;width:100%;text-align:left;border:1px solid #e5e7eb;background:#fff;border-radius:.5625rem;padding:.4375rem .625rem;margin:.3125rem 0;font-size:.8125rem;color:#111827;cursor:pointer}
.mp-opt:hover{border-color:var(--primary-500)}
.dark .mp-opt{background:rgb(255 255 255/.05);border-color:rgb(255 255 255/.18);color:#f9fafb}
.mp-fills{margin-top:.5rem;display:flex;flex-wrap:wrap;gap:.375rem;align-items:center}
.mp-fills-h{font-size:.71875rem;color:#6b7280}
.dark .mp-fills-h{color:#9ca3af}
.mp-fill{border:1px dashed #d1d5db;background:transparent;border-radius:999px;padding:.1875rem .625rem;font-size:.75rem;cursor:pointer;color:#374151}
.mp-fill:hover{border-color:var(--primary-500);color:var(--primary-700)}
.dark .mp-fill{color:#d1d5db;border-color:rgb(255 255 255/.25)}
.mp-atbtn{flex:none;border:1px solid #e5e7eb;background:#fff;border-radius:999px;width:2.375rem;font-weight:700;color:var(--primary-600);cursor:pointer}
.mp-atbtn:hover{border-color:var(--primary-500)}
.dark .mp-atbtn{background:transparent;border-color:rgb(255 255 255/.2)}
.mp-msg{max-width:92%;border-radius:.875rem;padding:.5rem .65rem;margin:0 0 .5625rem;font-size:.84375rem;white-space:pre-line;color:#111827;overflow-wrap:anywhere}
.dark .mp-msg{color:#f9fafb}
.mp-msg-u{background:#e0f2fe;margin-left:auto;border-bottom-right-radius:.25rem}
.dark .mp-msg-u{background:#0c4a6e}
.mp-msg-m{background:#f8fafc;border:1px solid #e5e7eb;border-bottom-left-radius:.25rem}
.dark .mp-msg-m{background:rgb(255 255 255/.05);border-color:rgb(255 255 255/.12)}
.mp-msg-m.mp-flash{animation:mp-fl 1.6s ease-out}
@keyframes mp-fl{0%{background:#fff7d6}100%{background:#f8fafc}}
.mp-msg-s{background:#fffbeb;border:1px dashed #f59e0b;color:#92400e;font-size:.78125rem;max-width:100%}
.dark .mp-msg-s{background:rgb(245 158 11/.12);color:#fcd34d}
.mp-src{margin-top:.3rem;font-size:.6875rem;color:#6b7280}
.dark .mp-src{color:#9ca3af}
.mp-src a{color:#6b7280;text-decoration:none;cursor:pointer}
.mp-src a:hover{text-decoration:underline}
.dark .mp-src a{color:#9ca3af}
.mp-src-full{display:none}
.mp-src-full.mp-src-open{display:inline}
.mp-quiet{color:#15803d;font-size:.8125rem;margin:.25rem 0 0}
.dark .mp-quiet{color:#4ade80}
.mp-duties{list-style:none;margin:.1rem 0 .2rem;padding:0}
.mp-duties li{padding:.14rem 0;font-size:.8125rem}
.mp-duties a{color:var(--primary-700);text-decoration:none;cursor:pointer}
.mp-duties a:hover,.mp-duties a:focus{text-decoration:underline}
.dark .mp-duties a{color:var(--primary-300)}
.mp-cad{color:#6b7280}
.dark .mp-cad{color:#9ca3af}
.mp-foot{flex:none;border-top:1px solid #e5e7eb;padding:.6875rem .875rem;position:relative}
.dark .mp-foot{border-color:rgb(255 255 255/.12)}
.mp-in{display:flex;gap:.5rem}
.mp-in input{flex:1;border:1px solid #e5e7eb;border-radius:999px;padding:.5625rem .875rem;font:inherit;background:#fff;color:#111827}
.dark .mp-in input{background:transparent;border-color:rgb(255 255 255/.2);color:#f9fafb}
/* §186: a backticked span in a manager message — a
   canonical form or a corrected sentence — renders
   as a quiet code span, its grammar keywords bold
   (the teaching layer, bodyHtml). */
.mp-code{font-family:ui-monospace,monospace;font-size:.92em;background:rgb(17 24 39/.06);border-radius:.375rem;padding:.05rem .3rem}
.dark .mp-code{background:rgb(255 255 255/.12)}
/* §243: the keyword weight is DECLARED here, not
   left to the ambient cascade — the pill's rules
   never named it, and inside the monospace pill
   the inherited <strong> default resolved to no
   visible bold on the deployed panel (the form
   line read flat while the same message's **row
   labels** rendered bold). */
.mp-code strong{font-weight:700}
/* §186 (T4): the shared governed-name autocomplete
   (.gn-ac-*) — surface-neutral classes: the Ask
   composer mounts the same component in §187. It
   floats above the composer it serves. */
.gn-ac{position:absolute;left:.875rem;right:.875rem;bottom:calc(100% + .375rem);background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;box-shadow:0 12px 32px rgb(0 0 0/.18);padding:.375rem;z-index:30;max-height:16rem;overflow:auto}
.dark .gn-ac{background:#1f2937;border-color:rgb(255 255 255/.14)}
.gn-ac-item{display:flex;align-items:baseline;gap:.5rem;width:100%;text-align:left;padding:.4375rem .625rem;border-radius:.5rem;font:inherit;font-size:.875rem;color:#111827;background:transparent;border:0;cursor:pointer}
.gn-ac-item:hover,.gn-ac-item:focus{background:rgb(17 24 39/.05)}
.dark .gn-ac-item{color:#f9fafb}
.dark .gn-ac-item:hover,.dark .gn-ac-item:focus{background:rgb(255 255 255/.08)}
.gn-ac-name{font-weight:600}
.gn-ac-code{color:#6b7280;font-family:ui-monospace,monospace;font-size:.8125rem}
.dark .gn-ac-code{color:#9ca3af}
.gn-ac-kind{margin-left:auto;color:#6b7280;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em}
.dark .gn-ac-kind{color:#9ca3af}
@media (max-width:40rem){
    .mp-panel{width:100vw;max-width:100vw}
    .mp-fab{right:.75rem;bottom:.75rem}
}

/* ---- Welcome tour (P-3/D6, §53) — .tour-* ----
   Scrim + lit element + tooltip card. The lit element is
   lifted above the scrim and ringed in the theme's
   primary; the card is JS-positioned beside it on
   desktop/tablet and becomes a bottom sheet on phones. */
.tour-scrim{position:fixed;inset:0;background:rgb(17 24 39/.55);z-index:80;pointer-events:none}
.tour-lit{position:relative;z-index:85;box-shadow:0 0 0 3px var(--primary-400),0 0 0 6px rgb(255 255 255/.85);border-radius:.5rem}
.dark .tour-lit{box-shadow:0 0 0 3px var(--primary-400),0 0 0 6px rgb(17 24 39/.85)}
.tour-card{position:fixed;width:20rem;max-width:calc(100vw - 1rem);z-index:90;background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;box-shadow:0 16px 40px rgb(0 0 0/.25);padding:1rem 1.125rem}
.dark .tour-card{background:#1f2937;border-color:rgb(255 255 255/.12)}
.tour-title{font-weight:700;font-size:.9375rem;color:#111827;margin:0}
.dark .tour-title{color:#f9fafb}
.tour-body{font-size:.875rem;line-height:1.5;color:#374151;margin:.375rem 0 0}
.dark .tour-body{color:#d1d5db}
.tour-foot{display:flex;align-items:center;justify-content:space-between;margin-top:.75rem}
.tour-dots{display:inline-flex;gap:.3125rem}
.tour-dot{width:.4375rem;height:.4375rem;border-radius:999px;background:#d1d5db}
.tour-dot--on{background:var(--primary-500)}
.tour-progress{font-size:.75rem;color:#6b7280}
.dark .tour-progress{color:#9ca3af}
.tour-actions{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;margin-top:.75rem}
.tour-btn{border:1px solid #d1d5db;background:#fff;color:#374151;font-weight:600;font-size:.8125rem;padding:.4375rem .875rem;border-radius:.5rem;cursor:pointer}
.dark .tour-btn{border-color:rgb(255 255 255/.15);background:#1f2937;color:#d1d5db}
.tour-btn--ghost{border-color:transparent;background:transparent;color:#6b7280}
.dark .tour-btn--ghost{background:transparent;color:#9ca3af}
.tour-btn--primary{background:var(--primary-600);border-color:var(--primary-600);color:#fff}
.tour-btn--primary:hover{background:var(--primary-500)}
@media (max-width:40rem){
    .tour-card{left:.75rem;right:.75rem;bottom:.75rem;top:auto;width:auto;max-width:none;border-radius:1rem}
}

/* ---- Form button language (Form Polish F-1/D5, §55) — .fi-btn-raised ----
   The elevation layer of the §5 button language: Filament
   colours stay native; only the surface's ONE raised
   primary gains a shadow — a grounding ring plus an
   ambient shadow tinted with the ACTIVE theme's primary
   (identity colour, so per §52's palette law it reads
   var(--primary-*), never a literal amber; P-2 tunes the
   tint per theme). Applied via
   App\Filament\Actions\ButtonStyle::raised(); defined in
   F-1 and adopted per surface from F-2 onward — nothing
   references the class yet. */
.fi-btn-raised {
    box-shadow:
        0 0 0 1px rgb(17 24 39 / 0.05),
        0 1px 2px rgb(17 24 39 / 0.10),
        0 4px 10px -2px color-mix(in oklab, var(--primary-500) 45%, transparent);
}
.dark .fi-btn-raised {
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 0.08),
        0 1px 2px rgb(0 0 0 / 0.35),
        0 4px 10px -2px color-mix(in oklab, var(--primary-500) 40%, transparent);
}

/* ---- Form footer law (Form Polish F-2/D5, §56) ----
   Edit footers carry Delete as a flat danger text-button
   at the bar's LEFT end while Cancel/Save align right:
   the auto inline-end margin absorbs the free space in
   the actions row. On phones (§11) the bar stacks
   full-width in rank order — the row reverses so the
   raised primary lands first and Delete last. Scoped to
   the .fi-polished-form-actions wrapper the footer
   traits put on the form-actions component. */
.fi-btn-footer-start {
    margin-inline-end: auto;
}
@media (max-width: 47.99rem) {
    .fi-polished-form-actions .fi-ac {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .fi-polished-form-actions .fi-btn-footer-start {
        margin-inline-end: 0;
    }
}

/* ---- Block sub-headings (Form Polish F-2, §56) ----
   Address groups inside a block carry a small-caps muted
   sub-heading with a dashed rule above (the approved
   Customer mock's .subhead); the first in a block drops
   the rule. Rendered by App\Filament\Forms\SubHeading. */
.fi-form-subhead {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(107 114 128);
    border-top: 1px dashed rgb(229 231 235);
    padding-top: 0.875rem;
    margin-top: 0.25rem;
}
.fi-form-subhead-first {
    border-top: none;
    padding-top: 0;
}
.dark .fi-form-subhead {
    color: rgb(156 163 175);
    border-top-color: rgb(255 255 255 / 0.12);
}

/* ---- Totals stack (Form Polish F-3/D4, §57) ----
   A document's totals block is a right-aligned stack of
   label:value rows reading like the printed document
   (D4): the values right-align inside the stack's
   right-hand column (the .fi-totals-stack group the sales
   forms place at the grid's right edge; full-width on
   phones), and the grand-total row — whose value carries
   .fi-totals-grand — is ruled off above and bolded, label
   and value alike. */
.fi-totals-stack .fi-in-entry-content {
    text-align: right;
}
.fi-totals-stack .fi-in-entry:has(.fi-totals-grand) {
    border-top: 1px solid rgb(229 231 235);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}
.fi-totals-stack .fi-in-entry:has(.fi-totals-grand) .fi-in-entry-label,
.fi-totals-grand {
    font-weight: 600;
}
.dark .fi-totals-stack .fi-in-entry:has(.fi-totals-grand) {
    border-top-color: rgb(255 255 255 / 0.12);
}

/* ---- Directory home pages (§234) — .dir-* ----
   The System Setup home and the Accounts Reports home:
   a search box, an optional lead card (the guided
   first-run checklist on the setup home), then the
   directory itself — domain groups with their screens
   as a simple link grid. One family for both homes so
   the two directories read identically. */
.dir-wrap{max-width:72rem}
.dir-intro{font-size:.875rem;color:#6b7280;max-width:60rem;margin:0 0 1rem}
.dark .dir-intro{color:#9ca3af}
.dir-search{width:100%;max-width:28rem;padding:.5rem .75rem;border:1px solid #d4d8de;border-radius:.5rem;font-size:.875rem;background:#fff;color:#111827;margin-bottom:1.25rem}
.dark .dir-search{background:#1f2937;border-color:rgb(255 255 255/.16);color:#f9fafb}
.dir-lead{display:flex;justify-content:space-between;align-items:center;gap:1rem;border:1px solid #d4d8de;border-radius:.75rem;padding:.875rem 1rem;margin-bottom:1.5rem;background:#f8f9fb}
.dark .dir-lead{background:rgb(255 255 255/.03);border-color:rgb(255 255 255/.12)}
.dir-lead-t{font-weight:700;font-size:.9375rem;color:#111827}
.dark .dir-lead-t{color:#f9fafb}
.dir-lead-s{font-size:.8125rem;color:#6b7280;margin-top:.125rem}
.dark .dir-lead-s{color:#9ca3af}
.dir-lead a{flex:none;background:var(--primary-600);color:#fff;font-weight:600;font-size:.8125rem;padding:.4375rem .875rem;border-radius:.5rem;text-decoration:none}
.dir-lead a:hover{background:var(--primary-500)}
.dir-group{margin-bottom:1.5rem}
.dir-group h3{font-size:.71875rem;letter-spacing:.07em;text-transform:uppercase;color:#6b7280;margin:0 0 .5rem;font-weight:700}
.dark .dir-group h3{color:#9ca3af}
.dir-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(13rem,1fr));gap:.5rem}
.dir-item{display:block;border:1px solid #e5e7eb;border-radius:.625rem;padding:.625rem .75rem;text-decoration:none;color:#111827;font-weight:600;font-size:.875rem;background:#fff}
.dir-item:hover{border-color:var(--primary-500);color:var(--primary-700)}
.dark .dir-item{background:#1f2937;border-color:rgb(255 255 255/.12);color:#f9fafb}
.dir-item-s{display:block;font-weight:400;font-size:.8125rem;color:#6b7280;margin-top:.125rem}
.dark .dir-item-s{color:#9ca3af}
.dir-empty{font-size:.875rem;color:#6b7280}
.dark .dir-empty{color:#9ca3af}