/* Company Intelligence board + dossier (/panel/company-intelligence) —
   page-scoped EDS polish. Scoped under .fi-eds--cib (the board's root
   wrapper), .cdx (the dossier slide-over partial's root), or one of this
   page's own Filament wrapper classes (.fi-resource-trial-conversions,
   .fi-resource-company-intelligence-table) so it can never leak onto
   another surface even though this file loads panel-wide. */

/* Relationship tablist: six chips at their natural width (488px) sit inside
   an `inline-flex` group with no wrap, so on a narrow viewport the row
   overruns .fi-eds-toolbar and the last two tabs (At risk, Churned) render
   past the right edge — `.fi-layout` clips overflow-x panel-wide with no
   scrollbar, so those tabs are fully unreachable, not just visually cut.
   Letting the group itself wrap keeps every tab reachable without
   introducing a horizontal scroller. */
@media (max-width: 640px) {
    .fi-eds--cib .fi-eds-toolbar__group[role='tablist'] {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }
}

/* Board card grid: `auto-fill` with a flat `minmax(340px, 1fr)` still lays a
   fixed 340px track even when the container is narrower than that, so at
   320-375px viewports the grid content box is narrower than one track and
   `.cib-card` overflows past the (panel-wide, non-scrolling) `.fi-layout`
   clip — the KPI column, the Paying/Free-trial badge and the tail of every
   red-flag sentence go unreachable. `min(340px, 100%)` lets the single
   track shrink to the container instead of forcing an overrun. */
.fi-eds--cib .cib-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}

/* Card footers (`.cib-kpis`) were left to sit wherever their content ended,
   so cards of different body length left ragged, differently-heighted
   footers and large dead voids inside every grid row. `.cib-card` is
   already a column flexbox — push the KPI strip to the bottom so every
   footer in a row lands on the same baseline. */
.fi-eds--cib .cib-card .cib-kpis {
    margin-top: auto;
}

/* Dossier head-strip meta line (.cdx__meta, company-dossier.blade.php): the
   separators used to be standalone dot spans between items, so a wrap at
   the modal's narrower widths could strand a separator alone at the end of
   one line with its item dropping to the next. The blade now emits the
   items with no separator markup; attach the dot to the item that follows
   it instead, so a wrap always carries the separator down with its item and
   a line can never end on a bare bullet. */
.cdx .cdx__meta {
    gap: 0;
}
.cdx .cdx__meta > span + span::before {
    content: '·';
    margin: 0 6px;
    color: var(--ink3);
}

/* Trial Conversions stat cards (.fi-resource-trial-conversions, native
   StatsOverviewWidget markup): the shared Filament description row is a
   flex line (icon + text), so a two-line description wraps its text
   independently while the vertically-centered icon lands at the seam
   between the lines, reading as a stray glyph mid-sentence with the last
   word stranded alone below it. TrialConversionStats now emits the icon
   `->before` the text instead of after (a leading marker, never mid-flow);
   pin it to the top of the row here so it can never land inside the wrap
   regardless of how many lines the description takes. */
.fi-resource-trial-conversions .fi-wi-stats-overview-stat-description {
    align-items: flex-start;
}
.fi-resource-trial-conversions .fi-wi-stats-overview-stat-description .fi-icon {
    flex: none;
    margin-top: 2px;
}

/* Company dossier companion cards (.cdx-window — the class the board's
   dossierAction stamps on ITS slide-over window only): the money/contacts/
   stats/KPI cards float on the drawer's inner (left) edge, over the dimmed
   page, exactly like the Nuxt candidate sidebar's aside column. They sit in
   the drawer's scrollable .fi-modal-content, so `position: fixed` is what
   lifts them out of the scroll clip — the drawer chain carries no resting
   transform/filter, so fixed still anchors to the viewport here. The column
   scrolls independently when taller than the viewport. Width mirrors the
   drawer's 2xl (42rem) + the theme's overlay inset. */
@media (min-width: 1200px) {
    .fi-modal-window.cdx-window .cdx-aside {
        position: fixed;
        top: var(--eds-overlay-inset, 16px);
        right: calc(min(42rem, 100vw - (var(--eds-overlay-inset, 16px) * 2)) + var(--eds-overlay-inset, 16px) + 16px);
        width: 316px;
        max-height: calc(100dvh - (var(--eds-overlay-inset, 16px) * 2));
        overflow-y: auto;
        scrollbar-width: none;
        padding: 2px; /* keeps card shadows/focus rings unclipped */
    }
}
/* Below the float breakpoint the same cards fall back in-flow at the top of
   the dossier, two-up where they fit. */
@media (max-width: 1199.98px) {
    .cdx .cdx-aside {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
        gap: 10px;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--line);
    }
}

/* Companies table (.fi-resource-company-intelligence-table): at a 1600px
   viewport the native table content (11 sortable columns, each with 12px
   inline cell padding) measures ~23px wider than its `.fi-ta-content-ctn`
   card, which eats the last column's right padding — the "Intelligence"
   action link sits flush against the card's rounded right edge with no
   gutter. Trim cell padding one notch on the 4px scale (12px -> 8px) so the
   table fits its card with room to spare. */
.fi-resource-company-intelligence-table .fi-ta-header-cell,
.fi-resource-company-intelligence-table .fi-ta-text {
    padding-inline: 8px;
}
