/* ============================================================
   octa-sales — app-level styles. COMPLEMENTS the Octacer design
   system (octacer-theme.css owns .oc-card / .btn / .field-* / .badge /
   .oc-table / .oc-empty / .oc-stat / .oc-hero / .oc-tabs). This file adds
   only the app SHELL + layout helpers and never redefines a theme class.
   Uses the theme's CSS variables (--brand-*, --ink-*, --line, --surface).
   ============================================================ */

:root { --sidebar-w: 248px; }

/* ============================================================
   Brand remap — "Stone / Indigo" theme (tweakcn/shadcn palette), mapped onto the
   Octacer raw design tokens so the whole .oc-* layer, this file, AND the Tailwind
   token utilities (bg-card / text-foreground / bg-primary / border-border) all
   re-skin from ONE place. This is the sanctioned app-customization seam
   (THEME.md §App customization): we override the PUBLIC variables only —
   octacer-theme.css / octacer-tailwind.css stay untouched so octa-core sync is clean.
   Tokens the source theme doesn't ship (status success/warning/info + subtle pairs,
   the brand ramp, the ink/line scales, overlay, gradients, and --ring as a box-shadow)
   are synthesized to match. Loaded after octacer-theme.css, so these win.
   Source palette: primary #6366f1 (indigo), warm-stone surfaces, radius 1.25rem,
   Plus Jakarta Sans + Lora + Roboto Mono. Fonts are loaded in _ThemeHead. */
:root {
    /* Brand ramp — Tailwind indigo (matches the theme's chart ramp) */
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;

    /* Primary action (theme --primary = indigo-500) */
    --primary:            #6366f1;
    --primary-active:     #4f46e5;
    --primary-foreground: #ffffff;

    /* Ink / text scale (theme foreground #1e293b → muted-foreground #6b7280) */
    --ink-900: #1e293b;
    --ink-800: #334155;
    --ink-700: #475569;
    --ink-600: #64748b;
    --ink-500: #6b7280;
    --ink-400: #9ca3af;
    --ink-300: #cbd5e1;

    /* Surfaces — warm stone (theme background / card / popover / muted) */
    --bg:            #e7e5e4;
    --surface:       #f5f5f4;
    --popover:       #f5f5f4;
    --surface-muted: #e7e5e4;

    /* Lines / fields (theme border + input #d6d3d1) */
    --line:        #d6d3d1;
    --line-2:      #e7e5e4;
    --line-strong: #c4c0bc;
    --input:       #d6d3d1;
    --overlay:     rgb(41 37 36 / 0.5);   /* stone-tinted modal/drawer scrim (synthesized) */

    /* Status — the theme ships only destructive; the rest kept accessible + on-brand */
    --danger:  #ef4444;  --danger-foreground:  #ffffff;
    --success: #059669;  --success-foreground: #ffffff;
    --warning: #d97706;  --warning-foreground: #ffffff;
    --info:    #2563eb;  --info-foreground:    #ffffff;
    --success-subtle: #ecfdf5;  --success-subtle-foreground: #065f46;
    --warning-subtle: #fffbeb;  --warning-subtle-foreground: #92400e;
    --danger-subtle:  #fef2f2;  --danger-subtle-foreground:  #991b1b;
    --info-subtle:    #eff6ff;  --info-subtle-foreground:    #1e40af;

    /* Charts — the theme's indigo ramp */
    --chart-1: #6366f1;
    --chart-2: #4f46e5;
    --chart-3: #4338ca;
    --chart-4: #3730a3;
    --chart-5: #312e81;

    /* Fonts (theme faces) + tracking */
    --font-sans:  "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Lora", ui-serif, Georgia, "Times New Roman", serif;
    --font-mono:  "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --tracking-normal: 0em;

    /* Radius (theme --radius = 1.25rem), synthesized gradients, --ring as a box-shadow */
    --radius:    1.25rem;
    --radius-lg: 1.25rem;
    --ring: 0 0 0 4px rgba(99, 102, 241, .25);
    --gradient-brand:   linear-gradient(135deg, #3730a3 0%, #4f46e5 52%, #6366f1 100%);
    --gradient-mono:    linear-gradient(135deg, #1e293b 0%, #475569 52%, #94a3b8 100%);
    --gradient-surface: linear-gradient(135deg, #f5f5f4 0%, #e7e5e4 100%);

    /* Soft, slightly-tinted shadow ramp (theme shadow color hsl(240 4% 60%)) */
    --shadow-sm: 2px 2px 10px 4px hsl(240 4% 60% / 0.09);
    --shadow-md: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 2px 4px 3px hsl(240 4% 60% / 0.18);
    --shadow-lg: 2px 2px 10px 4px hsl(240 4% 60% / 0.18), 2px 8px 10px 3px hsl(240 4% 60% / 0.18);
}

/* Dark mode (.dark on <html>) — theme's warm-black surfaces + indigo-400 primary.
   Wins over octacer-theme.css's .dark because this file loads after it. */
.dark {
    --primary:            #818cf8;
    --primary-active:     #6366f1;
    --primary-foreground: #1e1b18;

    --ink-900: #e2e8f0;
    --ink-800: #cbd5e1;
    --ink-700: #d1d5db;
    --ink-600: #9ca3af;
    --ink-500: #9ca3af;
    --ink-400: #6b7280;
    --ink-300: #4b5563;

    --bg:            #1e1b18;
    --surface:       #2c2825;
    --popover:       #2c2825;
    --surface-muted: #3a3633;   /* raised above --surface so hovers read on dark cards */

    --line:        #3a3633;
    --line-2:      #2c2825;
    --line-strong: #484441;
    --input:       #4a4643;      /* lighter than --line so inputs read editable */
    --overlay:     rgb(0 0 0 / 0.7);

    --success-subtle: #0c2417;  --success-subtle-foreground: #86efac;
    --warning-subtle: #2b1d05;  --warning-subtle-foreground: #fcd34d;
    --danger-subtle:  #2a1215;  --danger-subtle-foreground:  #fca5a5;
    --info-subtle:    #0b2434;  --info-subtle-foreground:    #7dd3fc;

    --chart-1: #818cf8;
    --chart-2: #6366f1;
    --chart-3: #4f46e5;
    --chart-4: #4338ca;
    --chart-5: #3730a3;

    --ring: 0 0 0 4px rgba(129, 140, 248, .30);
    --gradient-brand:   linear-gradient(135deg, #3730a3 0%, #4338ca 52%, #6366f1 100%);
    --gradient-mono:    linear-gradient(135deg, #1e1b18 0%, #3a3633 52%, #57534e 100%);
    --gradient-surface: linear-gradient(135deg, #2c2825 0%, #1e1b18 100%);

    --shadow-sm: 2px 2px 10px 4px hsl(0 0% 0% / 0.09);
    --shadow-md: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 2px 4px 3px hsl(0 0% 0% / 0.18);
    --shadow-lg: 2px 2px 10px 4px hsl(0 0% 0% / 0.18), 2px 8px 10px 3px hsl(0 0% 0% / 0.18);
}

/* ---------- Typography ----------
   Theme faces: Plus Jakarta Sans (UI/headings) + Roboto Mono (data), loaded in _ThemeHead.
   This display rule keeps the app's title/brand/stat classes on the sans face. */
h1, h2, h3, h4, h5, h6,
.oc-card-title, .oc-section-title, .oc-section-t, .oc-page-title, .oc-hero-title,
.oc-brand-name, .oc-land-title, .oc-niche-name,
.oc-kpi-value, .oc-tile-v, .oc-hero-metric .v, .oc-funnel-step .n, .oc-niche-metric .v,
.oc-stat-value, .oc-ring-v {
    font-family: var(--font-sans);
}

/* ---------- UX polish: cursor / hover / keyboard focus (applies app-wide) ---------- */
.btn, a.btn, button, .oc-chip, .oc-nav-link, .oc-icon-btn, .oc-start, .oc-kcard,
.oc-card-hover, [role="button"], summary, .oc-toggle, .oc-check, select, label[for] { cursor: pointer; }
button:disabled, .btn:disabled, .btn[aria-disabled="true"], [aria-busy="true"] { cursor: not-allowed; }
/* Loading-spinner visibility on light buttons. octacer-theme.css draws the mid-request spinner
   with a WHITE border (`border: 2px solid #fff`) — invisible on outline/ghost/white buttons, the
   light variants used all over the app (Generate/Regenerate/View, filter actions, …). Worse, that
   rule (`form.htmx-request … button[type="submit"].btn::after`) out-specifies the theme's own
   aria-busy variant overrides, so on a form submit the spinner always renders white regardless of
   variant. Recolour the arc to the brand accent for every light variant, in both the htmx-request
   and the aria-busy/is-loading states. sales.css loads after octacer-theme.css, so this wins. */
form.htmx-request button[type="submit"].btn-outline::after,
form.htmx-request button[type="submit"].btn-ghost::after,
form.htmx-request button[type="submit"].btn-white::after,
.btn-outline[aria-busy="true"]::after, .btn-outline.is-loading::after,
.btn-ghost[aria-busy="true"]::after, .btn-ghost.is-loading::after,
.btn-white[aria-busy="true"]::after, .btn-white.is-loading::after {
    border-color: var(--brand-600);
    border-right-color: transparent;
}
/* Bare HTMX buttons (hx-get/post ON the button, not a form submit) get `.htmx-request` on the
   element itself while the request is in flight — the theme only spins form submit buttons, so a
   standalone async button (e.g. the campaign document "View") showed no in-button feedback. Match
   the submit-button treatment so every async click reads as "working". htmx only tags the trigger
   this way when it has no hx-indicator, so buttons that drive a spinner elsewhere are untouched. */
button.btn.htmx-request { color: transparent !important; pointer-events: none; position: relative; }
button.btn.htmx-request > * { visibility: hidden; }
button.btn.htmx-request::after {
    content: ""; position: absolute; width: 1.05em; height: 1.05em; visibility: visible;
    border: 2px solid #fff; border-right-color: transparent; border-radius: 50%;
    animation: oc-spin .6s linear infinite;
}
button.btn-outline.htmx-request::after,
button.btn-ghost.htmx-request::after,
button.btn-white.htmx-request::after { border-color: var(--brand-600); border-right-color: transparent; }
/* keyboard focus ring on custom interactive elements (theme already covers .btn / .field-*) */
.oc-nav-link:focus-visible, .oc-chip:focus-visible, .oc-link:focus-visible,
.oc-icon-btn:focus-visible, .oc-start:focus-visible, .oc-kcard:focus-visible,
.oc-tab:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
/* clickable cards lift on hover, settle on press */
.oc-start:active, .oc-kcard:active, .oc-tile:active, .oc-kpi:active { transform: translateY(0); }

/* ---------- App shell ---------- */
.oc-shell { display: flex; min-height: 100vh; }

.oc-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 1.1rem .8rem; z-index: 40;
}
.oc-brand { display: flex; align-items: center; gap: .65rem; padding: .35rem .55rem 1.1rem; text-decoration: none; }
.oc-brand-badge { width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, var(--brand-500), var(--brand-700)); box-shadow: 0 2px 6px -1px rgba(79,70,229,.5); }
.oc-brand-badge i { font-size: 18px; }
.oc-brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; color: var(--ink-900); line-height: 1.1; }
.oc-brand-name small { display: block; font-size: .64rem; font-weight: 600; color: var(--ink-400); letter-spacing: .03em; text-transform: uppercase; }
/* Platform name: full "Octacer Sales", collapsing to "Sales" when space is tight */
.oc-brand-short { display: none; }

.oc-nav { display: flex; flex-direction: column; gap: .12rem; overflow-y: auto; }
.oc-nav-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-400); font-weight: 700; padding: .8rem .6rem .3rem; }
.oc-nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: .6rem; font-size: .875rem; font-weight: 500; color: var(--ink-600); text-decoration: none; transition: background .15s, color .15s; }
.oc-nav-link:hover { background: var(--line-2); color: var(--ink-900); }
.oc-nav-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.oc-nav-link i { font-size: 18px; flex: 0 0 auto; width: 18px; text-align: center; }

.oc-side-foot { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: .8rem; display: flex; align-items: center; gap: .6rem; }
.oc-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: 0 0 auto; }
.oc-side-user { flex: 1; min-width: 0; }
.oc-side-user .n { font-size: .82rem; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-side-user .r { font-size: .7rem; color: var(--ink-400); }

.oc-content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.oc-content--full { margin-left: 0; }
.oc-main { max-width: 1180px; margin: 0 auto; padding: 1.9rem 2rem 4rem; }

/* Guest top bar (unauthenticated) */
.oc-guestbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.oc-guestbar-in { max-width: 1180px; margin: 0 auto; padding: .7rem 2rem; display: flex; align-items: center; justify-content: space-between; }

/* ---------- Spacing utilities (no inline styles allowed in .cshtml) ---------- */
.oc-mt { margin-top: .9rem; }
.oc-mb { margin-bottom: .9rem; }
.oc-mb-lg { margin-bottom: 1.1rem; }
.oc-brand--flat { padding: 0; }

/* Inline code / search-query chip (monospace, wraps) */
.oc-code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem; line-height: 1.35; color: var(--ink-600, #475569); background: #f1f5f9;
    border: 1px solid #e2e8f0; border-radius: .35rem; padding: .15rem .4rem; white-space: normal;
    word-break: break-word; max-width: 34rem; }

/* ---------- Page header ---------- */
.oc-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.oc-page-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-900); }
.oc-page-sub { color: var(--ink-500); font-size: .85rem; margin-top: .2rem; max-width: 68ch; }
.oc-head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ---------- Card body (theme .oc-card intentionally has no padding) ---------- */
.oc-card-body { padding: 1rem 1.1rem; }
/* The rewritten octacer-theme.css auto-spaces card-body children (`.oc-card-body > * + *
   { margin-top: 1rem }`). This app hand-specifies card spacing via grid/flex `gap-*` and
   `mt-*` utilities, so that blanket rule double-spaces every multi-child card. Neutralise it
   and keep the app's explicit spacing model. */
.oc-card-body > * + * { margin-top: 0; }
/* Auto-pad bare content dropped straight into a card so nothing sits flush to the edge. */
.oc-card > .oc-dl,
.oc-card > .oc-list,
.oc-card > .oc-funnel,
.oc-card > .oc-assist-links,
.oc-card > .oc-checklist,
.oc-card > .oc-niche-stats,
.oc-card > .oc-empty,
.oc-card > textarea { padding: .9rem 1.1rem 1rem; margin: 0; }
.oc-card > p { padding: .25rem 1.1rem; margin: 0; color: var(--ink-600); font-size: .88rem; line-height: 1.5; }
.oc-card > p:first-of-type { padding-top: .9rem; }
.oc-card > p:last-of-type { padding-bottom: 1rem; }
.oc-card > .badge { margin: 0 1.25rem 1.25rem; }
.oc-card > .oc-alert { margin: 0 1.25rem 1.25rem; }
/* action bar placed directly in a card (e.g. the cockpit plan approve row) */
.oc-card > .oc-form-actions { padding-left: 1.25rem; padding-right: 1.25rem; padding-bottom: 1.25rem; }

/* ---------- Hero banner (theme .oc-hero provides the gradient; we add padding/content) ---------- */
.oc-hero-body { padding: 1.6rem 1.85rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.oc-hero-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.oc-hero-sub { color: rgba(255, 255, 255, .8); font-size: .9rem; margin-top: .3rem; max-width: 52ch; }
.oc-hero-metrics { display: flex; gap: 2rem; }
.oc-hero-metric .v { font-size: 1.7rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.oc-hero-metric .l { font-size: .74rem; color: rgba(255, 255, 255, .75); margin-top: .3rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Stat / KPI cards ---------- */
.oc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.oc-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.15rem 1.25rem; transition: box-shadow .2s, transform .2s, border-color .2s; }
.oc-kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #dbe1ea; }
.oc-kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); font-weight: 600; }
.oc-kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--ink-900); margin-top: .3rem; letter-spacing: -.02em; line-height: 1; }
.oc-kpi-foot { font-size: .78rem; color: var(--ink-400); margin-top: .3rem; }

/* ---------- Funnel row ---------- */
.oc-funnel { display: flex; flex-wrap: wrap; gap: .6rem; }
.oc-funnel-step { flex: 1; min-width: 108px; background: var(--line-2); border: 1px solid var(--line); border-radius: .75rem; padding: .85rem .6rem; text-align: center; }
.oc-funnel-step .n { font-size: 1.35rem; font-weight: 800; color: var(--brand-700); line-height: 1; }
.oc-funnel-step .s { font-size: .72rem; color: var(--ink-500); margin-top: .3rem; }

/* ---------- Grids ---------- */
.oc-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
/* align-items:start so a tall card (e.g. a long tech stack) doesn't stretch its row-mates
   into big empty boxes — each card sizes to its own content. */
.oc-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.oc-cockpit { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.15rem; }
.oc-card-wide { grid-column: 1 / -1; }
/* Lead cockpit: "story" (main) + "decision" (sidebar) two-column layout */
.oc-cockpit-2col { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }
.oc-colstack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 900px) { .oc-cockpit-2col { grid-template-columns: 1fr; } }
/* Destructive-action affordance (turns red on hover) */
.oc-danger-btn:hover { color: #dc2626; border-color: #dc2626; }
/* Inline checkbox row (e.g. buying-committee flags in the contact editor) */
.oc-checkrow { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.oc-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-700); }
/* Theme's `.oc-card + .oc-card` stacking margin is for column flows; in grids the container gap
   owns spacing (a margin here would sink every card after the first inside its cell). */
.oc-card-grid > .oc-card + .oc-card,
.oc-detail-grid > .oc-card + .oc-card,
.oc-cockpit > .oc-card + .oc-card,
.oc-guide-cols > .oc-card + .oc-card { margin-top: 0; }

/* ---------- Definition list / plain list inside cards ---------- */
.oc-dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: .5rem 1rem; margin: 0; }
.oc-dl dt { color: var(--ink-500); font-size: .82rem; }
.oc-dl dd { margin: 0; color: var(--ink-900); font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; }
.oc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.oc-list li { font-size: .875rem; color: var(--ink-700); }
.oc-checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; font-size: .875rem; color: var(--ink-700); }
.oc-niche-stats { display: flex; gap: 1.25rem; font-size: .82rem; color: var(--ink-600); }
.oc-add-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.oc-assist-links { display: flex; flex-wrap: wrap; gap: .45rem; }
/* ---------- Tag pills (tech stack, keyword lists) ---------- */
.oc-fieldlabel { font-size: .82rem; color: var(--ink-500); margin: 0 0 .45rem; }
.oc-card-body .oc-fieldlabel:not(:first-child) { margin-top: .9rem; }
.oc-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.oc-tag { font-size: .75rem; font-weight: 500; padding: .2rem .5rem; border-radius: 6px;
    background: var(--line-2); color: var(--ink-700); border: 1px solid var(--line); }
.oc-more { margin-top: .55rem; }
.oc-more > summary { font-size: .8rem; font-weight: 600; color: var(--brand-700); cursor: pointer; list-style: revert; }
.oc-more[open] > summary { margin-bottom: .5rem; }
/* ---------- Filter bar (list/board): ownership segmented control + field row ---------- */
.oc-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.oc-filterbar-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 1 1 auto; }
/* Theme form controls are width:100% block elements; inside the filter row they must size to content
   (an explicit flex-basis beats the inherited width:100%) so they sit inline instead of stacking. */
.oc-filterbar-fields .field-select { flex: 0 1 11rem; min-width: 8.5rem; width: auto; }
.oc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.oc-seg-btn { padding: .42rem .8rem; font-size: .82rem; font-weight: 500; color: var(--ink-600); background: transparent; border: 0; border-right: 1px solid var(--line); }
.oc-seg-btn:last-child { border-right: 0; }
.oc-seg-btn:hover { background: var(--line-2); color: var(--ink-900); }
.oc-seg-btn.is-active { background: var(--brand-600); color: #fff; }
/* Radio-backed segmented control (no JS): the radio is always serialized into the GET, so scope
   survives an auto-apply select change. Visually identical to .oc-seg-btn. */
.oc-seg-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.oc-seg-opt { padding: .42rem .8rem; font-size: .82rem; font-weight: 500; color: var(--ink-600);
    border-right: 1px solid var(--line); cursor: pointer; display: inline-flex; align-items: center; }
.oc-seg-opt:last-of-type { border-right: 0; }
.oc-seg-opt:hover { background: var(--line-2); color: var(--ink-900); }
.oc-seg-radio:checked + .oc-seg-opt { background: var(--brand-600); color: #fff; }
.oc-seg-radio:focus-visible + .oc-seg-opt { outline: none; box-shadow: var(--ring); position: relative; z-index: 1; }

/* Applied-filter chips (§31) — each removable via an HTMX swap; "Clear all" is a full reset. */
.oc-fchips { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 .95rem; }
.oc-fchip { display: inline-flex; align-items: center; gap: .4rem; padding: .26rem .32rem .26rem .6rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .78rem; color: var(--ink-700); }
.oc-fchip b { font-weight: 600; color: var(--ink-500); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.oc-fchip a { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 999px; color: var(--ink-400); text-decoration: none; }
.oc-fchip a:hover { background: var(--line-2); color: var(--ink-900); }
.oc-fchip a i { font-size: 11px; }
.oc-fclear { font-size: .8rem; color: var(--brand-700); font-weight: 500; text-decoration: none; }
.oc-fclear:hover { text-decoration: underline; }
.oc-fbusy { color: var(--ink-400); margin-left: .1rem; }
.oc-fsearch { flex: 1 1 14rem; min-width: 11rem; max-width: 22rem; width: auto; }

/* Filter row with a trailing Table|Board view toggle (Leads). Toggle stays inside the swapped panel so
   its active state re-renders with the results. */
.oc-filtertop { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.oc-filtertop > .oc-filterbar { flex: 1 1 auto; margin-bottom: 0; }
.oc-viewtoggle { flex: 0 0 auto; }
.oc-seg-link { padding: .42rem .8rem; font-size: .82rem; font-weight: 500; color: var(--ink-600);
    border-right: 1px solid var(--line); display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.oc-seg-link:last-child { border-right: 0; }
.oc-seg-link:hover { background: var(--line-2); color: var(--ink-900); }
.oc-seg-link.is-active, .oc-seg-link.is-active:hover { background: var(--brand-600); color: #fff; }

/* Row 1 sub-bar: Leads/Companies tabs on the left, scope + view toggles on the right. */
.oc-subbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.oc-subbar .oc-chips { margin-bottom: 0; }
.oc-subbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Row 2 head actions: search + Filters popover + Import CSV. Search is bounded so it doesn't crowd the row. */
.oc-fsearch-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.oc-head-actions .oc-fsearch { flex: 0 1 18rem; width: 18rem; max-width: 100%; }
.oc-filpop { position: relative; flex: 0 0 auto; }
.oc-filpop-btn { display: inline-flex; align-items: center; gap: .4rem; }
/* Popover aligns to the button's right edge (the button sits on the right side of the page). */
.oc-filpop-panel { position: absolute; top: calc(100% + .4rem); right: 0; left: auto; z-index: 40;
    min-width: 15rem; padding: .85rem; display: flex; flex-direction: column; gap: .7rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: .8rem;
    box-shadow: 0 12px 34px -10px rgba(15, 23, 42, .28); }
.oc-filpop-field { display: flex; flex-direction: column; gap: .3rem; }
.oc-filpop-field .field-label { font-size: .7rem; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .03em; }
.oc-filpop-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .55rem; border-top: 1px solid var(--line-2); }
/* Kanban card meta row (tier / ICP / owner) */
.oc-kcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .4rem; }
.oc-kcard-owner { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; color: var(--ink-500); }
/* Lead cockpit: header badge strip + contact rows */
.oc-head-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.oc-contact { display: block; }
.oc-contact + .oc-contact { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .1rem; }
/* Per-field provenance chip + inline verify affordance */
.oc-provwrap { display: inline-flex; align-items: center; gap: .25rem; margin-left: .35rem; vertical-align: middle; }
.oc-provtag { font-size: .62rem; }
.oc-provverify { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem;
    padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-500); font-size: .6rem; }
.oc-provverify:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.oc-muted { color: var(--ink-400); font-size: .85rem; }
.oc-link { color: var(--brand-700); font-weight: 600; text-decoration: none; }
.oc-link:hover { text-decoration: underline; }
.oc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
/* Collapsible advanced section (e.g. raw scoring-spec JSON on the ICP editor) */
.oc-advanced { margin: .75rem 0; border: 1px solid var(--line); border-radius: .5rem; padding: .5rem .75rem; background: var(--surface); }
.oc-advanced > summary { cursor: pointer; font-weight: 600; color: var(--ink-700); list-style: revert; }
.oc-advanced[open] > summary { margin-bottom: .6rem; }
/* Right-align numeric/currency/percentage columns (portal-ux §21) */
.oc-num { text-align: right; font-variant-numeric: tabular-nums; }
/* List result count / pagination context (portal-ux §35) */
.oc-listcount { color: var(--ink-400); font-size: .82rem; margin: 0 0 .6rem; }
/* Inline (in-card / in-widget) empty state — smaller than the page-level oc-empty (§66) */
.oc-empty-inline { padding: 1.5rem 1rem; }
.oc-empty-inline p { margin: 0; color: var(--ink-400); font-size: .85rem; text-align: center; }

/* ---------- Standalone tables get a card frame (theme table is bare, meant for inside a card) ---------- */
.oc-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.oc-card .oc-table { background: transparent; border: none; border-radius: 0; box-shadow: none; }

/* ---------- Toolbar / forms ---------- */
.oc-toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.oc-toolbar .field-group { flex: 1; max-width: 400px; }

/* Slim determinate progress bar — semantic native <progress>, no inline style (portal-ux §4/§61). */
.oc-progress { -webkit-appearance: none; appearance: none; width: 100%; height: .5rem; border: 0; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.oc-progress::-webkit-progress-bar { background: #e2e8f0; border-radius: 999px; }
.oc-progress::-webkit-progress-value { background: var(--brand-600); border-radius: 999px; }
.oc-progress::-moz-progress-bar { background: var(--brand-600); border-radius: 999px; }

/* AI-generated Markdown summary block (raw markdown, copyable) — SubTaskDetails pages. */
.oc-md { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.55; max-height: 30rem; overflow: auto; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .8rem .95rem; color: #1e293b; margin: 0; }

/* Rendered Markdown (Markdig HTML) — readable prose for the AI summary (SubTaskDetails pages). */
.oc-md-rendered { font-size: .9rem; line-height: 1.65; color: #1e293b; max-height: 42rem; overflow: auto; word-break: break-word; }
.oc-md-rendered > :first-child { margin-top: 0; }
.oc-md-rendered > :last-child { margin-bottom: 0; }
.oc-md-rendered h1, .oc-md-rendered h2, .oc-md-rendered h3, .oc-md-rendered h4, .oc-md-rendered h5 { font-weight: 700; color: #0f172a; line-height: 1.3; margin: 1.3em 0 .5em; }
.oc-md-rendered h1 { font-size: 1.35rem; }
.oc-md-rendered h2 { font-size: 1.15rem; }
.oc-md-rendered h3 { font-size: 1.02rem; }
.oc-md-rendered h4, .oc-md-rendered h5 { font-size: .92rem; }
.oc-md-rendered p { margin: .6em 0; }
.oc-md-rendered ul, .oc-md-rendered ol { margin: .6em 0; padding-inline-start: 1.4em; }
.oc-md-rendered ul { list-style: disc; }
.oc-md-rendered ol { list-style: decimal; }
.oc-md-rendered li { margin: .25em 0; }
.oc-md-rendered li > ul, .oc-md-rendered li > ol { margin: .25em 0; }
.oc-md-rendered a { color: var(--brand-700, #0369a1); text-decoration: underline; }
.oc-md-rendered strong { font-weight: 700; color: #0f172a; }
.oc-md-rendered code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: #f1f5f9; padding: .1em .35em; border-radius: .25rem; }
.oc-md-rendered pre { background: #0f172a; color: #e2e8f0; padding: .8rem 1rem; border-radius: .5rem; overflow: auto; margin: .8em 0; }
.oc-md-rendered pre code { background: none; padding: 0; color: inherit; font-size: .82rem; }
.oc-md-rendered blockquote { border-inline-start: 3px solid #e2e8f0; padding-inline-start: 1rem; color: #475569; margin: .8em 0; }
.oc-md-rendered table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: .85rem; }
.oc-md-rendered th, .oc-md-rendered td { border: 1px solid #e2e8f0; padding: .45rem .6rem; text-align: start; vertical-align: top; }
.oc-md-rendered th { background: #f8fafc; font-weight: 600; }
.oc-md-rendered hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1.3em 0; }
.oc-md-rendered img { max-width: 100%; height: auto; border-radius: .375rem; }
.oc-form { padding: 1.1rem; }
.oc-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem 1rem; margin-bottom: .8rem; }
.oc-form .field { margin-bottom: .7rem; }
.oc-form-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .4rem; padding-top: .85rem; border-top: 1px solid var(--line-2); }
/* a card head placed at the top of a padded form should still bleed to the card edges */
.oc-form > .oc-card-head:first-child { margin: -1.1rem -1.1rem 1rem; }
.oc-inline-form { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
/* Single-row action bar: a grow-to-fill input beside its buttons (compact create/generate forms) */
.oc-toolbar-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.oc-toolbar-form .field { margin: 0; }
.oc-grow { flex: 1 1 320px; min-width: 0; }
/* Inline checkbox + label as a form field (equal-weight boolean options) */
.oc-checkfield { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-700); cursor: pointer; }
.oc-checkfield input { flex: none; }
.oc-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.oc-field-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .45rem; }
.oc-nowrap { white-space: nowrap; }
/* Audit-log expandable payload */
.oc-audit-payload { margin-top: .35rem; }
.oc-audit-payload > summary { font-size: .8rem; color: var(--brand-700); }
.oc-audit-json { margin: .4rem 0 0; padding: .6rem .7rem; max-height: 20rem; overflow: auto;
    background: #f8fafc; border: 1px solid var(--line, #e2e8f0); border-radius: .4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem;
    line-height: 1.4; white-space: pre-wrap; word-break: break-word; color: var(--ink-700, #334155); }
.field-input-sm { padding: .4rem .55rem; font-size: .82rem; }

/* ---------- Chips (filter / sub-nav) ---------- */
.oc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.35rem; }
.oc-chip { padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--ink-600); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.oc-chip:hover { background: var(--line-2); color: var(--ink-900); }
.oc-chip-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ---------- Landing (guest) ---------- */
.oc-land { max-width: 720px; margin: 4.5rem auto; text-align: center; }
.oc-land-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: .8rem; padding: .35rem .8rem; border-radius: 999px; }
.oc-land-badge i { font-size: 15px; }
.oc-land-title { font-size: 2.7rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink-900); margin: 1.2rem 0 .7rem; line-height: 1.08; }
.oc-land-sub { color: var(--ink-600); font-size: 1.05rem; line-height: 1.65; margin: 0 auto 1.9rem; max-width: 34rem; }
.oc-land-foot { color: var(--ink-400); font-size: .85rem; margin-top: 1.1rem; }

/* ---------- Centered card (access-denied / error) ---------- */
.oc-center-card { max-width: 460px; margin: 5rem auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2.5rem 2rem; }
.oc-center-card .oc-icon-box { margin: 0 auto 1rem; }
.oc-center-card .oc-page-title { font-size: 1.25rem; }
.oc-center-card .oc-page-sub { margin: .5rem auto 0; }
.oc-center-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.oc-icon-danger { background: #fef2f2; color: var(--danger); }
.oc-icon-brand { background: var(--brand-50); color: var(--brand-700); }
/* Font Awesome glyphs size by font-size — scale them to fill the theme's icon tiles/buttons. */
.oc-icon-box i { font-size: 1.2rem; }
.oc-icon-btn i { font-size: 1rem; }

/* ---------- Kanban ---------- */
.oc-kanban { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.oc-kcol { flex: 0 0 268px; background: var(--line-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .7rem; }
.oc-kcol-head { font-size: .8rem; font-weight: 700; color: var(--ink-700); display: flex; align-items: center; justify-content: space-between; padding: .25rem .35rem .6rem; }
.oc-kcol-body { display: flex; flex-direction: column; gap: .55rem; min-height: 60px; }
.oc-kcol-empty { border: 1px dashed var(--line); border-radius: .6rem; padding: .9rem .5rem; text-align: center; color: var(--ink-400); font-size: .78rem; }
.oc-kcol-empty[hidden] { display: none; }
.oc-kcard { background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; padding: .7rem .8rem; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .1s; }
.oc-kcard:hover { box-shadow: var(--shadow-md); }
.oc-kcard:active { cursor: grabbing; }
.oc-kcard-sub { font-size: .75rem; color: var(--ink-400); margin-top: .4rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.oc-dragging { opacity: .5; }
.oc-col-over { outline: 2px dashed var(--brand-400, #818cf8); outline-offset: 2px; border-radius: var(--radius-lg); }

/* ---------- Get-started tiles (empty dashboard) ---------- */
.oc-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.oc-start { display: block; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; transition: box-shadow .2s, transform .1s, border-color .2s; }
.oc-start:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--brand-200, #c7d2fe); }
.oc-start-ic { width: 2.4rem; height: 2.4rem; border-radius: .7rem; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: .6rem; }
.oc-start-ic i { font-size: 20px; }
.oc-start-t { display: block; font-weight: 700; color: var(--ink-900); font-size: .92rem; }
.oc-start-d { display: block; color: var(--ink-500); font-size: .82rem; margin-top: .25rem; line-height: 1.45; }

/* ---------- AI suggestion cards (pick-a-target) ---------- */
.oc-suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.oc-suggest { text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 1rem 1.05rem; cursor: pointer; display: flex; flex-direction: column; gap: .35rem;
    transition: box-shadow .2s ease, transform .12s ease, border-color .2s ease; font: inherit; }
.oc-suggest:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--brand-500); }
.oc-suggest:focus-visible { outline: none; box-shadow: var(--ring); }
.oc-suggest-label { font-weight: 700; color: var(--ink-900); font-size: .92rem; display: flex; align-items: center; gap: .45rem; }
.oc-suggest-label::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand-500); flex: 0 0 auto; }
.oc-suggest-desc { font-size: .82rem; color: var(--ink-500); line-height: 1.45; }
.oc-suggest-cta { font-size: .74rem; color: var(--brand-700); font-weight: 700; margin-top: .3rem; display: inline-flex; align-items: center; gap: .3rem; }
.oc-suggest-cta i { font-size: 14px; }

/* ---------- Niche cards (premium, color-accented) ---------- */
.oc-niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.oc-niche-card { --acc: var(--brand-600); position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .25s ease, transform .18s ease, border-color .25s ease; }
.oc-niche-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--acc); }
.oc-niche-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--acc); }
.oc-niche-head { display: flex; align-items: center; gap: .85rem; padding: 1.3rem 1.25rem .5rem; }
.oc-niche-ic { width: 2.7rem; height: 2.7rem; border-radius: .85rem; display: grid; place-items: center; color: #fff;
    background: var(--acc); box-shadow: 0 6px 14px -5px var(--acc); flex: 0 0 auto; }
.oc-niche-ic i { font-size: 20px; }
.oc-niche-name { font-weight: 800; font-size: 1.03rem; letter-spacing: -.01em; color: var(--ink-900); line-height: 1.15; }
.oc-niche-meta { font-size: .78rem; color: var(--ink-400); margin-top: .15rem; }
.oc-niche-body { padding: .6rem 1.25rem 1.2rem; display: flex; flex-direction: column; gap: .95rem; flex: 1; }
.oc-niche-desc { font-size: .85rem; color: var(--ink-600); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oc-niche-metrics { display: flex; gap: .5rem; }
.oc-niche-metric { flex: 1; background: var(--line-2); border-radius: 12px; padding: .6rem .3rem; text-align: center; }
.oc-niche-metric .v { font-size: 1.25rem; font-weight: 800; color: var(--ink-900); line-height: 1; }
.oc-niche-metric .l { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-400); margin-top: .3rem; font-weight: 700; }
.oc-niche-win { display: flex; flex-direction: column; gap: .3rem; }
.oc-niche-win-top { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink-500); }
.oc-niche-win-top b { color: var(--ink-900); }
.oc-niche-win-bar { height: .4rem; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.oc-niche-win-fill { height: 100%; width: 0; border-radius: 999px; background: var(--acc); transition: width .6s cubic-bezier(.22,1,.36,1); }
.oc-niche-kw { display: flex; flex-wrap: wrap; gap: .3rem; }
.oc-niche-kw span { font-size: .68rem; color: var(--ink-500); background: var(--line-2); padding: .12rem .5rem; border-radius: 999px; }
.oc-niche-foot { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--ink-400); }
.oc-niche-foot i { font-size: 13px; }

/* ---------- Guide / help page ---------- */
.oc-obj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-bottom: 1.75rem; }
.oc-obj { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; }
.oc-obj-name { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink-900); font-size: .95rem; }
.oc-obj-name i { font-size: 17px; color: var(--brand-600); }
.oc-obj-desc { color: var(--ink-500); font-size: .84rem; margin-top: .4rem; line-height: 1.5; }
.oc-obj-arrow { display: flex; align-items: center; color: var(--ink-300, #cbd5e1); }

.oc-steps { display: flex; flex-direction: column; gap: 0; margin: 0 0 1.75rem; }
.oc-step { display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; padding-bottom: 1.4rem; position: relative; }
.oc-step:not(:last-child)::before { content: ""; position: absolute; left: 1.2rem; top: 2.4rem; bottom: 0; width: 2px; background: var(--line); }
.oc-step-num { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: linear-gradient(180deg, var(--brand-500), var(--brand-700)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; z-index: 1; box-shadow: 0 2px 6px -1px rgba(79,70,229,.5); }
.oc-step-body { padding-top: .25rem; }
.oc-step-title { font-weight: 700; color: var(--ink-900); font-size: .98rem; }
.oc-step-text { color: var(--ink-600); font-size: .88rem; line-height: 1.55; margin-top: .3rem; }
.oc-step-text code { background: var(--line-2); padding: .05rem .35rem; border-radius: .3rem; font-size: .82em; color: var(--ink-700); }
.oc-step-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

/* Lead workflow sidebar — compact step checklist with checks. */
.oc-wf-steps { list-style: none; margin: .35rem 0 0; padding: 0; }
.oc-wf-step { padding: .55rem 0; border-top: 1px solid var(--line); }
.oc-wf-step:first-child { border-top: 0; }
.oc-wf-step-head { display: flex; align-items: center; gap: .5rem; }
.oc-wf-step-title { flex: 1; font-weight: 600; font-size: .9rem; color: var(--ink-900); }
.oc-wf-crit { list-style: none; margin: .35rem 0 0 1.4rem; padding: 0; font-size: .8rem; line-height: 1.55; color: var(--ink-600); }
.oc-wf-step-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.oc-wf-done { color: var(--success-subtle-foreground, #16a34a); }
.oc-wf-todo { color: var(--warning-subtle-foreground, #b45309); }

.oc-guide-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.oc-checkline { display: flex; gap: .55rem; align-items: flex-start; font-size: .875rem; color: var(--ink-700); padding: .3rem 0; }
.oc-checkline i { font-size: 16px; flex: 0 0 auto; width: 16px; text-align: center; margin-top: .15rem; }
.oc-checkline.ok i { color: var(--success); }
.oc-checkline.wire i { color: var(--warning); }

/* ============================================================
   PREMIUM LAYER — data-viz + richer components (theme untouched)
   ============================================================ */

/* Subtle entrance for main content */
@keyframes oc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.oc-main > * { animation: oc-rise .35s ease both; }

/* Section header (icon + title + sub + optional action) */
.oc-section { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 .8rem; }
.oc-section-ic { width: 2rem; height: 2rem; border-radius: .6rem; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); flex: 0 0 auto; }
.oc-section-ic i { font-size: 17px; }
.oc-section-t { font-weight: 800; letter-spacing: -.01em; color: var(--ink-900); font-size: 1.02rem; }
.oc-section-s { color: var(--ink-400); font-size: .82rem; }
.oc-section .oc-head-actions { margin-left: auto; }

/* Company / contact square avatar (initials) */
.oc-sq { width: 2.1rem; height: 2.1rem; border-radius: .55rem; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #fff; flex: 0 0 auto; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); box-shadow: 0 2px 5px -1px rgba(79,70,229,.4); }
.oc-sq-lg { width: 3rem; height: 3rem; border-radius: .7rem; font-size: 1rem; }
.oc-idcell { display: flex; align-items: center; gap: .65rem; }
.oc-idcell .sub { color: var(--ink-400); font-size: .78rem; }

/* Score ring (conic-gradient) — set --v: 0..100 and --c: color */
.oc-ring { --v: 0; --c: var(--brand-600); width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
    background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line-2) 0); position: relative; }
.oc-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 1px 2px rgba(15,23,42,.05); }
.oc-ring-in { position: relative; text-align: center; line-height: 1; }
.oc-ring-v { font-size: 1.25rem; font-weight: 800; color: var(--ink-900); }
.oc-ring-l { font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); font-weight: 700; margin-top: .15rem; }
.oc-ring-sm { width: 60px; height: 60px; }
.oc-ring-sm .oc-ring-v { font-size: 1rem; }

/* Horizontal meter */
.oc-meter { display: flex; flex-direction: column; gap: .3rem; }
.oc-meter-top { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-500); }
.oc-meter-top b { color: var(--ink-900); font-weight: 700; }
.oc-meter-bar { height: .5rem; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.oc-meter-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); }
.oc-meter-fill.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.oc-meter-fill.ok { background: linear-gradient(90deg, #10b981, #059669); }

/* Rich stat tile with icon + trend */
.oc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.oc-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.2rem 1.25rem; overflow: hidden; transition: box-shadow .2s, transform .15s, border-color .2s; }
.oc-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #dbe1ea; }
.oc-tile::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(79,70,229,.09), transparent 70%); }
.oc-tile-ic { width: 2.5rem; height: 2.5rem; border-radius: .7rem; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: .85rem; }
.oc-tile-ic i { font-size: 19px; }
.oc-tile-v { font-size: 1.95rem; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; line-height: 1; }
.oc-tile-l { font-size: .8rem; color: var(--ink-500); margin-top: .35rem; font-weight: 500; }

/* Dashboard "Today's work" action queues (docs 20) — reuse the theme .oc-list rows inside columns */
.oc-queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; }
.oc-queue-col { min-width: 0; }
.oc-queue-h { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; color: var(--ink-700); margin-bottom: .65rem; }
.oc-queue-h .badge { margin-left: auto; }
.oc-queue-more { padding: .1rem .25rem; }

/* Sequence step editor (repeater) + read view */
.oc-seq-step { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .85rem; margin-top: .75rem; background: var(--surface); display: flex; flex-direction: column; gap: .5rem; }
.oc-seq-step-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.oc-seq-step-n { font-size: .8rem; font-weight: 600; color: var(--ink-500); }
.oc-seq-day { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ink-500); }
.oc-seq-day input { width: 4.5rem; }
.oc-seq-del { margin-left: auto; }
.oc-seq-view { align-items: flex-start; }
.oc-seq-subj { font-weight: 600; color: var(--ink-900); margin-top: .35rem; }
.oc-seq-body { white-space: pre-wrap; color: var(--ink-600); font-size: .875rem; margin-top: .25rem; }
.oc-ul { margin: .25rem 0 0 1rem; list-style: disc; color: var(--ink-600); font-size: .85rem; }
.oc-ul li { margin: .15rem 0; }

/* Accent card — colored top bar (tier / service) */
.oc-acard { position: relative; }
.oc-acard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--acc, var(--brand-600)); }

/* Tier + service colors */
.tier-A { --acc: #059669; } .tier-B { --acc: #2563eb; } .tier-C { --acc: #d97706; } .tier-D { --acc: #94a3b8; }
.badge-tier-A { color:#047857; background:#ecfdf5; } .badge-tier-B { color:#1d4ed8; background:#eff6ff; }
.badge-tier-C { color:#b45309; background:#fffbeb; } .badge-tier-D { color:#475569; background:#f1f5f9; }
.oc-svc-dot { width:.5rem;height:.5rem;border-radius:50%;display:inline-block;margin-right:.35rem;background:var(--brand-500); }

/* Funnel as proportional bars */
.oc-fbars { display: flex; flex-direction: column; gap: .55rem; }
.oc-fbar { display: grid; grid-template-columns: 130px 1fr 2.5rem; align-items: center; gap: .75rem; }
.oc-fbar-l { font-size: .82rem; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-fbar-track { height: 1.4rem; background: var(--line-2); border-radius: .5rem; overflow: hidden; }
.oc-fbar-fill { height: 100%; width: 0; border-radius: .5rem; background: linear-gradient(90deg, var(--brand-400,#818cf8), var(--brand-600)); min-width: 3px; transition: width .6s cubic-bezier(.22,1,.36,1); }
.oc-fbar-fill.acc { background: var(--acc); }
.oc-fbar.tier-A .oc-fbar-fill.acc { background: linear-gradient(90deg,#34d399,#059669); }
.oc-fbar.tier-B .oc-fbar-fill.acc { background: linear-gradient(90deg,#60a5fa,#2563eb); }
.oc-fbar.tier-C .oc-fbar-fill.acc { background: linear-gradient(90deg,#fbbf24,#d97706); }
.oc-fbar.tier-D .oc-fbar-fill.acc { background: linear-gradient(90deg,#cbd5e1,#94a3b8); }
.oc-fbar-n { font-size: .85rem; font-weight: 700; color: var(--ink-900); text-align: right; }
.oc-fbar-q { font-weight: 600; color: var(--ink-400); }

/* Strategy overview dashboard helpers */
.oc-col-full { grid-column: 1 / -1; }
.oc-num { text-align: right; }
.oc-cell-title { font-weight: 600; color: var(--ink-900); }
.oc-cell-sub { font-size: .75rem; }
.oc-frac { color: var(--ink-400); font-weight: 600; font-size: 1rem; }
.oc-frac-dim { opacity: .6; }
.oc-hint { margin-top: .75rem; }

/* Compact table cell — leading icon + stacked title/sub (business list rows) */
.oc-cell-lead { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.oc-cell-ic { width: 1.9rem; height: 1.9rem; flex: none; border-radius: .5rem; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: 14px; }
.oc-cell-lead .oc-cell-title, .oc-cell-lead .oc-cell-sub { display: block; }
.oc-truncate { max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Two-column deal header */
.oc-deal-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.oc-rings-row { display: flex; gap: 1.1rem; justify-content: space-around; flex-wrap: wrap; }

/* Critique (Lead Source QA) — headline ring beside the stacked sub-score meters. */
.oc-critique-top { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.oc-critique-meters { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.oc-verdict { font-size: .95rem; font-weight: 600; color: var(--ink-800, #1e293b); line-height: 1.5; }

/* Cockpit block state chip */
.oc-block-done { color: var(--success); } .oc-block-todo { color: var(--ink-300, #cbd5e1); }

/* ---------- Styled confirmation modal (portal-ux §12/§14 — replaces native window.confirm) ---------- */
.oc-confirm-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
    padding: 15vh 1rem 1rem; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.oc-confirm-overlay[hidden] { display: none; }
body.oc-modal-open { overflow: hidden; }
.oc-confirm { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); overflow: hidden; animation: oc-confirm-in .12s ease-out; }
@keyframes oc-confirm-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .oc-confirm { animation: none; } }
.oc-confirm-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem .6rem; }
.oc-confirm-title { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--ink-900); }
.oc-confirm-x { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--ink-400); cursor: pointer; padding: 0 .2rem; border-radius: .4rem; }
.oc-confirm-x:hover { color: var(--ink-700); }
.oc-confirm-body { display: flex; gap: .8rem; padding: .2rem 1.15rem 1.1rem; }
.oc-confirm-icon { flex: 0 0 auto; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
    background: #fef2f2; color: var(--danger); font-weight: 800; font-size: 1.1rem; }
.oc-confirm-msg { margin: 0; color: var(--ink-600); font-size: .9rem; line-height: 1.5; }
.oc-confirm-foot { display: flex; gap: .6rem; justify-content: flex-end; padding: .9rem 1.15rem; border-top: 1px solid var(--line-2); background: var(--line-2); }

/* ---------- Responsive: collapse the sidebar to a top bar ---------- */
@media (max-width: 900px) {
    .oc-sidebar { position: static; width: auto; flex-direction: row; align-items: center; gap: .5rem; padding: .6rem 1rem; overflow-x: auto; }
    .oc-brand { padding: 0 .5rem 0 0; }
    .oc-brand-name small { display: none; }
    .oc-brand-full { display: none; }
    .oc-brand-short { display: inline; }
    .oc-nav { flex-direction: row; gap: .1rem; }
    .oc-nav-label { display: none; }
    .oc-nav-link span { display: none; }
    .oc-side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
    .oc-side-user { display: none; }
    .oc-content { margin-left: 0; }
    .oc-main { padding: 1.25rem 1rem 3rem; }
}

/* ============================================================
   App shell (STRUCTURAL). Primary navigation is the header-based top bar in the .oc-h* block below.
   The .ms-* rules kept in this section are the SHARED sidebar-nav styling reused by (a) the mobile nav
   drawer (.oc-hdrawer) and (b) the Settings inner sub-nav — dimensions live here because the prebuilt
   theme's arbitrary/scale utilities are tree-shaken out; theme TOKEN classes + these vars handle the look.
   ============================================================ */
:root { --side-w: 250px; --appbar-h: 3.5rem; --hmax: 1536px; }

.ms-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(2,6,23,.45); }

/* ============================================================
   Header-based top navigation (.oc-h*). A sticky top bar with grouped dropdown menus (Alpine-driven,
   idempotent, no HTMX swaps). Below the header breakpoint the horizontal nav collapses into the
   .oc-hdrawer slide-in, which reuses the shared .ms-nav sidebar styling. Uses theme tokens
   (--surface/--line/--line-2/--ink-*/--brand-*) so the bar is correct in both light and dark.
   ============================================================ */
.oc-hshell { display: flex; flex-direction: column; min-height: 100vh; }

.oc-hbar { position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(15, 23, 42, .03); }
.oc-hbar-in { display: flex; align-items: center; gap: .4rem; height: var(--appbar-h);
    max-width: var(--hmax); margin: 0 auto; padding: 0 1.25rem; }

.oc-hbrand { padding: 0; margin-right: .35rem; flex: 0 0 auto; }
.oc-hburger { display: none; flex: 0 0 auto; }

.oc-hnav { display: flex; align-items: center; gap: .1rem; min-width: 0; }

/* Nav link / dropdown trigger — a stripped <button> and an <a> share one look. */
.oc-hlink { display: inline-flex; align-items: center; gap: .5rem; padding: .48rem .68rem;
    border: 0; background: none; border-radius: .6rem; font: inherit; font-size: .875rem; font-weight: 500;
    color: var(--ink-600); text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s; }
.oc-hlink i { font-size: 15px; }
.oc-hlink:hover { background: var(--line-2); color: var(--ink-900); }
.oc-hlink.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.oc-hcaret { font-size: 10px !important; opacity: .55; transition: transform .15s ease; }
.oc-hcaret.is-open { transform: rotate(180deg); }
/* Keyboard focus ring — the app's global :focus-visible rule doesn't cover the <button> triggers. */
.oc-hlink:focus-visible, .oc-hmenu-item:focus-visible { outline: none; box-shadow: var(--ring); }

/* Dropdown menu */
.oc-hmenu { position: relative; }
.oc-hmenu-pop { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 40;
    min-width: 13rem; padding: .4rem; display: flex; flex-direction: column; gap: .08rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: .8rem;
    box-shadow: 0 12px 34px -10px rgba(15, 23, 42, .28); }
.oc-hmenu-label { padding: .5rem .55rem .28rem; font-size: .64rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); }
.oc-hmenu-sep { height: 1px; margin: .35rem .25rem; background: var(--line-2); }
.oc-hmenu-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem;
    border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--ink-700);
    text-decoration: none; white-space: nowrap; transition: background .12s, color .12s; }
.oc-hmenu-item i { width: 1.05rem; text-align: center; font-size: 15px; color: var(--ink-400); flex: 0 0 auto; }
.oc-hmenu-item:hover { background: var(--line-2); color: var(--ink-900); }
.oc-hmenu-item:hover i { color: var(--ink-600); }
.oc-hmenu-item.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.oc-hmenu-item.is-active i { color: var(--brand-600); }

/* Right cluster */
.oc-hspacer { margin-left: auto; }
.oc-hsep { width: 1px; align-self: stretch; margin: .8rem .3rem; background: var(--line); }
.oc-hright-btn { flex: 0 0 auto; }
.oc-hright-btn.is-active { background: var(--brand-50); color: var(--brand-700); }
.oc-huser { display: inline-flex; align-items: center; gap: .55rem; flex: 0 0 auto; max-width: 15rem; }
.oc-huser-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.oc-huser-meta .n { font-size: .82rem; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-huser-meta .r { font-size: .7rem; color: var(--ink-400); }

/* Main content column (aligned to the header's max width). */
.oc-hmain { flex: 1; width: 100%; max-width: var(--hmax); margin: 0 auto; padding: 1.5rem 1.25rem 3.5rem; }

/* Mobile nav drawer */
.oc-hdrawer { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 50;
    display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
    box-shadow: 4px 0 28px -14px rgba(15, 23, 42, .3); }
.oc-hdrawer-anim { transition: transform .22s ease; }
.oc-hdrawer-off { transform: translateX(-100%); }
.oc-hdrawer-on { transform: translateX(0); }

/* Below the header breakpoint: swap the horizontal nav for the burger + drawer. */
@media (max-width: 900px) {
    .oc-hnav { display: none; }
    .oc-hburger { display: inline-grid; }
    .oc-huser-meta, .oc-hsep, .oc-hhelp, .oc-hsettings { display: none; }
    .oc-hbar-in { gap: .25rem; padding: 0 .85rem; }
}
@media (min-width: 901px) {
    /* Drawer + backdrop are mobile-only; Alpine also hides them — this is the resize belt-and-braces. */
    .oc-hdrawer, .oc-hshell > .ms-backdrop { display: none !important; }
}
@media (max-width: 640px) { .oc-hmain { padding: 1.15rem .9rem 2.75rem; } }
.ms-brandbar { display: flex; align-items: center; gap: .6rem; height: var(--appbar-h); padding: 0 1rem; border-bottom: 1px solid var(--line); }
.ms-nav { flex: 1; overflow-y: auto; padding: .7rem; display: flex; flex-direction: column; gap: .1rem; }
.ms-nav-label { padding: .6rem .7rem .3rem; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); }
.ms-navlink { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; border-radius: .6rem; font-size: .875rem; font-weight: 500; color: var(--ink-600); text-decoration: none; transition: background .15s, color .15s; }
.ms-navlink:hover { background: var(--line-2); color: var(--ink-900); }
.ms-navlink-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.ms-navlink-sub { margin-left: 1.35rem; font-size: .82rem; }
/* Wider modal for edit forms (structural width in CSS — Metronic's arbitrary max-w-[…] are tree-shaken). */
.oc-modal-wide { max-width: 640px; width: 100%; }
.oc-modal-scroll { max-height: 68vh; overflow-y: auto; }
/* Repeater rows (Brain structured editors) */
.oc-repeat-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.oc-repeat-row .field-input, .oc-repeat-row .field-select { flex: 1 1 auto; min-width: 0; }
.oc-repeat-del { flex: 0 0 auto; }
.oc-repeat-card { border: 1px solid var(--line, #e2e8f0); border-radius: .5rem; padding: .7rem; margin-bottom: .6rem; }
.oc-check-field { display: flex; flex-direction: column; gap: .4rem; justify-content: center; }
.oc-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-700, #334155); }
/* Compact "view then edit" section: read-only value shown until Edit opens the modal. */
.oc-viewrow { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: .4rem 1rem; }
.oc-viewrow dt { color: var(--ink-500); font-size: .82rem; }
.oc-viewrow dd { margin: 0; color: var(--ink-900); font-size: .875rem; white-space: pre-wrap; word-break: break-word; }
.oc-viewrow dd.is-empty { color: var(--ink-400); font-style: italic; }
.ms-navlink i { width: 1.1rem; text-align: center; font-size: 16px; flex: 0 0 auto; }
.ms-sidefoot { border-top: 1px solid var(--line-2); padding: .7rem; display: flex; align-items: center; gap: .6rem; }
.ms-spacer { margin-left: auto; }

/* Settings two-column (sidebar sub-nav + body) */
.ms-settings { display: flex; flex-direction: column; gap: 1.1rem; }
.ms-settings-nav { flex: 0 0 auto; }
.ms-settings-body { flex: 1; min-width: 0; }

@media (min-width: 1024px) {
    /* Settings inner sub-nav: sticky two-column workspace (sits under the header). */
    .ms-settings { flex-direction: row; gap: 1.25rem; align-items: flex-start; }
    .ms-settings-nav { width: 13.5rem; position: sticky; top: calc(var(--appbar-h) + 1rem); }
}

/* Backfill the few tree-shaken utilities the adopted octa-core partials rely on (e.g. _EmptyState). */
.py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.max-w-md { max-width: 28rem; }
.gap-2\.5 { gap: .625rem; }
.bg-muted\/70 { background-color: var(--line-2); }

/* ============================================================
   Weights SOFTENED — placed LAST so it wins over every weight/tracking rule
   above. The theme's 700/800 weights read as "everything is bold," so we drop
   weights one notch, neutralise negative letter-spacing, and open up body
   line-height so long tables/forms are easy on the eyes. Body/UI is Montserrat
   (core default); the display classes below keep the heavier display weights.
   ============================================================ */
body {
    font-weight: 400;
    letter-spacing: 0;          /* Montserrat reads cramped with the theme's -0.01em */
    line-height: 1.55;
}
/* Big display titles / numbers: 800 -> 700, relaxed tracking */
h1, h2, h3, h4, h5, h6,
.oc-page-title, .oc-hero-title, .oc-hero-metric .v, .oc-kpi-value, .oc-funnel-step .n,
.oc-land-title, .oc-niche-name, .oc-niche-metric .v, .oc-section-t, .oc-ring-v,
.oc-tile-v, .oc-brand-name, .oc-stat-value, .oc-sq, .oc-step-num {
    font-weight: 700;
    letter-spacing: -.005em;
}
/* Secondary bold labels / titles: 700 -> 600 */
.oc-card-title, .oc-section-title, .oc-nav-label, .ms-nav-label, .oc-avatar,
.oc-kcol-head, .oc-start-t, .oc-suggest-label, .oc-suggest-cta, .oc-niche-metric .l,
.oc-obj-name, .oc-step-title, .oc-fbar-n, .oc-confirm-title, .oc-ring-l, .oc-meter-top b,
.btn, .oc-chip, .badge {
    font-weight: 600;
}
/* Body / table / form text: keep it 400 and untracked for readability */
.oc-table td, .oc-table th, .field-input, .field-select, .field-textarea,
.oc-page-sub, p, li { letter-spacing: 0; }
.oc-table td { font-weight: 400; }

/* ---------- Icon guard: Font Awesome must NEVER inherit Montserrat ----------
   FA already pins its family on the <i> element and Keenicons uses !important,
   so icons are safe — this is an explicit belt-and-braces so the text font can
   never bleed into a glyph. Weights (900 solid / 400 regular) stay FA's own. */
.fa, .fas, .far, .fal, .fat, .fa-solid, .fa-regular, .fa-light, .fa-thin,
i[class*="fa-"]:not(.fab):not(.fa-brands) { font-family: "Font Awesome 6 Free" !important; }
.fab, .fa-brands { font-family: "Font Awesome 6 Brands" !important; }

/* ---------- Render Scripts playground (Settings › Render Scripts) ----------
   Chrome for the JS-renderer authoring surface. The preview <iframe> hosts the
   sandboxed render output; strip the UA border so it reads as one canvas. */
.oc-rs-frame { width: 100%; border: 0; display: block; background: transparent; min-height: 160px; }
.oc-rs-error { white-space: pre-wrap; }
.oc-rs-error:empty { display: none; }   /* self-hide when there is no error text */
.oc-rs-editor { min-height: 24rem; }
/* SubTaskDetails render host: the raw-JSON fallback is hidden until the renderer is absent/errors. */
.oc-render-fallback { display: none; }
.oc-render-fallback.is-shown { display: block; }

/* ---------- Render-kit vertical rhythm (oc-ui.js) ----------
   Self-contained so it never depends on which Tailwind space-y utilities the PREBUILT Metronic theme
   compiled — it ships space-y-2/4 but NOT space-y-6/8/1, which the kit relied on for its main gaps. */
.oc-render { display: flex; flex-direction: column; gap: 1.5rem; }
.oc-stack  { display: flex; flex-direction: column; }
.oc-stack-4 { gap: 1rem; }
.oc-stack-6 { gap: 1.5rem; }
.oc-stack-8 { gap: 2rem; }
.oc-list-y > li + li { margin-top: .25rem; }
.oc-empty-pad { padding-top: 2rem; padding-bottom: 2rem; }

/* ============================================================
   POST-REPLATFORM VISUAL POLISH (app layer over octa-core a13f714).
   The new theme is intentionally minimal — `--shadow-sm` is 4–6% alpha and the
   hairline card border sits on a near-white bg, so cards read very flat and the
   UI feels washed-out. These app-level touches add depth + hierarchy without
   departing from the theme's palette/design language. Appended last so they win.
   ============================================================ */

/* Cards: a softer ambient shadow so they lift off the #f8fafc background.
   (No hover lift on plain cards — that implies clickability; .oc-card-hover keeps that.) */
.oc-card,
.oc-kpi, .oc-tile, .oc-obj, .oc-center-card {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 10px -3px rgba(15, 23, 42, .08);
    border-color: #e6eaf1;
}
/* Card headers/footers: a crisper divider than the near-invisible --line-2. */
.oc-card-head { border-bottom-color: #e6eaf1; }

/* Active nav item: a clear left-accent (shared by the mobile drawer + the Settings sub-nav). */
.ms-navlink-active {
    background: linear-gradient(90deg, var(--brand-50), color-mix(in srgb, var(--brand-50) 55%, transparent));
    color: var(--brand-700);
    box-shadow: inset 3px 0 0 var(--brand-600);
}

/* Page title: a touch more presence so the header anchors the page. */
.oc-page-title { font-size: 1.35rem; letter-spacing: -.015em; }
.oc-page-head { padding-bottom: 1rem; border-bottom: 1px solid #eef1f5; }

/* Buttons: a hair of depth on the primary CTA so it reads as the main action. */
.btn-primary { box-shadow: 0 1px 2px rgba(79, 70, 229, .25), 0 2px 6px -1px rgba(79, 70, 229, .28); }
.btn-primary:hover { box-shadow: 0 2px 4px rgba(79, 70, 229, .3), 0 4px 12px -2px rgba(79, 70, 229, .35); }

/* ============================================================
   TYPE SCALE — consolidated (calm). The app layer had grown ~48 ad-hoc
   font-sizes (mixed px/rem, many near-duplicates: .78/.8/.82/.84/.85/.875…),
   which reads as "the fonts are off / inconsistent." Collapse the shared text
   classes onto ONE small deliberate scale (5 steps + the display sizes left as
   they are). Appended LAST so it wins — same convention as the "Weights
   SOFTENED" layer above. Values stay near the old ones, so nothing reflows.
   Hierarchy now comes from weight + colour, not from 13 slightly-different sizes.
   ============================================================ */
:root {
    --fs-2xs: .6875rem;   /* 11px — micro UPPERCASE labels (nav sections, ring labels, provenance) */
    --fs-xs:  .78rem;     /* ~12.5px — meta / captions / tags / chips / badges / hints / subs */
    --fs-sm:  .85rem;     /* ~13.5px — body, definition lists, list rows, tables, checklists */
    --fs-md:  .95rem;     /* ~15px — card + section titles, step titles, emphasis */
    --fs-lg:  1.1rem;     /* subsection headers */
}
/* micro uppercase labels */
.oc-nav-label, .ms-nav-label, .oc-hmenu-label, .oc-kpi-label, .oc-niche-metric .l,
.oc-ring-l, .oc-fchip b, .oc-filpop-field .field-label, .oc-provtag,
.oc-kcard-owner, .oc-tile-l, .oc-cell-sub { font-size: var(--fs-2xs); }
/* meta / secondary / tags / chips / hints / badges / subs */
.oc-page-sub, .oc-section-s, .oc-muted, .oc-tag, .oc-chip, .badge, .oc-hint,
.oc-idcell .sub, .oc-kcard-sub, .oc-meter-top, .oc-listcount, .oc-niche-desc,
.oc-step-text, .oc-fieldlabel, .oc-fchip, .oc-fclear, .oc-seg-btn, .oc-seg-opt,
.oc-seg-link, .oc-wf-crit, .oc-viewrow dt, .oc-empty-inline p, .field-hint { font-size: var(--fs-xs); }
/* body / data / lists / tables / forms */
.oc-dl dt, .oc-dl dd, .oc-list li, .oc-checklist, .oc-checkline, .oc-check, .oc-checkfield,
.oc-table td, .oc-table th, .oc-seq-body, .oc-ul, .oc-viewrow dd, .oc-niche-stats,
.oc-card > p { font-size: var(--fs-sm); }
/* card / section titles + emphasis */
.oc-card-title, .oc-section-t, .oc-step-title, .oc-obj-name, .oc-start-t,
.oc-suggest-label, .oc-wf-step-title, .oc-verdict, .oc-seq-subj { font-size: var(--fs-md); }

/* Modals (hand-rolled as .oc-card inside [data-oc-modal]) read cleaner with one
   clear elevation and a calm scrim; the text inside is already tamed by the scale. */
[data-oc-modal] .oc-card { box-shadow: 0 20px 50px -12px rgba(15, 23, 42, .35); border-color: #e6eaf1; }
[data-oc-modal] .bg-overlay { backdrop-filter: blur(2px); }

/* ============================================================
   FLATTEN — calmer, less "designed". The premium layer leaned on gradients,
   stacked shadows and hover-lifts that read as over-decorated. Solidify the
   decorative fills, use ONE soft shadow, and settle the hover motion (cards
   still respond via border + shadow — just no bounce, portal-ux §4). Appended
   last so it wins; purely visual and fully reversible.
   ============================================================ */
/* One soft shadow instead of the stacked pair (flatter, still lifts off the bg) */
.oc-card, .oc-kpi, .oc-tile, .oc-obj, .oc-center-card { box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
/* Solid brand fills instead of gradients on the small identity / decoration chips */
.oc-sq, .oc-brand-badge, .oc-step-num, .oc-niche-ic { background: var(--brand-600); box-shadow: none; }
/* Icon tiles: flat tint, drop the gradient glow */
.oc-start-ic, .oc-tile-ic, .oc-section-ic { box-shadow: none; }
/* Meter / progress: solid, no gradient */
.oc-meter-fill { background: var(--brand-600); }
.oc-meter-fill.ok { background: #059669; }
.oc-meter-fill.warn { background: #d97706; }
/* Settle hover: keep the shadow/border response, drop the vertical bounce */
.oc-kpi:hover, .oc-tile:hover, .oc-start:hover, .oc-suggest:hover, .oc-niche-card:hover { transform: none; }
/* Primary CTA: a single subtle shadow, not the stacked glow */
.btn-primary { box-shadow: 0 1px 2px rgba(79, 70, 229, .22); }
.btn-primary:hover { box-shadow: 0 2px 6px -1px rgba(79, 70, 229, .3); }
/* Badges: quieter weight so status reads without shouting */
.badge { font-weight: 500; }
/* Coloured accent top-bars on cards: keep, but hairline (less decorative) */
.oc-acard::before, .oc-niche-card::before { height: 2px; }

/* ============================================================
   FORMS — calm + consistent (fixes spacing/density, sizing, alignment).
   The rhythm was mixed: every .field added its own margin, the grid added
   ANOTHER margin plus its own gaps, so fields never lined up and the density
   read as uneven. Fix: the form column owns ONE gap, children add none —
   even rhythm + clean alignment. Plus quieter labels and slightly tighter
   inputs so long forms read less like a wall. Global (every modal + form
   page); appended last so it wins; purely visual + reversible.
   ============================================================ */
/* One vertical rhythm — the form owns the gap; direct children never add margin. */
.oc-form { display: flex; flex-direction: column; gap: .85rem; }
.oc-form > .field, .oc-form > .oc-form-grid, .oc-form > .oc-form-actions { margin: 0; }
.oc-form-grid { gap: .85rem 1rem; margin: 0; align-items: start; }
.oc-form-grid .field { margin: 0; }
/* Quieter labels — the wall of bold labels read noisy next to the calmed body. */
.field-label { font-weight: 500; color: var(--ink-600); margin-bottom: .3rem; }
/* Inputs: a touch tighter + consistent across input / select / textarea (less "tall"). */
.field-input, .field-select, .field-textarea { padding: .5rem .7rem; }
.field-textarea { padding: .55rem .7rem; }
/* Modal form body: comfortable, even padding so fields breathe without sprawl. */
[data-oc-modal] .oc-card-body.oc-form { padding: 1.15rem 1.25rem; }
/* Footer action row sits calm on its divider, aligned with the body padding. */
[data-oc-modal] form > .oc-card-body:last-child { padding: .9rem 1.25rem; }

/* ============================================================
   Impact — campaign cockpit (Areas/Impact/Views/Campaigns/Details + partials).
   A "command deck" hero (progress ring + live stat chips) anchoring an Alpine
   tabbed workspace, with the task list re-imagined as a vertical workflow
   pipeline. Purely token-driven so light/dark both resolve; companion JS keeps
   the ring/stats in step with the #impact-refresh poll (impact.js). Additive
   and reversible — never redefines a theme class.
   ============================================================ */

/* ---- Command-deck hero ---- */
.oc-camp-hero {
    position: relative; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background:
        radial-gradient(135% 130% at 100% -15%, color-mix(in oklab, var(--brand-500) 16%, transparent), transparent 62%),
        var(--surface);
    box-shadow: var(--shadow-sm);
}
.oc-camp-hero-in { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; padding: 1.35rem 1.5rem; }
.oc-camp-hero-main { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: .85rem; }
.oc-camp-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---- Progress ring (SVG) ---- */
.oc-camp-ring { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.oc-camp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.oc-ring-track { fill: none; stroke: var(--surface-muted); stroke-width: 9; }
.oc-ring-bar {
    fill: none; stroke: url(#ocRingGrad); stroke-width: 9; stroke-linecap: round;
    transition: stroke-dashoffset .7s cubic-bezier(.22, 1, .36, 1);
}
.oc-ring-grad-a { stop-color: var(--brand-400); }
.oc-ring-grad-b { stop-color: var(--brand-700); }
.oc-camp-ring.is-complete .oc-ring-grad-a { stop-color: #34d399; }
.oc-camp-ring.is-complete .oc-ring-grad-b { stop-color: var(--success); }
.oc-camp-ring.is-running .oc-ring-bar { animation: oc-ring-breathe 1.9s ease-in-out infinite; }
@keyframes oc-ring-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.oc-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.oc-ring-pct { font-family: var(--font-mono); font-weight: 700; font-size: 1.65rem; line-height: 1; color: var(--ink-900); }
.oc-ring-cap { font-size: .625rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-500); margin-top: .2rem; }

/* ---- Stat chips ---- */
.oc-camp-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.oc-camp-stat { display: flex; flex-direction: column; padding: .45rem .75rem; min-width: 4.75rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
.oc-camp-stat-v { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; line-height: 1.1; color: var(--ink-900); }
.oc-camp-stat-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); margin-top: .1rem; }

/* ---- Tabs count pill (sits inside .oc-tab) ---- */
.oc-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; margin-left: .35rem; font-family: var(--font-mono); font-size: .7rem; font-weight: 600; color: var(--ink-600); background: var(--surface-muted); border-radius: 999px; }
.oc-tab.is-active .oc-tab-count { color: var(--brand-700); background: color-mix(in oklab, var(--brand-500) 16%, transparent); }
.oc-tab-dot { display: inline-block; width: .45rem; height: .45rem; margin-left: .4rem; border-radius: 999px; background: var(--success); vertical-align: middle; }

/* ---- Next-action bar (inside the poll region) ---- */
.oc-camp-next {
    position: relative; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.25rem; border: 1px solid color-mix(in oklab, var(--brand-500) 40%, var(--line));
    border-radius: var(--radius-lg);
    background: radial-gradient(120% 160% at 0% 0%, color-mix(in oklab, var(--brand-500) 12%, transparent), transparent 60%), var(--surface);
    box-shadow: var(--shadow-sm);
}
.oc-camp-next-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-700); }

/* ---- Workflow pipeline ---- */
.oc-pipe { position: relative; }
.oc-pipe-node { position: relative; display: flex; gap: 1rem; padding: 0 1.25rem; }
.oc-pipe-rail { position: relative; width: 1.75rem; flex-shrink: 0; }
.oc-pipe-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 2px; background: var(--line); }
.oc-pipe-node:first-child .oc-pipe-rail::before { top: 1.9rem; }
.oc-pipe-node:last-child .oc-pipe-rail::before { bottom: calc(100% - 1.9rem); }
.oc-pipe-node:only-child .oc-pipe-rail::before { display: none; }
.oc-pipe-node.is-complete .oc-pipe-rail::before { background: color-mix(in oklab, var(--success) 55%, var(--line)); }

.oc-pipe-dot {
    position: relative; z-index: 1; margin-top: 1rem;
    width: 1.75rem; height: 1.75rem; border-radius: 999px;
    display: grid; place-items: center; font-size: .78rem;
    background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-500);
    box-shadow: 0 0 0 4px var(--surface);
}
.oc-pipe-node.is-complete .oc-pipe-dot { background: var(--success); border-color: var(--success); color: #fff; }
.oc-pipe-node.is-running  .oc-pipe-dot { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.oc-pipe-node.is-failed   .oc-pipe-dot { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.oc-pipe-node.is-running .oc-pipe-dot::after {
    content: ""; position: absolute; inset: -3px; border-radius: 999px;
    border: 2px solid var(--brand-500); animation: oc-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes oc-ping { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }

.oc-pipe-body { flex: 1; min-width: 0; padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--line-2); }
.oc-pipe-node:last-child .oc-pipe-body { border-bottom: 0; }
.oc-pipe-node.is-next .oc-pipe-body { border-bottom-color: transparent; }
.oc-pipe-node.is-next { background: color-mix(in oklab, var(--brand-500) 5%, transparent); border-radius: var(--radius-lg); }

@media (max-width: 640px) {
    .oc-camp-hero-in { gap: 1.1rem; }
    .oc-camp-ring { width: 96px; height: 96px; }
    .oc-ring-pct { font-size: 1.35rem; }
}

/* Collapsed multi-line value — long AI-authored brief fields clamp to a few lines with a
   "Show more" reveal (Alpine toggles the class in _BriefField). */
.oc-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
