/*
 * Ricco — Filament v5 brand CSS (additive).
 *
 * Loaded by `AdminPanelProvider::boot()` via `FilamentAsset::register`
 * AFTER Filament's pre-built `dist/theme.css`. This file is plain
 * CSS — no Tailwind directives — because Tailwind v4's vendor-template
 * scanning was unreliable on Windows (see the comment in
 * AdminPanelProvider). Filament's bundle provides every utility class
 * the blade templates expect; this file only contributes the
 * Ricco design vocabulary on top.
 *
 * Source-of-truth: 2026 CC Brand Guide + Claude Design styles.css.
 * Update both in lockstep when the brand changes.
 */

/* Brand fonts — direct selectors instead of `@theme --font-sans`
   because Tailwind isn't processing this file. The Google Fonts
   link tag is injected in AdminPanelProvider::boot(); these rules
   tell every Filament page to actually use those families. */
html,
body,
.fi-body,
.fi-main,
.fi-modal {
    font-family:
        'Source Sans 3', 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root {
    /* === Brand colors (2026 CC Brand Guide) === */
    --cc-gray: #454546; /* primary text / heads */
    --cc-dim-gray: #696969; /* secondary text */
    --cc-spanish: #939598; /* muted text */
    --cc-light: #d1d2d4; /* borders / dividers */
    --cc-air: #f6f6f6; /* app surface */
    --cc-orange: #d46929; /* Active Orange — primary CTA */
    --cc-orange-tint: #fbeee2; /* Orange wash for fills */
    --cc-orange-deep: #b95414; /* Orange hover */
    --cc-cyan: #1e90b9; /* Cyan Cornflower Blue — info / AI */
    --cc-cyan-tint: #e3f3f9;
    --cc-max: #44b3cc; /* MAX Blue */
    --cc-max-tint: #e6f6fa;

    /* === Semantic === */
    --bg: #ffffff;
    --bg-canvas: var(--cc-air);
    --bg-elev: #ffffff;
    --bg-sunken: #fafafa;
    --bg-hover: #f3f3f4;

    --fg: var(--cc-gray);
    --fg-secondary: var(--cc-dim-gray);
    --fg-muted: var(--cc-spanish);
    --fg-inverse: #ffffff;

    --border: #e5e5e7;
    --border-strong: var(--cc-light);
    --border-focus: var(--cc-cyan);

    --ok-fg: #1f7a4a;
    --ok-bg: #e6f4ec;
    --ok-border: #b8dec7;

    --warn-fg: #8a5a14;
    --warn-bg: #fbeee2;
    --warn-border: #efc89a;

    --err-fg: #9a2a2a;
    --err-bg: #fbeaea;
    --err-border: #efb8b8;

    --info-fg: #1e6a8a;
    --info-bg: var(--cc-cyan-tint);
    --info-border: #b8d9e5;

    /* Shape */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-pill: 999px;

    /* Elevation */
    --shadow-1:
        0 1px 2px rgba(20, 20, 30, 0.05), 0 0 0 1px rgba(20, 20, 30, 0.04);
    --shadow-2:
        0 4px 16px rgba(20, 20, 30, 0.08), 0 0 0 1px rgba(20, 20, 30, 0.04);
    --shadow-3:
        0 16px 40px rgba(20, 20, 30, 0.12), 0 0 0 1px rgba(20, 20, 30, 0.05);
}

/* Dark-mode overrides — Filament toggles `<html class="dark">`
   when the user picks dark mode (or system prefers it). Every
   --cc-* hue stays the same (orange is orange in both modes) but
   the semantic surface/text/border vars flip to dark equivalents
   so anywhere we render with `var(--bg-elev)` / `var(--fg)` / etc.
   adapts automatically. The pipeline tracker and custom-HTML cells
   rely on these to look right against a dark Filament panel. */
.dark {
    --bg: #0f172a;
    --bg-canvas: #0b1220;
    --bg-elev: #1e293b;
    --bg-sunken: #111827;
    --bg-hover: #1f2a3d;

    --fg: #e5e7eb;
    --fg-secondary: #cbd5e1;
    --fg-muted: #94a3b8;
    --fg-inverse: #0f172a;

    --border: #334155;
    --border-strong: #475569;

    --ok-fg: #6ee7b7;
    --ok-bg: rgba(31, 122, 74, 0.18);
    --ok-border: rgba(110, 231, 183, 0.35);

    --warn-fg: #fbbf24;
    --warn-bg: rgba(212, 105, 41, 0.16);
    --warn-border: rgba(251, 191, 36, 0.35);

    --err-fg: #fca5a5;
    --err-bg: rgba(154, 42, 42, 0.18);
    --err-border: rgba(252, 165, 165, 0.35);

    --info-fg: #7dd3fc;
    --info-bg: rgba(30, 144, 185, 0.18);
    --info-border: rgba(125, 211, 252, 0.35);
}

/* Sidebar logo wordmark sizing — Filament's default centres the
   logo wide; brand mark wants a fixed square sit-side with text
   beside it. The brand-mark.png we ship is icon-only so this is
   just a sizing tweak. */
.fi-sidebar-header img {
    height: 28px;
    width: auto;
}

/* JetBrains Mono for inline identifiers — Filament's TextEntry +
   text columns inherit `font-mono` when we apply the `font-mono`
   helper. The `code` element gets it automatically. */
code,
.font-mono {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
}

/* === Pipeline tracker (brand signature) ===
 * The 4-stage chevron-jointed tracker that lives at the top of the
 * Run Detail page. Ported verbatim from Claude Design — keep the
 * chevron geometry and dimensions; the small dot + ring on the
 * active stage is the moment the brand identity lands.
 */
.pipeline {
    display: flex;
    gap: 0;
    align-items: stretch;
}
.stage {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
    background: var(--bg-elev);
    color: var(--fg);
    border: 1px solid var(--border);
    border-right: none;
    position: relative;
    /* Flex column so an in-card CTA (e.g. View Import Summary on
       the Source card) can pin to the bottom via `margin-top: auto`
       while every other card without a CTA still keeps consistent
       height — the parent `.pipeline` uses `align-items: stretch`. */
    display: flex;
    flex-direction: column;
}
.stage:first-child {
    border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.stage:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
}
.stage + .stage::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    transform: translateY(-50%) rotate(45deg);
    z-index: 1;
}
.stage-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.stage-num {
    width: 22px;
    height: 22px;
    border-radius: var(--r-pill);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-sunken);
    color: var(--fg-muted);
    border: 1px solid var(--border);
}
.stage-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stage-meta {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--fg-secondary);
    font-weight: 600;
}
.stage-detail {
    font-size: 12px;
    color: var(--fg-muted);
    margin-top: 4px;
}
.stage-action {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
    margin-top: 12px;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stage.done .stage-num {
    background: var(--ok-bg);
    color: var(--ok-fg);
    border-color: var(--ok-border);
}
.stage.active .stage-num {
    background: var(--cc-orange);
    color: #ffffff;
    border-color: var(--cc-orange);
}
.stage.warn .stage-num {
    background: var(--warn-bg);
    color: var(--warn-fg);
    border-color: var(--warn-border);
}
.stage.pending .stage-num {
    background: var(--bg-sunken);
    color: var(--fg-muted);
}
.stage-running-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--cc-orange);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.stage-running-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cc-orange);
    box-shadow: 0 0 0 4px rgba(212, 105, 41, 0.18);
}
.stage-progress {
    height: 3px;
    margin-top: 12px;
    background: var(--bg-sunken);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.stage-progress > span {
    display: block;
    height: 100%;
    background: var(--cc-orange);
}

/* Determinate mode — the width is set inline by the blade based
   on real current/total. The width transitions smoothly so each
   wire:poll tick visibly advances rather than snapping. */
.stage-progress[data-state="determinate"] > span {
    transition: width 600ms ease-out;
}

/* Indeterminate mode — total unknown, so render a shimmer
   sweeping left-to-right inside the track. Pure CSS keyframes;
   no JS. The span fills 35% of the track width and slides across
   on a continuous loop. */
.stage-progress[data-state="indeterminate"] > span {
    width: 35%;
    background: linear-gradient(
        90deg,
        rgba(212, 105, 41, 0) 0%,
        var(--cc-orange) 40%,
        var(--cc-orange) 60%,
        rgba(212, 105, 41, 0) 100%
    );
    animation: stage-progress-shimmer 1.6s linear infinite;
}

@keyframes stage-progress-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(285%); }
}

/* In-card CTA button — pinned to the bottom of the stage card
   via `margin-top: auto`. Used today only on the Source card to
   surface the Import Summary modal. Stays compact and aligned
   with the chevron-card aesthetic. */
.cc-stage-cta {
    margin-top: auto;
    align-self: stretch;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--fg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cc-stage-cta:hover {
    background: var(--bg-hover);
    border-color: var(--cc-cyan);
    color: var(--cc-cyan);
}

/* Pure-Alpine inline modal (used by the Source card's Import
   Summary button). Stays out of Filament's modal stack because
   the content is small and read-only; no Livewire round-trip
   needed. */
.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cc-modal-card {
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    background: var(--bg-elev);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cc-modal-head {
    position: relative;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
}
.cc-modal-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.cc-modal-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--fg-muted);
}
.cc-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.cc-modal-close:hover {
    background: var(--bg-hover);
    color: var(--fg);
}
.cc-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.cc-modal-foot {
    padding: 12px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-sunken);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.cc-modal-btn {
    padding: 6px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elev);
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cc-modal-btn:hover {
    background: var(--bg-hover);
}

/* === Review summary card (Run Detail right column) ===
 * Net-new component per the Claude Design handoff. Donut chart +
 * legend on top, divider, top flag reasons bar chart below. All
 * `cc-*` prefixed classes are scoped to this partial so they can't
 * collide with Filament's `fi-*` namespace. */
.cc-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.cc-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.cc-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg);
    margin: 0;
}
.cc-card-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-cyan);
    text-decoration: none;
}
.cc-card-link:hover {
    text-decoration: underline;
}
.cc-review-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cc-donut-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cc-donut {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.cc-donut-hole {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--bg-elev);
    display: grid;
    place-items: center;
    text-align: center;
}
.cc-donut-pct {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}
.cc-donut-label {
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 3px;
}
.cc-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cc-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fg);
}
.cc-legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.cc-legend-label {
    flex: 1;
}
.cc-legend-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.cc-muted {
    color: var(--fg-muted);
}
.cc-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.cc-section-label {
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cc-flag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cc-flag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--fg);
}
.cc-flag-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-flag-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-sunken);
    border-radius: 3px;
    overflow: hidden;
}
.cc-flag-bar > span {
    display: block;
    height: 100%;
    background: var(--cc-orange);
}
.cc-flag-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    width: 36px;
    text-align: right;
}

/* === Run details compact 3-column grid === */
.cc-run-details-grid {
    padding: 20px 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    row-gap: 22px;
}
.cc-run-details-grid > div {
    min-width: 0;
}
.cc-kpi-label {
    font-size: 11px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 4px;
}
.cc-kpi-value {
    font-size: 14px;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-kpi-value.cc-numeric {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* === Two-column run-detail grid wrapper === */
.cc-run-detail-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
}
@media (max-width: 1024px) {
    .cc-run-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* === CSV split button ===
 * Filament v5 has no native split-button primitive. We render
 * Download CSV as a `color('gray')` Action followed by an
 * `iconButton` ActionGroup chevron also on gray.
 *
 * Verified DOM (by `$group->toHtml()` dump):
 *   <button class="fi-btn cc-csv-split-main ...">Download CSV</button>
 *   <div class="fi-dropdown">                          ← wrapper
 *     <div class="fi-dropdown-trigger">
 *       <button class="fi-icon-btn ... cc-csv-split-caret">  ← class lands HERE
 *         <svg>chevron</svg>
 *       </button>
 *     </div>
 *   </div>
 *
 * So `.cc-csv-split-caret` IS the button. For the negative margin
 * we have to target the `.fi-dropdown` wrapper that follows the
 * main button — that's the actual sibling in the action-bar flex
 * row, not the button inside. */

/* Main half: Download CSV button — strip right-side radius. */
.cc-csv-split-main {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* The dropdown wrapper following the main button — fully cancel
   the action-bar's `gap: calc(var(--spacing)*3)` (= 12px). */
.cc-csv-split-main + .fi-dropdown {
    margin-left: calc(var(--spacing, 0.25rem) * -3) !important;
}

/* Caret button. Rendering as `.fi-btn` (button() mode), so
   background-color and the button outline ring come from
   Filament's `.fi-btn:not(.fi-outlined)` rules — DO NOT override
   `box-shadow` (it carries the button's outline ring composed
   of multiple `--tw-*-shadow` variables). Use `border-left` for
   the divider between halves so it stacks with Filament's
   shadows instead of replacing them. */
.cc-csv-split-caret {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding-inline: 0.5rem !important;
    border-left: 1px solid rgba(0, 0, 0, 0.18) !important;
}
.dark .cc-csv-split-caret {
    border-left-color: rgba(255, 255, 255, 0.18) !important;
}

/* === AI-action cyan icon accent ===
 * Brand rule from the Claude Design handoff: "Cyan = AI." Actions
 * that invoke ML — Apply Transform, Enrich Items — get a cyan
 * tint on their leading icon while the button itself stays the
 * secondary `gray` fill. Targets the SVG that Filament renders
 * inside the button; `currentColor` lets the icon path inherit
 * the override without us reaching into the SVG markup. */
.cc-ai-action svg {
    color: var(--cc-cyan, #1e90b9) !important;
}

/* === Items review filter chip rail ===
 * Per the Claude Design `items.jsx` mock (lines 47–77). Sits
 * between the items table title and the filter row. Selected
 * chip is orange (Active Orange brand CTA) with white text and a
 * subtle shadow; idle chips are gray-on-white-ish (or dark in
 * dark mode) with a count next to the label.
 *
 * Wired up via the render hook registered in AdminPanelProvider
 * scoped to ItemsRelationManager. Counts and active state come
 * from the relation manager's Livewire props via Alpine `$wire`. */
.cc-chip-row {
    display: flex;
    align-items: center;
    /* Center the VIEW chip rail horizontally in its container per
       Steven's 2026-05-22 direction. `justify-content: center`
       centers the whole strip (the VIEW label + every chip) as a
       single unit so the visual balance matches a tab-bar. */
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    /* Top buffer so the chip rail has breathing room from the
       Activity Log section above. NO horizontal padding —
       Filament's table-header container already provides the
       interior padding; adding more pushed the chip-rail label
       past the left edge of the visible area. */
    padding: 16px 0 4px;
    margin-bottom: 8px;
}

/* Filters bar inline layout — force the filter row to be flex
   instead of CSS Grid. Filament v5 renders the filter form as a
   `<form class="fi-sc-form fi-sc">` whose direct children are
   `<div class="fi-grid-col">` with `grid-column: span N`. The
   default grid stretches each filter to equal width, which
   pushed the narrow Uncategorized-only toggle to the far right
   of its grid cell with a big visual gap from the dropdowns.
   The override below:
     1. Replaces grid with flex on the form container.
     2. Cancels each child's grid-column span so flex sizing
        actually wins (without this, `grid-column: span 6` is
        still active and reserves the column width even though
        the parent is now flex).
     3. Floors dropdowns at 200px, lets the toggle be narrow.
   `align-items: flex-end` keeps the inputs aligned regardless
   of label wrapping. */
.fi-ta-filters-above-content-ctn .fi-sc-form,
.fi-ta-filters-above-content-ctn .fi-sc-form .fi-sc {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px !important;
    /* !important here matters — Filament's `.fi-grid` rule sets
       `display: grid` and the grid's auto-rows + align-items default
       were keeping the toggle's cell content at the row top. Forcing
       the flex layout to align all cell BOTTOMS makes the toggle's
       widget land at the same Y as the dropdown's <select> input. */
    align-items: flex-end !important;
    grid-template-columns: none !important;
}
.fi-ta-filters-above-content-ctn .fi-sc-form > .fi-grid-col,
.fi-ta-filters-above-content-ctn .fi-sc-form .fi-sc > .fi-grid-col,
.fi-ta-filters-above-content-ctn .fi-sc-form > div[wire\:partial^="schema-component"],
.fi-ta-filters-above-content-ctn .fi-sc-form .fi-sc > div[wire\:partial^="schema-component"] {
    grid-column: auto !important;
    width: auto !important;
    min-width: 200px;
    flex: 0 0 auto !important;
}
/* (The toggle-specific overrides that used to live here were
   removed on 2026-05-22 when the standalone Uncategorized toggle
   filter was folded into the Category SelectFilter as a synthetic
   "(Uncategorized)" option. The filter row is now three
   homogeneous dropdowns — no inline-label widget to align.) */
.cc-chip-rail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 4px;
}
.cc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--bg-elev, #ffffff);
    color: var(--fg-secondary, #475569);
    border: 1px solid var(--border-strong, #d1d2d4);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cc-chip:hover {
    background: var(--bg-hover, #f3f3f4);
}
.cc-chip-active {
    background: var(--cc-orange, #d46929);
    color: #ffffff;
    border-color: var(--cc-orange, #d46929);
    box-shadow: 0 1px 2px rgba(212, 105, 41, 0.25);
}
.cc-chip-active:hover {
    background: var(--cc-orange-deep, #b95414);
    border-color: var(--cc-orange-deep, #b95414);
}
.cc-chip-count {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    opacity: 0.7;
}
.cc-chip-active .cc-chip-count {
    opacity: 0.85;
}

/* === Activity Log summary + raw tail ===
 * Layout for the per-run activity log partial. The previous
 * version used Tailwind utility classes that Filament's bundle
 * doesn't ship (text-cyan-400, bg-gray-700, divide-y, etc.) and
 * rendered as bare flat text. These scoped classes match the
 * intended design and resolve in both light/dark mode via the
 * `--bg-*` / `--fg-*` semantic CSS variables. */
.cc-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cc-log-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--fg, #e5e7eb);
}
.cc-log-stats strong {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.cc-log-dot {
    color: var(--fg-muted, #94a3b8);
}
.cc-log-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    color: #34d399;
    font-weight: 600;
}
.cc-log-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.cc-log-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border, #e5e5e7);
    border-radius: 6px;
    overflow: hidden;
    font-size: 12px;
}
.cc-log-view-btn {
    background: transparent;
    color: var(--fg-muted, #94a3b8);
    padding: 5px 12px;
    border: none;
    border-left: 1px solid var(--border, #e5e5e7);
    cursor: pointer;
    font-weight: 500;
}
.cc-log-view-btn:first-child {
    border-left: none;
}
.cc-log-view-btn:hover {
    color: var(--fg, #e5e7eb);
}
.cc-log-view-btn-active {
    background: var(--bg-hover, #1f2a3d);
    color: var(--fg, #e5e7eb);
    font-weight: 600;
}
.cc-log-empty {
    padding: 16px;
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    background: var(--bg-sunken, #111827);
    color: var(--fg-muted, #94a3b8);
    font-size: 12px;
}

/* Summary table — capped height so the CSM can scroll through
   the patterns without the whole page growing 50 rows tall. The
   sticky thead keeps the column labels visible during scroll. */
.cc-log-summary-card {
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    background: var(--bg-sunken, #111827);
    overflow: hidden;
    max-height: 22rem;
    display: flex;
    flex-direction: column;
}
.cc-log-summary-table-scroll {
    overflow-y: auto;
    flex: 1 1 auto;
}
.cc-log-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.cc-log-summary-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.cc-log-summary-table thead th {
    background: var(--bg, #0f172a);
    color: var(--fg-muted, #94a3b8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10.5px;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border, #334155);
}
.cc-log-summary-table tbody tr {
    border-top: 1px solid var(--border, #334155);
}
.cc-log-summary-row td {
    padding: 8px 12px;
}
.cc-log-summary-row:hover {
    background: rgba(148, 163, 184, 0.06);
}
.cc-log-stage-tag {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
}
.cc-log-pattern {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 12px;
    word-break: break-word;
}
.cc-log-sample-btn {
    background: transparent;
    color: var(--cc-cyan, #1e90b9);
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 0;
}
.cc-log-sample-btn:hover {
    color: var(--cc-cyan-tint, #4ec5e8);
    text-decoration: underline;
}
.cc-log-sample-row {
    background: rgba(148, 163, 184, 0.04);
}
.cc-log-sample-line {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11.5px;
    color: var(--fg, #e5e7eb);
    word-break: break-word;
    padding: 2px 0;
}
.cc-log-showall {
    border-top: 1px solid var(--border, #334155);
    padding: 8px 12px;
    text-align: center;
}
.cc-log-showall-btn {
    background: transparent;
    color: var(--cc-cyan, #1e90b9);
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
}
.cc-log-showall-btn:hover {
    text-decoration: underline;
}

/* Raw tail */
.cc-log-raw-tail {
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    background: var(--bg-sunken, #0a0f1a);
    padding: 12px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11.5px;
    line-height: 1.6;
    height: 24rem;
    max-height: 24rem;
    overflow-y: auto;
}
.cc-log-raw-line {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1px 0;
}

/* Compact meta line that lives under the Conversations page title.
   Replaces the old multi-card KPI strip with a single muted text row
   (see "Store Conversations Header.html" design — Option A). */
.cc-meta-line {
    font-size: 13px;
    color: rgb(105 105 105);
    font-variant-numeric: tabular-nums;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
}
.dark .cc-meta-line {
    color: rgb(154 155 160);
}
.cc-meta-line .cc-meta-num {
    color: rgb(69 69 70);
    font-weight: 600;
}
.dark .cc-meta-line .cc-meta-num {
    color: rgb(231 231 234);
}
.cc-meta-line .cc-meta-sep {
    opacity: 0.4;
}

/* === Conversation View two-column split ===
 * Forces the transcript / grading-stack split on the conversation
 * detail page to actually span the page's full available width. The
 * default Filament `.fi-grid` styling drives column count from CSS
 * custom properties + container queries, which on a `Width::Full`
 * page can leave the grid sized to roughly half the viewport when
 * the schema wrapper doesn't expand. Hard-pinning grid-template-
 * columns + width:100% sidesteps that ambiguity. The `align-items:
 * start` keeps the right-side stack from stretching to match the
 * transcript's tall height. */
.cc-conversation-split {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: start !important;
}
@media (max-width: 1023px) {
    .cc-conversation-split {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* === Grading column group ===
 * Visually group the Grade / Score / Confidence columns in the
 * Store Conversations table so reviewers can see at a glance which
 * cells come from the AI grader vs. the surrounding conversation
 * metadata. A warm-tinted background (Orange wash in light mode,
 * translucent orange in dark mode) sits behind both the header and
 * body cells; the column borders inherit from Filament so the
 * highlight reads as a contiguous band, not three isolated cells.
 *
 * Both the `<th>` (header) and `<td>` (cell) selectors are listed
 * explicitly because Filament v5 sets a background-color on its
 * `.fi-ta-cell` / `.fi-ta-header-cell` rules and we need the same
 * specificity (element + class) to win without overusing
 * !important. The hover-row override re-applies the tint so the
 * grouping stays visible when the user mouses over a row. */
th.cc-grading-cell,
td.cc-grading-cell,
.fi-ta-row:hover td.cc-grading-cell {
    background-color: #fbe5cf !important;
}
.dark th.cc-grading-cell,
.dark td.cc-grading-cell,
.dark .fi-ta-row:hover td.cc-grading-cell {
    background-color: rgba(212, 105, 41, 0.22) !important;
}

/* ---------------------------------------------------------------------------
 * Custom widget data tables (dashboard + Conversations report)
 *
 * The table/list widgets ({@see resources/views/filament/widgets/reports/
 * conversations/}) were authored with Tailwind utility classes (`px-3`,
 * `divide-y`, `bg-gray-50`, `tabular-nums`, …). None of those ship in
 * Filament's pre-built bundle and this project doesn't run Tailwind over its
 * own blade templates, so the tables rendered completely unstyled. These
 * semantic classes restore default table formatting — cell padding, a clear
 * header band, row separators, and right-aligned numeric columns. */
.cc-table-wrap {
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.1);
}
.dark .cc-table-wrap {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.cc-table thead {
    background-color: #f9fafb;
}
.dark .cc-table thead {
    background-color: rgba(255, 255, 255, 0.05);
}
.cc-table thead tr {
    border-bottom: 1px solid #e5e7eb;
}
.dark .cc-table thead tr {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
.cc-table tbody tr + tr {
    border-top: 1px solid #f3f4f6;
}
.dark .cc-table tbody tr + tr {
    border-top-color: rgba(255, 255, 255, 0.05);
}
.cc-table th,
.cc-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: middle;
}
.cc-table th {
    font-weight: 600;
    white-space: nowrap;
    color: #374151;
}
.dark .cc-table th {
    color: #d1d5db;
}
.cc-table td {
    color: #111827;
}
.dark .cc-table td {
    color: #f3f4f6;
}
.cc-table-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
/* Semantic cell tones (replacing the original text-success/danger/etc.) */
.cc-cell-pos {
    color: #16a34a;
    font-weight: 600;
}
.dark .cc-cell-pos {
    color: #4ade80;
}
.cc-cell-muted {
    color: #6b7280;
}
.dark .cc-cell-muted {
    color: #9ca3af;
}
.cc-cell-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}
.cc-sev-high {
    color: #dc2626;
    font-weight: 600;
}
.dark .cc-sev-high {
    color: #f87171;
}
.cc-sev-medium {
    color: #d97706;
}
.dark .cc-sev-medium {
    color: #fbbf24;
}
.cc-sev-low {
    color: #4b5563;
}
.dark .cc-sev-low {
    color: #9ca3af;
}
/* Single-column list widget (silent contractors) */
.cc-list {
    font-size: 0.875rem;
    color: #1f2937;
}
.dark .cc-list {
    color: #e5e7eb;
}
.cc-list li {
    padding: 0.375rem 0;
    border-top: 1px solid #f3f4f6;
}
.dark .cc-list li {
    border-top-color: rgba(255, 255, 255, 0.05);
}
.cc-list li:first-child {
    border-top: 0;
}
/* Cap long lists (e.g. silent contractors) and scroll inside the box so the
 * widget doesn't grow taller than the screen. */
.cc-list--scroll {
    max-height: 400px;
    overflow-y: auto;
}
/* Empty-state note shared by all the report widgets */
.cc-widget-note {
    font-size: 0.875rem;
    color: #6b7280;
}
.dark .cc-widget-note {
    color: #9ca3af;
}
/* Inline count badge in widget descriptions, e.g. "(47 total)" */
.cc-list-count {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.dark .cc-list-count {
    color: #9ca3af;
}
/* Show-more / show-less toggle under collapsible lists */
.cc-list-toggle {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #2563eb;
    background: transparent;
    border: 0;
    padding: 0.25rem 0;
    cursor: pointer;
}
.cc-list-toggle:hover {
    text-decoration: underline;
}
.dark .cc-list-toggle {
    color: #60a5fa;
}
/* Table bulk-selection bar: keep the "Select all / Deselect all" links next
   to the "N records selected" count on the LEFT. Filament strands the actions
   wrapper (the 2nd child) on the far right via `margin-inline-start: auto` on
   top of `justify-content: space-between` — override both. `!important` and the
   exact selector specificity make this win regardless of stylesheet load order. */
.fi-ta-ctn .fi-ta-selection-indicator {
    justify-content: flex-start !important;
    /* Breathing room between the "N records selected" count and the
       Select all / Deselect all links now that they sit side by side. */
    column-gap: 1.5rem;
}
.fi-ta-ctn .fi-ta-selection-indicator > :nth-child(2) {
    margin-inline-start: 0 !important;
}

/* Conversations table: a 1px blue border around any row that has a suggested
   fix attached (class set via the table's recordClasses()). Borders go on the
   cells rather than the <tr> — table rows don't render a border/box-shadow
   reliably. Top+bottom on every cell, plus left/right on the end cells, draws
   a continuous rectangle around the row. */
.fi-ta-row.cc-has-suggested-fix > :where(td, th) {
    border-block: 1px solid #1e90b9;
}
.fi-ta-row.cc-has-suggested-fix > :where(td, th):first-child {
    border-inline-start: 1px solid #1e90b9;
}
.fi-ta-row.cc-has-suggested-fix > :where(td, th):last-child {
    border-inline-end: 1px solid #1e90b9;
}

/* ===========================================================================
 * Category Enrichment browser (Phase 2)
 *
 * The two-pane page (resources/views/filament/pages/category-enrichment*.blade.php)
 * is authored with scoped `cc-ce-*` classes — NOT Tailwind utilities — because
 * this project doesn't run Tailwind over its own blade templates (see the file
 * header), so utilities like `grid`, `bg-info-100`, `border-s` never ship in
 * Filament's bundle and render unstyled. All tones come from the
 * `--cc-*` / `--bg-*` / `--fg-*` tokens, so the page adapts to dark mode
 * automatically.
 * ======================================================================== */
.cc-ce-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 18px;
    align-items: start;
}
@media (max-width: 1023px) {
    .cc-ce-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
.cc-ce-pane {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px;
}

/* Tree pane controls */
.cc-ce-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
}
.cc-ce-search::placeholder {
    color: var(--fg-muted);
}
.cc-ce-search:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--cc-cyan-tint);
}
.dark .cc-ce-search:focus {
    box-shadow: 0 0 0 3px rgba(30, 144, 185, 0.25);
}
.cc-ce-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--fg-secondary);
}
.cc-ce-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Expand/collapse-all toggle — floats to the right of the filter checkboxes */
.cc-ce-expand-all {
    margin-left: auto;
    align-self: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-cyan);
    background: var(--cc-cyan-tint);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}
.cc-ce-expand-all:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* Tree structure */
.cc-ce-tree,
.cc-ce-children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cc-ce-children {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}
.cc-ce-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: var(--r-sm);
}
.cc-ce-row:hover {
    background: var(--bg-hover);
}
.cc-ce-toggle {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}
.cc-ce-toggle:hover {
    color: var(--fg);
}
.cc-ce-spacer {
    display: inline-block;
    width: 16px;
    flex-shrink: 0;
}
.cc-ce-name {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-ce-name:hover {
    color: var(--cc-orange);
}
.cc-ce-name--active {
    color: var(--cc-orange);
    font-weight: 700;
}

/* Config-status badges */
.cc-ce-badges {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
}
.cc-ce-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}
.cc-ce-badge--q {
    background: var(--info-bg);
    color: var(--info-fg);
    border-color: var(--info-border);
}
.cc-ce-badge--g {
    background: var(--ok-bg);
    color: var(--ok-fg);
    border-color: var(--ok-border);
}
.cc-ce-badge--s {
    background: var(--bg-sunken);
    color: var(--fg-secondary);
    border-color: var(--border-strong);
}
.cc-ce-badge--draft {
    background: var(--warn-bg);
    color: var(--warn-fg);
    border-color: var(--warn-border);
    font-weight: 600;
}
.cc-ce-empty,
.cc-ce-placeholder {
    padding: 16px 6px;
    font-size: 13px;
    color: var(--fg-muted);
}

/* Detail pane */
.cc-ce-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cc-ce-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.cc-ce-crumb {
    font-size: 12px;
    color: var(--fg-muted);
}
.cc-ce-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin: 2px 0;
}
.cc-ce-sub {
    font-size: 12px;
    color: var(--fg-muted);
}
.cc-ce-field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-muted);
    margin-bottom: 6px;
}
.cc-ce-field-box {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--fg);
    white-space: pre-wrap;
}
.cc-ce-pre {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    margin: 0;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11.5px;
    color: var(--fg);
    overflow-x: auto;
}
.cc-ce-unset {
    font-size: 13px;
    font-style: italic;
    color: var(--fg-muted);
}
.cc-ce-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cc-ce-attr {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 12px;
    background: var(--bg-sunken);
    color: var(--fg-secondary);
    border: 1px solid var(--border-strong);
}
.cc-ce-foot {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}
.cc-ce-edit-btn {
    padding: 7px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-sunken);
    color: var(--fg-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: not-allowed;
}
.cc-ce-drift-banner {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--warn-bg);
    color: var(--warn-fg);
    border: 1px solid var(--warn-border);
    font-size: 13px;
    font-weight: 600;
}

/* Bounded scrollable content boxes for Agent Guidance, Starting Questions, Settings.
   min-height gives presence for empty state; max-height caps tall content. */
.cc-ce-box-bounded {
    min-height: 80px;
    max-height: 400px;
    overflow-y: auto;
}

/* Hierarchy context block in the detail pane */
.cc-ce-hierarchy {
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}
.cc-ce-hierarchy-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.cc-ce-hierarchy-key {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-muted);
    min-width: 100px;
}
.cc-ce-hierarchy-link {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--cc-cyan);
    cursor: pointer;
    font-weight: 500;
}
.cc-ce-hierarchy-link:hover {
    color: var(--cc-orange);
    text-decoration: underline;
}
.cc-ce-hierarchy-children {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cc-ce-hierarchy-none {
    font-size: 13px;
    font-style: italic;
    color: var(--fg-muted);
}

[x-cloak] {
    display: none !important;
}

/* === Category Enrichment Manager (Phase 4a editor) ===
 * Active Edit button that replaces the previous disabled placeholder,
 * and wrapper for the editor page scaffold. */
.cc-ce-edit-btn--active {
    display: inline-block;
    color: #ffffff;
    background: var(--cc-orange);
    border-color: var(--cc-orange);
    cursor: pointer;
    text-decoration: none;
}
.cc-ce-edit-btn--active:hover {
    background: var(--cc-orange-deep);
    border-color: var(--cc-orange-deep);
}
.cc-cem {
    margin-bottom: 8px;
}
.cc-cem-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.cc-cem-issues { margin-top: 16px; }
.cc-cem-issue { display: block; font-size: 12.5px; padding: 4px 0; color: var(--fg); }
.cc-cem-issue-sev { font-weight: 700; margin-right: 6px; }
.cc-cem-issue--error .cc-cem-issue-sev { color: var(--err-fg); }
.cc-cem-issue--warning .cc-cem-issue-sev { color: var(--warn-fg); }
.cc-cem-issue-path { font-family: var(--font-mono, monospace); color: var(--fg-muted); margin-right: 8px; }
.cc-cem-ref { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; }
.cc-cem-ref summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--fg); }
.cc-cem-ref-body { margin-top: 10px; }
.cc-cem-param { padding: 6px 0; border-top: 1px solid var(--border); }
.cc-cem-param code { font-size: 12px; font-weight: 700; }
.cc-cem-param-type { font-size: 11px; color: var(--fg-muted); margin-left: 8px; }
.cc-cem-param p { font-size: 12.5px; color: var(--fg-secondary); margin: 2px 0 0; }

/* === Review changes diff modal (Phase 4b) === */
.cc-diff-field { padding: 10px 0; border-top: 1px solid var(--border); }
.cc-diff-head { display: flex; align-items: center; gap: 10px; }
.cc-diff-label { font-weight: 700; font-size: 13px; color: var(--fg); }
.cc-diff-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-muted); }
.cc-diff-field--changed .cc-diff-status { color: var(--warn-fg); }
.cc-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.cc-diff-keys { margin: 8px 0 0; padding-left: 16px; }
.cc-diff-key { font-size: 12.5px; padding: 2px 0; }
.cc-diff-key code { font-weight: 700; }
.cc-diff-from { color: var(--err-fg); }
.cc-diff-to { color: var(--ok-fg); }

/* === Consumer preview modal (Phase 4b Task 3) === */
.cc-prev-block { padding: 12px 0; border-top: 1px solid var(--border); }
.cc-prev-block:first-child { border-top: none; }
.cc-prev-group { margin-bottom: 10px; }
.cc-prev-group-label { font-size: 11px; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 4px; }
.cc-prev-q { padding: 6px 0; }
.cc-prev-qtext { font-weight: 600; font-size: 13.5px; color: var(--fg); margin: 0 0 4px; }
.cc-prev-answers { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-prev-answer { display: inline-flex; padding: 3px 9px; border-radius: var(--r-pill); font-size: 12px; background: var(--bg-sunken); border: 1px solid var(--border-strong); color: var(--fg-secondary); }
.cc-prev-setting { padding: 6px 0; }
.cc-prev-setting-label { font-size: 13px; color: var(--fg); }
.cc-prev-setting-effect { font-size: 12px; color: var(--fg-muted); margin: 2px 0 0; }

/* ===========================================================================
 * Starting Questions Manager — reskin toward "Manager B" approved design
 *
 * Scope: the Starting Questions section on CategoryEnrichmentManager is wrapped
 * in a `cc-sqm` class (set via Section::extraAttributes). All selectors below
 * are prefixed with `.cc-sqm` so they cannot bleed into other Filament repeaters
 * elsewhere in the panel.
 * ========================================================================= */

/* --- Status pill in the section header description --- */
.cc-sqm-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    font-size: 11.5px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
    border: 1px solid transparent;
}
.cc-sqm-pill--ok {
    background: var(--ok-bg);
    color: var(--ok-fg);
    border-color: var(--ok-border);
}
.cc-sqm-pill--warn {
    background: var(--warn-bg);
    color: var(--warn-fg);
    border-color: var(--warn-border);
}

/* --- Item label chip strip --- */
.cc-sqm-item-label {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.cc-sqm-chips {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.cc-sqm-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--r-sm);
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
}
/* Blue chip — attribute value (cyan on cyan-tint) */
.cc-sqm-chip--v {
    background: var(--cc-cyan-tint);
    color: var(--cc-cyan);
    border-color: rgba(30, 144, 185, 0.28);
}
/* Mustard chip — conditional (showIf) */
.cc-sqm-chip--m {
    background: var(--warn-bg);
    color: var(--warn-fg);
    border-color: var(--warn-border);
}
/* Grey chip — misc flags (widget / informs / intent / normalized) */
.cc-sqm-chip--g {
    background: var(--bg-sunken);
    color: var(--fg-secondary);
    border-color: var(--border-strong);
}

/* --- Question card framing (Repeater items) --- */
/* Target the <li> items inside ONLY the Starting Questions repeater. The
   `.cc-sqm` wrapper sits on the fi-sc-section root element; the repeater
   items are descendants via fi-fo-repeater-items > fi-fo-repeater-item. */
.cc-sqm .fi-fo-repeater-item {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-elev);
    transition: border-color 0.15s ease;
    overflow: hidden;
}
.cc-sqm .fi-fo-repeater-item:hover {
    border-color: var(--border-strong);
}
/* Item header band — slightly sunken background to visually separate from content */
.cc-sqm .fi-fo-repeater-item-header {
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}
/* Item content area — normal elevated background with some padding */
.cc-sqm .fi-fo-repeater-item-content {
    background: var(--bg-elev);
}

/* --- "Add question" / "Add answer" dashed button styling ---
   The add button is rendered inside `.fi-fo-repeater-add > button.fi-btn`.
   We scope it to .cc-sqm only so other repeaters are unaffected.
   The nested answers repeater is ALSO a descendant of .cc-sqm so its
   add button gets the same dashed treatment — consistent with the design. */
.cc-sqm .fi-fo-repeater-add .fi-btn {
    width: 100%;
    justify-content: center;
    background: transparent !important;
    border: 1px dashed var(--border-strong) !important;
    color: var(--cc-cyan) !important;
    border-radius: var(--r-md) !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.cc-sqm .fi-fo-repeater-add .fi-btn:hover {
    border-color: var(--cc-cyan) !important;
    background: var(--cc-cyan-tint) !important;
}

/* --- Tier chips on field hints (Manager B design) ---
 * Rendered via ->hint(HtmlString) on every SQ field; the hint slot sits
 * at the top-right of the field label row — exactly where the design's
 * tier chip appears. Scoped under .cc-sqm to avoid bleed. */
.cc-sqm-tier {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
}
/* CORE — orange tint */
.cc-sqm-tier--core {
    background: var(--cc-orange-tint);
    color: var(--cc-orange-deep);
}
.dark .cc-sqm-tier--core {
    background: rgba(212, 105, 41, .20);
    color: #e3955f;
}
/* COMMON — cyan */
.cc-sqm-tier--common {
    background: var(--cc-cyan-tint);
    color: var(--cc-cyan);
}
.dark .cc-sqm-tier--common {
    background: rgba(30, 144, 185, .18);
    color: #7dd3fc;
}
/* OCCASIONAL — grey */
.cc-sqm-tier--occasional {
    background: var(--bg-sunken);
    color: var(--fg-secondary);
}
/* RARE — faint */
.cc-sqm-tier--rare {
    background: var(--bg-hover);
    color: var(--fg-muted);
}

/* ============================================================
   Category Enrichment — dark-mode charcoal palette (Claude Design)
   Scoped to the CE editor (.cc-ce-scope) and browser (.cc-ce-grid) so the
   rest of the panel's dark theme is untouched. Light mode is unchanged —
   every rule below is under `.dark`. .cc-ce-scope is display:contents, so
   it adds no box of its own but still carries the token overrides and acts
   as the selector root for re-skinning Filament's form chrome.
   Palette: bg #16171a · panel #1e2024 · card #25272b · card2 #2c2e33 ·
   field #191a1d · text #e9eaec/#a0a3a8/#71747a · lines white-alpha.
   ============================================================ */
.cc-ce-scope {
    display: contents;
}

/* Layer 1 — token overrides consumed by all custom cc-* boxes */
.dark .cc-ce-scope,
.dark .cc-ce-grid {
    --bg-elev: #25272b;
    --bg-sunken: #191a1d;
    --bg-hover: #2c2e33;
    --fg: #e9eaec;
    --fg-secondary: #a0a3a8;
    --fg-muted: #71747a;
    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .14);
}

/* Layer 2 — re-skin Filament's own form chrome inside the editor */
.dark .cc-ce-scope .fi-section,
.dark .cc-ce-scope .fi-fieldset {
    background: #1e2024;
    border-color: rgba(255, 255, 255, .07);
    box-shadow: none;
}
.dark .cc-ce-scope .fi-section-header,
.dark .cc-ce-scope .fi-section-content,
.dark .cc-ce-scope .fi-section-content-ctn {
    background: transparent;
}
.dark .cc-ce-scope .fi-section-header-heading {
    color: #e9eaec;
}
.dark .cc-ce-scope .fi-section-header-description {
    color: #a0a3a8;
}

/* Nested repeater item cards a touch lighter than the panel */
.dark .cc-ce-scope .fi-fo-repeater-item {
    background: #25272b;
    border-color: rgba(255, 255, 255, .07);
}

/* Inputs → sunken charcoal fields */
.dark .cc-ce-scope .fi-input-wrp {
    background: #191a1d;
    border-color: rgba(255, 255, 255, .13);
}
.dark .cc-ce-scope .fi-input {
    color: #e9eaec;
}
.dark .cc-ce-scope .fi-input::placeholder {
    color: #71747a;
}
