/* ============================================================================
   My Connect Buddy — shared design layer (the MCB look)

   ONE canonical stylesheet, linked into BOTH the organizer portal
   (ConnectBuddy.AdminApp) and the visitor/vendor app (ConnectBuddy.AttendeePwa)
   via a csproj <Content Link>. Edit here and both surfaces move together — two
   copies is exactly how they drifted apart.

   Load order (index.html): MudBlazor.min.css -> cb-design.css -> app.css
     - after MudBlazor so we can normalise its stock component look
     - before app.css so each app can still override locally

   PORTED from My Chamber Buddy's AdminApp (the family blueprint), not invented:
   values, gradients, easing and the signature devices are taken verbatim so the
   Buddies look like siblings. Two deliberate corrections to MCB are marked FIX.

   Section 3 matters most. Screens get reworked in a later pass, so this layer is
   written to make UNTOUCHED MudBlazor components already read as My Connect
   Buddy — every screen improves without being edited.
   ============================================================================ */

/* ── 1. Tokens ───────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --cb-primary: #F97316;          /* orange-500 — Buddy */
    --cb-primary-dark: #EA580C;     /* orange-600 */
    --cb-primary-400: #FB923C;      /* orange-400 — the lighter stop in brand gradients */
    --cb-primary-light: #FED7AA;    /* orange-200 */
    --cb-primary-soft: #FFF7ED;     /* orange-50  — wash/chip background */
    --cb-primary-ink: #C2410C;      /* orange-700 — text on a soft wash */
    --cb-accent: #0EA5E9;           /* sky-500 — the second hero layer */

    /* Ink + surfaces. MCB pairs WARM stone surfaces with COOL slate ink —
       that pairing is a core part of the feel; don't "tidy" it to one family. */
    --cb-secondary: #0F172A;
    --cb-text-primary: #0F172A;     /* slate-900 */
    --cb-text-secondary: #475569;   /* slate-600 */
    --cb-text-disabled: #94A3B8;    /* slate-400 */
    --cb-surface: #FFFFFF;
    --cb-bg: #FAFAF9;               /* stone-50 — warm off-white, NOT cool slate */
    --cb-bg-grey: #F5F5F4;          /* stone-100 */
    --cb-divider: #E7E5E4;          /* stone-200 — warm; a cool #E2E8F0 reads wrong */
    --cb-divider-light: #F5F5F4;

    /* FIX: MCB references these ~100x but never declares them, so they silently
       fall back and drift. Declared here once. */
    --cb-surface-2: #FAFAF9;
    --cb-border-strong: #94A3B8;
    --cb-ink: #0F172A;
    --cb-ink-soft: #475569;

    /* Semantic — 600-level for fills, 700-level for text/icon on a tint. */
    --cb-success: #16A34A;  --cb-success-ink: #15803D;
    --cb-warning: #D97706;  --cb-warning-ink: #B45309;
    --cb-error:   #DC2626;  --cb-error-ink:   #B91C1C;
    --cb-info:    #0EA5E9;  --cb-info-ink:    #0369A1;

    /* Shape — MCB's scale as actually used. */
    --cb-radius-sm: 8px;            /* input, square chip, small tile */
    --cb-radius: 10px;              /* theme default, nav item, small panel */
    --cb-radius-card: 12px;         /* THE standard content card */
    --cb-radius-feature: 14px;      /* feature card, dialog, icon tile */
    --cb-radius-hero: 16px;         /* hero, empty-state icon */
    --cb-radius-pill: 999px;

    /* Elevation — navy-tinted, never pure black. Reserved for things that float. */
    --cb-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --cb-shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, 0.18), 0 4px 12px -4px rgba(0, 0, 0, 0.06);
    --cb-shadow-lg: 0 16px 28px -8px rgba(15, 23, 42, 0.12), 0 8px 14px -8px rgba(15, 23, 42, 0.07);
    /* Hover lifts are tinted with the BRAND, not neutral — very MCB. */
    --cb-lift-tile: 0 6px 18px -10px rgba(249, 115, 22, 0.35);
    --cb-lift-card: 0 6px 18px -8px rgba(249, 115, 22, 0.25);
    --cb-lift-image: 0 8px 20px -10px rgba(249, 115, 22, 0.30);

    /* Signature gradients. The angles are consistent and meaningful:
       160deg = icon tiles + surface washes, 135deg = notices, 180deg = toolbars. */
    --cb-icon-tile: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 100%);
    --cb-icon-tile-ring: inset 0 0 0 1px rgba(249, 115, 22, 0.15);
    --cb-gradient-brand: linear-gradient(135deg, #F97316 0%, #EA580C 55%, #C2410C 100%);
    --cb-gradient-banner: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);

    --cb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --cb-hover-neutral: rgba(15, 23, 42, 0.04);   /* THE universal neutral hover */
    --cb-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── 2. Base ─────────────────────────────────────────────────────────────── */
html, body {
    margin: 0; padding: 0;
    font-family: var(--cb-font);
    color: var(--cb-text-primary);
    background-color: var(--cb-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; }
h1:focus { outline: none; }
h1, h2, h3, h4, h5, h6 { color: var(--cb-text-primary); }
a { color: var(--cb-primary); }

code, pre {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, Menlo, monospace;
    font-size: 0.85em;
    background: var(--cb-primary-soft);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    color: var(--cb-primary-dark);
}
pre code { background: transparent; padding: 0; color: inherit; }

:focus-visible { outline: 2px solid var(--cb-primary); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); border-radius: 8px; border: 2px solid var(--cb-bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.32); }

/* Numbers that sit in columns or tiles. */
.cb-tabular { font-variant-numeric: tabular-nums; }

/* Page enter — every content page fades up on arrival. */
.cb-page-enter { animation: cb-page-fade 280ms var(--cb-ease) both; }
@keyframes cb-page-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .cb-page-enter { animation: none; }
    * { transition-duration: 0.01ms !important; }
}

/* ── 3. MudBlazor normalisation ──────────────────────────────────────────────
   Make stock components read as MCB *before* any screen is reworked. This is
   what stops the product looking like generic Material with an orange tint.
   ------------------------------------------------------------------------- */

/* Content surfaces: a 1px warm divider and brand radius — and NO shadow.
   MCB reserves elevation for things that genuinely float (popovers, dialogs);
   shadowed content cards are the main reason a Material app looks generic. */
.mud-paper { border-radius: var(--cb-radius-card); }
.mud-paper.mud-paper-outlined { border-color: var(--cb-divider); border-radius: var(--cb-radius-card); box-shadow: none; }
.mud-card { border-radius: var(--cb-radius-card); }
.mud-card.mud-card-outlined { border-color: var(--cb-divider); box-shadow: none; }

/* Buttons: friendly radius, real weight, and never SHOUTY. */
.mud-button-root { border-radius: var(--cb-radius); text-transform: none; font-weight: 600; letter-spacing: 0.01em; }
.mud-button-filled { box-shadow: none; }
.mud-button-filled:hover { box-shadow: var(--cb-shadow-card); }
.mud-icon-button { border-radius: var(--cb-radius); }

/* Chips read as pills; the primary text chip picks up the brand wash. */
.mud-chip { border-radius: var(--cb-radius-pill); font-weight: 600; }
.mud-chip.mud-chip-text.mud-chip-color-primary { background-color: var(--cb-primary-soft); color: var(--cb-primary-ink); }

/* Alerts: soft tinted surfaces with 700-level ink, not flat Material slabs. */
.mud-alert { border-radius: var(--cb-radius); }
.mud-alert-text-info    { background-color: rgba(14, 165, 233, 0.08); color: var(--cb-info-ink); }
.mud-alert-text-success { background-color: rgba(22, 163, 74, 0.08);  color: var(--cb-success-ink); }
.mud-alert-text-warning { background-color: rgba(234, 179, 8, 0.10);  color: var(--cb-warning-ink); }
.mud-alert-text-error   { background-color: rgba(220, 38, 38, 0.07);  color: var(--cb-error-ink); }

/* Inputs: calm resting border, brand focus. */
.mud-input-outlined .mud-input-outlined-border { border-color: #D6D3D1; border-radius: var(--cb-radius-sm); }
.mud-input-control:focus-within .mud-input-outlined-border { border-color: var(--cb-primary); }

/* Tables: hairline rules and a quiet small-caps header. */
.mud-table { border-radius: var(--cb-radius-card); }
.mud-table-head .mud-table-cell {
    background: var(--cb-surface-2);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--cb-text-secondary);
}
.mud-table-cell { border-color: var(--cb-divider); }
.mud-table-row:hover { background: var(--cb-surface-2); }

/* Things that genuinely float get the elevation. */
.mud-dialog { border-radius: var(--cb-radius-feature); box-shadow: var(--cb-shadow-lg); }
.mud-popover-open { border-radius: var(--cb-radius); box-shadow: var(--cb-shadow-pop); }
.mud-snackbar { border-radius: var(--cb-radius) !important; }
.mud-progress-linear { border-radius: var(--cb-radius-pill); overflow: hidden; }

/* Nav drawer: 10%-orange pill on the active item. No left bar, no filled block. */
.cb-nav .mud-nav-link {
    margin: 0.15rem 0.4rem;
    border-radius: 9px;
    padding-left: 0.875rem !important;
    font-size: 0.9rem; font-weight: 500;
}
.cb-nav .mud-nav-link.active { background-color: rgba(249, 115, 22, 0.10); color: var(--cb-primary); }
.cb-nav .mud-nav-link.active .mud-nav-link-icon { color: var(--cb-primary); }
.cb-nav .mud-nav-link:hover { background-color: var(--cb-hover-neutral); }
.cb-nav-section {
    padding: 0.85rem 0.875rem 0.35rem 1.25rem;
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--cb-text-secondary);
}

/* ── 4. Signature devices ────────────────────────────────────────────────────
   The pieces that actually make it look like a Buddy product.
   ------------------------------------------------------------------------- */

/* 4a. The orange gradient icon tile — THE identifying MCB device. On every page
   header and empty state. Formula: 160deg hue-50 -> hue-100 + a 15% inset ring. */
.cb-icon-tile {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 56px; height: 56px;
    border-radius: var(--cb-radius-feature);
    background: var(--cb-icon-tile);
    box-shadow: var(--cb-icon-tile-ring);
    color: var(--cb-primary);
}
.cb-icon-tile-lg { width: 64px; height: 64px; border-radius: var(--cb-radius-hero); }
.cb-icon-tile-sm { width: 44px; height: 44px; border-radius: var(--cb-radius-card); }
/* Semantic recolours — same formula, different hue. */
.cb-icon-tile-danger  { background: linear-gradient(160deg, #FEE2E2 0%, #FECACA 100%); box-shadow: inset 0 0 0 1px rgba(220,38,38,0.15);  color: var(--cb-error-ink); }
.cb-icon-tile-success { background: linear-gradient(160deg, #ECFDF5 0%, #D1FAE5 100%); box-shadow: inset 0 0 0 1px rgba(22,163,74,0.15);  color: var(--cb-success-ink); }
.cb-icon-tile-info    { background: linear-gradient(160deg, #F0F9FF 0%, #E0F2FE 100%); box-shadow: inset 0 0 0 1px rgba(14,165,233,0.15); color: var(--cb-info-ink); }

/* 4b. The hero — three stacked layers: orange radial, sky radial, warm base. */
.cb-hero {
    background:
        radial-gradient(circle at 0% 0%,     rgba(249, 115, 22, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.08) 0%, transparent 55%),
        linear-gradient(160deg, #FFFFFF 0%, #FAFAF9 100%);
    border: 1px solid var(--cb-divider);
    border-radius: var(--cb-radius-hero);
}
/* Full-bleed variant (splash / boot). */
.cb-hero-full {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1.5rem; padding: 2rem;
    background:
        radial-gradient(circle at 12% 18%, rgba(249, 115, 22, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
        linear-gradient(160deg, #FFFFFF 0%, #FAFAF9 100%);
}
/* Solid brand panel — for the attendee passport header and reward hero. */
.cb-hero-brand {
    border-radius: var(--cb-radius-hero); color: #fff;
    background: var(--cb-gradient-brand);
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.28);
}

/* 4c. Hover lift — brand-tinted, MCB easing. */
.cb-lift { transition: transform 180ms var(--cb-ease), box-shadow 180ms var(--cb-ease); }
.cb-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 32px -12px rgba(249, 115, 22, 0.16), 0 8px 16px -8px rgba(249, 115, 22, 0.10);
}

/* 4d. Notice / banner — 135deg two-tone tint with a matching hairline. */
.cb-notice {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; border-radius: var(--cb-radius);
    background: linear-gradient(135deg, rgba(249,115,22,0.06) 0%, rgba(14,165,233,0.04) 100%);
    border: 1px solid rgba(249, 115, 22, 0.18);
}
.cb-notice-icon {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: var(--cb-radius);
    background: rgba(249, 115, 22, 0.14); color: var(--cb-primary);
    display: grid; place-items: center;
}
/* Strong feature banner — solid warm wash, brand border. */
.cb-banner { border-radius: var(--cb-radius-feature); border: 1px solid var(--cb-primary); background: var(--cb-gradient-banner); }
/* A row sitting inside a tinted banner. */
.cb-banner-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.85rem; border-radius: var(--cb-radius);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

/* 4e. Selection ring + status dot. */
.cb-selected { border-color: var(--cb-primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18); }
.cb-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.cb-status-active  { color: var(--cb-success-ink); }
.cb-status-pending { color: var(--cb-warning-ink); }
.cb-status-failed  { color: var(--cb-error-ink); }

/* 4f. Loader dots. */
.cb-loader { display: flex; gap: 0.4rem; }
.cb-loader span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--cb-primary); opacity: 0.4;
    animation: cb-loader-pulse 1.2s infinite ease-in-out;
}
.cb-loader span:nth-child(2) { animation-delay: 0.15s; }
.cb-loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cb-loader-pulse {
    0%, 80%, 100% { transform: scale(0.85); opacity: 0.4; }
    40%           { transform: scale(1.1);  opacity: 1.0; }
}

/* 4g. The wordmark lockup — navy subject + orange "Buddy" + superscript "My". */
.cb-logo-mark { display: inline-flex; align-items: center; gap: 0.6rem; user-select: none; }
.cb-logo-mascot { height: 40px; width: 40px; object-fit: contain; flex: 0 0 auto; }
.cb-logo-text { display: inline-flex; align-items: baseline; gap: 0.25rem; line-height: 1; }
.cb-logo-text-my {
    font-style: italic; font-weight: 700; font-size: 0.78rem;
    letter-spacing: -0.02em; color: var(--cb-secondary);
    transform: translateY(-0.45em);
}
.cb-logo-text-cb { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.025em; color: var(--cb-secondary); }
.cb-logo-text-buddy { color: var(--cb-primary); margin-left: 0.18em; }
.cb-logo-text--white .cb-logo-text-my,
.cb-logo-text--white .cb-logo-text-cb { color: #FFFFFF; }
.cb-logo-text--white .cb-logo-text-buddy { color: var(--cb-primary-light); }
@media (max-width: 600px) {
    .cb-logo-text-my { display: none; }
    .cb-logo-text-cb { font-size: 1rem; }
    .cb-logo-mascot { height: 34px; width: 34px; }
}
.cb-wordmark { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--cb-text-primary); }
.cb-wordmark .cb-accent { color: var(--cb-primary); }

/* ── 5. Idioms ───────────────────────────────────────────────────────────────
   The reusable building blocks. Anything used on more than one page belongs
   HERE, never in a page's own <style> — that rule is why MCB stayed coherent.
   ------------------------------------------------------------------------- */

/* Card — border, no shadow. */
.cb-card { background: var(--cb-surface); border: 1px solid var(--cb-divider); border-radius: var(--cb-radius-card); }
.cb-card-pad { padding: 20px 22px; }
.cb-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 14px; }
.cb-card-hover { transition: border-color 150ms, box-shadow 150ms, transform 150ms; }
.cb-card-hover:hover { border-color: var(--cb-primary); box-shadow: var(--cb-lift-card); transform: translateY(-1px); }
/* Clickable cards are <button>s — reset the browser's button chrome. */
.cb-card-button {
    cursor: pointer; text-align: left; font: inherit; color: inherit;
    width: 100%; box-sizing: border-box; padding: 0;
}

/* Page header. */
.cb-page-header { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cb-page-header-text { flex: 1 1 auto; min-width: 0; }
.cb-page-title { font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.cb-page-subtitle { margin-top: 4px; max-width: 68ch; color: var(--cb-text-secondary); }
.cb-page-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Small-caps section label — matches the Overline type spec. */
.cb-section {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--cb-text-secondary); margin: 1.75rem 0 0.6rem;
}

/* Compatibility alias: the portal's existing EmptyState markup uses
   .cb-empty-icon-wrap. Mapping it onto the canonical gradient tile upgrades every
   existing empty state to the MCB device without touching a single screen. */
.cb-empty-icon-wrap, .cb-empty-icon {
    display: grid; place-items: center;
    width: 64px; height: 64px;
    border-radius: var(--cb-radius-hero);
    background: var(--cb-icon-tile);
    box-shadow: var(--cb-icon-tile-ring);
    color: var(--cb-primary);
    margin-bottom: 4px;
}
.cb-empty.cb-empty-dense .cb-empty-icon-wrap { width: 56px; height: 56px; border-radius: var(--cb-radius-feature); }

/* Empty state. */
.cb-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 10px; padding: 48px 32px; min-height: 320px;
    background: var(--cb-surface); border: 1px solid var(--cb-divider); border-radius: var(--cb-radius-feature);
}
.cb-empty.cb-empty-dense { padding: 28px 24px; gap: 8px; min-height: 0; }
.cb-empty-title { font-weight: 600; }
.cb-empty-desc { max-width: 520px; line-height: 1.6; color: var(--cb-text-secondary); }
.cb-empty-action { margin-top: 12px; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Metric tiles. */
.cb-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 900px) { .cb-metric-grid { grid-template-columns: repeat(4, 1fr); } }
.cb-metric-tile {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 20px; background: var(--cb-surface);
    border: 1px solid var(--cb-divider); border-radius: var(--cb-radius-card);
    text-decoration: none; color: inherit;
    transition: border-color 120ms, transform 120ms, box-shadow 120ms;
}
.cb-metric-tile:hover { border-color: var(--cb-primary); transform: translateY(-1px); box-shadow: var(--cb-lift-tile); }
.cb-metric-icon { width: 40px; height: 40px; border-radius: var(--cb-radius); display: grid; place-items: center; margin-bottom: 4px; }
.cb-metric-icon-primary { background: rgba(249, 115, 22, 0.10); color: var(--cb-primary); }
.cb-metric-icon-info    { background: rgba(14, 165, 233, 0.10); color: var(--cb-info-ink); }
.cb-metric-icon-warning { background: rgba(234, 179, 8, 0.10);  color: var(--cb-warning-ink); }
.cb-metric-icon-success { background: rgba(22, 163, 74, 0.10);  color: var(--cb-success-ink); }
.cb-metric-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1.05; color: var(--cb-text-primary); font-variant-numeric: tabular-nums; }
.cb-metric-label { font-size: 13px; font-weight: 600; color: var(--cb-text-secondary); }
.cb-metric-sub { font-size: 11px; color: var(--cb-text-secondary); font-style: italic; }

/* Avatars. MCB distinguishes PEOPLE from ORGANISATIONS:
   people = circle, solid orange; organisations = squircle tile. */
.cb-avatar {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    background: var(--cb-primary); color: #fff;
    font-weight: 600; font-size: 0.95rem;
    display: grid; place-items: center;
}
.cb-avatar-tile {
    flex: 0 0 auto; width: 56px; height: 56px; border-radius: var(--cb-radius-card);
    background: var(--cb-surface-2); border: 1px solid var(--cb-divider);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-weight: 700; color: var(--cb-text-secondary); font-size: 1.05rem;
}
.cb-avatar-tile img { width: 100%; height: 100%; object-fit: cover; }
.cb-avatar-sm { width: 36px; height: 36px; border-radius: var(--cb-radius-sm); font-size: 0.78rem; }

/* Pills. Formula: rgba(hue,0.10) fill, hue-700 ink, rgba(hue,0.25) hairline.
   A DASHED border means "none / unassigned" — a recurring MCB idiom. */
.cb-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border-radius: var(--cb-radius-pill);
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
    background: var(--cb-surface-2); color: var(--cb-text-secondary);
    border: 1px solid var(--cb-divider);
}
.cb-pill-brand   { background: rgba(249, 115, 22, 0.10); color: var(--cb-primary-ink);  border-color: rgba(249, 115, 22, 0.25); }
.cb-pill-success { background: rgba(22, 163, 74, 0.10);  color: var(--cb-success-ink);  border-color: rgba(22, 163, 74, 0.25); }
.cb-pill-warning { background: rgba(234, 179, 8, 0.10);  color: var(--cb-warning-ink);  border-color: rgba(234, 179, 8, 0.25); }
.cb-pill-error   { background: rgba(220, 38, 38, 0.10);  color: var(--cb-error-ink);    border-color: rgba(220, 38, 38, 0.25); }
.cb-pill-info    { background: rgba(14, 165, 233, 0.10); color: var(--cb-info-ink);     border-color: rgba(14, 165, 233, 0.25); }
.cb-pill-none    { background: transparent; border-style: dashed; font-weight: 500; }

/* Filter pill / segmented choice. */
.cb-filter-pill {
    min-width: 80px; height: 36px; padding: 0 14px;
    border-radius: var(--cb-radius-pill);
    border: 1px solid var(--cb-divider); background: var(--cb-surface);
    color: var(--cb-ink); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background 100ms, border-color 100ms, color 100ms;
}
.cb-filter-pill:hover { background: var(--cb-surface-2); border-color: var(--cb-border-strong); }
.cb-filter-pill.selected { background: var(--cb-primary); border-color: var(--cb-primary); color: #fff; }

/* Segmented toggle (iOS-style). */
.cb-toggle { display: inline-flex; background: rgba(15, 23, 42, 0.05); border-radius: var(--cb-radius-pill); padding: 2px; gap: 2px; }
.cb-toggle button {
    border: 0; background: transparent; padding: 4px 12px; border-radius: var(--cb-radius-pill);
    font-size: 0.78rem; font-weight: 600; color: rgba(15, 23, 42, 0.6); cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
    transition: background 120ms, color 120ms;
}
.cb-toggle button:hover { color: rgba(15, 23, 42, 0.9); }
.cb-toggle button.active { background: #fff; color: var(--cb-primary-ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* Hand-rolled popover panel (MCB avoids MudMenu in the app bar). */
.cb-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 1300;
    min-width: 240px; background: var(--cb-surface);
    border: 1px solid var(--cb-divider); border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow-pop); overflow: hidden;
    animation: cb-panel-fade 120ms ease-out;
}
@keyframes cb-panel-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cb-panel-backdrop { position: fixed; inset: 0; z-index: 1290; }
.cb-panel-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: none; border: none; padding: 10px 16px; cursor: pointer;
    font-size: 14px; font-weight: 500; text-align: left; font-family: inherit;
    color: var(--cb-text-primary);
}
.cb-panel-item:hover { background: var(--cb-hover-neutral); }
.cb-panel-item-icon { color: var(--cb-text-secondary); }
.cb-panel-item:hover .cb-panel-item-icon { color: var(--cb-primary); }

/* Native field (used where MudBlazor is deliberately bypassed).
   The 1.5px border + 3px 12%-orange focus ring is the MCB input signature. */
.cb-field { margin-bottom: 18px; }
.cb-field label {
    display: block; font-size: 12px; font-weight: 700; color: var(--cb-ink);
    text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 7px;
}
.cb-field-input {
    width: 100%; padding: 12px 14px; box-sizing: border-box;
    border: 1.5px solid var(--cb-divider); border-radius: var(--cb-radius-sm);
    font-size: 15px; font-family: inherit; color: var(--cb-ink); background: var(--cb-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cb-field-input:focus { outline: none; border-color: var(--cb-primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12); }
.cb-field-input.invalid { border-color: var(--cb-error); }
.cb-field-error { font-size: 12px; color: var(--cb-error); margin-top: 5px; display: block; }
.cb-field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .cb-field-row-2 { grid-template-columns: 1fr; } }

/* Sticky save bar. */
.cb-savebar {
    position: sticky; bottom: 0; left: 0; right: 0; z-index: 5;
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--cb-divider); padding: 16px 24px; margin: 0 -24px;
}

/* Upload dropzone. */
.cb-upload {
    border: 2px dashed var(--cb-divider); border-radius: var(--cb-radius);
    padding: 36px; text-align: center; cursor: pointer; transition: all 0.15s;
}
.cb-upload:hover { border-color: var(--cb-primary); background: rgba(249, 115, 22, 0.04); }

/* Long-form prose (in-app guides, rendered Markdown). */
.cb-doc { font-size: 15px; line-height: 1.7; color: var(--cb-text-primary); max-width: 820px; }
.cb-doc h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 0.5rem; }
.cb-doc h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--cb-divider); }
.cb-doc h2:first-of-type { border-top: none; padding-top: 0; margin-top: 1.5rem; }
.cb-doc h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.cb-doc p { margin: 0 0 0.85rem; }
.cb-doc ul, .cb-doc ol { margin: 0 0 0.85rem; padding-left: 22px; }
.cb-doc li { margin: 4px 0; }
.cb-doc a { color: var(--cb-primary); text-decoration: none; }
.cb-doc a:hover { text-decoration: underline; }
.cb-doc code { background: var(--cb-surface-2); border: 1px solid var(--cb-divider); border-radius: 4px; padding: 1px 6px; font-size: 0.9em; color: var(--cb-primary-dark); }
.cb-doc pre { background: var(--cb-surface-2); border: 1px solid var(--cb-divider); border-radius: var(--cb-radius-sm); padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.cb-doc blockquote {
    margin: 1rem 0; padding: 0.75rem 1rem;
    background: rgba(249, 115, 22, 0.05); border-left: 3px solid var(--cb-primary);
    border-radius: 4px; color: var(--cb-text-secondary);
}
.cb-doc blockquote p:last-child { margin-bottom: 0; }
.cb-doc hr { border: none; border-top: 1px solid var(--cb-divider); margin: 22px 0; }
.cb-doc table { border-collapse: collapse; width: 100%; margin: 0 0 16px; display: block; overflow-x: auto; }
.cb-doc th, .cb-doc td { border: 1px solid var(--cb-divider); padding: 7px 10px; text-align: left; vertical-align: top; }
.cb-doc th { background: var(--cb-surface-2); font-weight: 700; white-space: nowrap; }
