/* ============================================================
   BRAND COLOR — single source of truth
   ============================================================
   Every place in this file (and none outside it — grepped for
   literal hex brand values before writing this block) that needs
   this app's actual configured brand color reads ONE of the four
   custom properties below, never a re-typed hex. This exists
   because of a standing, confirmed fact about Filament's own color
   system (see Filament\Support\Colors\Color::generatePalette()):
   every shade Filament computes for a configured ->colors(['primary'
   => Color::hex(...)]) value — including the shade its OWN button
   component picks for a background (400 in light mode) — is
   RECOMPUTED from the input color via a fixed per-shade OKLCH
   lightness/chroma table using only the input's hue. None of those
   computed shades reproduce the exact configured hex at any point,
   so Filament's own rendering of color="primary" never actually
   shows AdminPanelProvider's literal #0071bc — only some nearby,
   lighter/darker approximation of it. Every rule below exists to
   bypass that approximation entirely for real UI, forcing the exact
   literal brand hex instead.

   Why a custom property rather than leaving the hex typed once per
   rule (which would already be more consolidated than scattering it
   was before this block existed): a per-brokerage brand color is a
   planned future feature. When that lands, retargeting every one of
   these rules to a brokerage's own color is a single variable
   reassignment (e.g. a `[data-brokerage="x"] { --brand-primary:
   #abc123; }` override, or setting it inline from a Blade value) —
   never a hunt through this file for every literal hex again.

   --brand-danger/--brand-danger-hover deliberately ALIAS Filament's
   own --danger-600/--danger-500 (real, globally-exposed Filament
   custom properties — confirmed in vendor/filament/support/resources/
   css/index.css) rather than a new literal: unlike primary, danger
   has no ->colors() override in AdminPanelProvider, so Filament's own
   computed shade IS this app's actual danger color today — there is
   nothing to bypass yet. The variable exists so a FUTURE per-brokerage
   danger color has the same single hook primary already gets, without
   changing today's rendering at all (aliasing var(--danger-600) is a
   no-op until something reassigns it to a literal). */
:root {
    --brand-primary: #0071bc;
    --brand-primary-hover: #ff3333;
    /* The Inbox list's gold: a starred message's star and an overdue
       reminder's bell (Gmail and Manual Inbox alike). */
    --inbox-gold: #f4b400;
    --brand-danger: var(--danger-600);
    --brand-danger-hover: var(--danger-500);
}

/* Confirmed by reading the actual rendered classes Filament's button
   component applies (not assumed): a color="primary" button/link
   action always carries BOTH `fi-btn` and `fi-color-primary` in its
   class list, regardless of which page it's on, whether it's a plain
   <a href> link action, a modal-opening <button wire:click="mountAction
   (...)">, or a <button type="submit"> form action — confirmed
   identical, byte-for-byte, across Admin > Inbox Settings' own
   "Connect Gmail" (link), "Connect Email Account" (modal), and "Save
   signature" (submit) when this was investigated. That means this ONE
   selector already generalizes to every current AND future
   color="primary" button in the admin panel with no narrower, page-
   specific exception needed or wanted — the `.fi-btn.` prefix keeps it
   scoped to actual buttons only, so badges/pills that also legitimately
   use color="primary" (a lighter, intentional tint) are never forced to
   this same dark, high-contrast treatment. !important is required
   because Filament's own button component already ships its own
   background/text-color utility classes (fi-bg-color-N/fi-text-color-N)
   at the same specificity a plain compound class selector can't
   outrank on source order alone. */
.fi-btn.fi-color-primary {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.fi-btn.fi-color-primary:hover {
    background-color: var(--brand-primary-hover) !important;
    color: #ffffff !important;
}

/* The `color: #ffffff` above only reaches the button's own text (plain
   CSS inheritance/currentColor) — Filament renders a button's icon as
   its own nested .fi-icon element carrying its OWN explicit computed
   color class (a dark shade, unreadable on this brand blue), which
   inheritance never overrides regardless of the parent's color. Same
   root cause, and same fix, as .fi-inbox-brand-active .fi-icon further
   down this file (App\Filament\Pages\Inbox's own Compose/Reply
   buttons) — this is the general case for every color="primary" button
   app-wide, not just those.

   .fi-color-danger's own icon is included here defensively, not
   because any current danger button shows this problem — Filament's
   own computed danger background (shade 600) already happens to pair
   with Filament's own white icon/text choice (fi-text-color-0),
   confirmed by reading Disconnect Gmail's own rendered classes — but
   the SAME root cause (a background forced to a literal hex Filament
   never accounted for when it picked the icon's shade) would recur the
   moment --brand-danger ever gets reassigned to a real per-brokerage
   literal, exactly as it already did for primary. Covering it now
   costs nothing today and removes that risk before it can ever exist. */
.fi-btn.fi-color-primary .fi-icon,
.fi-btn.fi-color-danger .fi-icon {
    color: #ffffff !important;
}

/* No visual change today (see --brand-danger's own docblock above) —
   this exists purely so a future per-brokerage danger color has the
   exact same single hook primary already has, the moment
   --brand-danger stops aliasing Filament's own token and starts
   holding a real literal instead. */
.fi-btn.fi-color-danger {
    background-color: var(--brand-danger) !important;
    color: #ffffff !important;
}

.fi-btn.fi-color-danger:hover {
    background-color: var(--brand-danger-hover) !important;
    color: #ffffff !important;
}

/* Chrome-only bug (confirmed via DevTools, reproducible, not present
   in Edge): .fi-grid-ctn (Filament's container-query root — see
   vendor/filament/support/resources/css/components/grid.css,
   `@supports (container-type: inline-size) { .fi-grid-ctn { @apply
   @container; } }`) was computing to a width of literally 0 on the
   Dashboard's stat-overview widget, collapsing its @xl:/!@lg:
   container-query column count to the narrowest fallback — a single
   stacked column — regardless of actual viewport width.

   Traced the real ancestor chain (StatsOverviewWidget's own Section,
   ->contained(false)->gridContainer(), per
   vendor/filament/widgets/src/StatsOverviewWidget.php): .fi-grid-ctn
   is a plain display:block div, nested inside a .fi-grid-col (a CSS
   Grid item, itself inside a widget-level `display:grid;
   grid-template-columns: repeat(1, minmax(0,1fr))`). Neither
   dashboard-theme.css nor Filament's own compiled CSS sets width: 0,
   flex: 0, display: contents, or position: absolute anywhere in that
   chain — confirmed by reading both files directly, not assumed. A
   block box like this normally fills its parent's width regardless of
   content, so this isn't a CSS authoring mistake; container-type:
   inline-size implies size containment, which per spec makes the
   element report zero intrinsic size to anything sizing it from
   ABOVE — normally harmless against a minmax(0, 1fr) track (whose
   final size doesn't depend on content), but this specific nested
   combination (a size-contained descendant several levels inside
   minmax(0, 1fr) grid tracks, with an intervening
   .fi-section-not-contained grandchild that's itself display:grid)
   is a known category of real Chromium engine bugs — Edge tolerating
   it while Chrome doesn't is consistent with an engine-version bug in
   this exact scenario, not a spec-mandated fallback.

   Fix: give the container an explicit width instead of relying on
   inherited block-fill sizing, so Chrome has an unambiguous value to
   use instead of whatever's collapsing to zero. Scoped to exactly the
   class carrying container-type, so nothing else is affected; a no-op
   wherever the block-fill computation already works (Edge, and every
   other .fi-grid-ctn elsewhere in the app). NOT visually verified —
   no headless browser or rendering service is available in this
   environment (checked: no chromium/playwright/puppeteer installed,
   and shared libraries a headless Chromium needs are missing from
   this shared cPanel host with no sudo/apt access) — confirm in
   Chrome directly. */
.fi-grid-ctn {
    width: 100%;
}
@media (max-width: 640px) {
    .fi-topbar {
        gap: 0.5rem;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .fi-topbar-open-sidebar-btn,
    .fi-topbar-close-sidebar-btn {
        display: inline-flex;
        flex: 0 0 3.25rem;
        align-items: center;
        justify-content: center;
        width: 3.25rem;
        height: 3.25rem;
        margin: 0;
        padding: 0;
    }

    .fi-topbar-open-sidebar-btn svg,
    .fi-topbar-close-sidebar-btn svg {
        width: 2rem;
        height: 2rem;
    }

        .fi-topbar-end {
        flex: 1 1 auto;
        min-width: 0;
    }

        .fi-topbar .fi-topbar-end > .fi-global-search-ctn {
        flex: 0 0 calc(100% - 7rem) !important;
        width: calc(100% - 7rem) !important;
        max-width: calc(100% - 7rem) !important;
        min-width: 0 !important;
        margin-right: 0.5rem !important;
    }

    .fi-topbar-database-notifications-btn {
        margin-right: 0.75rem;
    }

    /* .fi-topbar-end grows to fill the bar above (it used to hold the
       header search box). Admin and Client have no header search any
       more (->globalSearch(false)), so without this the bell and avatar
       sat at the START of that stretched area, right next to the
       hamburger. Pin them to the right edge. Scoped to the two panels
       that load this stylesheet: Filament puts fi-panel-{id} on <body>. */
    .fi-panel-admin .fi-topbar-end,
    .fi-panel-client .fi-topbar-end {
        justify-content: flex-end;
    }
}

/* Brokerage logo in the Admin/Client MOBILE topbar
   (resources/views/filament/mobile-topbar-brand.blade.php, rendered from
   the TOPBAR_START hook, i.e. before the hamburger in the DOM).
   Layout: [Menu] [Logo] ............ [Bell] [Profile].
   Below Filament's lg breakpoint (64rem) only — the same width at which
   Filament hides its own topbar logo and moves the sidebar (with its
   logo) off-canvas. From lg up it is hidden, so desktop is unchanged
   and never shows a second logo.
   - order: -1 on the hamburger buttons puts the logo after them.
   - Same 2.5rem height as the sidebar logo (->brandLogoHeight()),
     which fits the existing 3.25rem hamburger row without changing
     the topbar height.
   - The large flex-shrink makes the LOGO absorb any shortage of width
     first, so the bell/profile controls are never squeezed; a too-wide
     logo is scaled down inside its box with object-fit: contain (never
     stretched or cropped), left-aligned next to the hamburger. */
.dbx-mobile-topbar-brand {
    display: none;
}

@media (max-width: 63.999rem) {
    .fi-panel-admin .fi-topbar-open-sidebar-btn,
    .fi-panel-admin .fi-topbar-close-sidebar-btn,
    .fi-panel-client .fi-topbar-open-sidebar-btn,
    .fi-panel-client .fi-topbar-close-sidebar-btn {
        order: -1;
    }

    .fi-panel-admin .dbx-mobile-topbar-brand,
    .fi-panel-client .dbx-mobile-topbar-brand {
        display: flex;
        flex: 0 1000 auto;
        align-items: center;
        min-width: 0;
        max-width: 13rem;
        margin-inline-start: 0.5rem;
        margin-inline-end: 0.75rem;
    }

    .dbx-mobile-topbar-brand-link {
        display: flex;
        align-items: center;
        min-width: 0;
        max-width: 100%;
    }

    .dbx-mobile-topbar-brand .fi-logo {
        min-width: 0;
        max-width: 100%;
        margin: 0;
    }

    .dbx-mobile-topbar-brand .fi-logo > picture {
        display: flex;
        min-width: 0;
        max-width: 100%;
    }

    .dbx-mobile-topbar-brand img {
        max-width: 100%;
        object-fit: contain;
        object-position: left center;
    }
}

/*
 * Client <-> Admin message thread (one per Client). Styled to match
 * the site's form language (bordered cards, generous padding, rounded
 * inputs) rather than a chat-bubble UI — reusing the same visual
 * pattern the original per-offer message thread used (buyer/seller
 * roles here become admin/client). Colors reuse Filament's own
 * --color-gray-* theme tokens where a matching step exists.
 */

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-thread-messages {
    display: flex;
    flex-direction: column;
    max-height: 34rem;
    padding-right: 0.25rem;
    overflow-y: auto;
}

.message-thread-empty {
    margin: 0;
    color: var(--color-gray-500);
    font-size: 0.92rem;
}

.message-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.message-thread-header-title {
    margin: 0;
    color: var(--color-gray-950);
    font-size: 1rem;
    font-weight: 600;
}

.message-thread-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/*
 * Inbox/Archived/All — no segmented/tab-style toggle exists anywhere
 * else in this app to reuse (the Domain Listings "status filter" is a
 * plain dropdown, not a visually segmented control), so this is built
 * from scratch: a single bordered pill split into three buttons, the
 * active one styled the same blue/white/bold combination
 * .fi-inbox-folder-item.is-active already uses elsewhere in this file
 * for "the current selection" in a nav list.
 */
.message-thread-filter-toggle {
    display: inline-flex;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.5rem;
    overflow: hidden;
}

.message-thread-filter-toggle-option {
    padding: 0.4rem 0.85rem;
    border: 0;
    border-left: 1px solid var(--color-gray-300);
    background: transparent;
    color: var(--color-gray-700);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.message-thread-filter-toggle-option:first-child {
    border-left: 0;
}

.message-thread-filter-toggle-option.is-active {
    background: var(--brand-primary);
    color: #ffffff;
}

.message-thread-message {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 1.1rem 1.35rem;
    border: 1px solid var(--color-gray-200);
    border-left: 3px solid var(--color-gray-300);
    border-radius: 0.75rem;
    background: #ffffff;
    margin-bottom: 0.75rem;
}

.message-thread-message:last-child {
    margin-bottom: 0;
}

/* Role-based, not viewer-based — a broker message always carries the
   viewing brokerage's own --brand-primary (BrandColor::
   buttonStyleOverride() sets it per tenant on both panels) and a
   client message is always green, whichever panel is looking. */
.message-thread-message.is-admin {
    border-left-color: var(--brand-primary);
}

.message-thread-message.is-client {
    border-left-color: var(--success-600);
}

.dark .message-thread-message.is-client {
    border-left-color: var(--success-400);
}

.message-thread-sender {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
}

.message-thread-sender.is-admin {
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.message-thread-sender.is-client {
    color: var(--success-700);
    background: color-mix(in srgb, var(--success-600) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-600) 30%, transparent);
}

.dark .message-thread-sender.is-client {
    color: var(--success-400);
}

.message-thread-time {
    color: var(--color-gray-500);
    font-size: 0.78rem;
}

.message-thread-message-body {
    flex: 1 1 auto;
    min-width: 12rem;
    margin: 0;
    color: var(--color-gray-700);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-line;
    word-break: break-word;
}

.message-thread-composer {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
}

.message-thread-textarea {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 8rem !important;
    padding: 0.75rem 1rem !important;
    resize: vertical !important;
    border: 2px solid var(--color-gray-300) !important;
    border-radius: 0.6rem !important;
    background: #ffffff !important;
    color: var(--color-gray-950) !important;
    outline: none !important;
}

.message-thread-textarea:focus {
    border-color: var(--brand-primary) !important;
}

.message-thread-composer-actions {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
}

.message-thread-send {
    flex-shrink: 0;
}

.message-thread-error {
    margin: 0;
    color: #ef4444;
    font-size: 0.82rem;
}

/*
 * Admin Analytics page (Fathom dashboard). Plain <table> markup styled
 * directly here rather than borrowing Filament's table-builder classes,
 * since Filament v5's own tables are a CSS-grid layout (not <table>
 * elements) and this app has no Tailwind build pass over its own Blade
 * views — only Filament's pre-purged component CSS ships to the browser,
 * so ad-hoc utility classes (px-3, text-sm, grid-cols-4, ...) render inert.
 */

.fi-analytics-table-scroll {
    overflow-x: auto;
}

.fi-analytics-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}

.fi-analytics-table th,
.fi-analytics-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    text-align: start;
}

.fi-analytics-table th {
    font-weight: 600;
    color: var(--color-gray-500);
    border-bottom: 1px solid var(--color-gray-200);
    white-space: nowrap;
}

.fi-analytics-table td {
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-100);
}

.fi-analytics-table tbody tr:last-child td {
    border-bottom: none;
}

.fi-analytics-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.fi-analytics-scope-note {
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: var(--color-gray-500);
}

/* Analytics dashboards' color pass (Admin Fathom/GA4 views, Client
   panel's own view — same App\Support\DomainTrafficStats-fed tables,
   same treatment). Stat-tile accents and the doughnut chart's own
   segment colors are set as literal hex directly in each page's own
   Blade (App\Support\BrandColor::primaryHex(), the SAME resolution
   .fi-btn.fi-color-primary above already uses) rather than a CSS class
   here — Canvas 2D fillStyle can't resolve var() at all, and an inline
   style covers the plain DOM tiles without a class. These two rules are
   only for the pageviews trend line CHART specifically: Filament's own
   chart Alpine component reads a real getComputedStyle().color off
   hidden ref elements (see vendor/filament/widgets' own chart.js) — a
   raw var(--brand-primary) works fine there since the BROWSER resolves
   it, unlike Canvas fillStyle. Swapped in Blade for the chart's own
   default fi-wi-chart-border-color/fi-wi-chart-bg-color classes, which
   only ever rendered a fixed Filament gray. */
.fi-analytics-chart-brand-border-color {
    color: var(--brand-primary);
}

.fi-analytics-chart-brand-bg-color {
    color: color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

/* Small colored circle preceding a table row's own label, matching
   that row's doughnut-chart segment color one-for-one (see the Device
   types section) — background is set inline per row (one of a handful
   of literal hex values picked in Blade, not a per-color class here). */
.fi-analytics-legend-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 9999px;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Domain Listings table: inline Price editor's in-field checkmark
   (InlineSaveTextInputColumn). Hidden in the field's normal display
   state, revealed only while a descendant of the input's wrapper has
   focus — pure CSS, not Alpine state, so it can't affect the input's
   own value hydration. */
.fi-ta-inline-save-btn {
    display: none;
}

.fi-ta-text-input:focus-within .fi-ta-inline-save-btn {
    display: inline-flex;
}

/* Domain Listings table: keep the Category, Sale Type and Price
   columns compact. Category and Sale Type now render as a single
   fi-icon-btn trigger (see inline-option-picker.blade.php) rather
   than a full-width control, so their *cell* only needs to fit that
   icon — but the *column* as a whole still has to fit the header
   label ("Category" / "Sale Type") plus its sort caret, which need
   noticeably more room than the icon does. A cap sized only for the
   icon (a prior version of this rule used 5rem) squeezes the header's
   own text+caret flex layout narrower than it needs, which is what
   made the header look cramped/overlapping — table-layout:auto sizes
   the whole column off the *widest* cell in it regardless, so the
   header was always going to set the real minimum here. 8rem fits
   "Sale Type" (the longer of the two labels) plus its caret with
   comfortable padding to spare. */
.fi-ta-cell-category-id,
.fi-ta-header-cell-category-id,
.fi-ta-cell-sale-type,
.fi-ta-header-cell-sale-type {
    width: 8rem;
    max-width: 8rem;
}

/* Price only sets a preferred `width`, not a `max-width`: unlike
   Category/Sale Type's fixed-size icon, Price's rendered content
   (the "$" prefix box + input, itself padded to leave room for the
   in-field checkmark button) scales with how many digits the actual
   value has. A hard max-width (a prior version of this rule capped
   it at 7rem) can be narrower than that combined content actually
   needs for a realistic 6-figure price — and because table cells
   don't clip overflowing children, the excess doesn't get cut off,
   it visually spills rightward into the Status cell that immediately
   follows Price in column order, with Status's own opaque cell
   background then painting over (in front of) that overflow — which
   is what actually produced the "Status badge behind/overlapping
   Price" bug. A `width` alone still keeps the *typical* short price
   compact, while still letting table-layout:auto grow the column for
   a genuinely wide value instead of silently overlapping the next
   column. */
.fi-ta-cell-price,
.fi-ta-header-cell-price {
    width: 9rem;
}

/*
 * Dashboard stat cards (Admin AdminStatsOverview, Client ClientStats):
 * semantic background/border tinting per card, matching the same
 * tinted-card visual language BrokerTiers.php's own widget already
 * established (see broker-tiers.blade.php's .broker-tier-card* rules)
 * — the warning/success/primary tints below are copied from there
 * verbatim so the two don't visually drift apart over time. Filament's
 * own ->color() on a Stat only tints its icon/description text, never
 * the card background, so it alone can't produce this — these classes
 * (applied via each Stat's own ->extraAttributes(['class' =>
 * 'stat-tint-*'])) are what actually paint the card. Filament's stock
 * .fi-wi-stats-overview-stat has no real border, only a box-shadow
 * "ring" (Tailwind's ring-1 ring-gray-950/5) — replaced here with a
 * real 1px solid border, the same technique .broker-tier-card uses,
 * rather than trying to recolor the ring's shadow.
 */
.fi-wi-stats-overview-stat.stat-tint-warning,
.fi-wi-stats-overview-stat.stat-tint-success,
.fi-wi-stats-overview-stat.stat-tint-primary,
.fi-wi-stats-overview-stat.stat-tint-danger,
.fi-wi-stats-overview-stat.stat-tint-info {
    box-shadow: none !important;
    border: 1px solid transparent;
}

.fi-wi-stats-overview-stat.stat-tint-warning {
    border-color: rgba(217, 119, 6, .35) !important;
    background: rgba(245, 158, 11, .08) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-warning {
    border-color: #fde68a !important;
    background: #fef3c7 !important;
}

.fi-wi-stats-overview-stat.stat-tint-success {
    border-color: rgba(16, 185, 129, .35) !important;
    background: rgba(16, 185, 129, .08) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-success {
    border-color: #b7ecd4 !important;
    background: #eafaf3 !important;
}

.fi-wi-stats-overview-stat.stat-tint-primary {
    border-color: rgba(0, 113, 188, .3) !important;
    background: rgba(0, 113, 188, .07) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-primary {
    border-color: #bcdcf2 !important;
    background: #eaf4fb !important;
}

.fi-wi-stats-overview-stat.stat-tint-danger {
    border-color: rgba(220, 38, 38, .35) !important;
    background: rgba(239, 68, 68, .08) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-danger {
    border-color: #fecaca !important;
    background: #fef2f2 !important;
}

.fi-wi-stats-overview-stat.stat-tint-info {
    border-color: rgba(2, 132, 199, .35) !important;
    background: rgba(14, 165, 233, .08) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-info {
    border-color: #bae6fd !important;
    background: #f0f9ff !important;
}

/* Violet: Admin Overview's "Manually Activated" card — a pastel distinct
   from the warning/success/primary/danger/info tints above. */
.fi-wi-stats-overview-stat.stat-tint-violet {
    box-shadow: none !important;
    border: 1px solid rgba(139, 92, 246, .35) !important;
    background: rgba(139, 92, 246, .08) !important;
}
html:not(.dark) .fi-wi-stats-overview-stat.stat-tint-violet {
    border-color: #ddd6fe !important;
    background: #f5f3ff !important;
}

/*
 * Clickable dashboard cards — one shared hover/focus treatment for every
 * stat card that is a link: Filament renders a Stat with ->url() as
 * <a class="fi-wi-stats-overview-stat"> (Admin's 3 × 3 grid, the Client
 * Dashboard's status cards), and the Domain Portfolio tiles and the
 * Client Analytics inquiries card use the same <a>. A card that is not a
 * link stays a <div> and is never matched, so it can't look clickable.
 * A slight lift and soft shadow on hover, a visible ring on keyboard
 * focus; colors and layout are untouched. Motion is dropped for
 * prefers-reduced-motion.
 */
a.fi-wi-stats-overview-stat {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

a.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .12) !important;
}

.dark a.fi-wi-stats-overview-stat:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important;
}

a.fi-wi-stats-overview-stat:focus-visible {
    outline: 2px solid var(--primary-500, #3b82f6);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    a.fi-wi-stats-overview-stat {
        transition: box-shadow .15s ease;
    }

    a.fi-wi-stats-overview-stat:hover {
        transform: none;
    }
}

/*
 * Gmail inbox feature, Phase 2 (App\Filament\Pages\Inbox). Reuses
 * .fi-analytics-table for the message/thread list itself (see that
 * rule's own comment for why this is plain <table> markup, not
 * Filament's table-builder), with a handful of Inbox-specific rules
 * layered on top for the view-mode toggle, unread rows, and the full
 * message/thread detail view. Phase 6 adds the three-pane layout
 * (.fi-inbox-layout and its three children) and folder sidebar
 * (.fi-inbox-sidebar*) — see further down.
 */
/*
 * .fi-inbox itself (the plain wire:poll wrapper div in inbox.blade.php)
 * is a CSS GRID ITEM of Filament's own .fi-page-content
 * (display:grid; grid-auto-columns:minmax(0,1fr)) — confirmed by
 * rendering a real page load and reading Filament's own compiled CSS
 * for the ancestor chain (.fi-layout > .fi-main-ctn > ... >
 * .fi-page-content > .fi-inbox > .fi-inbox-layout). Every OTHER level
 * in that chain explicitly neutralizes the classic flex/grid "item
 * defaults to min-width: auto" footgun — .fi-main-ctn sets
 * min-width: 0 directly, .fi-page-content's own grid track is
 * minmax(0,1fr) instead of the auto-sized default — but .fi-inbox
 * itself, being entirely our own unstyled div, was the one missing
 * link: its default min-width: auto let its content's (the whole
 * folder-sidebar + list + preview flex row) aggregate min-content
 * width force the grid track wider than the page's actual available
 * width, which .fi-layout's own overflow-x: clip then cuts off rather
 * than scrolls — this, not anything inside .fi-inbox-layout itself
 * (whose own list/preview panes already have their own min-width: 0,
 * see further down), was the real cause of the preview pane still
 * being cut off/pushed off-screen after the text-wrapping-only fix.
 */
.fi-inbox {
    min-width: 0;
}

.fi-inbox-list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

.fi-inbox-view-toggle {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

/* The Refresh button (partials/inbox-view-toggle.blade.php) is a plain
   <x-filament::icon-button>, whose own base Filament classes fight this
   row on TWO fronts, confirmed by reading the actual compiled
   public/css/filament/filament/app.css rather than assuming:

   1. .fi-icon-btn{margin:calc(var(--spacing) * -2);...} — a -0.5rem
      NEGATIVE margin on every side, baked into Filament's OWN base
      icon-button class. That's what was eating this row's own
      gap: 0.5rem (a negative margin pulls the element visually toward
      its neighbor, cancelling the gap that's supposed to sit between
      them) — not a missing gap value here, a margin working against it.
   2. .fi-icon-btn.fi-size-sm{width:...;height:...} sets a FIXED
      2rem square — shorter than its sibling .fi-btn.fi-size-sm buttons
      ("Threaded"/"Flat list", the layout-cycle button), whose own
      height instead comes from padding-block + line-height around
      their icon+label content and works out taller.

   width/height/margin here are !important specifically because the
   previous, non-!important version of this same override (width: auto;
   height: auto; relying on align-items: stretch to then size it) did
   NOT reliably win against Filament's own compiled CSS in practice —
   confirmed the hard way, by the button still rendering undersized
   after that version shipped. !important removes any doubt about which
   rule wins, rather than re-litigating cascade-layer/specificity theory
   this app has no way to verify against a real browser (still
   unavailable in this environment). align-self: stretch is what
   actually determines the exact height — matching whichever sibling in
   this row is tallest, live, rather than a hardcoded rem guess that
   could drift out of sync the next time a sibling button's own padding
   changes; aspect-ratio: 1 keeps the result visually square instead of
   stretching into a tall, narrow rectangle. */
.fi-inbox-view-toggle .fi-icon-btn {
    width: auto !important;
    height: auto !important;
    aspect-ratio: 1;
    margin: 0 !important;
    align-self: stretch;
}

.fi-inbox-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fi-inbox-pagination-page {
    color: var(--color-gray-600);
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Sits below the message list/table now (see
   partials/inbox-message-list.blade.php) rather than in the top
   toolbar alongside Flat/Threaded — the top spot is pagination's now. */
.fi-inbox-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fi-inbox-per-page-label {
    color: var(--color-gray-500);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.fi-inbox-per-page .fi-input-wrp {
    width: 5.5rem;
}

.fi-inbox-error {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(220, 38, 38, .35);
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, .08);
    color: var(--color-gray-700);
    font-size: 0.875rem;
}

/* Archive/Delete/Move running in the background (Inbox and Manual Inbox
   queueMailboxAction()): a quiet status line, not an alert. */
.fi-inbox-pending {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: var(--color-gray-50);
    color: var(--color-gray-700);
    font-size: 0.875rem;
}

.dark .fi-inbox-pending {
    border-color: var(--color-gray-700);
    background: rgba(255, 255, 255, .04);
    color: var(--color-gray-300);
}

/* Email drafts (ManagesEmailDrafts): the status line under every
   composer, and the "Saved in DBX" list at the top of a Drafts folder. */
.fi-email-draft-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-height: 1.5rem;
    color: var(--color-gray-500);
    font-size: 0.8125rem;
}

.fi-email-draft-status-error {
    color: var(--color-danger-600);
}

.fi-email-draft-discard {
    margin-left: auto;
}

.fi-email-drafts-note {
    margin: 0 0 0.5rem;
    color: var(--color-gray-500);
    font-size: 0.8125rem;
}

.fi-email-draft-note {
    margin: 0;
    color: var(--color-gray-500);
    font-size: 0.8125rem;
}

/* An uncertain draft match: the explanation, then the three choices
   stacked as a bulleted list (email-drafts/status.blade.php). */
.fi-email-draft-choice {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-warning-200);
    border-radius: 0.5rem;
    background: var(--color-warning-50);
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    text-align: start;
}

.fi-email-draft-choice p {
    margin: 0 0 0.375rem;
}

.fi-email-draft-choice ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.fi-email-draft-choice li + li {
    margin-top: 0.375rem;
}

.fi-email-draft-choice .fi-link {
    font-weight: 600;
}

.dark .fi-email-draft-choice {
    border-color: color-mix(in oklab, var(--color-warning-400) 40%, transparent);
    background: color-mix(in oklab, var(--color-warning-500) 10%, transparent);
    color: var(--color-gray-200);
}

.fi-email-draft-send-error p {
    margin: 0;
}

.fi-email-draft-send-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.375rem !important;
}

/* Why the last Send didn't go; the composer stays open for a fix
   (ManagesEmailDrafts::keepComposerOpenAfterFailedSend()). */
.fi-email-draft-send-error {
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-danger-200);
    border-radius: 0.5rem;
    background: var(--color-danger-50);
    color: var(--color-danger-700);
    font-size: 0.8125rem;
}

.fi-email-draft-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fi-email-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fi-email-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.375rem;
    background: var(--color-gray-50);
    font-size: 0.8125rem;
}

.fi-email-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16rem;
}

.fi-email-attachment-size {
    color: var(--color-gray-500);
}

.fi-email-attachment-note {
    color: var(--color-gray-500);
    font-style: italic;
}

.fi-email-attachment-failed {
    border-color: var(--color-danger-300);
}

.fi-email-attachment-failed .fi-email-attachment-note {
    color: var(--color-danger-600);
    font-style: normal;
}

.fi-email-draft-provider {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.fi-email-attachment-remove {
    padding: 0 0.25rem;
    color: var(--color-gray-500);
    font-size: 1rem;
    line-height: 1;
}

.fi-email-attachment-remove:hover {
    color: var(--color-danger-600);
}

.fi-email-attachment-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-gray-600);
}

.fi-email-attachment-progress-bar {
    flex: 1;
    max-width: 12rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: var(--color-gray-200);
    overflow: hidden;
}

.fi-email-attachment-progress-bar > span {
    display: block;
    height: 100%;
    background: var(--brand-primary, var(--color-primary-500));
}

.dark .fi-email-attachment {
    border-color: var(--color-gray-700);
    background: rgba(255, 255, 255, .04);
}

.fi-email-drafts-panel {
    margin-bottom: 1.25rem;
}

.fi-email-drafts-panel-heading {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

.fi-email-drafts-empty {
    color: var(--color-gray-500);
    font-size: 0.875rem;
}

.dark .fi-email-drafts-panel-heading {
    color: var(--color-gray-200);
}

.dark .fi-email-draft-status-error {
    color: var(--color-danger-400);
}

.dark .fi-email-draft-send-error {
    border-color: color-mix(in oklab, var(--color-danger-400) 40%, transparent);
    background: color-mix(in oklab, var(--color-danger-500) 12%, transparent);
    color: var(--color-danger-300);
}

.dark .fi-email-attachment-failed .fi-email-attachment-note {
    color: var(--color-danger-400);
}

.fi-inbox-row {
    cursor: pointer;
}

/* Read / unread row backgrounds (Gmail Inbox, IMAP/SMTP Inbox and the
   drafts list — every .fi-inbox-table): a READ row (no .is-unread) gets
   the same light tint the list's old alternating stripe used,
   rgba(0, 0, 0, .03); an UNREAD row keeps the plain (white) table
   background, alongside its existing bold text. No alternating stripe.

   Kept deliberately weaker than :hover / .is-selected below: everything
   but the final `td` sits inside :where(), which contributes ZERO
   specificity, so this rule weighs one type selector — less than
   `.fi-inbox-row:hover td` / `.fi-inbox-row.is-selected td` — and those
   still fully replace the tint on any row they apply to, exactly as they
   did over the old stripe. */
:where(.fi-inbox-table tbody tr.fi-inbox-row:not(.is-unread)) td {
    background: rgba(0, 0, 0, .03);
}

.fi-inbox-row:hover td {
    background: var(--color-gray-50);
}

.fi-inbox-row.is-unread td {
    font-weight: 600;
    color: var(--color-gray-950);
}

/* The accent bar is deliberately scoped to :first-child, not every td
   in the row: an inset box-shadow is drawn per-element, so applying it
   to EVERY cell (the prior version of this rule) drew one short accent
   bar at the left edge of each column — From, Subject, Preview, Date —
   which, sitting right next to that column's own 1px bottom border
   from .fi-analytics-table td, read as a grid of internal cell
   lines/borders rather than one clean highlighted row. The background
   itself is safe to keep on every td: with .fi-analytics-table's own
   border-collapse: collapse (no gap between adjacent cells), painting
   the same color on each cell already tiles into one seamless block —
   only the accent bar was ever the fragmented part. */
.fi-inbox-row.is-selected td {
    background: var(--primary-50);
}

.fi-inbox-row.is-selected td:first-child {
    box-shadow: inset 3px 0 0 0 var(--primary-600);
}

.dark .fi-inbox-row.is-selected td {
    background: color-mix(in srgb, var(--primary-500) 12%, transparent);
}

.dark .fi-inbox-row.is-selected td:first-child {
    box-shadow: inset 3px 0 0 0 var(--primary-400);
}

.fi-inbox-checkbox-cell {
    width: 2rem;
    padding-right: 0 !important;
    text-align: center !important;
}

/* Block-level and centered, like the star and bell beside it: an inline
   checkbox sat on the text baseline, a little above the icons. 16px
   (was the browser's ~13px). */
.fi-inbox-checkbox-cell input[type="checkbox"] {
    display: block;
    width: 1rem;
    height: 1rem;
    margin: 0 auto;
    cursor: pointer;
}

.fi-inbox-checkbox-cell input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

/* Shared by both contexts (see
   partials/inbox-action-toolbar.blade.php's own docblock) — the
   bordered "toolbar box" treatment is bulk-only (a floating panel
   above the list); the single-message variant is plain inline buttons
   sitting in the detail pane's own header row, styled by
   .fi-inbox-detail-header-actions below instead. */
.fi-inbox-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.fi-inbox-action-toolbar-bulk {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--primary-200, var(--color-gray-200));
    border-radius: 0.5rem;
    background: var(--primary-50);
}

.dark .fi-inbox-action-toolbar-bulk {
    background: color-mix(in srgb, var(--primary-500) 10%, transparent);
    border-color: color-mix(in srgb, var(--primary-500) 25%, transparent);
}

/* The detail pane's own header row (Reply/Reply All/the single-message
   action toolbar/Back to inbox or Close) — renders via Filament's
   afterHeader slot, so it already sits to the right of the "Message"/
   "Conversation" heading; this just keeps its own children inline with
   sensible spacing and lets them wrap on narrow screens instead of
   overflowing. */
.fi-inbox-detail-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* The open message's section has no heading (the subject is in the
   message's own header band): its actions take the whole header row,
   starting at the left, instead of sitting right of an empty title. */
.fi-section-header:has(.fi-inbox-detail-header-actions):not(:has(.fi-section-header-text-ctn)) .fi-section-header-after-ctn {
    flex: 1 1 auto;
    min-width: 0;
    margin-inline-start: 0;
}

.fi-section-header:has(.fi-inbox-detail-header-actions):not(:has(.fi-section-header-text-ctn)) .fi-inbox-detail-header-actions {
    justify-content: flex-start;
}

/* Reply/Reply All/Forward (App\Filament\Pages\Inbox::getHeaderActions())
   are real, ->visible() Filament actions — NOT ->hidden(), which
   Filament's own CanBeDisabled::isDisabled() treats as also disabled,
   and a disabled action can never actually be mounted/triggered at all
   (see getHeaderActions()'s own comment on the 'reply' action for how
   that was discovered). They still auto-render in Filament's own page
   header toolbar (.fi-header-actions-ctn) the same as "Compose" does —
   this is what hides only THAT copy from view. Reply/Reply All's own
   real, visible copy is .fi-inbox-detail-header-actions' own plain
   button (calling the exact same wire:click="mountAction(...)"),
   positioned next to "Message"/"Conversation"; Forward's own real,
   visible copy is instead the per-message dropdown item in
   partials/inbox-detail.blade.php (Threaded view only — see that
   action's own docblock for why it has no header-adjacent button of
   its own the way Reply/Reply All do). */
.fi-header-actions-ctn [wire\:click="mountAction('reply')"],
.fi-header-actions-ctn [wire\:click="mountAction('replyAll')"],
.fi-header-actions-ctn [wire\:click="mountAction('forward')"] {
    display: none !important;
}

/* 'reminderMenu' (App\Filament\Pages\Inbox::getHeaderActions()) is the
   exact same "real ->visible() action, hidden here rather than via
   ->hidden()" trick as reply/replyAll just above — only ever triggered
   from the bell button in a message-list row (see
   partials/inbox-message-list.blade.php), never from this header
   copy. Attribute selector only matches the plain mountAction('reminderMenu')
   call with no arguments (Livewire renders the header copy's own
   wire:click with none), not the row bell's own
   mountAction('reminderMenu', { threadId: ... }) call. */
.fi-header-actions-ctn [wire\:click="mountAction('reminderMenu')"] {
    display: none !important;
}

/* 'manualReply'/'manualReplyAll'/'manualForward'/'manualReminderMenu'
   (App\Filament\Pages\ManualInbox::getHeaderActions()) — Manual
   Email's own equivalents of reply/replyAll/forward/reminderMenu just
   above, deliberately named DIFFERENTLY from Gmail's ('manualReply',
   not 'reply') specifically so they need their OWN rule here rather
   than accidentally matching (or being matched by) Gmail's: confirmed
   the hard way that reusing the bare name 'reply' would have made
   Gmail's OWN rule above silently hide Manual's header Reply button
   too, back when it WAS meant to be the only visible copy. A later
   turn moved Reply/Reply All inline into the detail pane's own header
   row (manual-inbox-detail-header-actions.blade.php), matching Gmail's
   own inbox-detail-header-actions.blade.php placement exactly — so
   manualReply/manualReplyAll are now ALSO hidden here, the identical
   "only the detail-pane copy is ever actually visible" trick reply/
   replyAll's own rule above already uses. manualForward's own real,
   visible copy is instead the message header's own icon-button pair
   (manual-inbox-detail.blade.php's own .fi-inbox-message-actions block
   — reused verbatim from Gmail's identical per-message dropdown, see
   that block's own docblock), never this header-toolbar copy.
   manualReminderMenu's own bare, no-argument header copy is hidden for
   the same "only ever triggered from the row bell" reasoning as
   reminderMenu's own rule above. */
.fi-header-actions-ctn [wire\:click="mountAction('manualReply')"],
.fi-header-actions-ctn [wire\:click="mountAction('manualReplyAll')"],
.fi-header-actions-ctn [wire\:click="mountAction('manualForward')"],
.fi-header-actions-ctn [wire\:click="mountAction('manualReminderMenu')"] {
    display: none !important;
}

/* The due-reminder bell cell in the message list (see
   partials/inbox-message-list.blade.php) — a narrow, non-growing
   column matching .fi-inbox-checkbox-cell's own precedent for a
   dedicated icon-only column rather than cramming it into an existing
   one. */
.fi-inbox-reminder-cell {
    width: 1.75rem;
    padding-inline: 0 !important;
    text-align: center !important;
}

/* Checkbox | star | bell | sender — the star and bell cells sit right
   after the checkbox, each a small fixed icon slot (empty when there's
   nothing to show) so every row lines up and no row grows taller. Both
   are buttons of their own (clicks never reach the row). */
.fi-inbox-star-cell {
    width: 1.75rem;
    padding-inline: 0 !important;
    text-align: center !important;
}

.fi-inbox-star,
.fi-inbox-reminder-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    cursor: pointer;
}

/* 18px icons (were 16px) in the same 24px hit target. */
.fi-inbox-star svg,
.fi-inbox-reminder-bell svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* The three control cells: centered on the row's middle, with less
   vertical padding than text cells so the 24px star/bell targets don't
   make the row taller than its text (20px line + 2 x 8px). */
.fi-inbox-table td.fi-inbox-checkbox-cell,
.fi-inbox-table td.fi-inbox-star-cell,
.fi-inbox-table td.fi-inbox-reminder-cell,
.fi-inbox-table th.fi-inbox-checkbox-cell,
.fi-inbox-table th.fi-inbox-star-cell,
.fi-inbox-table th.fi-inbox-reminder-cell {
    padding-block: 0.25rem;
    line-height: 0;
    vertical-align: middle;
}

/* The list's Refresh (partials/inbox-list-refresh), Gmail-style: a gray
   circular arrow right of Select all, the same visual size as the
   checkbox (18px icon) in a 24px target, gray hover like the star; it
   spins while refreshing. Above an empty list it sits in a slim bar,
   lined up with the header position. */
.fi-inbox-list-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-list-refresh svg {
    width: 1.125rem;
    height: 1.125rem;
}

.fi-inbox-list-refresh:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.fi-inbox-list-refresh:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-list-refresh:disabled {
    cursor: progress;
}

.fi-inbox-list-refresh.is-refreshing svg {
    animation: fi-inbox-refresh-spin 0.8s linear infinite;
}

@keyframes fi-inbox-refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fi-inbox-list-refresh.is-refreshing svg {
        animation: none;
    }
}

/* The header cell spanning the star and bell columns (1.75rem each,
   unchanged — the rows below keep both): Refresh centered in it, i.e.
   midway between Select all and From. Takes the star column's place for
   table-layout: fixed, so the From column doesn't move. */
.fi-inbox-table th.fi-inbox-refresh-cell {
    width: 3.5rem;
}

.fi-inbox-list-refresh-bar {
    display: flex;
    justify-content: center;
    width: 3.5rem;
    margin-left: 2rem;
    padding-block: 0.25rem;
}

.fi-inbox-list-refresh-bar .fi-inbox-list-refresh {
    margin: 0;
}

.dark .fi-inbox-list-refresh {
    color: var(--color-gray-400);
}

.dark .fi-inbox-list-refresh:hover {
    background: var(--color-gray-800);
    color: var(--color-gray-200);
}

/* Unstarred: a gray outline; starred: filled yellow (Gmail's own). */
.fi-inbox-star {
    color: var(--color-gray-400);
}

.fi-inbox-star:hover {
    color: var(--color-gray-600);
}

.fi-inbox-star.is-starred,
.fi-inbox-star.is-starred:hover {
    color: var(--inbox-gold);
}

.fi-inbox-star:disabled {
    cursor: progress;
    opacity: 0.6;
}

/* A future reminder: a muted gray bell; overdue (due, or its time
   passed): gold, ringing. Dismissed or deleted reminders have no bell. */
.fi-inbox-reminder-bell {
    color: var(--color-gray-500);
}

.fi-inbox-reminder-bell.is-due,
.fi-inbox-reminder-bell.is-due:hover {
    color: var(--inbox-gold);
}

.fi-inbox-star:hover,
.fi-inbox-reminder-bell:hover {
    background: var(--color-gray-100);
}

.fi-inbox-star:focus-visible,
.fi-inbox-reminder-bell:focus-visible,
.fi-inbox-search-icon:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

/* More than one active reminder on the message: how many. */
.fi-inbox-reminder-count {
    position: absolute;
    top: -0.125rem;
    right: -0.25rem;
    min-width: 0.875rem;
    padding: 0 0.125rem;
    border-radius: 9999px;
    background: var(--color-gray-600);
    color: #ffffff;
    font-size: 0.5625rem;
    font-weight: 700;
    line-height: 0.875rem;
}

.fi-inbox-reminder-bell.is-due .fi-inbox-reminder-count {
    background: var(--inbox-gold);
    color: #1f2937;
}

.dark .fi-inbox-star:hover,
.dark .fi-inbox-reminder-bell:hover {
    background: var(--color-gray-800);
}

/* The wrapper that carries a disabled toolbar action's reason (a
   disabled button itself gets no hover). */
.fi-inbox-disabled-action {
    display: inline-flex;
    cursor: not-allowed;
}

/* A composer's Send while the send runs (every composer window carries
   .fi-inbox-compose-modal: Inbox, Manual Inbox, Email Buyer, Warm and
   Cold Leads, Reminders). Filament already disables the button for the
   whole request (wire:loading) and adds its spinner; the label also
   reads "Sending…" so a click is never mistaken for nothing happening.
   Only the label changes — the button, the request and its guards don't. */
.fi-inbox-compose-modal .fi-modal-footer-actions .fi-btn.fi-color-primary:disabled {
    font-size: 0;
    cursor: progress;
}

.fi-inbox-compose-modal .fi-modal-footer-actions .fi-btn.fi-color-primary:disabled::after {
    content: "Sending…";
    font-size: 0.875rem;
}

/* A composer whose draft has ended (sent, deleted in Gmail, discarded in
   another window — its footer carries data-draft-ended): no Send, only
   Cancel / the X to close it. The server refuses a send regardless
   (ManagesEmailDrafts::claimComposeSend()). */
.fi-inbox-compose-modal:has(.fi-email-draft-footer[data-draft-ended]) .fi-modal-footer-actions .fi-btn.fi-color-primary {
    display: none;
}

.fi-inbox-drafts-bulk-note {
    flex-basis: 100%;
    margin: 0;
    color: var(--color-gray-500);
    font-size: 0.75rem;
}

.fi-inbox-bulk-count {
    margin-right: 0.25rem;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.fi-inbox-bulk-move {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.fi-inbox-bulk-move .fi-input-wrp {
    width: 10rem;
}

.fi-inbox-snippet {
    max-width: 28rem;
    overflow: hidden;
    color: var(--color-gray-500) !important;
    font-weight: 400 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-inbox-date {
    white-space: nowrap;
}

/* Gmail-style compact message list (Inbox and Manual Inbox; the Drafts
   list keeps its own columns): fixed proportions — a compact sender
   column, one flexible "Subject — preview" line, a narrow right-aligned
   date — every cell one line, cut with an ellipsis, never wrapped. The
   Drafts list (email-drafts/list.blade.php) uses the same rows.
   table-layout: fixed takes the widths from the header row, so a long
   subject can't push the date off-screen or widen the table. */
.fi-inbox-table {
    table-layout: fixed;
}

.fi-inbox-table td:not(.fi-inbox-checkbox-cell):not(.fi-inbox-star-cell):not(.fi-inbox-reminder-cell) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-inbox-table th.fi-inbox-from {
    width: 13rem;
}

/* Message rows read at 14px (the panel's tables use 13px), Gmail's own
   list size; the date stays 13px. Same 20px line, so the same row height. */
.fi-inbox-table td {
    font-size: 0.875rem;
}

.fi-inbox-table td.fi-inbox-date {
    font-size: 0.8125rem;
}

.fi-inbox-table th.fi-inbox-summary {
    width: auto;
}

/* The preview runs on from the subject inside the same cell, muted;
   the cell (not the span) does the truncating. */
/* Inbox search (partials/mail-search-bar): between the folder name and
   Refresh, taking the free width of the list toolbar; the field is the
   same height as the toolbar's small buttons. Only headers holding the
   inbox toolbar change layout (:has), so other sections are untouched. */
.fi-section-header:has(.fi-inbox-list-controls) {
    flex-wrap: wrap;
}

/* Filament's header row is align-items: flex-start, and only its after
   slot (the toolbar) centers itself: the folder name centers on the
   toolbar's line too. */
.fi-section-header:has(.fi-inbox-list-controls) .fi-section-header-text-ctn {
    flex: 0 1 auto;
    align-self: center;
}

.fi-section-header:has(.fi-inbox-list-controls) .fi-section-header-after-ctn {
    flex: 1 1 auto;
    min-width: 0;
}

.fi-inbox-list-controls {
    justify-content: flex-end;
}

.fi-inbox-search-wrap {
    display: flex;
    flex: 1 1 14rem;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 12rem;
    max-width: 32rem;
}

.fi-inbox-search-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.fi-inbox-search {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 0.125rem;
    height: 2rem;
    padding: 0 0.375rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.5rem;
    background: #ffffff;
}

.fi-inbox-search:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.fi-inbox-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 0.25rem;
    border: 0;
    background: transparent;
    color: var(--color-gray-900);
    font-size: 0.8125rem;
    outline: none;
}

/* No browser-drawn clear button: the gray X is the only one. */
.fi-inbox-search-input::-webkit-search-cancel-button,
.fi-inbox-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.fi-inbox-search-input::-ms-clear {
    display: none;
}

/* The filter menu: a compact funnel + native select beside the bar,
   outlined in the brand color while a filter is on. */
.fi-inbox-search-filter {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
    height: 2rem;
    padding: 0 0.375rem 0 0.5rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.5rem;
    background: #ffffff;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-search-filter svg {
    width: 1rem;
    height: 1rem;
    flex: none;
}

/* The select fills the control; its padding leaves room on the right for
   the drawn arrow (and the X, when shown), which sit over it. The browser
   arrow is replaced by that drawn one so the X can go between the name
   and the arrow. */
.fi-inbox-search-filter select {
    height: 100%;
    padding: 0 1.375rem 0 0.125rem;
    border: 0;
    background: transparent none;
    -webkit-appearance: none;
    appearance: none;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    cursor: pointer;
    box-shadow: none;
}

.fi-inbox-search-filter-clearable select {
    padding-right: 2.625rem;
}

.fi-inbox-search-filter select:focus {
    outline: none;
    box-shadow: none;
}

.fi-inbox-search-filter-chevron,
.fi-inbox-search-clear {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: var(--color-gray-400);
}

.fi-inbox-search-filter-chevron {
    right: 0.375rem;
    pointer-events: none;
    color: var(--color-gray-500);
}

.fi-inbox-search-clear {
    right: 1.625rem;
    width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    cursor: pointer;
}

.fi-inbox-search-clear:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
}

.fi-inbox-search-clear:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-search-filter .fi-inbox-search-clear svg,
.fi-inbox-search-filter-chevron svg {
    width: 0.875rem;
    height: 0.875rem;
}

.dark .fi-inbox-search-clear:hover {
    background: var(--color-gray-800);
    color: var(--color-gray-200);
}

.fi-inbox-search-filter:focus-within,
.fi-inbox-search-filter-active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.fi-inbox-search-filter-active,
.fi-inbox-search-filter-active select {
    color: var(--color-gray-900);
    font-weight: 600;
}

.fi-inbox-search-input::placeholder {
    color: var(--color-gray-400);
}

.fi-inbox-search-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-search-icon:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.fi-inbox-search-help {
    cursor: help;
}

.fi-inbox-search-icon svg {
    width: 1rem;
    height: 1rem;
}

.fi-inbox-search-error {
    margin: 0;
    color: var(--color-danger-600);
    font-size: 0.75rem;
}

.fi-inbox-search-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--color-gray-50);
    color: var(--color-gray-600);
    font-size: 0.8125rem;
}

.dark .fi-inbox-search,
.dark .fi-inbox-search-filter {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

.dark .fi-inbox-search-filter select,
.dark .fi-inbox-search-filter-active {
    color: var(--color-gray-200);
}

.dark .fi-inbox-search-filter-active {
    border-color: var(--brand-primary);
}

.dark .fi-inbox-search-input {
    color: var(--color-gray-100);
}

.dark .fi-inbox-search-icon:hover {
    background: var(--color-gray-800);
    color: var(--color-gray-200);
}

.dark .fi-inbox-search-summary {
    background: var(--color-gray-800);
    color: var(--color-gray-300);
}

@media (max-width: 40rem) {
    .fi-inbox-search-wrap {
        flex-basis: 100%;
        max-width: none;
    }
}

/* The list's paperclip: inside the "Subject — preview" cell, ahead of
   the subject (so truncation never hides it), small and muted. */
.fi-inbox-attachment-flag {
    display: inline-flex;
    margin-right: 0.375rem;
    color: var(--color-gray-400);
    vertical-align: -0.125rem;
}

.fi-inbox-attachment-flag svg {
    width: 0.875rem;
    height: 0.875rem;
}

.dark .fi-inbox-attachment-flag {
    color: var(--color-gray-500);
}

/* A message's files, under its body (partials/message-attachments). */
.fi-inbox-message-attachments {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-gray-200);
}

.fi-inbox-message-attachments-heading {
    margin: 0 0 0.5rem;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    font-weight: 600;
}

.fi-inbox-message-attachments ul {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fi-inbox-message-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 36rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}

.fi-inbox-message-attachment-icon {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-gray-500);
}

.fi-inbox-message-attachment-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--color-gray-800);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-inbox-message-attachment-meta {
    flex: none;
    color: var(--color-gray-500);
    white-space: nowrap;
}

.fi-inbox-message-attachment-download {
    flex: none;
    font-weight: 600;
}

.dark .fi-inbox-message-attachments,
.dark .fi-inbox-message-attachment {
    border-color: var(--color-gray-700);
}

.dark .fi-inbox-message-attachment-name {
    color: var(--color-gray-200);
}

/* A draft's status, only when it needs noticing (full text in the
   cell's tooltip): a small pill ahead of the subject, like Gmail's red
   "Draft". */
.fi-inbox-draft-badge {
    display: inline-block;
    margin-right: 0.5rem;
    padding: 0 0.375rem;
    border-radius: 0.25rem;
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.125rem;
    vertical-align: baseline;
}

.fi-inbox-draft-badge.is-alert {
    background: var(--color-danger-50);
    color: var(--color-danger-700);
}

.dark .fi-inbox-draft-badge {
    background: var(--color-gray-800);
    color: var(--color-gray-300);
}

.dark .fi-inbox-draft-badge.is-alert {
    background: color-mix(in oklab, var(--color-danger-500) 15%, transparent);
    color: var(--color-danger-300);
}

.fi-inbox-summary .fi-inbox-snippet {
    max-width: none;
    overflow: visible;
}

.fi-inbox-table th.fi-inbox-date,
.fi-inbox-table td.fi-inbox-date {
    width: 8.5rem;
    text-align: end;
}

@media (max-width: 40rem) {
    .fi-inbox-table th.fi-inbox-from {
        width: 7.5rem;
    }

    .fi-inbox-table th.fi-inbox-date,
    .fi-inbox-table td.fi-inbox-date {
        width: 6.5rem;
    }

    .fi-inbox-table td,
    .fi-inbox-table th {
        padding-inline: 0.5rem;
    }
}

.fi-inbox-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* min-width: 0 overrides a flex item's default min-width: auto (.fi-
   inbox-thread is display: flex; flex-direction: column, and this is
   one of its items) — without it, a From/Subject line with no natural
   break point (a long email address, a long unbroken subject) can
   force this item, and therefore .fi-inbox-thread and the whole
   preview pane column around it, wider than the viewport instead of
   wrapping — most noticeable on a single standalone message, whose
   From/Subject aren't shortened the way a reply's "Re: ..." thread
   entries typically are. See .fi-inbox-message-from/-subject below for
   the matching wrap rules that make the shrink actually take effect. */
.fi-inbox-message {
    min-width: 0;
    padding: 1.1rem 1.35rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.75rem;
    background: #ffffff;
}

/* The header band — sender/date through the subject line, never the
   body below (see the blade's own comment on why that's a separate
   wrapper rather than shading .fi-inbox-message as a whole). var(--info-50)
   is the SAME "info" semantic color family this app's messaging UI
   already uses elsewhere for exactly this kind of admin/broker
   messaging accent (.message-thread-message.is-admin's own
   border-left-color: var(--info-600) — the light 50-shade of that same
   scale, not a new color introduced just for this). Negative
   margin+matching padding pulls this flush to .fi-inbox-message's own
   padding edges so the background reaches the card's real left/right/
   top edges (and shares its top corner radius) rather than floating as
   an inset rectangle; display: flow-root establishes a new block
   formatting context so .fi-inbox-message-subject's own existing
   margin-bottom (unchanged) renders as real space CONTAINED inside this
   header's box — and so inside the blue background — instead of
   collapsing through it, which is what a plain zero-bottom-padding
   wrapper would otherwise risk. */
.fi-inbox-message-header {
    display: flow-root;
    margin: -1.1rem -1.35rem 0;
    padding: 1.1rem 1.35rem 0;
    background: var(--info-50);
    border-radius: 0.75rem 0.75rem 0 0;
}

.fi-inbox-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.fi-inbox-message-from {
    font-weight: 600;
    color: var(--color-gray-950);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.fi-inbox-message-date {
    color: var(--color-gray-500);
    font-size: 0.78rem;
}

/* Row 2 of the header — subject on the left, the reply-arrow/chevron
   (see .fi-inbox-message-actions below) on the right, side by side
   rather than stacked. align-items: center is what keeps the reply
   controls vertically aligned WITH the subject text on this same row
   instead of sitting below it. margin-bottom here (moved off
   .fi-inbox-message-subject itself, which no longer needs one now that
   it shares a row rather than being the last item in a stack) is what
   still gives the same gap before the message body as before this
   whole restructure. */
.fi-inbox-message-subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.fi-inbox-message-subject {
    min-width: 0;
    color: var(--color-gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Each message's own reply-arrow + dropdown-chevron (Threaded view only
   — see partials/inbox-detail.blade.php's own docblock), now sharing
   .fi-inbox-message-subject-row with the subject text rather than its
   own separate row — flex-shrink: 0 keeps it from being squeezed if the
   subject is long (.fi-inbox-message-subject's own min-width: 0 is what
   lets the SUBJECT shrink/wrap instead). position: relative still
   anchors .fi-inbox-message-actions-menu's own position: absolute — the
   same pattern .fi-inbox-toolbar-row uses for the custom date calendar
   popover, for the same reason: a menu genuinely floating over whatever
   sits below it instead of pushing it down. */
.fi-inbox-message-actions {
    position: relative;
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
}

.fi-inbox-message-reply-btn,
.fi-inbox-message-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-500);
}

.fi-inbox-message-reply-btn:hover,
.fi-inbox-message-actions-toggle:hover {
    background: var(--color-gray-50);
    color: var(--color-gray-700);
}

.fi-inbox-message-reply-btn svg,
.fi-inbox-message-actions-toggle svg {
    width: 1rem;
    height: 1rem;
}

/* Gmail-style conversation (partials/inbox-detail): neutral white
   messages divided by hairlines — no colored header band. Brand color
   stays on the controls (the primary pill, the composer's Send). */
.fi-inbox-conversation {
    gap: 0;
}

.fi-inbox-conversation .fi-inbox-message {
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--color-gray-200);
    border-radius: 0;
    background: transparent;
}

.fi-inbox-conversation .fi-inbox-message:last-child {
    border-bottom: 0;
}

.fi-inbox-conversation-subject {
    margin: 0.25rem 0 1rem;
    padding-inline-start: 0.5rem;
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--color-gray-950);
    overflow-wrap: anywhere;
}

/* Initials from the sender's own name — never a fabricated picture; brand-colored (is-outgoing / is-incoming, below). */
.fi-inbox-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    user-select: none;
}

/* Collapsed: avatar | sender … date star / preview — two lines. */
.fi-inbox-message-summary {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.875rem 0.5rem;
    cursor: pointer;
}

.fi-inbox-message-summary:hover {
    background: var(--color-gray-50);
}

.fi-inbox-message-summary:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
}

.fi-inbox-message-summary-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.fi-inbox-message-summary-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.fi-inbox-message-summary-from {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.fi-inbox-message-summary-date {
    flex: 0 0 auto;
    margin-inline-start: auto;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    white-space: nowrap;
}

.fi-inbox-message-summary-snippet {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-gray-600);
    font-size: 0.875rem;
}

/* Expanded: avatar | sender <email> / to … ▾ | date star reply trash. */
.fi-inbox-message-expanded {
    padding: 1rem 0.5rem 1.25rem;
}

.fi-inbox-conversation .fi-inbox-message-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin: 0 0 0.75rem;
    padding: 0;
    background: transparent;
    color: inherit;
    border-radius: 0;
}

.fi-inbox-message-header-main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.fi-inbox-conversation .fi-inbox-message-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.1rem;
}

.fi-inbox-conversation .fi-inbox-message-from {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-950);
}

.fi-inbox-message-from-address {
    color: var(--color-gray-500);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.fi-inbox-message-recipients {
    position: relative;
}

.fi-inbox-message-recipients-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    text-align: start;
    cursor: pointer;
}

.fi-inbox-message-recipients-toggle svg {
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
}

.fi-inbox-message-details {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
    min-width: 18rem;
    max-width: min(34rem, 90vw);
    margin: 0.25rem 0 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem;
    cursor: default;
}

.fi-inbox-message-details dt {
    color: var(--color-gray-500);
    text-align: end;
}

.fi-inbox-message-details dd {
    margin: 0;
    color: var(--color-gray-800);
    overflow-wrap: anywhere;
}

.fi-inbox-message-header-side {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.125rem;
}

.fi-inbox-conversation .fi-inbox-message-date {
    margin-inline-end: 0.35rem;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    white-space: nowrap;
}

.fi-inbox-conversation .fi-inbox-message-actions {
    gap: 0.125rem;
}

.fi-inbox-conversation .fi-inbox-message-subject {
    margin: 0 0 0.5rem 3.375rem;
    color: var(--color-gray-700);
}

/* The body lines up under the sender, past the avatar (2.5rem + gap). */
.fi-inbox-conversation .fi-inbox-message-body {
    margin: 0 0 0 3.375rem;
    color: var(--color-gray-800);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.fi-inbox-conversation .fi-inbox-message-body p {
    margin: 0 0 0.85rem;
}

.fi-inbox-message-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-message-icon-btn:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
}

.fi-inbox-message-icon-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-message-icon-btn svg {
    width: 1.1rem;
    height: 1.1rem;
}

.fi-inbox-message-star.is-starred {
    color: #f4b400;
}

.fi-inbox-message-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0 3.375rem;
}

.fi-inbox-message-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.fi-inbox-message-pill:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

.fi-inbox-message-pill.is-primary {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #ffffff;
}

.fi-inbox-message-pill svg {
    width: 1rem;
    height: 1rem;
}

/* Quoted history behind "•••" (GmailApiClient::foldQuotedHistory()). */
.fi-inbox-quote {
    margin-top: 0.5rem;
}

.fi-inbox-quote-toggle {
    display: inline-flex;
    align-items: center;
    height: 0.9rem;
    padding: 0 0.45rem;
    border: 0;
    border-radius: 0.5rem;
    background: var(--color-gray-200);
    color: var(--color-gray-600);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    line-height: 1;
    cursor: pointer;
}

.fi-inbox-quote-toggle:hover {
    background: var(--color-gray-300);
}

.fi-inbox-quoted {
    margin-top: 0.5rem;
}

/* Unsent drafts never look delivered: red mark, dashed outline. */
.fi-inbox-draft-mark {
    display: inline-block;
    padding: 0 0.25rem;
    color: var(--color-red-600, #dc2626);
    font-size: 0.75rem;
    font-weight: 600;
}

.fi-inbox-summary .fi-inbox-draft-mark {
    margin-inline-end: 0.35rem;
    padding: 0;
}

.fi-inbox-conversation .fi-inbox-message.is-draft {
    margin: 0.35rem 0;
    border: 1px dashed var(--color-red-300, #fca5a5);
    border-radius: 0.5rem;
    background: var(--color-red-50, #fef2f2);
}

.dark .fi-inbox-conversation .fi-inbox-message {
    border-color: var(--color-gray-700);
}

.dark .fi-inbox-conversation-subject,
.dark .fi-inbox-conversation .fi-inbox-message-from,
.dark .fi-inbox-message-summary-from {
    color: var(--color-gray-100);
}

.dark .fi-inbox-message-summary-snippet,
.dark .fi-inbox-message-details dd {
    color: var(--color-gray-300);
}

.dark .fi-inbox-message-summary:hover,
.dark .fi-inbox-message-icon-btn:hover,
.dark .fi-inbox-message-pill:hover {
    background: var(--color-gray-800);
}

.dark .fi-inbox-message-pill {
    border-color: var(--color-gray-600);
    background: transparent;
    color: var(--color-gray-200);
}

.dark .fi-inbox-message-details {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

.dark .fi-inbox-conversation .fi-inbox-message.is-draft {
    background: rgba(220, 38, 38, 0.08);
}

/* Dark mode: an email's own HTML keeps its own colors (signature
   branding included) on the light "paper" it was written for, rather
   than dark text on the dark panel or a recolored copy. */
.dark .fi-inbox-conversation .fi-inbox-message-body-html {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1f2937;
}

.dark .fi-inbox-conversation .fi-inbox-message-body-html a {
    color: var(--primary-600);
}

.dark .fi-inbox-quote-toggle {
    background: var(--color-gray-700);
    color: var(--color-gray-200);
}

/* The Manual (IMAP) Inbox's single message keeps its own layout, on
   the same neutral background (no colored band). */
.fi-inbox-thread:not(.fi-inbox-conversation) .fi-inbox-message-header {
    background: transparent;
}

.fi-inbox-message-actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    margin-block-start: 0.25rem;
    min-width: 9rem;
    padding: 0.25rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark .fi-inbox-message-actions-menu {
    background: var(--color-gray-800);
}

.fi-inbox-message-actions-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    text-align: left;
}

.fi-inbox-message-actions-menu button:hover:not(:disabled) {
    background: var(--color-gray-50);
}

/* Forward's own visible-but-disabled placeholder — see this menu's own
   blade docblock for why it's shown at all despite doing nothing yet. */
.fi-inbox-message-actions-menu button:disabled {
    color: var(--color-gray-400);
    cursor: not-allowed;
}

.fi-inbox-message-actions-menu svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* word-break: break-word alone was the previous (incomplete) fix here
   — per spec it's supposed to behave like overflow-wrap: anywhere, but
   real browsers are inconsistent about honoring that for INTRINSIC/
   min-content sizing specifically (the calculation that determines
   whether a long unbroken run — a bare URL with no spaces, e.g. a
   Google Voice voicemail notification's "http://voice.google.com/
   calls?a=nc,%2B..." repeated across several lines — forces this box,
   and everything containing it, wider before any wrapping is even
   considered). overflow-wrap: anywhere is the property actually
   defined to affect that calculation, which word-break: break-word's
   real-world implementations don't reliably do — this is the fix the
   earlier .fi-inbox-message-from/-subject-only pass missed, since
   those already used overflow-wrap: anywhere directly and this, the
   actual message CONTENT, is a separate element that didn't. */
/* margin-top here (not relying on .fi-inbox-message-subject-row's own
   margin-bottom above) is deliberate — confirmed against the CSS spec,
   not assumed: .fi-inbox-message-header is display: flow-root
   specifically so its own background/border-radius extends around
   every one of its children (see that rule's own docblock) — but that
   SAME flow-root/BFC behavior also means a child's own bottom margin
   (subject-row's 0.6rem) is INCLUDED in the header's own rendered
   height rather than escaping it as real whitespace below the blue
   band, so the band's own background visually swallows that gap
   instead of leaving it blank. This body-side margin sits genuinely
   OUTSIDE the header's own flow-root box, so it's real, visible space
   between the band and the text that follows — not more background. */
.fi-inbox-message-body {
    margin-top: 0.75rem;
    color: var(--color-gray-700);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Paragraph spacing WITHIN the body itself — a sender's message
   content, sign-off ("Kind Regards,"), and signature block are each
   their own real <p> now (see GmailApiClient::ALLOWED_HTML_TAGS —
   htmlToSafeBody() preserves real block structure rather than
   flattening everything to one run-on blob of text), but nothing
   scoped to .fi-inbox-message-body gave them any spacing of their own
   — explicit here rather than left to whatever a browser's own default
   paragraph margin happens to be, so this reads as visually distinct
   blocks regardless. Last child never carries a trailing gap the body
   wrapper's own padding/next element would otherwise double up on. */
.fi-inbox-message-body p {
    margin: 0 0 0.75rem;
}

.fi-inbox-message-body p:last-child {
    margin-bottom: 0;
}

/* Plain-text bodies (the common case) have no markup of their own —
   line breaks in the original text are the only structure there is,
   so they need preserving. HTML-derived bodies (see
   GmailApiClient::htmlToSafeBody()) carry their own explicit <br>
   tags instead; applying pre-line there too would ALSO preserve every
   stray whitespace/indentation character left over from the original
   markup, which reads as broken rather than as a paragraph break.
   This class is purely about whitespace — see .fi-inbox-message-body
   a below for link styling, which deliberately does NOT key off this
   same "-plain"/"-html" suffix (a message body can be plain-text
   AND still contain real <a> tags — see
   GmailApiClient::linkifyBracketedUrls() — so scoping link color to
   only the "-html" variant left those links completely unstyled). */
.fi-inbox-message-body-plain {
    white-space: pre-line;
}

/* Filament's own compiled CSS ships a Tailwind-Preflight-style base
   reset — a global, unscoped `a { color: inherit; text-decoration:
   inherit; }` (see public/css/filament/filament/app.css) — which
   otherwise makes a real, working <a href> render visually identical
   to its surrounding plain text. This selector's specificity (one
   class + one element) beats that bare-element rule regardless of
   load order, and is intentionally keyed off the outer
   .fi-inbox-message-body wrapper (present on every body variant)
   rather than the "-html" suffix class, since a genuinely plain-text
   body can still contain real, safe <a> tags — see the comment on
   .fi-inbox-message-body-plain above. */
.fi-inbox-message-body a {
    color: var(--primary-600);
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
}

.fi-inbox-message-body a:hover {
    color: var(--primary-700);
}

.dark .fi-inbox-message-body a {
    color: var(--primary-400);
}

.dark .fi-inbox-message-body a:hover {
    color: var(--primary-300);
}

/*
 * HTML-email overflow containment (see GmailApiClient::htmlToSafeBody()
 * — text/html is now the PREFERRED body source, rendered with real
 * markup: tables, images, colored/sized elements). Fixed-width tables
 * and inline pixel widths are routine in real marketing/transactional
 * HTML email and will overflow the message pane — which now has its
 * own bounded height/internal scroll (.fi-inbox-preview-pane
 * .fi-inbox-thread / .fi-inbox-full-pane .fi-inbox-thread / the
 * Compose modal's own .fi-inbox-compose-thread-history .fi-inbox-thread,
 * all further down/up in this file) — WITHOUT the horizontal dimension
 * also being contained, a wide table would force the pane wider than
 * its column instead. Scoped to .fi-inbox-message-body specifically
 * (never applied globally) so nothing here can affect this app's own
 * UI, only sender-supplied message content.
 *
 * The `!important`s are load-bearing, not decorative: a sender's own
 * inline `style="width: 900px"` has HIGHER specificity than any plain
 * selector-based rule (inline style always wins over an external
 * stylesheet's selector match), so only `!important` on OUR rule can
 * still cap it — confirmed against Chromium's own CSS cascade engine
 * (not assumed from source) the same way the earlier scroll/height
 * fixes to this same pane were, see this file's own history.
 */
.fi-inbox-message-body table {
    table-layout: fixed;
    max-width: 100% !important;
}

.fi-inbox-message-body img {
    max-width: 100% !important;
    height: auto;
}

/* The generic net for anything ELSE carrying an inline fixed pixel
   width — table/tr/td/th are deliberately excluded (the table rule
   above already contains the table as a whole, and max-width on
   individual table-cells has inconsistent behavior across browsers
   under table-layout: fixed's own column-width algorithm — capping
   the table itself is the correct/standard fix, not fighting its
   cells too). div/p/span/li/blockquote cover the realistic "fixed-
   width layout wrapper" case a marketing email's HTML routinely uses
   outside of a table. */
.fi-inbox-message-body div[style*="width"],
.fi-inbox-message-body p[style*="width"],
.fi-inbox-message-body span[style*="width"],
.fi-inbox-message-body li[style*="width"],
.fi-inbox-message-body blockquote[style*="width"] {
    max-width: 100% !important;
}

/* The per-message "Display images" control (see
   partials/inbox-detail.blade.php's own docblock) — a small inline
   notice directly above the (possibly image-bearing) body, matching
   the same "blocked content" banner convention other mail clients
   use. x-cloak (already loaded globally by this admin panel, same as
   every other x-cloak usage in this file) keeps it hidden for the one
   frame before Alpine initializes, rather than a flash of "images
   are hidden" text with a still-non-functional button underneath. */
.fi-inbox-message-images-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* ~5px — the notice previously touched the colored message-header
       cell's own bottom border directly above it with no gap at all
       (margin-bottom existed, margin-top never did). Also fixes Manual
       Email's identical notice for free: App\Filament\Pages\ManualInbox's
       own manual-inbox-detail.blade.php reuses this EXACT class name,
       so this one rule already applies to both — confirmed, not a
       separate Manual-side fix. */
    margin-top: 0.3125rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-gray-600);
}

.fi-inbox-message-display-images-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.375rem;
    background: #ffffff;
    color: var(--color-gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.fi-inbox-message-display-images-btn:hover {
    background: var(--color-gray-100);
}

.dark .fi-inbox-message-images-notice {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
    color: var(--color-gray-300);
}

.dark .fi-inbox-message-display-images-btn {
    background: var(--color-gray-900);
    border-color: var(--color-gray-600);
    color: var(--color-gray-200);
}

.dark .fi-inbox-message-display-images-btn:hover {
    background: var(--color-gray-700);
}

/*
 * Gmail inbox feature, Phase 6: folder sidebar plus a content area
 * (message list + preview) laid out as a CSS flex row, stacking to one
 * column on narrow screens (a fixed-height list/preview would be
 * unreadable stacked, so both switch to auto height and rely on normal
 * page scroll instead). Phase 7 makes the content area's own internal
 * arrangement one of three interchangeable modes — see
 * .fi-inbox-content-side_by_side / -stacked and .fi-inbox-full-pane
 * further down, and Inbox::$layoutMode for the PHP/view side of this.
 */
.fi-inbox-layout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    /* Keeps the preview pane from sitting flush against the browser
       window's right edge even once it's properly width-bounded —
       applies to all three $layoutMode presentations since they all
       share this same wrapper. */
    padding-right: 1.5rem;
}

/* Narrower than the original 12rem (then 9.5rem) to reclaim horizontal
   space for the list/preview panes — confirmed before narrowing
   further that this actually matters: .fi-inbox-layout is a plain flex
   row with the sidebar at flex: 0 0 auto (a FIXED width) and the list/
   preview panes at flex: 1 (see .fi-inbox-full-pane/.fi-inbox-content-*)
   — nothing else in the row claims space independently, so every rem
   trimmed here is a rem the flex:1 panes gain, not space absorbed by
   some other sibling.

   The old resize: horizontal drag handle (removed) let an admin widen/
   narrow this on their own, but plain CSS resize isn't persisted
   anywhere — every reload silently reset it back to this base width,
   which is what was reported broken. Replaced with a real collapsed/
   expanded toggle instead (Inbox::$folderSidebarCollapsed —
   persisted per-admin, see toggleFolderSidebarCollapsed()'s own
   docblock), matching the collapse-to-icon-rail pattern and transition
   this admin panel's own main navigation already uses
   (->sidebarCollapsibleOnDesktop() — see vendor/filament/filament's
   own .fi-sidebar/.fi-sidebar-open rules) rather than a parallel
   implementation. min/max-width are gone with the drag handle — width
   is now only ever one of these two fixed values. */
.fi-inbox-sidebar {
    flex: 0 0 auto;
    width: 8rem;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 150ms ease;
}

.fi-inbox-sidebar.is-collapsed {
    width: 2.75rem;
}

.fi-inbox-sidebar-collapse-ctn {
    display: flex;
    justify-content: flex-end;
    padding: 0 0.25rem 0.5rem;
}

.fi-inbox-sidebar.is-collapsed .fi-inbox-sidebar-collapse-ctn {
    justify-content: center;
}

.fi-inbox-sidebar-heading {
    padding: 0 0.5rem 0.5rem;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fi-inbox-folder-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fi-inbox-folder-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    text-align: start;
    cursor: pointer;
}

.fi-inbox-folder-item-icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: var(--color-gray-400);
}

.fi-inbox-folder-item.is-active .fi-inbox-folder-item-icon {
    color: #ffffff;
}

/* Icon-only: headings/item labels are omitted SERVER-SIDE entirely
   when collapsed (see inbox.blade.php's own @unless($folderSidebarCollapsed)
   guards around them) rather than hidden here via display: none — this
   rule just centers each row's now-lone icon instead of leaving it
   left-aligned in the now-mostly-empty row. The icon plus this
   button's own title="" attribute (a native browser tooltip) are what
   identify each row once its label is gone, the same role Filament's
   own collapsed nav items delegate to a tooltip/label. */
.fi-inbox-sidebar.is-collapsed .fi-inbox-folder-item {
    justify-content: center;
    padding-inline: 0;
}

.fi-inbox-folder-item:hover {
    background: var(--color-gray-100);
}

/* Reads var(--brand-primary) — see this file's own top-of-file "BRAND
   COLOR" block for the full why (Filament's own shade system never
   reproduces the exact configured hex at any computed shade, so this
   bypasses it entirely rather than trusting color="primary"). This
   rule predates that consolidation — it used to hardcode the literal
   hex directly, same as every other rule this file now points at the
   one shared variable instead. */
.fi-inbox-folder-item.is-active {
    background: var(--brand-primary);
    color: #ffffff;
    font-weight: 600;
}

/* The unread count beside Inbox (partials/inbox-folder-unread-count). */
.fi-inbox-folder-item-count {
    margin-inline-start: auto;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
}

.fi-inbox-folder-item.is-active .fi-inbox-folder-item-count {
    background: rgb(255 255 255 / 0.25);
    color: #ffffff;
}

.dark .fi-inbox-folder-item-count {
    background: var(--color-gray-800);
    color: var(--color-gray-200);
}

/* See .fi-inbox-folder-item.is-active's own comment just above, and
   the top-of-file "BRAND COLOR" block, for the shared reasoning — this
   is the SAME variable, applied to Filament Actions/buttons instead of
   the custom sidebar buttons that selector targets (Compose —
   App\Filament\Pages\Inbox::getHeaderActions(), Reply —
   partials/inbox-detail-header-actions.blade.php, and the Flat/
   Threaded + Layout toolbar buttons —
   partials/inbox-view-toggle.blade.php). !important is necessary here
   specifically because Filament's own button component already ships
   its own background and text-color utility classes (fi-bg-color-N
   and fi-text-color-N) at the same specificity a plain class selector
   can't outrank on source order alone. Text AND icon both forced to
   white for the same reason .fi-inbox-folder-item.is-active already
   is: this brand blue is dark enough that Filament's own default
   color="primary" text color (a DARK shade, ~900) is unreadable on
   it — confirmed by reading the actual rendered classes Filament's
   button component applies (fi-text-color-900), not assumed.

   PRIOR BUG, fixed here: this comment used to write those two class
   families joined by a bare forward slash, immediately followed by an
   asterisk from the next word — that two-character sequence is a
   comment TERMINATOR in CSS, so it closed this very comment early,
   mid-sentence. Everything from there up to this comment's own real
   ending was then unguarded, live CSS text, which made the
   .fi-inbox-brand-active selector list below invalid (that garbage
   text got prepended to it) and dropped the entire background/color
   rule, while the separate .fi-inbox-brand-active .fi-icon rule
   further down (its own, independently-terminated block) kept
   applying — a white icon with no dark-blue background behind it to
   give it contrast, which is exactly the "icon missing" symptom this
   was reported as. Confirmed by writing a small script that traces
   every comment-open/close pair in this file, not guessed — never let
   a slash and an asterisk land next to each other inside a CSS
   comment's own text, including across a line wrap; this note is
   phrased to avoid the sequence itself for exactly that reason. */
.fi-inbox-brand-active,
.fi-inbox-brand-active:hover,
.fi-inbox-brand-active:focus {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
}

.fi-inbox-brand-active .fi-icon {
    color: #ffffff !important;
}

.dark .fi-inbox-folder-item {
    color: var(--color-gray-300);
}

.dark .fi-inbox-folder-item:hover {
    background: var(--color-gray-800);
}

/*
 * Phase 7's three Inbox::$layoutMode presentations. "Side by side" and
 * "Stacked" both keep the list and preview pane simultaneously visible
 * (see inbox.blade.php) — only the flex-direction of the .fi-inbox-content
 * wrapper around them differs, so their flex-basis needs scoping to
 * which mode is active rather than being a flat, unconditional rule
 * (a 40/60 column split makes no sense once they're stacked full-width
 * instead). "List only" doesn't use either — .fi-inbox-full-pane is
 * just the plain flex-1 content slot the single list-or-detail section
 * renders into, matching Phase 2's original single-pane behavior.
 */
.fi-inbox-content-side_by_side {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.fi-inbox-content-stacked {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.fi-inbox-content-side_by_side .fi-inbox-list-pane {
    flex: 1 1 40%;
    min-width: 0;
}

.fi-inbox-content-side_by_side .fi-inbox-preview-pane {
    flex: 1 1 60%;
    min-width: 0;
}

.fi-inbox-content-stacked .fi-inbox-list-pane,
.fi-inbox-content-stacked .fi-inbox-preview-pane {
    width: 100%;
    min-width: 0;
}

.fi-inbox-full-pane {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.fi-inbox-list-scroll {
    max-height: 34rem;
    overflow: auto;
}

/* The "Loading messages…" notice inside the list (Gmail and IMAP/SMTP
   Inbox): Filament's contained empty state draws its 1px border as an
   outer ring (box-shadow), and this scroll box's overflow clipped the
   part outside its left edge, so the notice had no left border. Drawing
   the same ring just inside the edge (Tailwind's ring-inset) shows all
   four sides with the same color, thickness, radius, shadow and size. It
   is the only empty state inside the scroll box. */
.fi-inbox-list-scroll > .fi-empty-state {
    --tw-ring-inset: inset;
}

/*
 * The open conversation (.fi-inbox-thread, partials/inbox-detail) in
 * every layout mode — Side by side/Stacked (.fi-inbox-preview-pane) and
 * List only (.fi-inbox-full-pane): no height cap and no scrollbar of its
 * own. The expanded message shows at its full height and the page
 * scrolls, so the inline composer below simply follows it in the flow
 * (it can never slide under or over it). This replaces the earlier
 * 34rem cap, which gave the last message its own scrollbar.
 *
 * Composer modals keep their own bounded history panel
 * (.fi-inbox-compose-modal .fi-inbox-compose-thread-history
 * .fi-inbox-thread, further down — a more specific rule).
 */
.fi-inbox-preview-pane .fi-inbox-thread,
.fi-inbox-full-pane .fi-inbox-thread {
    max-height: none;
    overflow-y: visible;
}

/* A lead's other conversations (partials/inbox-related-threads): never
   a second, nested scroll. */
.fi-inbox-thread .fi-inbox-thread {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.fi-inbox-related-thread {
    margin: 1rem 0;
}

.fi-inbox-related-thread-heading {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-gray-500);
}

@media (max-width: 900px) {
    .fi-inbox-layout {
        flex-direction: column;
    }

    .fi-inbox-sidebar,
    .fi-inbox-sidebar.is-collapsed {
        flex: 0 0 auto;
        width: 100%;
    }

    .fi-inbox-folder-list,
    .fi-inbox-layout-toggle {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .fi-inbox-content-side_by_side {
        flex-direction: column;
    }

    .fi-inbox-content-side_by_side .fi-inbox-list-pane,
    .fi-inbox-content-side_by_side .fi-inbox-preview-pane {
        width: 100%;
    }

    .fi-inbox-list-scroll,
    .fi-inbox-preview-pane .fi-inbox-thread,
    .fi-inbox-full-pane .fi-inbox-thread {
        max-height: 20rem;
    }
}

/*
 * Gmail inbox feature: the Compose/Reply/Reply All modal's compact,
 * mail-client-style restyle (App\Filament\Pages\Inbox::messageFormSchema()
 * — scoped to .fi-inbox-compose-modal, the class every one of that
 * page's three actions adds via ->extraModalWindowAttributes(), so
 * none of this leaks into any other Filament modal elsewhere in the
 * app).
 *
 * Two real bugs were found and fixed here (both confirmed against the
 * actual rendered markup, not guessed):
 *
 * 1. The label column was narrowed by overriding
 *    .fi-fo-field-has-inline-label's grid-template-columns from
 *    Filament's own 3 columns down to 2 (4.5rem + 1fr), WITHOUT also
 *    updating .fi-fo-field-content-col's own grid-column: span 2 to
 *    match — a 2-fr-wide item couldn't fit in the 1 remaining column of
 *    a 2-column grid, so CSS Grid auto-placement pushed it onto a NEW
 *    ROW instead, which is what actually made every inline-label field
 *    render with its label and input STACKED instead of side by side.
 *    Fixed by keeping Filament's own 3-column template (just making the
 *    FIRST column narrow) and leaving .fi-fo-field-content-col's own
 *    span untouched — no column-count mismatch possible this way.
 *
 * 2. The "make the body fill remaining height" rule targeted
 *    .fi-fo-field:last-child — but EVERY field here is the sole/only
 *    child of its own individual .fi-sc-component wrapper, so
 *    :last-child matched ALL of them, not just the body — which forced
 *    display: flex onto From/To/Cc/Bcc/Subject too, one of the two
 *    causes of the stacked-label bug above (a flex container with
 *    flex-direction: column stacks its label-col/content-col children
 *    regardless of what grid-template-columns says, since display:flex
 *    simply replaces display:grid outright). Fixed by giving the body
 *    field its own explicit, unambiguous class
 *    (->extraFieldWrapperAttributes(['class' => 'fi-inbox-body-field']))
 *    instead of a positional selector.
 */
.fi-inbox-compose-modal .fi-fo-field-has-inline-label {
    grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.5rem;
}

.fi-inbox-compose-modal .fi-fo-field-has-inline-label .fi-fo-field-label-col {
    padding-top: 0.5rem;
}

/* The popup composer's window has one fixed height that always fits the
   screen (Filament caps the window at 100dvh - 2rem and scrolls the
   WINDOW past that — a fixed-height content area plus the header and
   footer used to overflow it on laptop screens, the outer scrollbar);
   the content takes whatever the header and footer leave, and the
   message editor in it fills the rest (the flex chain below). */
.fi-modal-window-ctn > .fi-modal-window.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) {
    height: min(calc(100dvh - 2rem), 54rem);
}

.fi-inbox-compose-modal .fi-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding-block: 1rem;
    /* A composer with more rows than fit (Related lead, a placeholder
       note, the conversation-history toggle) scrolls as a whole rather
       than squeezing the reply editor to nothing — see the editor's own
       min-height below. */
    overflow-y: auto;
}

/* The real vertical-rhythm control between EVERY row (From/To/Cc/Bcc/
   Subject/the toolbar row/Body) is .fi-sc-has-gap's own `gap` — the
   schema's own top-level grid container — not .fi-modal-content's
   row-gap, which does nothing here since .fi-modal-content has only
   ONE direct child (the schema itself). Switched from display: grid to
   display: flex specifically so the body field below can use a plain
   flex: 1 to fill remaining height regardless of how many siblings are
   currently visible (a hidden Cc/Bcc row — see messageFormSchema()'s
   own ->hidden() on those fields — is fully removed from a FLEX
   layout's space distribution the same way it is from a grid's; this
   is not why flex was chosen over grid, just confirms it isn't a
   regression). Safe to override display here: this schema is always a
   single column (Compose/Reply/Reply All never use multi-column
   layouts), so flex and grid behave identically for arranging children.

   :not(.fi-inbox-toolbar-row .fi-sc-has-gap) excludes the toolbar
   row's OWN nested schema (Grid::make(2) wrapping the "Use Template"
   and "Insert field" selects — see the ->extraAttributes() class on
   that Grid in messageFormSchema()). Grid::make() renders an outer div
   (carrying that class) around a SECOND, nested schema div of its own,
   which is where Filament actually puts .fi-sc-has-gap and the real
   grid-template-columns (confirmed by reading Grid::toEmbeddedHtml()
   and Schema::toHtml() directly) — this blanket selector was matching
   THAT nested div too, flattening the toolbar's intended 2-column
   side-by-side layout into a stacked flex column. This exclusion keeps
   the toolbar's own display:grid (and Filament's default 1.5rem gap)
   so its two selects stay side by side.
 */
.fi-inbox-compose-modal .fi-sc-has-gap:not(.fi-inbox-toolbar-row .fi-sc-has-gap) {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Every ancestor of the body field, up to (and including) whichever
   .fi-sc-has-gap actually contains it, needs to also participate in
   that flex chain for its flex: 1 to have any effect — :has() lets this
   apply generically at every nesting depth instead of enumerating each
   exact wrapper class by hand (fragile the same way the :last-child
   mistake above was). Requires a browser with CSS :has() support
   (all current Chrome/Firefox/Safari/Edge) — acceptable for an
   internal admin tool.

   .fi-fo-rich-editor/.fi-input-wrp-content-ctn were a REAL, confirmed
   gap in this chain — not covered here, not covered by the
   .fi-fo-rich-editor-main/-content rules further down either, since
   BOTH of those sit ONE level below this exact pair. Confirmed against
   real captured markup + computed styles (not guessed): with these two
   left out, they defaulted to display: block, flex-grow: 0, min-height:
   auto (all the RAW initial values — no rule here was reaching them at
   all), which for a flex item means its automatic minimum size is its
   own CONTENT's natural height, not 0. A short signature happened to
   fit inside the modal's own fixed height regardless, so the gap above
   "Conversation history" (and everything else below the body field)
   still LOOKED correct — but a long typed message/quoted reply grows
   these two wrappers to fit their own content, pushing the thread-
   history panel down past what actually fits, which is what a "correct
   in some modals, not others" report traces back to: it was never
   about which modal, only about how long the body's own content
   happened to be at the time. .fi-input-wrp-content-ctn is scoped
   under .fi-inbox-body-field specifically (that generic wrapper class
   is shared by every OTHER field's own input too — From/To/Subject/
   etc. — scoping here is what keeps this from also flex-ifying theirs).

   [role="group"] (the rich editor's own actual root, between
   .fi-input-wrp-content-ctn and .fi-fo-rich-editor-main — Filament
   gives it no class of its own at all, only aria-labelledby/id/role/
   x-load/x-data, confirmed against the real rendered markup) was a
   SECOND gap the fix above introduced rather than closed: once
   .fi-input-wrp-content-ctn correctly shrank to the available flex
   space, this UNCOVERED child — still display: block; flex-grow: 0;
   min-height: auto, the same broken defaults as before — no longer
   grew WITH it, so it kept its own natural content height instead.
   Worse, because [role="group"] itself is display: block (not flex),
   its own child .fi-fo-rich-editor-main's flex-grow: 1/min-height: 0
   (declared further down, correctly) went INERT — those properties
   only do anything when the PARENT is a flex container, and
   [role="group"] wasn't one. The result: the editor's real content
   (confirmed against a real signature body) overflowed the now
   properly-bounded .fi-fo-rich-editor.fi-input-wrp box entirely — and
   since that box's own overflow-y computes to visible (confirmed, not
   assumed), nothing clipped it, so it rendered outside the visible
   bordered box instead of scrolling inside it. Adding [role="group"]
   to this same chain is what actually reconnects
   .fi-fo-rich-editor-main/-content's already-correct flex/min-height
   declarations to a parent that lets them mean something. */
.fi-inbox-compose-modal .fi-sc-has-gap:has(.fi-inbox-body-field),
.fi-inbox-compose-modal .fi-inbox-composer-box,
.fi-inbox-compose-modal .fi-grid-col:has(.fi-inbox-body-field),
.fi-inbox-compose-modal .fi-sc-component:has(.fi-inbox-body-field),
.fi-inbox-compose-modal div[x-data]:has(.fi-inbox-body-field),
.fi-inbox-compose-modal .fi-inbox-body-field,
.fi-inbox-compose-modal .fi-inbox-body-field .fi-fo-field-content-col,
.fi-inbox-compose-modal .fi-inbox-body-field .fi-fo-field-content,
.fi-inbox-compose-modal .fi-inbox-body-field .fi-fo-rich-editor,
.fi-inbox-compose-modal .fi-inbox-body-field .fi-input-wrp-content-ctn,
.fi-inbox-compose-modal .fi-inbox-body-field .fi-fo-rich-editor [role="group"] {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The reply editor always keeps a usable height: every other row in the
   composer is fixed-size, and with min-height: 0 throughout the chain
   above, the rows added for personalization plus a quoted conversation
   once left it 0px tall (the history then sat on top of the toolbar). */
/* .fi-modal-content in the selector: these wrappers also match the
   div[x-data]:has(...) selector of the min-height: 0 chain, which would
   otherwise outrank this. */
.fi-inbox-compose-modal .fi-modal-content .fi-grid-col:has(.fi-inbox-body-field),
.fi-inbox-compose-modal .fi-modal-content .fi-sc-component:has(.fi-inbox-body-field) {
    min-height: 12rem;
}

.fi-inbox-compose-modal .fi-fo-rich-editor-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.fi-inbox-compose-modal .fi-fo-rich-editor-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* The thread-history panel below the body editor (see
   ComposesGmailEmail::threadHistoryPanel()) — reuses .fi-inbox-thread/
   -message/-message-header/etc. from partials/inbox-detail.blade.php
   completely unchanged, wrapped in this scrollable container so an
   arbitrarily long conversation doesn't grow the fixed-height modal
   itself (see .fi-inbox-compose-modal .fi-modal-content's own fixed
   height above). Absent entirely from the DOM (not just hidden)
   whenever threadHistoryPanel() has nothing to show, so nothing here
   needs its own ->visible()/->hidden() gate.

   The real height cap lives on .fi-inbox-thread itself below (a plain
   max-height/overflow-y — those work regardless of flex participation,
   so that rule alone is what actually bounds this panel); the
   flex-shrink: 0 here is a SEPARATE, ALSO-necessary piece confirmed
   against the real rendered DOM (not guessed from source): this
   .fi-inbox-compose-thread-history div is NOT itself the flex item —
   Filament wraps every schema row in its own .fi-grid-col >
   .fi-sc-component pair first (confirmed via
   $instance->{$schemaName}->toHtml() in a real Livewire test), and
   THAT .fi-sc-component is what .fi-inbox-compose-modal
   .fi-sc-has-gap:not(...)'s own display:flex/flex-direction:column
   above actually lays out as a flex item — flex-shrink here has zero
   effect three levels down, only on the genuine flex-item ancestor
   (targeted via :has(), the same pattern .fi-inbox-body-field's own
   ancestor-flex rules above already use) is what keeps this row from
   ever being squeezed smaller than its own capped content by a flex
   container short on space, the same way it never grows past it. */
.fi-inbox-compose-modal .fi-sc-component:has(.fi-inbox-compose-thread-history) {
    flex-shrink: 0;
}

/* margin-top alone now, no padding-top/border-top — the divider LINE
   this rule used to draw is gone entirely (see this rule's own history:
   0.5rem, then 1.25rem+0.75rem+a border once the body editor's own
   containment bug got fixed and the gap needed to read as unambiguous
   against THAT bug). With the editor now correctly bounded to its own
   flex-allocated space (see the min-height: 0 chain further up) rather
   than overflowing it, that separate divider row's own 2rem combined
   footprint (margin-top + padding-top) was more than the actual
   section break needed, AND it was space the body editor's own
   flex: 1 share never got to claim — every rem trimmed here is a rem
   the editor gains instead, since it's the only flex-grow item in this
   column. The heading directly below (uppercase, small, letter-spaced,
   muted gray — see .fi-inbox-compose-thread-history-heading) already
   reads as a clear section label on its own; a hard rule above it was
   redundant once the gap itself stopped needing to visually apologize
   for an overflow bug that no longer exists. */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history {
    margin-top: 1rem;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history-heading {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-gray-500);
    /* A toggle (collapsed by default — see threadHistoryPanel()). */
    display: inline-flex;
    gap: 0.25rem;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history-heading:hover {
    color: var(--color-gray-700);
}

/* The quoted messages stay inside their own box: nothing in them can
   widen, overlay or scroll the composer around them. */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-body {
    margin-top: 0.5rem;
    contain: layout paint;
    overflow-x: auto;
}

/* Unlike Inbox's own panes (whose conversation shows at full height),
   this panel earns its own scrollbar rather than growing past the fixed-
   height modal. This
   is the rule that actually bounds the panel's height — confirmed by
   rendering the real schema markup inside a faithful reconstruction of
   the real .fi-inbox-compose-modal .fi-modal-content wrapper and
   reading the computed max-height/overflow-y back from a real browser,
   not assumed from this source alone. */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history .fi-inbox-thread {
    max-height: 12rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* The Use Template / Insert field toolbar row (a plain 3-column Grid,
   not a .fi-fo-field — see ComposesGmailEmail::messageFormSchema()'s
   own ->extraAttributes(['class' => 'fi-inbox-toolbar-row']) on it,
   since Filament's Grid component has no default class of its own to
   target) — tightened to read as one compact strip rather than a full
   field-height row. The middle column holds either State B (four
   reminderChoiceActions() squares — no reminder set/picked yet) or
   State A (the bell + date field + Remove — see hasReminderToDisplay()'s
   own docblock for what backs each), exactly one at a time, both
   pinned to the SAME ->columnStart(2) — given a FIXED width rather than
   `auto`, which is what actually caused the two states to render
   different overall row geometry in an earlier turn: `auto` sizes the
   column to whatever currently occupies it, and State B's four
   squares vs State A's date field are NOT the same size, so the two
   flanking 1fr columns ended up different widths depending on which
   state was showing. A fixed width makes both states share the exact
   same column, and .fi-inbox-reminder-slot below centers whichever one
   is actually visible within it — confirmed against a real Livewire
   test asserting both states share the identical --col-start-lg pin
   AND rendered footprint (see ComposeReminderInlineTest's own
   test_the_reminder_slot_has_identical_column_structure_in_both_states()).

   12rem (up from an earlier 9.75rem — sized back then to fit exactly 4
   squares at their own 2.25rem width plus gaps, see
   .fi-inbox-reminder-choice below: 4 × 2.25rem + 3 × 0.2rem gaps =
   9.6rem) widens the column to fit State A's own date field without
   truncating it — reported directly against the rendered page: a
   native <input type="date"> showing "10/15/2026" rendered as
   "10/15/202" at 9.75rem, the bell prefix icon and the input's own
   native calendar-picker-indicator both eating into the already-tight
   remaining space for the digits themselves. State B's own four
   squares (9.6rem total) still fit comfortably inside the wider
   column — .fi-inbox-reminder-slot's own centering just gives them
   more surrounding space either side, not a different size. The two
   flanking columns are still equal `minmax(0, 1fr)` on both sides, so
   widening the fixed middle column narrows "Use Template"/"Insert
   field" by the same amount each — deliberately even, not one taking
   more than the other — and .fi-inbox-custom-date-calendar's own
   `left: 50%` centering (see that rule's own docblock) still lands
   correctly under column 2 either way, since that only ever depended
   on the two flanking columns staying equal to each other, never on
   the middle column's own exact width. */
/* position: relative is the anchor point .fi-inbox-custom-date-calendar
   (see that rule's own docblock, further down) positions itself
   against — confirmed via the compiled public/css/filament/filament/app.css
   that NONE of the Filament wrapper classes between the calendar and
   this row (.fi-grid-col, .fi-sc-component, .fi-grid, .fi-sc-has-gap,
   .fi-sc) set their own `position`, so this row is genuinely the
   NEAREST positioned ancestor — no unrelated wrapper hijacks the
   anchor. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row {
    position: relative;
    margin-block: 0.25rem;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-sc-has-gap {
    /* Template | Insert field | Reminder (the chosen date with its X
       needs its 11rem). */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(11rem, 1fr);
    align-items: start;
}

/* Shared by BOTH State B's own Actions::make() wrapper and State A's
   own Group — the class each one's own ->extraAttributes() adds, so
   this rule applies identically regardless of which is actually
   rendered. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-slot {
    display: flex;
    justify-content: flex-start;
}

/* State B: the four reminderChoiceActions() squares (1 week / 2 weeks
   / 1 month / a calendar icon for a custom date) — Filament's own
   .fi-ac already lays multiple actions out in a row; this just tightens
   the gap and centers the row within its fixed-width column (see
   .fi-inbox-reminder-slot above). 0.2rem (not the previous 0.25rem) is
   deliberate — see .fi-inbox-reminder-choice's own comment for the
   9.6rem minimum-width math this gap is part of. */
.fi-inbox-reminder-choices .fi-ac {
    display: flex;
    justify-content: flex-start;
    gap: 0.2rem;
}

/* Every one of the four choices — square (equal width/height), fixed
   size regardless of icon-only (Custom date) vs short-text (the three
   intervals) content, so the row reads as four uniform tiles rather
   than four differently-sized buttons. rounded-md rather than
   Filament's own default pill/circular icon-button shape is what
   actually reads as "square" here.

   All four now render through the SAME Filament base button type
   (.fi-btn — see reminderChoiceActions()'s own comment on "Custom
   date" specifically using ->hiddenLabel() instead of ->iconButton()
   for exactly this reason), which has no fixed width of its own — just
   padding — so this rule's own width/height apply cleanly to all four
   alike. An EARLIER version had "Custom date" on ->iconButton()
   instead (.fi-icon-btn, a genuinely different base view with its own
   competing width), which is what actually caused the two to render
   different sizes — confirmed via direct DevTools inspection of the
   rendered class attribute, not CSS-source reasoning (two separate
   attempts to fix this purely in CSS, including an !important
   min-width/min-height override, failed for exactly that reason: no
   CSS on a shared class can reliably reconcile two different Filament
   button types). Now that both button types are unified, an explicit
   border on this shared class (rather than each button type's own
   default) still ensures visual consistency between the plain-text and
   icon-only content.

   width/height are 2.25rem (up from an earlier 1.85rem) — matching
   Filament's own standard form-control height (--spacing * 9, the same
   value Filament's compiled CSS uses for .fi-input/.fi-select-input's
   own line-height-plus-padding — confirmed directly against
   public/css/filament/filament/app.css, not assumed) so the row reads
   the same height as "Use Template"/"Insert field" beside it, rather
   than visibly shorter. Kept SQUARE (equal width/height) per its own
   name. The column width above (see .fi-inbox-toolbar-row .fi-sc-has-gap's
   own docblock — now sized for State A's own date field, not these
   squares) only needs to be AT LEAST 4 × 2.25rem + 3 × 0.2rem gaps
   (see .fi-inbox-reminder-choices .fi-ac's own gap) = 9.6rem for these
   four to fit — comfortably true at every width the column has ever
   had.

   Separately: this stylesheet is registered with a cache-busting ?v=
   query in AdminPanelProvider that MUST be bumped on every edit here —
   several turns' worth of earlier changes to this exact rule never
   reached a browser that had already cached an earlier version under
   the same URL. */
.fi-inbox-reminder-choice {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
}

/* The inline active-reminder DatePicker + Remove link (State A — see
   messageFormSchema()'s own Group::make() for this pair) — stacked
   vertically, Remove sitting directly under the CENTER of the date
   field with as little vertical gap as still reads as two separate
   controls, rather than Filament's own default field spacing (which
   read as a large, disconnected gap between the two). Zeroing every
   wrapper's own margin/padding (rather than relying on `gap` alone) is
   what actually closes that gap — Filament's field/grid-col wrappers
   each carry their own default spacing that plain flex `gap` on the
   container doesn't touch.

   align-items: stretch (not center) is deliberate — align-items:
   center on a column flex container shrinks EVERY child, including
   the date field's own wrapper, down to its own content width, which
   is what was actually truncating the visible date ("09/07/2" instead
   of "09/07/2026"): .fi-fo-date-time-picker's own width:100% below has
   nothing full-width left to size itself against once its parent has
   already shrunk to fit. Stretching the wrapper back to the column's
   full 9rem (see .fi-inbox-toolbar-row .fi-sc-has-gap's own
   grid-template-columns) restores that. text-align: center is scoped
   ONLY to Remove's own wrapper (via :has(), not the whole container)
   so it keeps Remove's short text centered without ALSO centering the
   date input's own text, which should stay at its normal left-aligned
   default now that its wrapper is full-width again. */
.fi-inbox-active-reminder .fi-sc-has-gap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.fi-inbox-active-reminder .fi-grid-col:has(.fi-inbox-remove-reminder) {
    text-align: center;
}

.fi-inbox-active-reminder .fi-grid-col,
.fi-inbox-active-reminder .fi-sc-component,
.fi-inbox-active-reminder [data-field-wrapper] {
    margin: 0;
    padding: 0;
}

.fi-inbox-active-reminder .fi-fo-date-time-picker {
    width: 100%;
}

/* Overrides .fi-inbox-cc-bcc-toggle's own margin-inline-start (needed
   for ITS Cc/Bcc usage, sitting beside the To field — see that rule's
   own docblock) which would otherwise nudge Remove sideways off-center
   here, since align-items: center on the column above centers each
   item's own margin box, not just its content. */
.fi-inbox-active-reminder .fi-inbox-remove-reminder {
    margin-inline-start: 0;
    margin-block-start: 0.125rem;
}

/* The "Custom date" square's own expanded calendar (see
   ComposesGmailEmail::customDateCalendarHtml()) — no Filament
   DatePicker/DateTimePicker is involved (see that method's own
   docblock for why one couldn't be reused here); this hand-built grid
   provides its OWN floating positioning instead of relying on one.

   Two things this rule is fixing at once, both reported directly
   against the rendered page rather than assumed from source:

   1. WIDTH: an earlier version set width: 100%, filling its own
      ->columnStart(2) column (the SAME fixed-width column the four
      squares sit in) — far too narrow for a real 7-column day grid,
      which rendered crushed/overlapping. A real popover needs its own
      adequate width, independent of the trigger row's own narrow
      column — 16rem here, matching what a calendar-sized dropdown
      actually needs (7 day columns + gaps + padding comfortably).

   2. POSITION: an earlier version was a plain block sitting in normal
      document flow, which pushed everything below it (the rich text
      editor) down the page while open. position: absolute (anchored
      against .fi-inbox-toolbar-row's own position: relative, see that
      rule's own comment) takes it OUT of normal flow entirely — the
      grid cell it nominally still occupies (->columnStart(2) in
      messageFormSchema(), kept for auto-placement ordering reasons —
      see that Group's own PHP comment) is force-collapsed to zero
      height by the .fi-grid-col rule directly below, so nothing below
      the toolbar row ever shifts, while this still visually floats on
      top of it like a real popover. left: 50%/transform: translateX(-50%)
      centers it under the row as a whole, which — since the row's own
      grid-template-columns (minmax(0,1fr) / <fixed> / minmax(0,1fr))
      keeps the two flanking columns EQUAL to each other regardless of
      the fixed middle column's own exact width — lands it centered
      under column 2 (the squares) specifically too, without needing to
      compute that offset directly (which a dynamic 1fr column width
      makes impractical). */
.fi-inbox-custom-date-calendar {
    position: absolute;
    top: 100%;
    /* Under the Reminder menu, the row's last control. */
    right: 0;
    z-index: 20;
    width: 16rem;
    margin-block-start: 0.375rem;
    padding: 0.5rem;
    background: var(--color-white);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark .fi-inbox-custom-date-calendar {
    background: var(--gray-800);
}

/* Force-collapses the calendar's own grid cell (see
   .fi-inbox-custom-date-calendar's own docblock, point 2) so nothing
   below the toolbar row shifts while the calendar is open — its only
   child is now position: absolute (out of normal flow), but without
   this the cell could still reserve implicit grid-row space for it.
   overflow: visible is required alongside height: 0 — otherwise a
   0-height box would clip the absolutely-positioned child that
   deliberately extends beyond it. */
.fi-inbox-toolbar-row .fi-grid-col:has(.fi-inbox-custom-date-calendar) {
    height: 0;
    overflow: visible;
}

.fi-inbox-custom-date-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.fi-inbox-custom-date-calendar-header button {
    border: none;
    background: none;
    padding: 0.125rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    color: var(--primary-600);
    cursor: pointer;
}

.dark .fi-inbox-custom-date-calendar-header button {
    color: var(--primary-400);
}

.fi-inbox-custom-date-calendar-header button:disabled {
    color: var(--gray-300);
    cursor: default;
}

.fi-inbox-custom-date-calendar-weekdays,
.fi-inbox-custom-date-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.125rem;
    text-align: center;
}

.fi-inbox-custom-date-calendar-weekdays span {
    padding-block: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-500);
}

.fi-inbox-custom-date-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 9999px;
    font-size: 0.75rem;
    cursor: pointer;
}

button.fi-inbox-custom-date-calendar-day:hover {
    background: var(--primary-50);
}

.dark button.fi-inbox-custom-date-calendar-day:hover {
    background: color-mix(in srgb, var(--primary-500) 20%, transparent);
}

.fi-inbox-custom-date-calendar-day-today {
    font-weight: 700;
    color: var(--primary-600);
}

.dark .fi-inbox-custom-date-calendar-day-today {
    color: var(--primary-400);
}

.fi-inbox-custom-date-calendar-day-disabled {
    color: var(--gray-300);
    cursor: default;
}

/* Rendered via TextInput::make('to')->afterContent() — a SIBLING of
   the input's own bordered wrapper (.fi-input-wrp), not inside it (a
   prior version used ->suffix(), which renders INSIDE that border —
   confirmed the hard way this crams a clickable link inside a text
   input's own box, which is exactly the "crammed inside the border"
   look that was reported). .fi-fo-field-content-ctn (afterContent's own
   parent) is display:flex already, so this just needs to not shrink to
   the point of wrapping oddly. */
.fi-inbox-cc-bcc-toggle {
    flex-shrink: 0;
    margin-inline-start: 0.5rem;
    border: none;
    background: none;
    padding: 0;
    color: var(--primary-600);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.fi-inbox-cc-bcc-toggle:hover {
    color: var(--primary-700);
}

.dark .fi-inbox-cc-bcc-toggle {
    color: var(--primary-400);
}

/* Send/Cancel stay Filament's own default (left-aligned) footer
   actions — this is the one EXTRA action (see
   Inbox::attachmentsPlaceholderAction()) pushed to the opposite end of
   that same flex row, since Filament has no built-in "some footer
   actions left, one right" split. */

/* Filament's own stylesheet gives the top-level groups list
   (.fi-sidebar-nav-groups, row-gap: calc(var(--spacing) * 7) = 1.75rem)
   a much looser row-gap than the items list WITHIN one group
   (.fi-sidebar-group-items, row-gap: calc(var(--spacing) * 1) =
   0.25rem) — group headers end up feeling loosely separated from each
   other compared to the tight rhythm between items in the same group.
   Matching the two row-gaps makes the whole sidebar read as one
   consistent vertical rhythm instead. */
.fi-sidebar-nav-groups {
    row-gap: calc(var(--spacing) * 1);
}

/* Reminders → Remind At. The compact date ("Oct 27") is the trigger for
   the page's one small calendar (filament/pages/reminders.blade.php);
   plain text when the date can't be changed (completed / read-only). */
.fi-reminder-date-trigger {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.875rem;
    white-space: nowrap;
    color: var(--primary-600);
    cursor: pointer;
}

.fi-reminder-date-trigger:hover,
.fi-reminder-date-trigger:focus-visible {
    text-decoration: underline;
}

.dark .fi-reminder-date-trigger {
    color: var(--primary-400);
}

.fi-reminder-date-trigger-disabled,
.dark .fi-reminder-date-trigger-disabled {
    color: var(--gray-500);
    cursor: default;
    text-decoration: none;
}

/* The same calendar as the composer's custom date, anchored to the
   clicked control instead of under the composer toolbar: fixed at the
   position the page computes, above the table and its sticky header. */
.fi-inbox-custom-date-calendar.fi-reminder-calendar {
    position: fixed;
    transform: none;
    margin: 0;
    z-index: 40;
}

.fi-reminder-calendar .fi-reminder-calendar-day-selected,
.fi-reminder-calendar button.fi-reminder-calendar-day-selected:hover {
    background: var(--primary-600);
    color: var(--color-white);
}

/* ------------------------------------------------------------------
   Inbox's inline composer (Inbox::INLINE_COMPOSER_ACTIONS — Reply,
   Reply All, Forward). The same Filament action, rendered in the reading
   pane's composer slot (inbox.blade.php) and marked
   ->modalClickThrough() (no overlay, focus trap or scroll lock).

   One plain card in the page flow, right under the conversation, at its
   natural height and the conversation's full width (no indent; a 20px
   gap above it): the compact recipient line, the editor, its formatting
   bar, then Send. Nothing in it is fixed, sticky or height-capped, so
   nothing is clipped and nothing scrolls underneath it; the only inner
   scroll is a long draft's own text. (The earlier attempt pinned the
   pane to the viewport and capped the composer at 70% with its own
   scrolling — that is what squeezed and clipped the editor, split it
   from its Send footer and gave it a second scrollbar.)
   ------------------------------------------------------------------ */
.fi-inbox-composer-slot > [wire\:partial="action-modals"] {
    height: auto !important;
}

.fi-inbox-composer-slot .fi-modal:has(> .fi-modal-window-ctn > .fi-inbox-inline-composer) {
    pointer-events: auto;
}

.fi-inbox-composer-slot .fi-modal:has(> .fi-modal-window-ctn > .fi-inbox-inline-composer) > .fi-modal-window-ctn {
    position: static;
    inset: auto;
    z-index: auto;
    display: block;
    min-height: 0;
    padding: 0;
    overflow: visible;
}

.fi-modal-window.fi-inbox-inline-composer {
    width: auto;
    max-width: none;
    margin: 1.25rem 0 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--color-gray-300);
}

/* The compact header line replaces the modal's own title row here. */
.fi-modal-window.fi-inbox-inline-composer > .fi-modal-header {
    display: none;
}

.fi-modal-window.fi-inbox-inline-composer > .fi-modal-footer {
    position: static;
    padding-block: 0.25rem 0.75rem;
    border-top: 0;
}

.fi-inbox-inline-composer.fi-inbox-compose-modal .fi-modal-content {
    height: auto;
    max-height: none;
    padding-block: 0.75rem 0.25rem;
    overflow: visible;
}

/* A comfortable editor that grows with the text, then scrolls itself. */
.fi-inbox-inline-composer .fi-inbox-body-field .fi-fo-rich-editor-content {
    min-height: 12rem;
    max-height: 55vh;
    overflow-y: auto;
}

.dark .fi-modal-window.fi-inbox-inline-composer {
    box-shadow: 0 0 0 1px var(--color-gray-700);
}

/* ------------------------------------------------------------------
   Every composer (Inbox inline, Email Buyer, Reminders, Warm/Cold Leads,
   Manual Inbox): Gmail's order — a one-line header (mode, recipients,
   caret), the message, its formatting bar below it (the formatting
   controls, then Undo, Redo and the paperclip — EmailRichEditor::
   ATTACH_TOOL), Send.
   ------------------------------------------------------------------ */
.fi-inbox-compose-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.fi-inbox-compose-mode {
    position: relative;
    flex: 0 0 auto;
}

.fi-inbox-compose-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.4rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    font-weight: 500;
}

button.fi-inbox-compose-mode-btn {
    cursor: pointer;
}

button.fi-inbox-compose-mode-btn:hover,
.fi-inbox-compose-recipients:hover {
    background: var(--color-gray-100);
}

.fi-inbox-compose-mode-btn svg,
.fi-inbox-compose-recipients svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.fi-inbox-compose-mode-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    min-width: 10rem;
    margin-top: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fi-inbox-compose-mode-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-800);
    font-size: 0.8125rem;
    text-align: start;
    cursor: pointer;
}

.fi-inbox-compose-mode-option:hover {
    background: var(--color-gray-100);
}

.fi-inbox-compose-mode-option svg {
    width: 1rem;
    height: 1rem;
}

.fi-inbox-compose-recipients {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.25rem 0.4rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-900);
    font-size: 0.875rem;
    text-align: start;
    cursor: pointer;
}

.fi-inbox-compose-recipients-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-inbox-compose-header-fields {
    padding-top: 0.5rem;
}

.dark .fi-inbox-compose-summary {
    border-bottom-color: var(--color-gray-700);
}

.dark .fi-inbox-compose-mode-btn,
.dark .fi-inbox-compose-recipients {
    color: var(--color-gray-200);
}

.dark button.fi-inbox-compose-mode-btn:hover,
.dark .fi-inbox-compose-recipients:hover,
.dark .fi-inbox-compose-mode-option:hover {
    background: var(--color-gray-800);
}

.dark .fi-inbox-compose-mode-menu {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

.dark .fi-inbox-compose-mode-option {
    color: var(--color-gray-200);
}

/* The formatting bar under the message (the same Filament editor; its
   bar is only drawn after the text). */
.fi-inbox-compose-modal .fi-fo-rich-editor [role="group"] > .fi-fo-rich-editor-toolbar {
    order: 2;
    border-top: 1px solid var(--color-gray-200);
    border-bottom: 0;
}

.dark .fi-inbox-compose-modal .fi-fo-rich-editor [role="group"] > .fi-fo-rich-editor-toolbar {
    border-top-color: var(--color-gray-700);
}

/* ------------------------------------------------------------------
   The open conversation's toolbar (partials/inbox-detail-header-
   actions): one compact row on a light tint of the brokerage's own brand
   color (--brand-primary, per brokerage — BrandColor), actions on the
   left, "3 of 1,332" and Newer/Older side by side on the right. Only the
   headers are tinted; the messages and list rows stay neutral.

   --inbox-header-tint is the one tint both Inbox headers share — this
   bar and the list's header (folder name, search, view, layout, Compose,
   pagination: partials/inbox-view-toggle) — so they never drift apart.
   ------------------------------------------------------------------ */
:root {
    --inbox-header-tint: color-mix(in srgb, var(--brand-primary) 7%, #ffffff);
}

.dark {
    --inbox-header-tint: color-mix(in srgb, var(--brand-primary) 16%, var(--color-gray-900));
}

.fi-section-header:has(.fi-inbox-detail-header-actions),
.fi-section-header:has(.fi-inbox-list-controls) {
    background: var(--inbox-header-tint);
    border-start-start-radius: inherit;
    border-start-end-radius: inherit;
}

/* The open message's toolbar is exactly as tall as the list's: both keep
   Filament's own section-header padding around the same 42px
   .fi-inbox-toolbar-icon, and Filament pulls a header's after slot in by
   calc(var(--spacing) * -1) top and bottom whenever it holds a small
   .fi-btn (.fi-section-header-after-ctn:has(.fi-btn.fi-size-sm)) — always
   true of the list toolbar (List only, Compose), true of this one only
   with "Edit draft". The same offset here always, so the two rows match
   (66px at 4px spacing) in every folder and opening or closing a message
   never moves the content below. */
.fi-section-header:has(.fi-inbox-detail-header-actions) .fi-section-header-after-ctn {
    margin-block: calc(var(--spacing) * -1);
}

.fi-inbox-detail-header-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.fi-inbox-detail-toolbar-start,
.fi-inbox-action-toolbar.fi-inbox-action-toolbar-single {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

/* Each control a 42px round target with a 22px icon and 10px of real
   space to the next one. margin: 0 cancels Filament's own
   .fi-icon-btn{margin:-0.5rem}, which pulled every button 8px into its
   neighbours and made the hover circles touch. */
.fi-inbox-detail-header-actions .fi-inbox-toolbar-icon,
.fi-inbox-list-pager .fi-inbox-toolbar-icon {
    flex: 0 0 auto;
    width: 2.625rem;
    height: 2.625rem;
    margin: 0;
    border-radius: 999px;
}

.fi-inbox-detail-header-actions .fi-inbox-toolbar-icon svg,
.fi-inbox-list-pager .fi-inbox-toolbar-icon svg {
    width: 1.375rem;
    height: 1.375rem;
}

.fi-inbox-detail-header-actions .fi-inbox-toolbar-icon:hover,
.fi-inbox-list-pager .fi-inbox-toolbar-icon:hover {
    background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.fi-inbox-detail-header-actions .fi-inbox-toolbar-icon:focus-visible,
.fi-inbox-list-pager .fi-inbox-toolbar-icon:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-toolbar-divider {
    flex: 0 0 auto;
    width: 1px;
    height: 1.5rem;
    margin-inline: 0.125rem;
    background: var(--color-gray-300);
}

.dark .fi-inbox-toolbar-divider {
    background: var(--color-gray-600);
}

.fi-inbox-detail-nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.625rem;
    margin-inline-start: auto;
}

.fi-inbox-detail-position {
    margin-inline-end: 0.375rem;
    color: var(--color-gray-600);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.dark .fi-inbox-detail-position {
    color: var(--color-gray-300);
}

.fi-inbox-detail-header-actions .fi-inbox-toolbar-icon,
.fi-inbox-list-pager .fi-inbox-toolbar-icon {
    color: var(--color-gray-700);
}

.dark .fi-inbox-detail-header-actions .fi-inbox-toolbar-icon,
.dark .fi-inbox-list-pager .fi-inbox-toolbar-icon {
    color: var(--color-gray-200);
}

.fi-inbox-move {
    position: relative;
}

.fi-inbox-move-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    min-width: 12rem;
    max-height: 20rem;
    margin-top: 0.25rem;
    padding: 0.25rem;
    overflow-y: auto;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fi-inbox-move-heading {
    margin: 0;
    padding: 0.35rem 0.6rem;
    color: var(--color-gray-500);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fi-inbox-move-option {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-gray-800);
    font-size: 0.8125rem;
    text-align: start;
    cursor: pointer;
}

.fi-inbox-move-option:hover {
    background: var(--color-gray-100);
}

.dark .fi-inbox-move-menu {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

.dark .fi-inbox-move-option {
    color: var(--color-gray-200);
}

.dark .fi-inbox-move-option:hover {
    background: var(--color-gray-800);
}

/* ------------------------------------------------------------------
   Inbox list rows, Gmail's one line: participants and count | subject —
   preview | date, with clear space before the fixed, right-aligned date.
   ------------------------------------------------------------------ */
.fi-inbox-row-count {
    margin-inline-start: 0.3rem;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    font-weight: 400;
}

.fi-inbox-table .fi-inbox-subject {
    color: var(--color-gray-900);
    font-weight: 500;
}

.dark .fi-inbox-table .fi-inbox-subject {
    color: var(--color-gray-100);
}

.fi-inbox-table th.fi-inbox-date,
.fi-inbox-table td.fi-inbox-date {
    width: 10rem;
    padding-inline-start: 0.5rem;
}

@media (max-width: 40rem) {
    .fi-inbox-table th.fi-inbox-date,
    .fi-inbox-table td.fi-inbox-date {
        width: 7.5rem;
        padding-inline-start: 0.5rem;
    }
}

/* Composer modals (Email Buyer, Reminders, Warm/Cold Leads): the
   conversation now sits above the reply (ComposesGmailEmail::
   messageFormSchema()), Gmail-style, in its own bounded scroll. */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history .fi-inbox-thread {
    max-height: min(18rem, 32vh);
}

/* The Inbox list's view: two segments, the active one filled with the
   brokerage's brand color (partials/inbox-view-toggle). */
.fi-inbox-view-mode {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.5rem;
}

.fi-inbox-view-mode-option {
    padding: 0.3rem 0.7rem;
    border: 0;
    background: transparent;
    color: var(--color-gray-700);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.fi-inbox-view-mode-option + .fi-inbox-view-mode-option {
    border-inline-start: 1px solid var(--color-gray-300);
}

.fi-inbox-view-mode-option:hover {
    background: var(--color-gray-50);
}

.fi-inbox-view-mode-option.is-active {
    background: var(--brand-primary);
    color: #ffffff;
    cursor: default;
}

.dark .fi-inbox-view-mode,
.dark .fi-inbox-view-mode-option + .fi-inbox-view-mode-option {
    border-color: var(--color-gray-600);
}

.dark .fi-inbox-view-mode-option {
    color: var(--color-gray-200);
}

.dark .fi-inbox-view-mode-option:hover {
    background: var(--color-gray-800);
}

/* Gmail list row: subject — preview takes the free width and is cut with
   an ellipsis before a fixed 40px paperclip slot, reserved on every row
   (empty without a file) so the date column never moves. */
.fi-inbox-summary-line {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.fi-inbox-summary-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-inbox-attachment-slot {
    display: flex;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
}

.fi-inbox-summary-line .fi-inbox-attachment-flag {
    flex: 0 0 auto;
    margin: 0;
    vertical-align: middle;
}

.fi-inbox-summary-line .fi-inbox-attachment-flag svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ------------------------------------------------------------------
   Message avatars (partials/inbox-detail): initials on the brokerage's
   own brand color (--brand-primary — BrandColor), never a per-sender
   hue. Outgoing (from this mailbox's own address — ComposesGmailEmail::
   mailboxOwnAddresses()): the full color. Incoming: a light tint with
   a fine ring. Outgoing initials are white, exactly like the text of
   the primary buttons on the same color; incoming ones a dark shade of
   the brand color on the tint (CSS relative colors; a browser without
   them keeps the plain fallback declared just before).
   ------------------------------------------------------------------ */
.fi-inbox-avatar.is-outgoing {
    background: var(--brand-primary);
    /* The same text color as the brokerage's primary buttons
       (.fi-btn.fi-color-primary: always white on --brand-primary). */
    color: #ffffff;
}

.fi-inbox-avatar.is-incoming {
    /* The brokerage's own 7% tint, the one the Inbox headers use. */
    background: var(--inbox-header-tint);
    color: var(--color-gray-800);
    color: oklch(from var(--brand-primary) min(l, 0.4) c h);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 24%, #ffffff);
}

.dark .fi-inbox-avatar.is-incoming {
    color: var(--color-gray-100);
    color: oklch(from var(--brand-primary) max(l, 0.88) min(c, 0.06) h);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 40%, var(--color-gray-900));
}

/* ------------------------------------------------------------------
   Composer modals' conversation history, compact (ComposesGmailEmail::
   threadHistoryPanel()): the heading and one collapsed row for the
   newest message; "Show all" opens every message inside ONE bounded
   scroll (the body itself — the conversations inside it no longer
   carry their own caps), opened at the newest. Short enough by default
   that the composer fits without the modal's own scrollbar at normal
   desktop sizes; that outer scroll stays for small screens.
   ------------------------------------------------------------------ */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-body,
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview {
    max-height: min(16rem, 30vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview {
    margin-top: 0.25rem;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history-body .fi-inbox-thread,
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview .fi-inbox-thread {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview .fi-inbox-message-summary {
    padding-block: 0.5rem;
}

/* One message: the heading is a label, not a toggle. */
.fi-inbox-compose-modal p.fi-inbox-compose-thread-history-heading {
    margin: 0;
    cursor: default;
}

.fi-inbox-compose-modal p.fi-inbox-compose-thread-history-heading:hover {
    color: var(--color-gray-500);
}

/* No conversation yet: one quiet line where the history would be. */
.fi-inbox-compose-modal .fi-inbox-compose-history-empty {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-gray-500);
}

/* The reminder date with its small X right beside it (ComposesGmailEmail::
   removeActiveReminderLink()), instead of a text link underneath. */
.fi-inbox-active-reminder .fi-sc-has-gap {
    flex-direction: row;
    /* stretch, never center: centering shrank the date field to its
       content and truncated the date (ComposeReminderInlineTest). */
    align-items: stretch;
    gap: 0.25rem;
}

.fi-inbox-active-reminder .fi-grid-col:has(.fi-fo-date-time-picker) {
    flex: 1 1 auto;
    min-width: 0;
}

.fi-inbox-active-reminder .fi-grid-col:has(.fi-inbox-remove-reminder) {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.fi-inbox-active-reminder .fi-inbox-remove-reminder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-active-reminder .fi-inbox-remove-reminder:hover {
    color: var(--color-gray-800);
    background: var(--color-gray-100);
}

.fi-inbox-active-reminder .fi-inbox-remove-reminder:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-active-reminder .fi-inbox-remove-reminder svg {
    width: 1rem;
    height: 1rem;
}

.dark .fi-inbox-active-reminder .fi-inbox-remove-reminder:hover {
    color: var(--color-gray-100);
    background: var(--color-gray-800);
}

/* ------------------------------------------------------------------
   Compact composer — every composer (Inbox Compose and Reply, Email
   Buyer, Reminders, Warm/Cold Leads, Manual Inbox; ComposesGmailEmail::
   messageFormSchema() / ComposesManualEmail::manualMessageFormSchema()):
   ONE box (.fi-inbox-composer-box) holding the From/To/Cc/Bcc/Subject
   rows, the Template / Insert field / Reminder row and the message with
   its formatting bar. Rows are tight and left-aligned, divided by thin
   lines rather than gaps; the fields inside drop their own borders.
   ------------------------------------------------------------------ */
.fi-inbox-compose-modal .fi-inbox-composer-box {
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: var(--color-white);
}

.dark .fi-inbox-compose-modal .fi-inbox-composer-box {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

/* The inline reply's card is already the box. Its rows' lines reach the
   card's edges, as they reach the popup box's border: the box spans the
   content's side padding (Filament's .fi-modal-content, 1.5rem) and its
   rows add that padding back, so nothing inside moves. Its bottom line
   closes the formatting bar, as the popup box's own border does. */
.fi-inbox-inline-composer .fi-inbox-composer-box {
    --fi-inline-composer-bleed: calc(var(--spacing) * 6);
    margin-inline: calc(-1 * var(--fi-inline-composer-bleed));
    border: 0;
    border-bottom: 1px solid var(--color-gray-200);
    border-radius: 0;
    background: transparent;
}

.dark .fi-inbox-inline-composer .fi-inbox-composer-box {
    border-bottom-color: var(--color-gray-700);
    background: transparent;
}

.fi-inbox-compose-modal.fi-inbox-inline-composer .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field,
.fi-inbox-compose-modal.fi-inbox-inline-composer .fi-inbox-composer-box .fi-inbox-toolbar-row,
.fi-inbox-compose-modal.fi-inbox-inline-composer .fi-inbox-composer-box .fi-inbox-body-field .fi-fo-rich-editor-content {
    padding-inline: calc(0.75rem + var(--fi-inline-composer-bleed));
}

.fi-inbox-compose-modal.fi-inbox-inline-composer .fi-inbox-composer-box .fi-fo-rich-editor-toolbar {
    padding-inline: calc(0.5rem + var(--fi-inline-composer-bleed));
}

/* No gaps between the rows inside the box (the toolbar row keeps its
   own grid gap). */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-sc-has-gap:not(.fi-inbox-toolbar-row .fi-sc-has-gap) {
    gap: 0;
}

.fi-inbox-composer-box .fi-inbox-compose-summary {
    padding: 0.375rem 0.75rem;
}

.fi-inbox-composer-box .fi-inbox-compose-header-fields {
    padding-top: 0;
}

/* From / To / Cc / Bcc / Subject: one tight row each, a thin line under. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field {
    padding-inline: 0.75rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.dark .fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field {
    border-bottom-color: var(--color-gray-700);
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field-label-col {
    padding-top: 0;
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field-label-content {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-500);
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-input-wrp,
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-input-wrp:focus-within,
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-body-field .fi-input-wrp,
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-body-field .fi-input-wrp:focus-within {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-input {
    padding-block: 0.375rem;
    padding-inline: 0;
}

/* A field's error still shows under its row. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field-wrp-error-message,
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field-content-col > p {
    margin-block-end: 0.25rem;
}

/* Cc and Bcc folded away by the To row's disclosure: hidden only —
   their recipients stay in the message (ManagesEmailDrafts::
   composeCcBccFieldAttributes()). */
.fi-inbox-compose-modal .fi-inbox-compose-cc-bcc.is-collapsed {
    display: none;
}

/* The To row's up/down disclosure for Cc and Bcc
   (ManagesEmailDrafts::composeCcBccToggle()). */
.fi-inbox-cc-bcc-disclosure {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-inline-start: 0.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--color-gray-500);
    cursor: pointer;
}

.fi-inbox-cc-bcc-disclosure:hover {
    color: var(--color-gray-800);
    background: var(--color-gray-100);
}

.fi-inbox-cc-bcc-disclosure:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.fi-inbox-cc-bcc-disclosure svg {
    width: 1rem;
    height: 1rem;
}

/* Folded with recipients in them: a small brand-colored dot. */
.fi-inbox-cc-bcc-disclosure.is-filled::after {
    content: "";
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--brand-primary);
}

.dark .fi-inbox-cc-bcc-disclosure:hover {
    color: var(--color-gray-100);
    background: var(--color-gray-800);
}

/* Template | Insert field | Reminder: one row inside the box, under
   Subject, a thin line under it. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-toolbar-row {
    margin-block: 0;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.dark .fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-toolbar-row {
    border-bottom-color: var(--color-gray-700);
}

/* The message and its formatting bar fill the rest of the box. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-body-field .fi-fo-rich-editor-content {
    padding-inline: 0.75rem;
}

/* Narrow screens: Template and Insert field share a row, Reminder
   takes the next; nothing overlaps or clips. */
@media (max-width: 40rem) {
    .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-sc-has-gap {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-compose-header-fields .fi-fo-field-has-inline-label {
        grid-template-columns: 3.75rem minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------
   Final composer layout (the approved "Compact Modern Email Composer"):
   inside the one box — From / To / Subject rows; Choose Template ·
   Insert Field · Reminder as plain text menus with chevrons; the
   message; then the formatting bar (Undo Redo | B I U S A | lists |
   alignment | link paperclip) as quiet icons with thin dividers.
   ------------------------------------------------------------------ */

/* Template, Insert field and Reminder sit side by side from the left,
   each column exactly as wide as its own control (Reminder's too — no
   reserved width between it and Insert Field); the rest of the row is
   an empty last column. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-sc-has-gap {
    grid-template-columns: max-content max-content max-content minmax(0, 1fr);
    column-gap: 0.5rem;
    row-gap: 0;
    align-items: center;
}

/* Choose Template and Insert Field: Filament's non-native selects
   (->native(false), .fi-compose-menu-select), so their open menus are
   drawn the same in every browser. Closed, each is plain 600-weight text
   with a chevron, like Reminder beside them. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-toolbar-row .fi-input-wrp,
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-toolbar-row .fi-input-wrp:focus-within {
    border-radius: 0.375rem;
    background: transparent;
    box-shadow: none;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-btn {
    max-width: 15rem;
    min-height: 2.25rem;
    padding-block: 0.375rem;
    padding-inline: 0 1.75rem;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5rem;
    color: var(--color-gray-900);
    background-position: right 0.25rem center;
    cursor: pointer;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-btn {
    color: var(--color-gray-100);
}

/* "Choose Template" / "Insert Field" read as labels, not greyed out. (A
   long chosen name ends in "…": ->wrapOptionLabels(false), Filament's own.) */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-placeholder {
    color: inherit;
}

/* Open: Filament's dropdown panel, list and rounded inset highlights, as
   Reminder's. One line per option (->wrapOptionLabels(false)); the menu is
   as wide as its longest option (content-sized: Insert Field stays at
   Reminder's 14rem, a long template name widens it), never narrower than
   the control. It stays inside the 56rem composer modal and the screen
   (Filament's shift() keeps it in view); only a name longer than that
   ends in "…" (its full text stays in the option for screen readers).
   Above the message; items in Reminder's text color. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-dropdown-panel {
    z-index: 30;
    width: max-content !important;
    min-width: max(14rem, 100%);
    max-width: min(48rem, calc(100vw - 4rem)) !important;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option {
    color: var(--color-gray-700);
}

.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option {
    color: var(--color-gray-200);
}

/* Filament marks the option it focuses when a menu opens (the chosen one,
   else the first) with .fi-selected — not a choice, so no background. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option.fi-selected {
    background-color: transparent;
}

/* Hovered, keyboard-focused and chosen (aria-selected) options, and
   Reminder's hovered/focused choices: a faint brand-blue tint instead of
   Filament's gray (7%; 16% on the dark panel). Keyboard focus adds a thin
   inset ring; the chosen option is semibold. Only these three menus. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled):hover,
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled):focus-visible,
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled)[aria-selected="true"],
.fi-inbox-compose-modal .fi-inbox-reminder-choices .fi-inbox-reminder-option.fi-dropdown-list-item:not(.fi-disabled):not([disabled]):hover,
.fi-inbox-compose-modal .fi-inbox-reminder-choices .fi-inbox-reminder-option.fi-dropdown-list-item:not(.fi-disabled):not([disabled]):focus-visible {
    background-color: color-mix(in srgb, var(--brand-primary) 7%, transparent);
}

.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled):hover,
.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled):focus-visible,
.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:not(.fi-disabled)[aria-selected="true"],
.dark .fi-inbox-compose-modal .fi-inbox-reminder-choices .fi-inbox-reminder-option.fi-dropdown-list-item:not(.fi-disabled):not([disabled]):hover,
.dark .fi-inbox-compose-modal .fi-inbox-reminder-choices .fi-inbox-reminder-option.fi-dropdown-list-item:not(.fi-disabled):not([disabled]):focus-visible {
    background-color: color-mix(in srgb, var(--brand-primary) 16%, transparent);
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 45%, transparent);
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-compose-menu-select .fi-select-input-option[aria-selected="true"] {
    font-weight: 600;
}

/* Reminder right after Insert Field (the menu, or the chosen date with
   its X): no divider, the same spacing as between the other two. Always
   a left-aligned row — the menu's wrapper is Filament's .fi-sc-actions,
   a COLUMN flexbox, where align-items: center alone would center the
   menu across its column instead. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-slot {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

/* Reminder: a calendar, the word, a chevron — no button box. */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn {
    gap: 0.375rem;
    padding: 0.375rem 0.25rem;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn::before {
    content: "";
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn .fi-icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-gray-500);
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn:hover {
    background: var(--color-gray-100) !important;
}

.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn {
    color: var(--color-gray-100);
}

.dark .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-reminder-menu.fi-btn:hover {
    background: var(--color-gray-800) !important;
}

/* Its menu opens under it, wide enough for every choice. */
.fi-inbox-compose-modal .fi-inbox-reminder-choices .fi-dropdown-panel {
    min-width: 11rem;
}

/* The chosen date's X: an 18px icon, centered on the date. */
.fi-inbox-active-reminder .fi-inbox-remove-reminder svg,
.fi-inbox-active-reminder .fi-inbox-remove-reminder .fi-icon {
    width: 1.125rem;
    height: 1.125rem;
}

/* "Choose date"'s calendar opens right under Reminder (its own grid
   cell, in Reminder's column, anchors it). */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-grid-col:has(.fi-inbox-custom-date-calendar) {
    position: relative;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-custom-date-calendar {
    top: 0;
    right: auto;
    left: 0;
}

/* Below Filament's lg breakpoint its column pins don't apply: keep the
   calendar's cell in Reminder's column there too. */
@media (min-width: 40.0625rem) {
    .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-grid-col:has(.fi-inbox-custom-date-calendar) {
        grid-column-start: 3;
    }
}

/* The formatting bar: quiet icons, thin dividers between groups. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-fo-rich-editor-toolbar {
    align-items: center;
    column-gap: 0;
    padding-block: 0.25rem;
    padding-inline: 0.5rem;
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-fo-rich-editor-toolbar-group {
    align-items: center;
    column-gap: 0.125rem;
    padding-inline: 0.375rem;
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-fo-rich-editor-toolbar-group + .fi-fo-rich-editor-toolbar-group {
    border-inline-start: 1px solid var(--color-gray-200);
}

.dark .fi-inbox-compose-modal .fi-inbox-composer-box .fi-fo-rich-editor-toolbar-group + .fi-fo-rich-editor-toolbar-group {
    border-inline-start-color: var(--color-gray-700);
}

.fi-inbox-compose-modal .fi-inbox-composer-box .fi-fo-rich-editor-tool {
    height: 2rem;
    min-width: 2rem;
    border-radius: 0.375rem;
}

/* The message fills the box; the history and draft line stay outside. */
.fi-inbox-compose-modal .fi-inbox-composer-box .fi-inbox-body-field .fi-fo-rich-editor-content {
    padding-block: 0.75rem;
}

/* The draft status under the box, on the right (Send and Cancel stay on
   the left of the footer). */
.fi-inbox-compose-modal .fi-email-draft-status {
    justify-content: flex-end;
}

.fi-inbox-compose-modal .fi-email-draft-discard {
    margin-left: 0;
}

/* The attachment input is only ever opened by the paperclip — never the
   browser's own "Choose Files / No file chosen" control. */
[data-compose-attachments] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Narrow screens: Template and Insert field share a row, Reminder
   takes the next; nothing overlaps or clips. */
@media (max-width: 40rem) {
    .fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-sc-has-gap {
        grid-template-columns: max-content minmax(0, 1fr);
        row-gap: 0.25rem;
    }

}

/* ------------------------------------------------------------------
   Text color (App\Filament\Support\EmailTextColorTool) — every editor
   that uses EmailRichEditor: the "A" shows the current color under it;
   the panel opens at the control (above it when there is no room
   below) with swatches, Default and a custom HEX.
   ------------------------------------------------------------------ */
.fi-email-color {
    position: relative;
    display: inline-flex;
}

.fi-email-color-trigger {
    gap: 0.125rem;
    padding-inline: 0.25rem;
}

.fi-email-color-trigger > .fi-icon,
.fi-email-color-trigger > svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--color-gray-500);
}

.fi-email-color-glyph {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
}

.fi-email-color-bar {
    display: block;
    width: 1rem;
    height: 0.1875rem;
    margin-top: 0.125rem;
    border-radius: 1px;
    background: var(--fi-email-color-current, currentColor);
}

.fi-email-color-panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 30;
    width: max-content;
    padding: 0.625rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.5rem;
    background: var(--color-white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    pointer-events: auto;
}

.fi-email-color-panel.is-up {
    top: auto;
    bottom: calc(100% + 0.25rem);
}

.fi-email-color-grid {
    display: grid;
    grid-template-columns: repeat(7, 1.5rem);
    gap: 0.375rem;
}

.fi-email-color-swatch,
.fi-email-color-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
}

.fi-email-color-swatch {
    border: 0;
    background: var(--swatch);
    color: #ffffff;
}

.fi-email-color-swatch svg,
.fi-email-color-swatch .fi-icon {
    width: 0.875rem;
    height: 0.875rem;
    visibility: hidden;
}

.fi-email-color-swatch[aria-checked="true"] svg,
.fi-email-color-swatch[aria-checked="true"] .fi-icon {
    visibility: visible;
}

.fi-email-color-default {
    border: 1px solid var(--color-gray-300);
    background: var(--color-white);
    color: var(--color-gray-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.fi-email-color-swatch[aria-checked="true"],
.fi-email-color-default[aria-checked="true"] {
    box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-gray-500);
}

.fi-email-color-swatch:focus-visible,
.fi-email-color-default:focus-visible,
.fi-email-color-hex:focus-visible,
.fi-email-color-apply:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.fi-email-color-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--color-gray-200);
}

.fi-email-color-custom-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-gray-500);
}

.fi-email-color-preview {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.25rem;
}

.fi-email-color-hex {
    width: 5.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 0.375rem;
    background: var(--color-white);
    color: var(--color-gray-900);
    font-size: 0.8125rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.fi-email-color-hex[aria-invalid="true"] {
    border-color: var(--color-danger-500);
}

.fi-email-color-apply {
    padding: 0.25rem 0.625rem;
    border: 0;
    border-radius: 0.375rem;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.fi-email-color-apply:hover {
    background: var(--brand-primary-hover);
}

.fi-email-color-error {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-danger-600);
}

.dark .fi-email-color-panel {
    border-color: var(--color-gray-700);
    background: var(--color-gray-900);
}

.dark .fi-email-color-default {
    border-color: var(--color-gray-600);
    background: var(--color-gray-800);
    color: var(--color-gray-200);
}

.dark .fi-email-color-swatch[aria-checked="true"],
.dark .fi-email-color-default[aria-checked="true"] {
    box-shadow: 0 0 0 2px var(--color-gray-900), 0 0 0 4px var(--color-gray-300);
}

.dark .fi-email-color-custom {
    border-top-color: var(--color-gray-700);
}

.dark .fi-email-color-hex {
    border-color: var(--color-gray-600);
    background: var(--color-gray-800);
    color: var(--color-gray-100);
}

.dark .fi-email-color-error {
    color: var(--color-danger-400);
}

/* ------------------------------------------------------------------
   The chosen reminder date — every composer, Gmail and IMAP/SMTP alike
   (ManagesEmailDrafts::reminderDateField()): bell, date, the date
   field's calendar icon and the X in one compact row, no box, the date
   in the same type as Choose Template / Insert Field / Reminder.
   ------------------------------------------------------------------ */
.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-active-reminder .fi-sc-has-gap {
    flex-direction: row;
    align-items: center;
    gap: 0.125rem;
}

.fi-inbox-compose-modal .fi-inbox-toolbar-row .fi-inbox-active-reminder .fi-grid-col:has(.fi-fo-date-time-picker) {
    flex: 0 0 auto;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input-wrp,
.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input-wrp:focus-within {
    border-radius: 0.375rem;
    background: transparent;
    box-shadow: none;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input-wrp-prefix {
    padding-inline: 0.25rem 0.125rem;
    border: 0;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input-wrp-prefix .fi-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-gray-700);
}

/* As wide as a whole date (mm/dd/yyyy) and its calendar icon — the
   icon right after the date, no empty space between them. */
.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input {
    width: 7.5rem;
    min-width: 0;
    padding-block: 0.375rem;
    padding-inline: 0.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-900);
    cursor: pointer;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input::-webkit-calendar-picker-indicator {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0 0 0 0.25rem;
    padding: 0;
    cursor: pointer;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
    border-radius: 0.25rem;
}

.dark .fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input {
    color: var(--color-gray-100);
    color-scheme: dark;
}

.dark .fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-reminder-date .fi-input-wrp-prefix .fi-icon {
    color: var(--color-gray-300);
}

/* The X: a 24px icon (up from 18px), centered in a 32px target right
   after the calendar icon — the same
   for the Gmail button and the IMAP/SMTP Filament icon button. */
.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-remove-reminder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
}

.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-remove-reminder svg,
.fi-inbox-compose-modal .fi-inbox-active-reminder .fi-inbox-remove-reminder .fi-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* ------------------------------------------------------------------
   Inbox inline Reply / Reply All / Forward: the full width of the
   reading pane, aligned with the messages above it (every wrapper from
   the composer slot down to the card stretches; nothing centers it).
   ------------------------------------------------------------------ */
.fi-inbox-composer-slot,
.fi-inbox-composer-slot > [wire\:partial="action-modals"],
.fi-inbox-composer-slot .fi-modal:has(> .fi-modal-window-ctn > .fi-inbox-inline-composer),
.fi-inbox-composer-slot .fi-modal:has(> .fi-modal-window-ctn > .fi-inbox-inline-composer) > .fi-modal-window-ctn {
    width: 100%;
    max-width: none;
    align-self: stretch;
}

.fi-inbox-composer-slot .fi-modal > .fi-modal-window-ctn > .fi-modal-window.fi-inbox-inline-composer {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    justify-self: stretch;
}

/* ------------------------------------------------------------------
   Popup composers' heights (Reminders, Email Buyer, Email Contact,
   Warm/Cold Leads, Inbox Compose, IMAP/SMTP): the conversation history
   takes its natural height — collapsed, just the latest message's row —
   and at most about two collapsed rows (10.5rem) once "Show all" opens
   it, the one scroll in it (a scrollbar only when it is needed; the
   composer shifts by about a row). The composer box never shrinks
   below its own rows plus a usable editor (the editor scrolls inside
   itself); only when even that cannot fit (a small screen) does the
   modal's content scroll, without clipping anything.

   The overflow these replace: history could grow to min(16rem, 30vh)
   and the box's flex chain was min-height: 0 throughout, so on a laptop
   screen the box shrank below its fixed rows (From/To/Subject, the
   utility row, the formatting bar) plus the editor's 12rem floor — its
   rows spilled past its border and the modal content scrolled.
   ------------------------------------------------------------------ */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-body,
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview {
    height: auto;
    max-height: 10.5rem;
    overflow-y: auto;
}

/* Expanded messages inside it grow the one scroll, never their own. */
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-body .fi-inbox-message-body,
.fi-inbox-compose-modal .fi-inbox-compose-thread-history-preview .fi-inbox-message-body {
    max-height: none;
    overflow: visible;
    overflow-wrap: anywhere;
}

/* The box: its rows (~12.5rem) plus a 7rem editor; more while Cc and
   Bcc are shown. The wrappers around it keep the same floor. */
.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) {
    --fi-composer-min: 20.5rem;
}

.fi-inbox-compose-modal:not(.fi-inbox-inline-composer):has(.fi-inbox-compose-cc-bcc:not(.is-collapsed)) {
    --fi-composer-min: 25.5rem;
}

.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) .fi-modal-content .fi-grid-col:has(> .fi-sc-component > .fi-inbox-composer-box),
.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) .fi-modal-content .fi-sc-component:has(> .fi-inbox-composer-box),
.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) .fi-modal-content .fi-inbox-composer-box {
    min-height: var(--fi-composer-min);
}

.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) .fi-modal-content .fi-inbox-composer-box .fi-grid-col:has(.fi-inbox-body-field),
.fi-inbox-compose-modal:not(.fi-inbox-inline-composer) .fi-modal-content .fi-inbox-composer-box .fi-sc-component:has(.fi-inbox-body-field) {
    min-height: 7rem;
}

/*
 * Inbox / Manual Inbox: the page's own scrollbar takes its space whether
 * or not the page is taller than the window. The list's loading state is
 * shorter than its loaded rows, so on windows where the loaded page just
 * overflows, the scrollbar appeared and vanished as pages loaded and the
 * whole interface moved sideways by its width. Scrolling is unchanged;
 * overlay scrollbars (phones, macOS default) take no space either way.
 */
html:has(.fi-inbox) {
    scrollbar-gutter: stable;
}

/* ------------------------------------------------------------------
   Font / Size / Spacing dropdowns (App\Filament\Support\
   EmailFormatDropdownTool, EmailFormattingPlugin) — every email editor
   built by EmailRichEditor::make(). Filament's own dropdown-tool look;
   the trigger shows the value at the cursor, kept narrow so the bar
   stays compact, and each menu entry previews its own font or size.
   ------------------------------------------------------------------ */
.fi-email-format-trigger {
    font-weight: 500;
    font-size: 0.8125rem;
}

.fi-email-format-value {
    display: inline-block;
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fi-email-format .fi-fo-rich-editor-dropdown-tool-menu {
    max-height: 20rem;
    overflow-y: auto;
}

.fi-email-format .fi-fo-rich-editor-dropdown-tool-option {
    height: auto;
    min-height: 2rem;
}

/*
 * ===== Release B dashboards (Admin & Client) =====
 * Shared by the Portfolio, Needs Attention and Analytics Summary
 * sections (resources/views/filament/widgets/dashboard). Plain CSS
 * here because app Blade views aren't compiled by Tailwind.
 *
 * Series colors (validated for CVD separation in light and dark):
 * Connected blue, TXT aqua, Manual violet, Awaiting amber (status),
 * Other slate. Every colored mark sits beside a text label + count,
 * so identity is never color alone.
 */
.dbx-dash {
    container-type: inline-size;
    --dash-border: #e5e7eb;
    --dash-surface: #ffffff;
    --dash-muted-surface: #f9fafb;
    --dash-text: #111827;
    --dash-text-2: #4b5563;
    --dash-text-3: #6b7280;
    --dash-track: #eef0f3;
    --dash-gap-ring: #ffffff;
    --series-connected: #2a78d6;
    --series-txt: #1baf7a;
    --series-manual: #6250d6;
    --series-awaiting: #eda100;
    --series-other: #94a3b8;
    --tone-warning-bg: #fffbeb;
    --tone-warning-border: #fcd34d;
    --tone-warning-text: #92400e;
    --tone-danger-text: #b91c1c;
    --tone-success-text: #047857;
}

.dark .dbx-dash {
    --dash-border: rgba(255, 255, 255, .1);
    --dash-surface: rgba(255, 255, 255, .03);
    --dash-muted-surface: rgba(255, 255, 255, .02);
    --dash-text: #f3f4f6;
    --dash-text-2: #d1d5db;
    --dash-text-3: #9ca3af;
    --dash-track: rgba(255, 255, 255, .08);
    --dash-gap-ring: #18181b;
    --series-connected: #3987e5;
    --series-txt: #199e70;
    --series-manual: #9085e9;
    --series-awaiting: #c98500;
    --series-other: #64748b;
    --tone-warning-bg: rgba(245, 158, 11, .08);
    --tone-warning-border: rgba(217, 119, 6, .45);
    --tone-warning-text: #fcd34d;
    --tone-danger-text: #fca5a5;
    --tone-success-text: #6ee7b7;
}

.dbx-dash a {
    color: inherit;
    text-decoration: none;
}

.dbx-dash-num {
    font-variant-numeric: tabular-nums;
}

/* --- KPI cards --- */
.dbx-dash-kpis {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

@container (min-width: 560px) {
    .dbx-dash-kpis.dbx-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dbx-dash-kpis.dbx-cols-2,
    .dbx-dash-kpis.dbx-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 900px) {
    .dbx-dash-kpis.dbx-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dbx-dash-kpi {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
    padding: 1rem 1.125rem;
    border: 1px solid var(--dash-border);
    border-radius: .75rem;
    background: var(--dash-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

a.dbx-dash-kpi:hover,
a.dbx-dash-attn-card:hover {
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--dash-border));
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

a.dbx-dash-kpi:focus-visible,
a.dbx-dash-attn-card:focus-visible,
a.dbx-dash-legend-item:focus-visible,
a.dbx-dash-chip:focus-visible,
a.dbx-dash-alert:focus-visible,
a.dbx-dash-link:focus-visible {
    outline: 2px solid var(--primary-500, #3b82f6);
    outline-offset: 2px;
}

.dbx-dash-kpi-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--dash-text-2);
}

.dbx-dash-kpi-label .fi-icon {
    width: 1rem;
    height: 1rem;
    color: var(--dash-text-3);
}

.dbx-dash-kpi-value {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 650;
    letter-spacing: -.01em;
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-kpi-meta {
    font-size: .8125rem;
    color: var(--dash-text-3);
}

/* --- Awaiting verification alert --- */
.dbx-dash-alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--tone-warning-border);
    border-radius: .75rem;
    background: var(--tone-warning-bg);
    color: var(--tone-warning-text);
    font-size: .875rem;
}

.dbx-dash-alert .fi-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.dbx-dash-alert strong {
    font-variant-numeric: tabular-nums;
}

.dbx-dash-alert-action {
    margin-left: auto;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Segmented bar + legend --- */
.dbx-dash-breakdown {
    margin-top: 1.25rem;
}

.dbx-dash-breakdown-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    margin-bottom: .5rem;
}

.dbx-dash-subheading {
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--dash-text);
}

.dbx-dash-caption {
    font-size: .8125rem;
    color: var(--dash-text-3);
}

.dbx-dash-bar {
    display: flex;
    gap: 2px;
    height: .75rem;
    overflow: hidden;
    border-radius: 9999px;
    background: var(--dash-track);
}

.dbx-dash-bar-seg {
    min-width: 3px;
    height: 100%;
}

.dbx-dash-bar-seg:first-child { border-radius: 9999px 0 0 9999px; }
.dbx-dash-bar-seg:last-child { border-radius: 0 9999px 9999px 0; }
.dbx-dash-bar-seg:only-child { border-radius: 9999px; }

.dbx-dash-legend {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
    grid-template-columns: minmax(0, 1fr);
}

@container (min-width: 480px) {
    .dbx-dash-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 900px) {
    .dbx-dash-legend { grid-template-columns: repeat(var(--legend-cols, 4), minmax(0, 1fr)); }
}

.dbx-dash-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    padding: .5rem .625rem;
    border: 1px solid var(--dash-border);
    border-radius: .5rem;
    background: var(--dash-muted-surface);
    font-size: .8125rem;
    color: var(--dash-text-2);
}

a.dbx-dash-legend-item:hover {
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--dash-border));
}

.dbx-dash-legend-item.is-attention {
    border-color: var(--tone-warning-border);
    background: var(--tone-warning-bg);
}

.dbx-dash-swatch {
    flex-shrink: 0;
    width: .625rem;
    height: .625rem;
    border-radius: .1875rem;
}

.dbx-dash-legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dbx-dash-legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-legend-pct {
    min-width: 2.75rem;
    text-align: right;
    color: var(--dash-text-3);
    font-variant-numeric: tabular-nums;
}

.dbx-swatch-connected { background: var(--series-connected); }
.dbx-swatch-txt { background: var(--series-txt); }
.dbx-swatch-manual { background: var(--series-manual); }
.dbx-swatch-awaiting { background: var(--series-awaiting); }
.dbx-swatch-other { background: var(--series-other); }

/* --- Other listing states (chips) + reconciliation --- */
.dbx-dash-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.dbx-dash-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3125rem .625rem;
    border: 1px solid var(--dash-border);
    border-radius: 9999px;
    background: var(--dash-muted-surface);
    font-size: .8125rem;
    color: var(--dash-text-2);
}

a.dbx-dash-chip:hover {
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--dash-border));
}

.dbx-dash-chip strong {
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-reconcile {
    margin: .875rem 0 0;
    font-size: .8125rem;
    color: var(--dash-text-3);
    font-variant-numeric: tabular-nums;
}

/* --- Needs Attention --- */
.dbx-dash-attn {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
}

.dbx-dash-attn-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .75rem .875rem;
    border: 1px solid var(--dash-border);
    border-radius: .75rem;
    background: var(--dash-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.dbx-dash-attn-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .625rem;
    background: var(--dash-track);
    color: var(--dash-text-3);
}

.dbx-dash-attn-icon .fi-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.dbx-dash-attn-card.is-active .dbx-dash-attn-icon {
    background: color-mix(in srgb, var(--attn-color) 14%, transparent);
    color: var(--attn-color);
}

.dbx-dash-attn-card.is-active {
    border-color: color-mix(in srgb, var(--attn-color) 35%, var(--dash-border));
}

.dbx-dash-attn-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dbx-dash-attn-value {
    font-size: 1.375rem;
    line-height: 1.75rem;
    font-weight: 650;
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-attn-card:not(.is-active) .dbx-dash-attn-value {
    color: var(--dash-text-3);
}

.dbx-dash-attn-label {
    font-size: .8125rem;
    line-height: 1.125rem;
    color: var(--dash-text-2);
}

.dbx-tone-warning { --attn-color: #d97706; }
.dbx-tone-danger { --attn-color: #dc2626; }
.dbx-tone-primary { --attn-color: var(--brand-primary); }
.dbx-tone-info { --attn-color: #0284c7; }

.dbx-dash-note {
    margin: .75rem 0 0;
    font-size: .8125rem;
    color: var(--dash-text-3);
}

.dbx-dash-link {
    font-weight: 600;
    color: var(--brand-primary) !important;
}

.dbx-dash-link:hover {
    text-decoration: underline !important;
}

/* --- Analytics Summary --- */
.dbx-dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.dbx-dash-select {
    padding: .375rem 2rem .375rem .75rem;
    border: 1px solid var(--dash-border);
    border-radius: .5rem;
    background-color: var(--dash-surface);
    color: var(--dash-text);
    font-size: .8125rem;
}

.dbx-dash-charts {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

@container (min-width: 900px) {
    .dbx-dash-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dbx-dash-chart-card.is-wide { grid-column: 1 / -1; }
}

.dbx-dash-chart-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem 1.125rem;
    border: 1px solid var(--dash-border);
    border-radius: .75rem;
    background: var(--dash-surface);
}

.dbx-dash-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem .75rem;
    margin-bottom: .75rem;
}

.dbx-dash-chart-total {
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-chart-frame {
    position: relative;
    height: 15rem;
}

.dbx-dash-chart-frame.is-short {
    height: 12rem;
}

.dbx-dash-empty {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-height: 10rem;
    padding: 1rem;
    border: 1px dashed var(--dash-border);
    border-radius: .5rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--dash-text-3);
}

.dbx-dash-empty .fi-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.dbx-dash-empty strong {
    color: var(--dash-text-2);
}

.dbx-dash-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem 1rem;
    margin-top: .75rem;
    font-size: .8125rem;
    color: var(--dash-text-2);
}

.dbx-dash-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.dbx-dash-chart-legend strong {
    color: var(--dash-text);
    font-variant-numeric: tabular-nums;
}

.dbx-dash-skeleton {
    height: 18rem;
    border-radius: .75rem;
    background: var(--dash-track);
}

@media (prefers-reduced-motion: reduce) {
    .dbx-dash-kpi,
    .dbx-dash-attn-card {
        transition: none;
    }
}
