/* ==========================================================================
   Candid Founders — Design Tokens (CF Brand Guidelines v1.0 · 2025)
   Loaded AFTER tailwind.css so token overrides win without rebuilding
   tailwind. Also defines Poppins @font-face + semantic component classes
   that map 1:1 to the exported design system previews.
   ========================================================================== */

@font-face { font-family:'Poppins'; src:url('/static/fonts/Poppins-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Poppins'; src:url('/static/fonts/Poppins-Medium.woff2') format('woff2'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Poppins'; src:url('/static/fonts/Poppins-SemiBold.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'Poppins'; src:url('/static/fonts/Poppins-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Poppins'; src:url('/static/fonts/Poppins-ExtraBold.woff2') format('woff2'); font-weight:800; font-style:normal; font-display:swap; }

:root {
  /* Body-level overlays clear shell chrome; their popovers and notifications
     have distinct roles. Local panel/header order stays inside the overlay. */
  --layer-chrome: 80;
  --layer-overlay: 100;
  --layer-popover: 110;
  --layer-notification: 120;
  /* Primary palette */
  --cf-black:       #212121;
  --cf-lime:        #DDFD99;
  --cf-white:       #ffffff;
  /* Secondary palette */
  --cf-lilac:       #F2E5F7;
  --cf-blue:        #007AFF;
  /* Derived */
  --cf-black-90:    #363636;
  --cf-black-80:    #525252;
  --cf-black-60:    #7d7d7d;
  --cf-black-40:    #aaaaaa;
  --cf-lime-dark:   #c3e87a;
  --cf-lime-tint:   #f1fcd3;
  --cf-lilac-dark:  #d9c0e2;
  --cf-blue-600:    #0062d1;
  --cf-blue-tint:   #e6f2ff;
  --cf-blue-50:     var(--interaction-selected-surface);
  /* Neutrals derived from Candid Black */
  --neutral-50:     #fafafa;
  --neutral-100:    #f3f3f3;
  --neutral-200:    #e6e6e6;
  --neutral-300:    #cccccc;
  --neutral-400:    #a3a3a3;
  --neutral-500:    #7a7a7a;
  --neutral-600:    #525252;
  --neutral-700:    #3d3d3d;
  --neutral-800:    #2b2b2b;
  --neutral-900:    #212121;
  /* Semantic (functional, outside core palette) */
  --success-50:  #ecfdf5; --success-500: #10b981; --success-700: #047857;
  --warning-50:  #fffbeb; --warning-500: #f59e0b; --warning-700: #b45309;
  --danger-50:   #fef2f2; --danger-500:  #ef4444; --danger-700:  #b91c1c;

  /* Analytics chart roles */
  --cf-chart-primary:    var(--cf-blue);
  --cf-chart-comparison: var(--neutral-700);
  --cf-chart-context:    var(--cf-lilac);
  --cf-chart-positive:   var(--success-700);
  --cf-chart-warning:    var(--warning-700);
  --cf-chart-negative:   var(--danger-700);
  --cf-chart-grid:       var(--neutral-200);
  /* Extended-current categorical palette. These tokens identify persistent
     peer series; semantic outcomes continue to use positive/warning/negative. */
  --cf-chart-series-1: #007AFF;
  --cf-chart-series-2: #84CC16;
  --cf-chart-series-3: #8B5CF6;
  --cf-chart-series-4: #14B8A6;
  --cf-chart-series-5: #F59E0B;
  --cf-chart-series-6: #F43F5E;
  --cf-chart-series-7: #6366F1;
  --cf-chart-series-8: #64748B;
  --cf-chart-band-startup:   var(--cf-chart-series-8);
  --cf-chart-band-small:     var(--cf-chart-series-3);
  --cf-chart-band-medium:    var(--cf-chart-series-1);
  --cf-chart-band-large:     var(--cf-chart-series-2);
  --cf-chart-band-unclassified: var(--neutral-200);
  --cf-chart-band-separator: var(--cf-white);
  --cf-chart-band-outline:   var(--neutral-600);

  /* Type */
  --font-sans:    'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-display: 56px;  --lh-display: 1.02;  --tr-display: -0.025em;
  --fs-h1:      36px;  --lh-h1:      1.12;  --tr-h1:      -0.02em;
  --fs-h2:      24px;  --lh-h2:      1.22;  --tr-h2:      -0.01em;
  --fs-h3:      18px;  --lh-h3:      1.35;
  --fs-body:    15px;  --lh-body:    1.6;
  --fs-small:   13px;  --lh-small:   1.5;
  --fs-xs:      12px;
  /* Shared eyebrows; operational category labels use .cf-page-label. */
  --fs-eyebrow: 11px;  --lh-eyebrow: 1.2; --tr-eyebrow: 0.14em;

  /* 4px geometry scale. Semantic aliases are the public contract; primitives
     keep new page and component spacing on one predictable rhythm. */
  --cf-space-1:  4px;
  --cf-space-2:  8px;
  --cf-space-3:  12px;
  --cf-space-4:  16px;
  --cf-space-5:  20px;
  --cf-space-6:  24px;
  --cf-space-8:  32px;
  --cf-space-10: 40px;
  --cf-space-12: 48px;

  --cf-page-section-gap:                 var(--cf-space-6);
  --cf-panel-inset:                      var(--cf-space-5);
  --cf-card-inset:                       var(--cf-space-5);
  --cf-field-gap:                        var(--cf-space-2);
  --cf-inline-control-gap:               var(--cf-space-2);
  --cf-row-padding-block-compact:        var(--cf-space-2);
  --cf-row-padding-inline-compact:       var(--cf-space-3);
  --cf-row-padding-block-comfortable:    var(--cf-space-3);
  --cf-row-padding-inline-comfortable:   var(--cf-space-4);
  --cf-control-height-desktop:           var(--cf-space-10);
  --cf-control-target-coarse:            44px;
  --cf-content-width-reading:            720px;
  --cf-content-width-operator-wide:      1440px;
  --cf-layout-grid-gap:                  var(--cf-space-4);

  /* Documentation tokens for the shared responsive vocabulary. CSS custom
     properties cannot be used in @media conditions, so rules use these exact
     literal values: 640 / 768 / 1024 / 1280. */
  --cf-breakpoint-sm:  640px;
  --cf-breakpoint-md:  768px;
  --cf-breakpoint-lg:  1024px;
  --cf-breakpoint-xl:  1280px;

  /* Semantic interaction roles. Keep #007AFF for brand/decorative accents;
     operational text and state boundaries use contrast-tested roles. */
  --interaction-action-fill:             #0062d1;
  --interaction-action-foreground:       #ffffff;
  --interaction-action-fill-hover:       #0057bd;
  --interaction-action-fill-active:      #004da8;
  --interaction-inverse-foreground:      #ffffff;
  --interaction-focus-outline:           #0070e8;
  --interaction-focus-outline-width:     3px;
  --interaction-focus-outline-offset:    2px;
  --interaction-focus-halo:              0 0 0 5px rgba(0,112,232,0.18);
  --interaction-selected-surface:        #eef6ff;
  --interaction-selected-foreground:     #212121;
  --interaction-selected-border:         #0062d1;
  --interaction-selected-indicator:      #0062d1;
  --interaction-disabled-surface:        #f3f3f3;
  --interaction-disabled-foreground:     #3d3d3d;
  --interaction-disabled-border:         #a3a3a3;

  /* Available supporting information on white/light neutral surfaces.
     Unselected does not mean disabled or missing. */
  --text-supporting-foreground:          var(--neutral-600);

  /* Inverse KPI text on the existing operational blue; no opacity on text.
     Delta direction also needs a visible sign or word, never colour alone. */
  --stat-inverse-surface:                var(--interaction-action-fill);
  --stat-inverse-foreground:             var(--interaction-inverse-foreground);
  --stat-inverse-positive:               var(--cf-lime);
  --stat-inverse-negative:               var(--danger-50);

  /* Editable control identity on white and light neutral surfaces. These
     roles do not replace focus, selection or validation colours. */
  --field-boundary-idle:                 var(--neutral-500);
  --field-boundary-hover:                var(--neutral-600);
  --field-placeholder-foreground:        var(--neutral-600);

  /* Radius / shadow / motion */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl: 18px; --radius-2xl: 24px; --radius-pill: 9999px;

  --shadow-xs:   0 1px 2px rgba(33,33,33,0.04);
  --shadow-sm:   0 1px 3px rgba(33,33,33,0.06), 0 1px 2px rgba(33,33,33,0.04);
  --shadow-md:   0 4px 14px rgba(33,33,33,0.08), 0 2px 4px rgba(33,33,33,0.04);
  --shadow-lg:   0 14px 32px rgba(33,33,33,0.10), 0 4px 10px rgba(33,33,33,0.05);
  --shadow-ring: 0 0 0 1px rgba(33,33,33,0.06);
  --shadow-focus:var(--interaction-focus-halo);

  --ease-out:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 300ms;
}

/* Safari does not consistently resolve custom properties supplied through SVG
   presentation attributes. Apply categorical chart roles through CSS so the
   canonical palette renders identically in HTML swatches and inline SVG. */
.cf-chart-band-fill { stroke: var(--cf-chart-band-separator); stroke-width: 1; }
.cf-chart-band-outline { fill: none; stroke: var(--cf-chart-band-outline); stroke-width: 1; }
.cf-chart-band-fill-startup { fill: var(--cf-chart-band-startup); }
.cf-chart-band-fill-small { fill: var(--cf-chart-band-small); }
.cf-chart-band-fill-medium { fill: var(--cf-chart-band-medium); }
.cf-chart-band-fill-large { fill: var(--cf-chart-band-large); }
.cf-chart-band-fill-unclassified { fill: var(--cf-chart-band-unclassified); }
.cf-chart-band-swatch-startup { background-color: var(--cf-chart-band-startup); }
.cf-chart-band-swatch-small { background-color: var(--cf-chart-band-small); }
.cf-chart-band-swatch-medium { background-color: var(--cf-chart-band-medium); }
.cf-chart-band-swatch-large { background-color: var(--cf-chart-band-large); }
.cf-chart-band-swatch-unclassified { background-color: var(--cf-chart-band-unclassified); }

/* ==========================================================================
   Base element styles — Poppins across the product, headers bold.
   ========================================================================== */

html, body {
  font-family: var(--font-sans);
  color: var(--cf-black);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.01em;
}

/* Shared eyebrow: Poppins Bold, readable at the 11px scale floor. */
.cf-eyebrow, .eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--tr-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neutral-600);
}

/* Page-title typography that respects the design-system spec.
   Templates were inheriting Tailwind text-2xl (22.5 px); cf-h1 enforces
   the 36 px / -0.02 em token at md+, with a slightly smaller mobile size
   so titles don't overpower a 375 px viewport. */
.cf-h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--cf-black);
}
@media (min-width: 640px) {
  .cf-h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
    letter-spacing: var(--tr-h1);
  }
}

.cf-h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 700;
  color: var(--cf-black);
}

.cf-h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 700;
  color: var(--cf-black);
}
@media (min-width: 640px) {
  .cf-h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
    letter-spacing: var(--tr-h2);
  }
}

/* ==========================================================================
   Token overrides — tailwind.css is pre-compiled with the old `cf.lime` and
   `cf.dark` hexes (186,217,88 / 18,18,18). Until the CSS is rebuilt, these
   selectors realign the existing tailwind utility classes to the brand-
   correct palette. Low-specificity single-class selectors match tailwind's
   own output.
   ========================================================================== */

.bg-cf-lime      { background-color: var(--cf-lime); }
.text-cf-lime    { color: var(--cf-lime); }
.border-cf-lime  { border-color: var(--cf-lime); }
.ring-cf-lime    { --tw-ring-color: var(--cf-lime); }
.hover\:bg-cf-lime:hover { background-color: var(--cf-lime); }

.bg-cf-black      { background-color: var(--cf-black); }
.text-cf-black    { color: var(--cf-black); }
.border-cf-black  { border-color: var(--cf-black); }
.hover\:bg-cf-black:hover { background-color: var(--cf-black); }
.hover\:text-cf-black:hover { color: var(--cf-black); }

.bg-cf-black  { background-color: var(--cf-black); }
.text-cf-black{ color: var(--cf-black); }

.bg-cf-lilac     { background-color: var(--cf-lilac); }
.text-cf-lilac   { color: var(--cf-lilac); }
.border-cf-lilac { border-color: var(--cf-lilac); }

/* Already brand-correct — kept here for parity. */
.bg-cf-blue      { background-color: var(--cf-blue); }
.text-cf-blue    { color: var(--cf-blue-600); }
.border-cf-blue  { border-color: var(--cf-blue); }

/* ==========================================================================
   Semantic component classes — mapped 1:1 to the design-system previews.
   Use these on new surfaces; retrofit existing templates opportunistically.
   ========================================================================== */

.cf-btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.cf-btn-sm { font-size: 13px; padding: 7px 14px; }

/* Black pill with Lime label — the defining CF CTA pairing */
.cf-btn-primary { background: var(--cf-black); color: var(--cf-lime); }
.cf-btn-primary:hover { background: #000; color: var(--cf-lime); }

/* Blue action — operational progress without the urgency of black/lime. */
.cf-btn-action {
  background: var(--interaction-action-fill);
  color: var(--interaction-action-foreground);
}
.cf-btn-action:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--interaction-action-fill-hover);
  color: var(--interaction-action-foreground);
}
.cf-btn-action:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--interaction-action-fill-active);
  color: var(--interaction-action-foreground);
}

/* Lime pill with Black label — hero / marketing CTA */
.cf-btn-lime { background: var(--cf-lime); color: var(--cf-black); }
.cf-btn-lime:hover { background: var(--cf-lime-dark); color: var(--cf-black); }

.cf-btn-secondary {
  background: var(--cf-white);
  color: var(--cf-black);
  border: 1.5px solid var(--cf-black);
}
.cf-btn-secondary:hover { background: var(--cf-black); color: var(--cf-white); }

.cf-btn-ghost {
  background: transparent;
  color: var(--neutral-600);
  padding: 8px 12px;
}
.cf-btn-ghost:hover { color: var(--cf-black); background: var(--neutral-100); }

.cf-btn:focus-visible { box-shadow: var(--shadow-focus); }

/* ==========================================================================
   Icons — one sizing system for inline SVGs, icon-only buttons, and tiles.
   Existing templates can keep inline SVG markup; these classes normalize the
   container, alignment, and reusable semantic colors.
   ========================================================================== */
.cf-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}
.cf-icon-xs { width: 12px; height: 12px; }
.cf-icon-sm { width: 14px; height: 14px; }
.cf-icon-md { width: 16px; height: 16px; }
.cf-icon-lg { width: 20px; height: 20px; }
.cf-icon-xl { width: 24px; height: 24px; }

.cf-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-600);
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.cf-icon-btn:hover {
  background: var(--neutral-100);
  color: var(--cf-black);
}
.cf-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.cf-icon-btn-sm { width: 28px; height: 28px; border-radius: var(--radius-sm); }
.cf-icon-btn-lg { width: 36px; height: 36px; }
.cf-icon-btn-ghost { background: transparent; border-color: transparent; }
.cf-icon-btn-muted { background: var(--neutral-100); color: var(--neutral-600); }
.cf-icon-btn-primary { background: var(--cf-blue); color: #fff; }
.cf-icon-btn-primary:hover { background: var(--cf-blue-600); color: #fff; }
.cf-icon-btn-danger { background: var(--danger-50); color: var(--danger-700); }
.cf-icon-btn-danger:hover { background: #fee2e2; color: var(--danger-700); }
@media (pointer: coarse) {
  .cf-icon-btn,
  .cf-icon-btn-sm,
  .cf-icon-btn-lg {
    min-width: 44px;
    min-height: 44px;
  }
}

.cf-brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--cf-blue-tint);
  color: var(--cf-blue-600);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
img.cf-brand-mark {
  display: block;
  object-fit: contain;
  background: var(--cf-white);
  padding: 4px;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Geometry roles — 4px spacing, two intentional row densities, and stable
   control targets. Compact is for repeated, high-volume data review;
   comfortable is for settings, profile, and reading surfaces.
   ========================================================================== */
.cf-page-sections {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: var(--cf-page-section-gap);
}
.cf-content-reading {
  width: 100%;
  max-width: var(--cf-content-width-reading);
}
.cf-content-operator-wide {
  width: 100%;
  max-width: var(--cf-content-width-operator-wide);
  margin-inline: auto;
}
.cf-panel-inset { padding: var(--cf-panel-inset); }
.cf-card-inset { padding: var(--cf-card-inset); }
.cf-field-stack {
  display: grid;
  gap: var(--cf-field-gap);
}
.cf-inline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cf-inline-control-gap);
}
.cf-control-standard {
  box-sizing: border-box;
  min-height: var(--cf-control-height-desktop);
}
/* Explicit standard button adoption: minimum targets grow with wrapped labels. */
.cf-btn.cf-control-standard {
  line-height: 20px;
  padding-block: 8px;
  justify-content: center;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cf-btn.cf-control-standard > svg { flex-shrink: 0; }
.cf-btn.cf-control-standard > span { min-width: 0; }
.cf-density-list > .cf-density-row + .cf-density-row {
  border-top: 1px solid var(--neutral-100);
}
.cf-density-list[data-density="compact"] > .cf-density-row {
  padding: var(--cf-row-padding-block-compact) var(--cf-row-padding-inline-compact);
}
.cf-density-list[data-density="comfortable"] > .cf-density-row {
  padding: var(--cf-row-padding-block-comfortable) var(--cf-row-padding-inline-comfortable);
}
@media (pointer: coarse) {
  .cf-control-standard {
    min-height: var(--cf-control-target-coarse);
  }
}

/* First adopter: Brand Profile keeps its source-defined section and row order
   while replacing template-local geometry with the shared roles above. */
.cf-brand-profile-primary-grid,
.cf-brand-profile-link-grid {
  display: grid;
  min-width: 0;
  gap: var(--cf-layout-grid-gap);
}
.cf-brand-profile-detail-row {
  display: grid;
  min-width: 0;
  gap: var(--cf-field-gap);
}
.cf-brand-profile-detail-row > * { min-width: 0; }
.cf-brand-profile-detail-row dd,
.cf-brand-profile-links-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.cf-brand-profile-identity-layout {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: var(--cf-layout-grid-gap);
}
.cf-brand-profile-mark {
  box-sizing: border-box;
  display: flex;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--cf-blue-tint);
  color: var(--cf-blue-600);
  font-size: 18px;
  font-weight: 700;
  object-fit: contain;
}
img.cf-brand-profile-mark {
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
  padding: var(--cf-space-1);
}
.cf-brand-profile-identity-copy { min-width: 0; }
.cf-brand-profile-identity-meta { margin-top: var(--cf-space-1); }
.cf-brand-profile-identity-actions { margin-top: var(--cf-space-3); }
.cf-brand-profile-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.cf-brand-profile-link-card:hover {
  border-color: var(--neutral-300);
  box-shadow: var(--shadow-sm);
}
.cf-brand-profile-link-card h2 { margin-top: var(--cf-space-1); }
.cf-brand-profile-link-card .cf-brand-profile-link-description { margin-top: var(--cf-space-2); }
.cf-brand-profile-links-table {
  table-layout: fixed;
  width: 100%;
}
.cf-table-scroller .cf-brand-profile-links-table {
  min-width: 100%;
  white-space: normal;
}
.cf-brand-profile-links-table td:first-child { width: 36%; }
@media (min-width: 640px) {
  .cf-brand-profile-detail-row {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
@media (min-width: 1024px) {
  .cf-brand-profile-primary-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }
  .cf-brand-profile-link-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Page shell, shared page headers, and side drawers.
   The dashboard is an operations tool, so the default content shell is fluid
   and dense. Pages that need a narrower reading width can still pass
   main_width_class from their route. */
:root {
  --cf-page-gutter: 14px;
}
@media (min-width: 640px) {
  :root { --cf-page-gutter: 18px; }
}
@media (min-width: 1024px) {
  :root { --cf-page-gutter: 22px; }
}

.cf-page-chrome,
.cf-page-shell {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--cf-page-gutter);
  padding-right: var(--cf-page-gutter);
}
.cf-page-shell { padding-top: 18px; }

.cf-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--cf-layout-grid-gap);
  margin-bottom: 18px;
}
.cf-page-header-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 28rem;
}
.cf-page-brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--cf-blue-tint);
  color: var(--cf-blue);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
}
img.cf-page-brand-mark {
  display: block;
  object-fit: contain;
  background: var(--cf-white);
  padding: 5px;
  box-shadow: var(--shadow-xs);
}
.cf-page-header-copy {
  min-width: 0;
}
.cf-page-header-subtitle {
  margin-top: 4px;
  max-width: 72ch;
  color: var(--neutral-600);
  font-size: 14px;
  line-height: 1.5;
}
.cf-page-header-meta {
  margin-top: 8px;
}
.cf-page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--cf-inline-control-gap);
  flex: 0 1 auto;
  max-width: 100%;
}
.cf-page-header-compact {
  margin-bottom: 14px;
}
.cf-page-header-compact .cf-page-brand-mark {
  width: 32px;
  height: 32px;
}
.cf-page-header-compact .cf-page-header-subtitle {
  margin-top: 2px;
}

@media (max-width: 900px) {
  .cf-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .cf-page-header-main {
    flex: 0 1 auto;
    width: 100%;
  }
  .cf-page-header-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Platform component ownership: menus, disclosures, tables and mutations live
   here. base-shell.css owns layout only and loads before this file. */
.cf-menu-root { position: relative; }
.cf-menu-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--cf-white);
  padding: 0.45rem 0.75rem;
  color: var(--neutral-700);
  font-size: 0.875rem;
  font-weight: 600;
}
.cf-menu-trigger:hover,
.cf-menu-root.is-open .cf-menu-trigger { border-color: var(--neutral-500); color: var(--cf-black); }
.cf-menu-trigger-inline {
  border-color: transparent;
  background: transparent;
  padding: 0.375rem 0.75rem;
  color: var(--neutral-600);
  font-weight: 500;
}
.cf-menu-trigger-inline:hover,
.cf-menu-root.is-open .cf-menu-trigger-inline {
  border-color: transparent;
  background: var(--neutral-100);
  color: var(--cf-black);
}
.cf-menu-trigger:focus-visible,
.cf-menu-item:focus-visible { box-shadow: var(--shadow-focus); }
.cf-menu {
  z-index: 60;
  min-width: 12rem;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--cf-white);
  padding: 0.25rem;
  box-shadow: var(--shadow-lg);
}
.cf-menu-section { border-bottom: 1px solid var(--neutral-100); padding: 0.5rem 0.75rem; }
.cf-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 0.5rem 0.75rem;
  color: var(--neutral-700);
  font-size: 0.8125rem;
  text-align: left;
}
.cf-menu-item:hover { background: var(--neutral-50); color: var(--cf-black); }
.cf-menu-item.is-selected,
.cf-menu-item[aria-checked="true"] {
  background: var(--interaction-selected-surface);
  color: var(--interaction-selected-foreground);
  box-shadow: inset 3px 0 0 var(--interaction-selected-indicator);
  font-weight: 700;
}
.cf-menu-item.is-danger { color: var(--danger-700); }
.cf-menu-item.is-danger:hover { background: var(--danger-50); }
.cf-disclosure-trigger[aria-expanded="true"] .cf-disclosure-chevron { transform: rotate(180deg); }
.cf-disclosure-chevron { transition: transform 160ms ease; }
.cf-icon-toggle { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.cf-icon-toggle[aria-pressed="true"] { color: var(--success-700); }
[data-cf-mutation][aria-busy="true"], [data-cf-mutation].is-busy { cursor: progress; }
[data-cf-mutation-busy] { display: none; }
[data-cf-mutation][aria-busy="true"] [data-cf-mutation-idle] { display: none; }
[data-cf-mutation][aria-busy="true"] [data-cf-mutation-busy] { display: inline-flex; }
.cf-processing-button { justify-content: center; max-width: 100%; }
.cf-processing-content { color: inherit; -webkit-text-fill-color: currentColor; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; white-space: normal; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
[data-cf-mutation-idle].cf-processing-content { display: inline-flex; }
.cf-processing-button .cf-spinner { flex-shrink: 0; border-color: color-mix(in srgb, currentColor 28%, transparent); border-top-color: currentColor; }
@media (prefers-reduced-motion: reduce) {
  .cf-processing-button .cf-spinner { animation: none; }
}
.cf-table-scroller {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.cf-table-scroller:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
}
.cf-table-scroll-hint { margin: 0 0 0.35rem; color: var(--neutral-600); font-size: 0.75rem; }
.cf-table-scroller.is-overflowing:not(.is-at-end) { box-shadow: inset -16px 0 12px -16px rgba(33, 33, 33, 0.35); }
.cf-table-scroller.is-overflowing:not(.is-at-start).is-at-end { box-shadow: inset 16px 0 12px -16px rgba(33, 33, 33, 0.35); }
.cf-table-scroller.is-overflowing:not(.is-at-start):not(.is-at-end) { box-shadow: inset 16px 0 12px -16px rgba(33, 33, 33, 0.35), inset -16px 0 12px -16px rgba(33, 33, 33, 0.35); }
@media (max-width: 639px) {
  .cf-table-scroller table { min-width: max-content; white-space: nowrap; }
}
@media (pointer: coarse) {
  .cf-menu-trigger, .cf-menu-item, .cf-control, .cf-top-tab, .info-tip .info-btn { min-height: 44px; }
}

.cf-side-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 24, 39, 0.2);
}
.cf-side-drawer-backdrop.hidden { display: none; }
.cf-side-drawer {
  position: absolute;
  inset-block: 0;
  right: 0;
  width: 100%;
  max-width: min(720px, 100vw);
  overflow-y: auto;
  background: var(--cf-white);
  box-shadow: -18px 0 45px rgba(17, 24, 39, 0.18);
  border-left: 1px solid rgba(17, 24, 39, 0.08);
}
.cf-help-drawer-backdrop {
  z-index: 60;
  background: rgba(17, 24, 39, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cf-help-drawer {
  position: fixed;
  z-index: 70;
  max-width: 28rem;
}
.cf-side-drawer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--neutral-100);
  background: var(--cf-white);
  padding: 16px 20px;
}
.cf-side-drawer-body {
  padding: 20px;
}
@media (min-width: 1280px) {
  .cf-side-drawer {
    max-width: min(760px, 44vw);
  }
}

.cf-btn > svg,
.cf-btn-toolbar > svg,
.cf-icon-btn > svg,
.primary-icon-glyph > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
:is(button, a).inline-flex > svg:not(.cf-icon) {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.cf-tooltip-anchor {
  position: relative;
  display: inline-flex;
}

.cf-help { align-items: center; display: inline-flex; height: 20px; justify-content: center; position: relative; vertical-align: middle; width: 20px; }
.cf-help-trigger {
  align-items: center; background: transparent; border: 0; border-radius: var(--radius-pill); color: var(--neutral-500);
  cursor: help; display: inline-flex; height: 44px; justify-content: center; margin: -12px; padding: 0; width: 44px;
}
.cf-help-trigger svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; width: 18px; }
.cf-help-trigger:hover { color: var(--cf-blue-600); }
.cf-help-trigger:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.cf-help-popover {
  background: var(--cf-black); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(15,23,42,.2);
  color: var(--neutral-100); font-size: 11px; font-weight: 500; line-height: 1.45; max-width: calc(100vw - 24px); padding: 8px 10px;
  position: fixed; text-align: left; text-transform: none; width: 240px; z-index: 80;
  max-height: calc(100vh - 16px); overflow-y: auto; overflow-wrap: anywhere;
}
.cf-help-popover[hidden] { display: none; }
.cf-help-popover a { color: var(--cf-white); font-weight: 700; text-decoration: underline; }

.cf-toast-stack { display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); position: fixed; right: 16px; top: 16px; width: 360px; z-index: var(--layer-notification); }
.cf-toast, .cf-toast-pending-item { align-items: flex-start; background: var(--cf-white); border: 1px solid var(--neutral-200); border-left: 4px solid var(--neutral-400); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: grid; gap: 10px; grid-template-columns: 16px minmax(0,1fr) 32px; padding: 12px 10px 12px 14px; width: 100%; }
.cf-toast-success { border-left-color: var(--success-500); }
.cf-toast-info { border-left-color: var(--cf-blue-600); }
.cf-toast-warning { border-left-color: var(--warning-500); }
.cf-toast-danger { border-left-color: var(--danger-700); }
.cf-toast-icon { background: currentColor; border-radius: var(--radius-pill); color: var(--neutral-400); height: 10px; margin-top: 5px; width: 10px; }
.cf-toast-success .cf-toast-icon { color: var(--success-500); }
.cf-toast-info .cf-toast-icon { color: var(--cf-blue-600); }
.cf-toast-warning .cf-toast-icon { color: var(--warning-500); }
.cf-toast-danger .cf-toast-icon { color: var(--danger-700); }
.cf-toast-copy { min-width: 0; overflow-wrap: anywhere; }
.cf-toast-title { color: var(--neutral-900); display: block; font-size: 13px; line-height: 1.35; }
.cf-toast-message { color: var(--neutral-600); font-size: 12px; line-height: 1.45; margin: 2px 0 0; }
.cf-toast-dismiss { align-items: center; background: transparent; border: 0; border-radius: var(--radius-md); color: var(--neutral-500); display: inline-flex; font-size: 20px; height: 32px; justify-content: center; width: 32px; }
.cf-toast-dismiss:hover { background: var(--neutral-100); color: var(--neutral-900); }
.cf-toast-dismiss:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.cf-toast-stack { max-height: calc(100dvh - 32px); overflow-y: auto; padding: 3px; }
.cf-toast-stack[hidden], .cf-toast-stack [hidden] { display: none; }
.cf-toast-visible { display: flex; flex-direction: column; gap: 10px; }
.cf-toast-pending, .cf-toast-overflow { background: var(--cf-white); border: 1px solid var(--neutral-300); border-radius: var(--radius-lg); color: var(--neutral-900); font-size: 13px; }
.cf-toast-pending summary { cursor: pointer; min-height: 44px; padding: 12px; }
.cf-toast-pending summary:focus-visible { outline: 2px solid var(--cf-blue-600); outline-offset: -3px; }
.cf-toast-pending-help, .cf-toast-overflow { margin: 0; padding: 12px; }
.cf-toast-overflow { border-left: 4px solid var(--warning-500); }
#cf-toast-pending-list { display: grid; gap: 8px; padding: 8px; }
.cf-toast-pending-item { border-radius: 0; border-top: 0; border-right: 0; box-shadow: none; }
@media (forced-colors: active) { .cf-toast-dismiss:focus-visible, .cf-toast-pending summary:focus-visible { outline: 2px solid Highlight; } }
@media (max-width: 479px) { .cf-toast-stack { left: 16px; right: 16px; top: calc(12px + env(safe-area-inset-top, 0px)); width: auto; } }

/* Contextual help. The 18px trigger is deliberately quieter than the label
   beside it; coarse pointers retain a larger interaction target below. */
.info-tip {
  position: relative;
  display: inline-flex;
  min-width: 20px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
*:has(> .info-tip:hover) {
  position: relative;
  z-index: 60 !important;
}
.info-tip:hover { z-index: 60; }
.seg-detail,
.seg-detail > summary,
details.seg-detail[open] > div {
  overflow: visible;
}
.info-tip .info-btn,
.cf-tooltip-trigger {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-pill);
  background: var(--neutral-50);
  color: var(--neutral-500);
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.info-tip:hover .info-btn,
.info-tip .info-btn:focus-visible,
.cf-tooltip-trigger:hover,
.cf-tooltip-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--cf-blue) 55%, var(--neutral-300));
  background: var(--cf-blue-tint);
  color: var(--cf-blue-600);
}
.info-tip .info-btn:focus-visible,
.cf-tooltip-trigger:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.info-tip .info-bubble {
  display: none;
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: min(240px, calc(100vw - 24px));
  padding: 7px 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: var(--cf-black);
  color: var(--neutral-100);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}
.info-tip .info-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--cf-black);
}
.info-tip .info-bubble.anchor-right {
  right: 0;
  left: auto;
  transform: none;
}
.info-tip .info-bubble.anchor-right::after {
  right: 8px;
  left: auto;
  transform: none;
}
.info-tip .info-bubble.anchor-left {
  left: 0;
  transform: none;
}
.info-tip .info-bubble.anchor-left::after { left: 8px; }
.info-tip .info-bubble.anchor-bottom {
  top: calc(100% + 7px);
  bottom: auto;
}
.info-tip .info-bubble.anchor-bottom::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--cf-black);
}
.info-tip:hover .info-bubble,
.info-tip:focus-within .info-bubble,
.info-tip .info-bubble.show-touch {
  display: block;
}
.cf-table-panel:has(.info-tip:hover),
.cf-table-panel:has(.info-tip:focus-within),
.cf-table-panel:has(.info-bubble.show-touch),
.cf-table-panel-scroll:has(.info-tip:hover),
.cf-table-panel-scroll:has(.info-tip:focus-within),
.cf-table-panel-scroll:has(.info-bubble.show-touch) {
  overflow: visible;
}

.cf-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 60;
  width: max-content;
  max-width: min(260px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: var(--cf-black);
  color: var(--neutral-100);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast) var(--ease-out);
  visibility: hidden;
}

.cf-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--cf-black);
}

.cf-tooltip-anchor:hover .cf-tooltip,
.cf-tooltip-anchor:focus-within .cf-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.cf-tooltip-anchor[data-tooltip-align="start"] .cf-tooltip {
  left: 0;
  transform: translate(0, 4px);
}

.cf-tooltip-anchor[data-tooltip-align="start"] .cf-tooltip::after {
  left: 32px;
}

.cf-tooltip-anchor[data-tooltip-align="start"]:hover .cf-tooltip,
.cf-tooltip-anchor[data-tooltip-align="start"]:focus-within .cf-tooltip {
  transform: translate(0, 0);
}

.cf-tooltip-anchor[data-tooltip-align="end"] .cf-tooltip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.cf-tooltip-anchor[data-tooltip-align="end"] .cf-tooltip::after {
  left: auto;
  right: 32px;
  transform: none;
}

.cf-tooltip-anchor[data-tooltip-align="end"]:hover .cf-tooltip,
.cf-tooltip-anchor[data-tooltip-align="end"]:focus-within .cf-tooltip {
  transform: translate(0, 0);
}

.cf-review-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.cf-review-action-btn {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 18px;
  border: 2px solid var(--neutral-300);
  background: var(--cf-white);
  color: var(--cf-black);
  padding: 13px 20px;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(33,33,33,0.08);
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.cf-review-action-btn:hover {
  border-color: var(--cf-black);
  box-shadow: 0 4px 12px rgba(33,33,33,0.12);
}

.cf-review-action-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus), 0 4px 12px rgba(33,33,33,0.12);
}

.cf-review-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cf-review-action-btn[aria-busy="true"] {
  cursor: progress;
  opacity: 1;
}

.cf-review-action-btn[aria-busy="true"] .cf-review-action-letter {
  display: none;
}

.cf-review-action-btn-primary {
  border-color: var(--cf-black);
  background: var(--cf-black);
  color: var(--cf-lime);
}

.cf-review-action-btn-primary:hover {
  border-color: #000;
  background: #000;
  color: var(--cf-lime);
}

.cf-review-action-btn-danger {
  border-color: #fecaca;
  background: #fff7f7;
  color: var(--danger-700);
}

.cf-review-action-btn-danger:hover {
  border-color: #fca5a5;
  background: var(--danger-50);
  color: var(--danger-700);
}

.cf-review-action-letter {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid rgba(33,33,33,0.12);
  background: rgba(33,33,33,0.04);
  color: currentColor;
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 700;
}

.cf-review-action-btn-primary .cf-review-action-letter {
  border-color: rgba(221,253,153,0.35);
  background: rgba(221,253,153,0.12);
}

.cf-review-action-btn-danger .cf-review-action-letter {
  border-color: #fecaca;
  background: #fff;
}

@media (max-width: 640px) {
  .cf-review-action-group {
    justify-content: stretch;
  }
  .cf-review-action-btn {
    flex: 1 1 145px;
    min-height: 50px;
    padding: 12px 14px;
    font-size: 15px;
  }
}

/* Pills / badges — matches preview/badges.html */
.cf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
}
.cf-pill-sm {
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--fs-eyebrow);
  line-height: 1.35;
}
.cf-pill-lime  { background: var(--cf-lime);  color: var(--cf-black); }
.cf-pill-lilac { background: var(--cf-lilac); color: var(--cf-black); }
.cf-pill-dark  { background: var(--cf-black); color: var(--cf-lime); }
.cf-pill-success { background: var(--success-50); color: var(--success-700); }
.cf-pill-warning { background: var(--warning-50); color: var(--warning-700); }
.cf-pill-danger  { background: var(--danger-50);  color: var(--danger-700); }
.cf-pill-info    { background: var(--cf-blue-tint); color: var(--cf-blue-600); }
.cf-pill-neutral { background: var(--neutral-100); color: var(--neutral-600); }
.cf-pill .cf-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.cf-pod-card {
  --pod-accent: var(--neutral-300);
  --pod-bg: var(--neutral-100);
  --pod-text: var(--neutral-700);
  border-color: var(--neutral-100);
  border-left: 4px solid var(--pod-accent);
}
.cf-pod-marker {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: var(--radius-pill);
  background: var(--pod-accent);
  box-shadow: 0 0 0 3px var(--pod-bg);
}
.cf-pod-count {
  background: var(--pod-bg);
  color: var(--pod-text);
}
.cf-pod-color-0 { --pod-accent: var(--neutral-300); --pod-bg: var(--neutral-100); --pod-text: var(--neutral-600); }
.cf-pod-color-1 { --pod-accent: #007aff; --pod-bg: #e6f2ff; --pod-text: #0062d1; }
.cf-pod-color-2 { --pod-accent: #84cc16; --pod-bg: #f1fcd3; --pod-text: #365314; }
.cf-pod-color-3 { --pod-accent: #c084fc; --pod-bg: #f2e5f7; --pod-text: #6b21a8; }
.cf-pod-color-4 { --pod-accent: #14b8a6; --pod-bg: #ccfbf1; --pod-text: #0f766e; }
.cf-pod-color-5 { --pod-accent: #f59e0b; --pod-bg: #fffbeb; --pod-text: #b45309; }
.cf-pod-color-6 { --pod-accent: #f43f5e; --pod-bg: #fff1f2; --pod-text: #be123c; }
.cf-pod-color-7 { --pod-accent: #6366f1; --pod-bg: #eef2ff; --pod-text: #4338ca; }
.cf-pod-color-8 { --pod-accent: #0ea5e9; --pod-bg: #e0f2fe; --pod-text: #0369a1; }
.cf-pod-color-9 { --pod-accent: #a855f7; --pod-bg: #f3e8ff; --pod-text: #7e22ce; }
.cf-pod-color-10 { --pod-accent: #64748b; --pod-bg: #f1f5f9; --pod-text: #475569; }
.cf-workspace-pod-pill {
  display: inline-flex;
  min-width: 0;
  max-width: 96px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--pod-bg);
  color: var(--pod-text);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-workspace-pod-pill .cf-pod-marker {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  box-shadow: none;
}

/* Branded loader — CSS-only so loading states do not fetch large GIFs. */
.cf-logo-loader {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid color-mix(in srgb, var(--cf-blue) 18%, transparent);
  border-top-color: var(--cf-blue);
  border-right-color: var(--warning-500);
  border-radius: 999px;
  background: transparent;
  animation: cf-logo-loader-spin 900ms linear infinite;
}
.cf-logo-loader--dark {
  border-color: color-mix(in srgb, white 24%, transparent);
  border-top-color: white;
  border-right-color: var(--warning-500);
}
.cf-logo-loader-mark {
  display: none;
}
@keyframes cf-logo-loader-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-logo-loader { animation-duration: 2400ms; }
}

/* Stat card — matches preview/stats.html */
.cf-stat {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
}
.cf-stat dt {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--neutral-600);
  letter-spacing: 0.1em;
  margin: 0;
}
.cf-stat dd {
  margin: 8px 0 0;
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1;
  color: var(--cf-black);
}
.cf-stat dd.cf-stat-multi {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  line-height: 1;
}
.cf-stat-main-count {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.cf-stat-mini-grid {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 1px;
}
.cf-stat-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 72px;
}
.cf-stat-mini strong {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--cf-black);
}
.cf-stat-mini span {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--neutral-600);
  text-transform: none;
}
.cf-stat.cf-stat-lime { background: var(--cf-lime); border-color: transparent; }
.cf-stat.cf-stat-dark { background: var(--cf-black); border-color: transparent; }
.cf-stat.cf-stat-dark dt { color: var(--neutral-400); }
.cf-stat.cf-stat-dark dd { color: var(--cf-lime); }

/* Messaging dashboard: equal-weight metrics and a compact first-run journey. */
.cf-dashboard-stats .cf-stat {
  display: flex;
  min-height: 132px;
  flex-direction: column;
}
.cf-dashboard-stats .cf-stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.cf-dashboard-stats .cf-stat-link {
  margin-top: auto;
  padding-top: 12px;
  color: var(--cf-blue-600);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.cf-dashboard-stats .cf-stat-link:hover { text-decoration: underline; }
.cf-dashboard-onboarding {
  border-color: rgba(0, 122, 255, 0.24);
  background: linear-gradient(110deg, var(--cf-white) 0%, #f4f9ff 100%);
}
.cf-dashboard-onboarding-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}
.cf-dashboard-onboarding-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--cf-blue-tint);
  color: var(--cf-blue);
}
.cf-dashboard-onboarding-icon svg { width: 21px; height: 21px; }
.cf-dashboard-onboarding-copy h2 {
  margin-top: 2px;
  color: var(--cf-black);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}
.cf-dashboard-onboarding-copy p {
  margin-top: 4px;
  max-width: 70ch;
  color: var(--neutral-600);
  font-size: 13px;
  line-height: 1.5;
}
.cf-dashboard-onboarding-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--warning-700);
  font-size: 12px;
  font-weight: 600;
}
.cf-dashboard-onboarding-note .cf-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--warning-500);
}
.cf-dashboard-onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.cf-dashboard-workflow-next {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.cf-dashboard-workflow-next .cf-btn { flex: 0 0 auto; }
@media (max-width: 900px) {
  .cf-dashboard-onboarding-body { grid-template-columns: auto minmax(0, 1fr); }
  .cf-dashboard-onboarding-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 58px;
  }
}
@media (max-width: 560px) {
  .cf-dashboard-onboarding-body { grid-template-columns: 1fr; padding: 16px; }
  .cf-dashboard-onboarding-icon { display: none; }
  .cf-dashboard-onboarding-actions { padding-left: 0; flex-direction: column; align-items: stretch; }
  .cf-dashboard-onboarding-actions .cf-btn { justify-content: center; }
  .cf-dashboard-workflow-next { align-items: stretch; flex-direction: column; }
  .cf-dashboard-workflow-next .cf-btn { justify-content: center; }
}

/* This command-centre view earns back vertical space from app chrome. */
@media (min-width: 640px) {
  body[data-usage-page-key="home"] .cf-topbar { height: 48px; }
  body[data-usage-page-key="home"] .cf-global-search { top: 6px; }
  body[data-usage-page-key="home"] .cf-subtab-bar {
    top: 48px;
    min-height: 34px;
  }
  body[data-usage-page-key="home"] .cf-subtab-bar .cf-page-chrome {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  body[data-usage-page-key="home"] .cf-page-shell { padding-top: 14px; }
}

/* Banner — matches preview/banners.html */
.cf-banner {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  align-items: flex-start;
}
.cf-banner .cf-banner-ic {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cf-banner .cf-banner-t { font-size: 13px; font-weight: 700; font-family: var(--font-heading); }
.cf-banner .cf-banner-s { font-size: 12px; margin-top: 3px; }
.cf-banner-brand  { background: var(--cf-lilac); }
.cf-banner-brand  .cf-banner-ic { background: var(--cf-black); color: var(--cf-lilac); }
.cf-banner-brand  .cf-banner-t  { color: var(--cf-black); }
.cf-banner-brand  .cf-banner-s  { color: var(--neutral-600); }
.cf-banner-success{ background: var(--cf-lime); }
.cf-banner-success .cf-banner-ic { background: var(--cf-black); color: var(--cf-lime); }
.cf-banner-success .cf-banner-t, .cf-banner-success .cf-banner-s { color: var(--cf-black); }
.cf-banner-warning{ background: var(--warning-50); border: 1px solid #fde68a; }
.cf-banner-warning .cf-banner-ic { background: #fef3c7; color: #d97706; }
.cf-banner-warning .cf-banner-t  { color: #92400e; }
.cf-banner-warning .cf-banner-s  { color: var(--warning-700); }
.cf-banner-danger { background: var(--danger-50); border: 1px solid #fecaca; }
.cf-banner-danger .cf-banner-ic { background: #fee2e2; color: #dc2626; }
.cf-banner-danger .cf-banner-t  { color: #991b1b; }
.cf-banner-danger .cf-banner-s  { color: var(--danger-700); }

/* Shared notice extends banner geometry without changing legacy recipes.
   Severity never selects announcement urgency; cf-notice.js owns that. */
.cf-notice {
  --notice-surface: var(--neutral-50);
  --notice-ink: var(--neutral-700);
  background: var(--notice-surface);
  color: var(--notice-ink);
  border: 1px solid var(--notice-ink);
  gap: var(--cf-space-3);
  padding: var(--cf-space-4);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  container-type: inline-size;
}
.cf-notice-info { --notice-surface: var(--cf-blue-tint); --notice-ink: var(--cf-blue-600); }
.cf-notice-success { --notice-surface: var(--success-50); --notice-ink: var(--success-700); }
.cf-notice-warning { --notice-surface: var(--warning-50); --notice-ink: var(--warning-700); }
.cf-notice-error { --notice-surface: var(--danger-50); --notice-ink: var(--danger-700); }
.cf-notice .cf-notice-icon { width: 24px; height: 24px; color: var(--notice-ink); }
.cf-notice-icon svg { flex: none; }
.cf-notice-body {
  flex: 1 1 min(22rem, calc(100% - 36px));
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cf-space-3) var(--cf-space-5);
}
.cf-notice-copy { flex: 1 1 22rem; min-width: 0; }
.cf-notice .cf-banner-t, .cf-notice .cf-banner-s, .cf-notice-content {
  color: var(--notice-ink);
  line-height: var(--lh-small);
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}
.cf-notice-controls {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cf-space-2) var(--cf-space-3);
  min-width: 0;
  max-width: 100%;
}
.cf-notice-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: var(--lh-small);
  overflow-wrap: break-word;
  min-width: 0;
}
.cf-notice-actions { display: flex; flex-wrap: wrap; gap: var(--cf-space-2); max-width: 100%; }
.cf-notice-actions .cf-btn, .cf-notice-dismissal .cf-icon-btn {
  color: var(--notice-ink);
  background: var(--cf-white);
  border: 1px solid var(--notice-ink);
  white-space: normal;
  word-break: normal;
  max-width: 100%;
  justify-content: center;
}
.cf-notice-actions .cf-btn { padding-inline: var(--cf-space-2); }
.cf-notice-actions .cf-btn:hover:not(:disabled), .cf-notice-dismissal .cf-icon-btn:hover:not(:disabled) {
  color: var(--cf-white); background: var(--notice-ink);
}
.cf-notice-actions .cf-btn:active:not(:disabled), .cf-notice-dismissal .cf-icon-btn:active:not(:disabled) {
  color: var(--cf-white); background: var(--cf-black);
}
.cf-notice-actions .cf-btn:focus-visible, .cf-notice-dismissal .cf-icon-btn:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
  box-shadow: none;
}
.cf-notice-actions .cf-btn:disabled, .cf-notice-dismissal .cf-icon-btn:disabled {
  color: var(--neutral-600); background: var(--neutral-100); border-color: var(--neutral-600);
  cursor: not-allowed; opacity: 1;
}
.cf-notice-dismissal { flex: 0 0 auto; margin-inline-start: auto; }
@container (max-width: 16rem) {
  .cf-notice-body { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .cf-notice-actions .cf-btn, .cf-notice-dismissal .cf-icon-btn {
    min-height: var(--cf-control-target-coarse); min-width: var(--cf-control-target-coarse);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cf-notice .cf-spinner { animation: none; }
  .cf-notice .cf-btn, .cf-notice .cf-icon-btn { transition: none; }
}

/* Card with icon tile — matches preview/cards.html */
.cf-card,
.cf-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
  box-shadow: var(--shadow-xs);
}
:where(.cf-surface) {
  box-sizing: border-box;
  border-color: var(--neutral-200);
  background: var(--cf-white);
}
.cf-surface-quiet {
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
  box-shadow: none;
}
.cf-control {
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.cf-control:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.cf-panel.overflow-x-auto {
  overflow-x: auto;
}
.cf-panel.cf-panel-tooltip {
  overflow: visible;
}

/* Small, named chart-role layer for evidence-led Analytics visuals. */
.cf-chart-bar-primary,
.cf-chart-swatch-primary { background: var(--cf-chart-primary); }
.cf-chart-bar-comparison,
.cf-chart-swatch-comparison { background: var(--cf-chart-comparison); }
.cf-chart-outcome-positive { color: var(--cf-chart-positive); }
.cf-chart-outcome-negative { color: var(--cf-chart-negative); }
.cf-chart-outcome-neutral { color: var(--neutral-700); }

.analytics-revenue-bar-group {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-sm);
  outline: none;
}
.analytics-revenue-bar-group:focus-visible {
  box-shadow: var(--shadow-focus);
}
.analytics-evidence-tooltip {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 2.1rem;
  box-sizing: border-box;
  width: 250px;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--cf-white);
  box-shadow: var(--shadow-md);
  color: var(--cf-black);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.analytics-revenue-bar-group:hover .analytics-evidence-tooltip,
.analytics-revenue-bar-group:focus .analytics-evidence-tooltip,
.analytics-revenue-bar-group:focus-within .analytics-evidence-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}
.analytics-evidence-tooltip-title {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.analytics-evidence-tooltip-values {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.6875rem;
}
.analytics-evidence-tooltip-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.analytics-evidence-tooltip-values dt { color: var(--neutral-600); }
.analytics-evidence-tooltip-values dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.analytics-evidence-tooltip-source {
  margin: 0.5rem 0 0;
  overflow-wrap: anywhere;
  color: var(--neutral-600);
  font-size: 0.625rem;
  line-height: 1.35;
}
.analytics-evidence-tooltip-source + .analytics-evidence-tooltip-source { margin-top: 0.15rem; }

@media (max-width: 639px) {
  .analytics-revenue-chart { min-width: 0; }
  .analytics-revenue-bar-group:nth-child(-n+2) .analytics-evidence-tooltip {
    left: 0;
    transform: translate(0, 4px);
  }
  .analytics-revenue-bar-group:nth-last-child(-n+2) .analytics-evidence-tooltip {
    right: 0;
    left: auto;
    transform: translate(0, 4px);
  }
  .analytics-revenue-bar-group:nth-child(-n+2):hover .analytics-evidence-tooltip,
  .analytics-revenue-bar-group:nth-child(-n+2):focus .analytics-evidence-tooltip,
  .analytics-revenue-bar-group:nth-child(-n+2):focus-within .analytics-evidence-tooltip,
  .analytics-revenue-bar-group:nth-last-child(-n+2):hover .analytics-evidence-tooltip,
  .analytics-revenue-bar-group:nth-last-child(-n+2):focus .analytics-evidence-tooltip,
  .analytics-revenue-bar-group:nth-last-child(-n+2):focus-within .analytics-evidence-tooltip {
    transform: translate(0, 0);
  }
}
.cf-card { border-radius: var(--radius-xl); }
.cf-card-compact { border-radius: var(--radius-lg); }
.cf-card-hover {
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.cf-card-hover:hover {
  border-color: rgba(0,122,255,0.28);
  box-shadow: var(--shadow-sm);
}
.cf-tool-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.cf-tool-card:hover {
  border-color: rgba(0,122,255,0.28);
  box-shadow: var(--shadow-sm);
}
.cf-card .cf-card-body,
.cf-panel-body { padding: var(--cf-panel-inset); }
.cf-card-compact .cf-card-body,
.cf-panel-compact .cf-panel-body { padding: 14px 16px; }
.cf-card .cf-card-footer,
.cf-panel-footer {
  border-top: 1px solid var(--neutral-100);
  padding: 10px 20px;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--neutral-600);
}
.cf-quick-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cf-quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--neutral-600);
  font-size: 14px;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.cf-quick-link:hover {
  background: var(--neutral-50);
  color: var(--cf-black);
}
.cf-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}
.cf-panel-title,
.cf-section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 700;
  color: var(--cf-black);
  margin: 0;
}
.cf-panel-subtitle {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--neutral-600);
}
.cf-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.cf-kpi {
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
  background: var(--cf-white);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.cf-kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neutral-600);
}
.cf-kpi-value {
  margin-top: 6px;
  font-family: var(--font-heading);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  color: var(--cf-black);
}
.cf-kpi-note {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--neutral-600);
}
.cf-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.cf-icon-tile-inline { margin-bottom: 0; }
.cf-icon-tile-xs { width: 28px; height: 28px; border-radius: var(--radius-sm); }
.cf-icon-tile-sm { width: 32px; height: 32px; border-radius: var(--radius-md); }
.cf-icon-tile-md { width: 40px; height: 40px; }
.cf-icon-tile-lg { width: 48px; height: 48px; border-radius: var(--radius-lg); }
.cf-icon-tile > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.cf-icon-tile-xs > svg { width: 12px; height: 12px; }
.cf-icon-tile-lg > svg { width: 20px; height: 20px; }
.cf-icon-tile-blue,
.cf-icon-tile-info { background: var(--cf-blue-tint); color: var(--cf-blue); }
.cf-icon-tile-lime { background: var(--cf-lime-tint); color: var(--cf-black); }
.cf-icon-tile-lilac { background: var(--cf-lilac); color: var(--cf-black); }
.cf-icon-tile-dark { background: var(--cf-black); color: var(--cf-lime); }
.cf-icon-tile-success { background: var(--success-50); color: var(--success-700); }
.cf-icon-tile-warning { background: var(--warning-50); color: var(--warning-700); }
.cf-icon-tile-danger { background: var(--danger-50); color: var(--danger-700); }
.cf-icon-tile-neutral { background: var(--neutral-100); color: var(--neutral-600); }

/* ==========================================================================
   Sidebar chrome — matches CF HQ UI kit (ui_kits/cf_hq/_chrome.css).
   Black rail with blue-filled active state + lime indicator bar on the
   left. Scoped to #app-sidebar so other "active = blue-tint" patterns in
   the product (tabs, filter chips) keep their current behaviour.
   ========================================================================== */

/* Rail background */
#app-sidebar {
  background-color: var(--cf-black) !important;
  border-right: 1px solid #000 !important;
}

/* Section eyebrows (MSG / MKT / STORE / SYS): mono, darker gray so they
   don't compete with icons; brand-spec monospace + wide tracking. */
#app-sidebar > div > span[class*="text-gray-300"] {
  color: #6e6e6e !important;
  border-top-color: #2f2f2f !important;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
}

#app-sidebar .sidebar-group-label {
  color: #b8b8b8 !important;
}

.cf-subtab-bar .cf-horizontal-scroll {
  scrollbar-width: thin;
  padding-bottom: 0.2rem;
  background:
    linear-gradient(90deg, transparent, white 1rem) left center / 1rem 100% no-repeat,
    linear-gradient(270deg, rgba(255,255,255,0), white 1rem) right center / 1rem 100% no-repeat;
}

/* Default nav-icon color (when not active). Text-gray-400 in markup
   reads as mid-gray against the rail. */
#app-sidebar .sidebar-tip {
  color: #8a8a8a !important;
}
#app-sidebar:not(:hover):not(.sidebar-expanded) .sidebar-tip {
  justify-content: center;
  gap: 0;
  padding-left: 7px !important;
  padding-right: 7px !important;
}
#app-sidebar:not(:hover):not(.sidebar-expanded) .sidebar-tip > span[class*="absolute"][class*="rounded-full"] {
  top: 5px !important;
  right: 5px !important;
  transform: none !important;
}
#app-sidebar:hover .sidebar-tip,
#app-sidebar.sidebar-expanded .sidebar-tip {
  justify-content: flex-start;
  padding-left: 12px !important;
  padding-right: 42px !important;
  height: 40px !important;
}

/* Hover: lift to #2b2b2b + white, matches kit */
#app-sidebar .sidebar-tip:hover {
  background-color: #2b2b2b !important;
  color: #fff !important;
}

/* Active state: blue fill + white icon + lime indicator bar */
#app-sidebar a.bg-cf-blue\/10.text-cf-blue,
#app-sidebar a.text-cf-blue.bg-cf-blue\/10 {
  background-color: var(--interaction-action-fill) !important;
  color: #fff !important;
  position: relative;
  box-shadow: 0 10px 22px rgba(0, 122, 255, 0.22);
}
#app-sidebar a.bg-cf-blue\/10.text-cf-blue svg,
#app-sidebar a.text-cf-blue.bg-cf-blue\/10 svg {
  color: #fff;
}
#app-sidebar a.bg-cf-blue\/10.text-cf-blue::before,
#app-sidebar a.text-cf-blue.bg-cf-blue\/10::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--cf-lime);
  border-radius: 0 3px 3px 0;
}

#app-sidebar:hover .sidebar-tip > span[class*="absolute"][class*="rounded-full"],
#app-sidebar.sidebar-expanded .sidebar-tip > span[class*="absolute"][class*="rounded-full"] {
  right: 12px !important;
}

/* Notification badges on the rail: slim the chunky 18px circle to a refined
   pill so the count doesn't dominate the icon. Lime stays for daily-pop on
   the dark rail; ring is dropped (the dark rail provides its own separation). */
#app-sidebar .bg-cf-lime.text-cf-black,
#app-sidebar .bg-cf-lime {
  border: 0;
  font-size: var(--fs-eyebrow) !important;
  height: 18px !important;
  min-width: 18px !important;
  width: auto !important;
  padding: 0 4.5px !important;
  letter-spacing: 0;
}
/* When inside the blue active pill, give the badge a thin white ring so
   the lime separates cleanly from the underlying blue fill. */
#app-sidebar a.bg-cf-blue\/10.text-cf-blue .bg-cf-lime,
#app-sidebar a.text-cf-blue.bg-cf-blue\/10 .bg-cf-lime {
  box-shadow: 0 0 0 1.5px var(--cf-blue);
}
/* Same treatment for blue/red/purple badges */
#app-sidebar .bg-cf-blue.text-white,
#app-sidebar .bg-red-500,
#app-sidebar .bg-purple-500 {
  font-size: var(--fs-eyebrow) !important;
  height: 18px !important;
  min-width: 18px !important;
  width: auto !important;
  padding: 0 4.5px !important;
}

#app-sidebar .sidebar-label {
  color: #d1d5db;
  font-weight: 500;
}
#app-sidebar a.bg-cf-blue\/10.text-cf-blue .sidebar-label,
#app-sidebar a.text-cf-blue.bg-cf-blue\/10 .sidebar-label {
  color: #fff;
}

/* ==========================================================================
   Motion — brand spec: fast and subtle, no bouncy springs.
   ========================================================================== */
@keyframes cf-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cf-fade-in { animation: cf-fade-in var(--dur-slow) var(--ease-out); }

@keyframes cf-pulse    { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes cf-shimmer  { 0% { transform: translateX(-16px); } 100% { transform: translateX(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .animate-spin,
  .animate-pulse,
  .cf-fade-in {
    animation: none !important;
  }
}

/* ==========================================================================
   UI Kit — Outbound Dashboard vocabulary (from ui_kits/cf_hq/index.html).
   Reusable component classes pulled out of the design so any page can adopt
   brand-correct stats, pills, tabs, chips, tables, queue cards, etc. Prefer
   these over ad-hoc Tailwind when building a surface matching the kit.
   ========================================================================== */

/* Public operational page-label role. Static context, never an action/status.
   Explicit adoption only; legacy kit/table/metric labels retain their styling. */
.cf-page-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cf-blue-600);
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

/* Legacy blue monospace kit label. Not the operational page-label role. */
.cf-kit-label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cf-blue);
  margin-bottom: 4px;
}

.cf-btn-cancel {
  background: transparent;
  color: var(--neutral-600);
  border: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.cf-btn-cancel:hover { background: var(--neutral-100); color: var(--cf-black); }

.cf-btn-toolbar {
  background: var(--interaction-action-fill);
  color: var(--interaction-action-foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.cf-btn-toolbar:hover { background: var(--interaction-action-fill-hover); color: var(--interaction-action-foreground); }
.cf-btn-toolbar:active { background: var(--interaction-action-fill-active); color: var(--interaction-action-foreground); }
.cf-btn-toolbar kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  background: rgba(255,255,255,.18);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  color: inherit;
}

.cf-btn-danger {
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1.5px solid #fecaca;
}
.cf-btn-danger:hover {
  background: #fee2e2;
  color: var(--danger-700);
}
.cf-btn.cf-btn-sm,
.cf-btn-cancel.cf-btn-sm,
.cf-btn-toolbar.cf-btn-sm {
  font-size: 13px;
  padding: 7px 14px;
}

@media (pointer: coarse) {
  .cf-btn,
  .cf-btn-sm,
  .cf-btn-cancel,
  .cf-btn-toolbar,
  .cf-input,
  .cf-workspace-chip,
  .cf-menu-item,
  #help-fab,
  .cf-topbar-left > a,
  .cf-topbar [data-cf-menu-trigger],
  .cf-topbar [data-mobile-nav-toggle],
  .info-btn,
  .mobile-nav-link,
  .cf-segmented-option,
  .cf-step {
    min-width: 44px;
    min-height: 44px;
  }
  .cf-segmented-option,
  .cf-step {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .filter-card-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Stat cards · new colour variants + supporting pieces ─────────────── */
.cf-stat.cf-stat-blue {
  background: var(--stat-inverse-surface);
  border-color: transparent;
  color: var(--stat-inverse-foreground);
}
.cf-stat.cf-stat-blue dt,
.cf-stat.cf-stat-blue dd,
.cf-stat.cf-stat-blue .cf-stat-caption { color: var(--stat-inverse-foreground); }
.cf-stat.cf-stat-blue .cf-stat-delta { color: var(--stat-inverse-positive); }
.cf-stat.cf-stat-blue .cf-stat-delta.down { color: var(--stat-inverse-negative); }

.cf-stat.cf-stat-lilac { background: var(--cf-lilac); border-color: transparent; }
.cf-stat.cf-stat-lilac dt  { color: #6e3b82; }
.cf-stat.cf-stat-lilac dd  { color: var(--cf-black); }

.cf-stat.cf-stat-lime  dt  { color: var(--cf-black); opacity: .72; }
.cf-stat.cf-stat-lime  dd  { color: var(--cf-black); }

.cf-stat.cf-stat-outline {
  background: transparent;
  border: 1.5px solid var(--cf-black);
}

.cf-stat dd .cf-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-600);
  margin-left: 3px;
}
.cf-stat.cf-stat-blue dd .cf-unit { color: var(--stat-inverse-foreground); }
.cf-stat.cf-stat-dark dd .cf-unit { color: var(--neutral-400); }

.cf-stat-delta {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  color: var(--success-700);
  letter-spacing: 0;
  text-transform: none;
}
.cf-stat-delta.down { color: var(--danger-700); }

.cf-stat .cf-spark {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  pointer-events: none;
  opacity: .65;
}
.cf-stat.cf-stat-blue .cf-spark path { stroke: rgba(255,255,255,.55) !important; }

/* ── Pills · new variants from the kit ─────────────────────────────── */
.cf-pill-info-inv   { background: var(--interaction-action-fill); color: var(--interaction-inverse-foreground); }
.cf-pill-lime-inv   { background: var(--cf-lime);      color: var(--cf-black); }
.cf-pill-active     { background: var(--success-50);   color: var(--success-700); }
.cf-pill-idle       { background: var(--neutral-100);  color: var(--neutral-600); }
.cf-pill .cf-dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success-500);
  animation: cf-pulse 1.4s infinite;
}
.cf-pill .cf-dot-blue {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cf-blue);
  animation: cf-pulse 1.4s infinite;
}
.cf-pill .cf-dot-white {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
}

/* ── Tabs · underlined with count chip (kit-header tab row) ────────── */
.cf-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 16px;
}
.cf-tab {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-600);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  font-family: var(--font-sans);
  transition: color var(--dur-fast) var(--ease-out);
}
.cf-tab:hover { color: var(--cf-black); }
.cf-tab.is-active { color: var(--interaction-action-fill); border-bottom-color: var(--interaction-selected-indicator); }
.cf-tab .cf-tab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-supporting-foreground);
  background: var(--neutral-100);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.cf-tab.is-active .cf-tab-num {
  background: var(--interaction-selected-surface);
  color: var(--interaction-action-fill);
}
.cf-tabset {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cf-tabset .cf-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}
.cf-tabset .cf-tab[aria-selected="true"] {
  color: var(--interaction-action-fill);
  border-bottom-color: var(--interaction-selected-indicator);
}
.cf-tabset .cf-tab[aria-selected="true"] .cf-tab-num {
  background: var(--interaction-selected-surface);
  color: var(--interaction-action-fill);
}
.cf-tabset .cf-tab:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--neutral-100);
}
.cf-tabset .cf-tab:disabled,
.cf-tabset .cf-tab[aria-disabled="true"] {
  color: var(--interaction-disabled-foreground);
  cursor: not-allowed;
  background: var(--interaction-disabled-surface);
}
.cf-tabset .cf-tab:disabled .cf-tab-num,
.cf-tabset .cf-tab[aria-disabled="true"] .cf-tab-num {
  color: var(--interaction-disabled-foreground);
  border: 1px solid var(--interaction-disabled-border);
  background: var(--interaction-disabled-surface);
}
.cf-tab-panel[hidden] { display: none; }

@media (pointer: coarse) {
  .cf-tabset .cf-tab { min-height: 44px; }
}

@media (forced-colors: active) {
  .cf-tabset .cf-tab[aria-selected="true"] { border-bottom: 3px solid Highlight; }
  .cf-tabset .cf-tab:disabled,
  .cf-tabset .cf-tab[aria-disabled="true"] { color: GrayText; }
  .cf-tabset .cf-tab-num { border: 1px solid CanvasText; }
}

/* ── Topbar · sticky app-wide chrome ─────────────────────────────────
   56px sticky white band that sits above content and carries the
   workspace chip + breadcrumb trail on the left and the user menu on
   the right. Pair with .cf-subtab-bar for the 40px secondary strip.
   ────────────────────────────────────────────────────────────────── */
.cf-topbar {
  position: sticky;
  top: 0;
  z-index: var(--layer-chrome);
  height: 56px;
  background: var(--cf-white);
  border-bottom: 1px solid var(--neutral-200);
}
.cf-topbar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 34rem) minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
}
.cf-topbar-layout .cf-topbar-left {
  min-width: 0;
  max-width: 100%;
}
.cf-topbar-layout .cf-global-search {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  transform: none;
}
.cf-topbar-layout .cf-topbar-right {
  min-width: 0;
  justify-self: end;
}
.cf-subtab-bar {
  position: sticky;
  top: 56px;
  z-index: calc(var(--layer-chrome) - 20);
  min-height: 40px;
  height: auto;
  background: var(--cf-white);
  border-bottom: 1px solid var(--neutral-200);
}
.cf-subtab-bar[data-nav-levels="2"] {
  min-height: 82px;
}
.cf-subtab-bar .cf-horizontal-scroll {
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}
.cf-subtab-bar .cf-horizontal-scroll::-webkit-scrollbar {
  display: none;
}
.cf-subtab-bar .cf-top-tab {
  scroll-snap-align: start;
}
@media (min-width: 640px) and (max-width: 1360px) {
  .cf-topbar-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem) minmax(0, 1fr);
    column-gap: 12px;
  }
  .cf-topbar-layout .cf-workspace-chip {
    max-width: 238px;
  }
  .cf-topbar-layout .cf-workspace-chip-label,
  .cf-topbar-layout .cf-workspace-chip-action {
    display: none;
  }
  .cf-topbar-layout .cf-workspace-chip-name {
    max-width: 108px;
  }
  .cf-subtab-bar .cf-page-chrome {
    padding-left: 14px;
    padding-right: 14px;
  }
  .cf-subtab-bar .cf-top-tab {
    padding-left: 9px !important;
    padding-right: 9px !important;
    font-size: 12px !important;
  }
}
@media (min-width: 640px) and (max-width: 1040px) {
  .cf-topbar-layout {
    grid-template-columns: minmax(0, 9rem) minmax(13rem, 1fr) auto;
    column-gap: 8px;
  }
  .cf-topbar-layout .cf-workspace-chip {
    max-width: 144px;
  }
  .cf-topbar-layout .cf-workspace-chip-meta,
  .cf-topbar-layout .cf-account-menu-name,
  .cf-topbar-layout .cf-account-menu-caret {
    display: none;
  }
  .cf-topbar-layout .cf-workspace-chip-name {
    max-width: 82px;
  }
  .cf-subtab-bar .cf-top-tab {
    padding-left: 7px !important;
    padding-right: 7px !important;
    font-size: 11px !important;
  }
}
@media (max-width: 639px) {
  .cf-topbar-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
  }
  .cf-topbar-layout .cf-topbar-left {
    flex: 1 1 auto;
  }
  .cf-topbar-layout .cf-global-search {
    position: static;
    width: 44px;
    flex: 0 0 44px;
    transform: none;
  }
}
.cf-analytics-mobile-nav {
  position: sticky;
  top: 56px;
  z-index: 58;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--neutral-200);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}
.cf-analytics-mobile-nav-inner {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.cf-analytics-mobile-current {
  display: grid;
  gap: 0;
  min-width: 0;
}
.cf-analytics-mobile-current-eyebrow {
  color: var(--neutral-500);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.cf-analytics-mobile-current-title {
  color: var(--neutral-900);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-analytics-mobile-current-page {
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-analytics-mobile-controls {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cf-analytics-mobile-select {
  appearance: auto;
  background: var(--cf-white);
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  color: var(--neutral-900);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}
.cf-analytics-mobile-select:focus {
  border-color: var(--cf-blue);
  box-shadow: 0 0 0 3px var(--cf-blue-tint);
  outline: none;
}
.cf-global-stop-banner {
  position: sticky;
  top: 56px;
  z-index: 55;
}
@media (max-width: 639px) {
  .cf-global-stop-banner[data-analytics-mobile-nav="1"] {
    top: 148px;
  }
}
@media (max-width: 360px) {
  .cf-analytics-mobile-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .cf-global-stop-banner[data-analytics-mobile-nav="1"] {
    top: 188px;
  }
}
@media (min-width: 640px) {
  .cf-global-stop-banner[data-nav-levels="1"] {
    top: 96px;
  }
  .cf-global-stop-banner[data-nav-levels="2"] {
    top: 138px;
  }
}

.cf-brand-dropdown {
  z-index: 90;
  width: min(340px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 74px));
  overflow-y: auto;
  overscroll-behavior: contain;
}


/* At narrow zoomed widths, reflow the existing controls without shrinking
   their targets. Chrome scrolls with the page so stacked controls do not
   consume the remaining reading area. Names, order and actions stay intact. */
@media (max-width: 319px) {
  :root { --cf-mobile-nav-clearance: 10rem; }
  #help-fab { bottom: calc(var(--cf-mobile-nav-clearance) + env(safe-area-inset-bottom, 0px)); }
  body:has(.cf-topbar [aria-expanded="true"]) #help-fab { visibility: hidden; }
  .cf-topbar { height: auto; position: relative; }
  .cf-topbar-layout { flex-wrap: wrap; padding-block: 4px; }
  .cf-topbar-layout .cf-topbar-left { flex-basis: 100%; flex-wrap: wrap; }
  .cf-topbar-left #brand-switcher { flex-basis: 100%; }
  .cf-topbar .cf-menu { min-width: 0; max-width: calc(100vw - 28px); }
  .cf-subtab-bar,
  .cf-analytics-mobile-nav,
  .cf-global-stop-banner { position: static; }
  #mobile-bottom-nav > div { flex-wrap: wrap; }
  #mobile-bottom-nav .mobile-bottom-link { flex: 1 1 30%; min-width: 44px; min-height: 44px; padding-inline: 0; }
  #mobile-bottom-nav .mobile-bottom-link > span:last-child {
    max-width: 100%; white-space: normal; overflow-wrap: anywhere;
    text-align: center; line-height: 1.3;
  }
}

.su-ops-mode-nav {
  position: sticky;
  top: 96px;
  z-index: 20;
}

@media (max-width: 640px) {
  .su-ops-mode-nav {
    top: 56px;
  }
}

/* ── Workspace chip · prominent brand switcher ──────────────────────
   Leads the topbar breadcrumb. Bordered blue-tint control with the active
   brand identity and an explicit switch affordance when multiple brands
   are available.
   ────────────────────────────────────────────────────────────────── */
.cf-workspace-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  max-width: min(376px, 50vw);
  padding: 5px 8px 5px 6px;
  border-radius: 12px;
  background: #f0f7ff;
  color: var(--neutral-900);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  cursor: pointer;
  border: 1px solid #8fc7ff;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.12), 0 0 0 3px rgba(0, 122, 255, 0.08);
}
.cf-workspace-chip:hover {
  background: #e4f2ff;
  border-color: var(--cf-blue);
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.18), 0 0 0 3px rgba(0, 122, 255, 0.14);
}
.cf-workspace-chip-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--cf-white);
  border: 1px solid rgba(0, 122, 255, 0.18);
  padding: 2px;
  flex-shrink: 0;
}
.cf-workspace-chip-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--cf-blue);
  color: var(--cf-white);
  font-size: 12px;
  font-weight: 700;
}
.cf-workspace-chip-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}
.cf-workspace-chip-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.cf-workspace-chip-label {
  color: var(--cf-blue-600);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}
.cf-workspace-chip-name {
  overflow: hidden;
  max-width: 154px;
  color: var(--neutral-900);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
}
.cf-workspace-chip-action {
  border-radius: var(--radius-pill);
  background: var(--interaction-action-fill);
  color: var(--interaction-inverse-foreground);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  flex-shrink: 0;
}
.cf-workspace-chip-caret {
  width: 12px;
  height: 12px;
  color: var(--cf-blue);
  flex-shrink: 0;
}
@media (max-width: 639px) {
  .cf-workspace-chip {
    gap: 7px;
    min-height: 44px;
    max-width: 138px;
    padding: 4px 7px 4px 5px;
    border-radius: 10px;
  }
  .cf-workspace-chip-logo {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }
  .cf-workspace-chip-label,
  .cf-workspace-chip-action,
  .cf-workspace-chip .cf-workspace-pod-pill {
    display: none;
  }
  .cf-workspace-chip-name {
    max-width: 72px;
    font-size: 12px;
  }
  .cf-workspace-chip-caret {
    width: 10px;
    height: 10px;
  }
}

/* ── Breadcrumb trail · Workspace › Section › Page ───────────────── */
.cf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  min-width: 0;
}
.cf-breadcrumb-sep {
  width: 14px;
  height: 14px;
  color: var(--neutral-400);
  flex-shrink: 0;
}
.cf-breadcrumb-link {
  color: var(--neutral-600);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.cf-breadcrumb-link:hover { color: var(--interaction-action-fill); }
.cf-breadcrumb-current {
  color: var(--cf-black);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Filter chips · toolbar row ─────────────────────────────────────── */
.cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--neutral-200);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--neutral-600);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.cf-chip:hover { border-color: var(--neutral-400); color: var(--cf-black); }
.cf-chip.is-on {
  border-color: var(--cf-blue);
  color: var(--cf-blue-600);
  background: var(--cf-blue-tint);
}
.cf-chip .cf-chip-x { opacity: .6; font-size: 11px; }

/* Pressed filter buttons opt into the completed contract. Legacy chip links
   and message choices retain their existing presentation until migrated. */
.cf-chip[aria-pressed] {
  min-height: 32px;
  justify-content: center;
  border-color: var(--field-boundary-idle);
  color: var(--interaction-selected-foreground);
  background: var(--cf-white);
}
.cf-chip[aria-pressed].cf-control-standard { min-height: var(--cf-control-height-desktop); }
.cf-chip[aria-pressed]:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--field-boundary-hover);
  background: var(--neutral-100);
}
.cf-chip[aria-pressed]:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--neutral-200);
}
.cf-chip[aria-pressed="true"] {
  border-color: var(--interaction-selected-border);
  background: var(--interaction-selected-surface);
  color: var(--interaction-selected-foreground);
}
.cf-chip[aria-pressed="true"]:hover:not(:disabled):not([aria-disabled="true"]),
.cf-chip[aria-pressed="true"]:active:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--interaction-selected-border);
  box-shadow: inset 0 0 0 1px var(--interaction-selected-border);
}
/* Explicit score choices carry assessment meaning. Neutral filters do not.
   Only selected values override the shared selection roles; disabled and focus
   continue to use their independent component contracts. */
.cf-chip[data-score-tone="success"][aria-pressed="true"] {
  --interaction-selected-surface: var(--success-50);
  --interaction-selected-border: var(--success-700);
  --interaction-selected-foreground: var(--success-700);
  --interaction-selected-indicator: var(--success-700);
}
.cf-chip[data-score-tone="danger"][aria-pressed="true"] {
  --interaction-selected-surface: var(--danger-50);
  --interaction-selected-border: var(--danger-700);
  --interaction-selected-foreground: var(--danger-700);
  --interaction-selected-indicator: var(--danger-700);
}
.cf-chip[data-score-tone="neutral"][aria-pressed="true"] {
  --interaction-selected-surface: var(--neutral-100);
  --interaction-selected-border: var(--neutral-600);
  --interaction-selected-foreground: var(--neutral-700);
  --interaction-selected-indicator: var(--neutral-700);
}
.cf-chip[data-score-tone][aria-pressed="true"]:is(:hover, :active):not(:disabled):not([aria-disabled="true"]) {
  background: var(--interaction-selected-surface);
}
.cf-chip-check { flex: 0 0 14px; visibility: hidden; }
.cf-chip[aria-pressed="true"] .cf-chip-check {
  visibility: visible;
  color: var(--interaction-selected-indicator);
}
/* Filter chips that navigate (server-filtered GET links) share the pressed
   contract; aria-current marks the active filter instead of aria-pressed. */
a.cf-chip[data-chip-link] {
  min-height: 32px;
  justify-content: center;
  border-color: var(--field-boundary-idle);
  color: var(--interaction-selected-foreground);
  background: var(--cf-white);
  text-decoration: none;
}
a.cf-chip[data-chip-link]:hover { border-color: var(--field-boundary-hover); background: var(--neutral-100); }
a.cf-chip[data-chip-link][aria-current] {
  border-color: var(--interaction-selected-border);
  background: var(--interaction-selected-surface);
  color: var(--interaction-selected-foreground);
}
a.cf-chip[data-chip-link][aria-current] .cf-chip-check {
  visibility: visible;
  color: var(--interaction-selected-indicator);
}
a.cf-chip[data-chip-link]:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
}
.cf-chip[aria-pressed]:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
}
.cf-chip[aria-pressed]:disabled,
.cf-chip[aria-pressed][aria-disabled="true"] {
  border-color: var(--interaction-disabled-border);
  background: var(--interaction-disabled-surface);
  color: var(--interaction-disabled-foreground);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}
.cf-chip[aria-pressed]:disabled .cf-chip-check,
.cf-chip[aria-pressed][aria-disabled="true"] .cf-chip-check { color: inherit; }
.cf-chip[aria-busy="true"] { cursor: progress; }
@media (pointer: coarse) {
  .cf-chip[aria-pressed],
  .cf-chip[aria-pressed].cf-control-standard { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-chip[aria-pressed] { transition: none; }
}
@media (forced-colors: active) {
  .cf-chip[aria-pressed] { border-color: ButtonText; }
  .cf-chip[aria-pressed="true"] { border-color: Highlight; }
  .cf-chip[aria-pressed="true"] .cf-chip-check { color: ButtonText; }
  .cf-chip[aria-pressed]:focus-visible { outline-color: Highlight; }
  .cf-chip[aria-pressed]:disabled,
  .cf-chip[aria-pressed][aria-disabled="true"] { color: GrayText; border-color: GrayText; }
}

/* ── Retailer avatar · table cells + queue card rows ────────────────── */
.cf-ret-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--cf-blue-tint);
  color: var(--cf-blue-600);
}
.cf-ret-avatar.cf-ret-avatar-lime  { background: var(--cf-lime-tint); color: var(--cf-black); }
.cf-ret-avatar.cf-ret-avatar-lilac { background: var(--cf-lilac);     color: #6e3b82; }

/* ── Progress bar + label ───────────────────────────────────────────── */
.cf-progress {
  width: 100%;
  height: 4px;
  background: var(--neutral-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.cf-progress .cf-progress-bar {
  height: 100%;
  background: var(--cf-blue);
  border-radius: var(--radius-pill);
}
.cf-progress .cf-progress-bar.lime { background: var(--cf-lime-dark); }
.cf-progress .cf-progress-bar.dark { background: var(--cf-black); }
.cf-native-progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--neutral-100);
}
.cf-native-progress::-webkit-progress-bar {
  background: var(--neutral-100);
  border-radius: var(--radius-pill);
}
.cf-native-progress::-webkit-progress-value {
  background: var(--cf-blue);
  border-radius: var(--radius-pill);
}
.cf-native-progress::-moz-progress-bar {
  background: var(--cf-blue);
  border-radius: var(--radius-pill);
}

/* ── Run strip · live progress bar with shimmer ─────────────────────── */
.cf-run-strip {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.cf-run-strip .cf-run-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neutral-600);
}
.cf-run-strip .cf-run-id strong { color: var(--cf-black); font-weight: 600; }
.cf-run-strip .cf-run-bar {
  flex: 1;
  height: 6px;
  background: var(--neutral-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.cf-run-strip .cf-run-bar-fill {
  height: 100%;
  background: var(--cf-blue);
  border-radius: var(--radius-pill);
  position: relative;
}
.cf-run-strip .cf-run-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 16px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: cf-shimmer 1.2s infinite;
}
.cf-run-strip .cf-run-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-blue-600);
  min-width: 42px;
  text-align: right;
}

/* ── Queue approval card · right-rail (kit queue panel) ─────────────── */
.cf-qcard {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 13px 16px;
  background: #fff;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
  position: relative;
}
.cf-qcard:hover { background: var(--neutral-50); }
.cf-qcard.is-current {
  background: var(--cf-blue-tint);
  border-color: var(--cf-blue-tint);
}
.cf-qcard.is-current::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cf-blue);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.cf-qcard .cf-qcard-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 6px;
}
.cf-qcard .cf-qcard-name {
  font-size: 13px; font-weight: 600;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-qcard .cf-qcard-seg {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  color: var(--cf-blue-600);
}
.cf-qcard .cf-qcard-msg {
  font-size: 12px;
  color: var(--neutral-600);
  line-height: 1.5;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cf-qcard .cf-qcard-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--neutral-600);
  margin-top: 7px;
  display: flex;
  gap: 10px;
}

/* ── Table · lightweight wrapper for monospace-header data tables ────── */
.cf-table-wrap {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cf-table th {
  text-align: left;
  font-weight: 600;
  padding: 10px 14px;
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutral-600);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Shared sortable table headers. JS progressively enhances data columns only. */
.cf-table-sort-button {
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  width: 100%;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  border-radius: 0.375rem;
}
.text-right > .cf-table-sort-button,
.cf-table-number > .cf-table-sort-button,
.cf-num > .cf-table-sort-button { justify-content: flex-end; }
.cf-table-sort-button:hover { color: var(--interaction-action-fill); }
.cf-table-sort-button:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
}
.cf-table-sort-indicator {
  display: inline-flex;
  width: 0.9rem;
  flex: 0 0 0.9rem;
  justify-content: center;
  color: var(--neutral-300);
  font-size: 0.85rem;
}
th[aria-sort="ascending"] .cf-table-sort-indicator,
th[aria-sort="descending"] .cf-table-sort-indicator { color: var(--interaction-action-fill); }
th[aria-sort="ascending"] .cf-table-sort-button,
th[aria-sort="descending"] .cf-table-sort-button { color: var(--interaction-action-fill); }
.cf-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--neutral-100);
  color: var(--cf-black);
  vertical-align: middle;
}
.cf-table tr:last-child td { border-bottom: 0; }
.cf-table tr:hover td { background: var(--neutral-50); }
.cf-table tr.is-selected td { background: var(--interaction-selected-surface); }
.cf-table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--interaction-selected-indicator); }
.cf-table .cf-table-sticky-cell,
.cf-table-sticky-cell {
  position: sticky;
  right: 0;
  background: var(--cf-white);
  z-index: 1;
}
.cf-table tr:hover .cf-table-sticky-cell { background: var(--neutral-50); }
.cf-table thead .cf-table-sticky-cell { background: var(--neutral-50); z-index: 2; }
.cf-table .cf-table-sticky-left,
.cf-table-sticky-left {
  position: sticky;
  left: 0;
  background: var(--cf-white);
  z-index: 1;
}
.cf-table tr:hover .cf-table-sticky-left { background: var(--neutral-50); }
.cf-table thead .cf-table-sticky-left { background: var(--neutral-50); z-index: 2; }
/* Keep brand identity visible while comparing wide rankings. */
[data-fi-ranking-filter] table { border-collapse: separate; border-spacing: 0; }
[data-fi-ranking-filter] tr > :nth-child(-n+2) {
    position: sticky;
    z-index: 1;
    background: var(--cf-white);
}
[data-fi-ranking-filter] tr > :first-child {
    left: 0;
    width: 5.5rem;
    min-width: 5.5rem;
    max-width: 5.5rem;
    box-sizing: border-box;
}
[data-fi-ranking-filter] tr > :nth-child(2) {
    left: 5.5rem;
    width: 12rem;
    min-width: 12rem;
    max-width: 12rem;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 1px 0 0 var(--neutral-200);
}
[data-fi-ranking-filter] thead tr > :nth-child(-n+2) {
    z-index: 2;
    background: var(--neutral-50);
}
[data-fi-ranking-filter] tr[data-fi-current-brand-row] > :nth-child(-n+2) {
    background: #eff6ff;
}
[data-fi-ranking-filter] tbody tr:hover > :nth-child(-n+2) {
    background: var(--neutral-50);
}

.cf-table-panel {
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.cf-table-panel-scroll { overflow-x: auto; }

/* Unified bounded data-table shell. Data selection, ordering and LIMIT stay server-side. */
.cf-data-table-shell {
  min-width: 0;
  overflow: hidden;
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
}
.cf-data-table-shell.is-warning { border-color: var(--warning-500); }
.cf-data-table-shell.is-error { border-color: var(--danger-500); }
.cf-data-table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-100);
}
.cf-data-table-heading { min-width: 0; }
.cf-data-table-title {
  margin: 0;
  color: var(--neutral-900);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}
.cf-data-table-description { margin: 3px 0 0; color: var(--neutral-600); font-size: 12px; }
.cf-data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--neutral-100);
}
.cf-data-table-toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.cf-data-table-toolbar .cf-select { width: auto; min-width: 150px; }
.cf-data-table-toolbar .cf-input { width: auto; min-width: 240px; }
.cf-data-table-controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.cf-data-table-density {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 600;
}
.cf-data-table-density span { white-space: nowrap; }
.cf-data-table-scroller {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.cf-data-table-scroller .cf-table { min-width: 100%; }
.cf-data-table-scroller .cf-table-wide { min-width: 860px; }
.cf-data-table-shell[data-density="compact"] .cf-table th,
.cf-data-table-shell[data-density="compact"] .cf-table td,
.cf-table[data-density="compact"] th,
.cf-table[data-density="compact"] td {
  padding: var(--cf-row-padding-block-compact) var(--cf-row-padding-inline-compact);
}
.cf-data-table-shell[data-density="comfortable"] .cf-table th,
.cf-data-table-shell[data-density="comfortable"] .cf-table td,
.cf-table[data-density="comfortable"] th,
.cf-table[data-density="comfortable"] td {
  padding: var(--cf-row-padding-block-comfortable) var(--cf-row-padding-inline-comfortable);
}
.cf-data-table-shell .cf-table tbody tr:focus-within td {
  background: var(--interaction-selected-surface);
  box-shadow: inset 0 2px 0 var(--interaction-focus-outline), inset 0 -2px 0 var(--interaction-focus-outline);
}
.cf-data-table-shell .cf-table tbody tr[aria-selected="true"] td,
.cf-data-table-shell .cf-table tbody tr.is-selected td {
  background: var(--interaction-selected-surface);
  color: var(--interaction-selected-foreground);
  box-shadow: inset 0 1px 0 var(--interaction-selected-border), inset 0 -1px 0 var(--interaction-selected-border);
}
.cf-data-table-shell .cf-table tbody tr[aria-selected="true"] td:first-child,
.cf-data-table-shell .cf-table tbody tr.is-selected td:first-child {
  box-shadow: inset 4px 0 0 var(--interaction-selected-indicator), inset 0 1px 0 var(--interaction-selected-border), inset 0 -1px 0 var(--interaction-selected-border);
}
.cf-data-table-shell .cf-table tbody tr[aria-selected="true"] td:first-child::before,
.cf-data-table-shell .cf-table tbody tr.is-selected td:first-child::before {
  content: "\2713";
  display: inline-flex;
  margin-inline-end: 7px;
  color: var(--interaction-selected-indicator);
  font-weight: 800;
}
.cf-data-table-shell .cf-table tbody tr[aria-disabled="true"] td { opacity: .56; }
.cf-data-table-shell .cf-table-sort-form { display: inline; margin: 0; }
.cf-data-table-state {
  display: grid;
  min-height: 148px;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 20px;
  color: var(--neutral-600);
  text-align: center;
  font-size: 13px;
}
.cf-data-table-state strong { color: var(--neutral-900); }
.cf-data-table-shell.is-error .cf-data-table-state strong { color: var(--danger-700); }
.cf-data-table-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--cf-blue);
  border-radius: 999px;
  animation: cf-spin .75s linear infinite;
}
.cf-data-table-warning {
  padding: 8px 16px;
  color: var(--warning-700);
  background: var(--warning-50);
  border-bottom: 1px solid #fde68a;
  font-size: 12px;
}
.cf-data-table-shell.is-loading .cf-data-table-scroller,
.cf-data-table-shell.is-loading .cf-data-table-pagination { opacity: .5; pointer-events: none; }
.cf-data-table-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--cf-white) 94%, transparent);
  border-top: 1px solid var(--neutral-200);
  box-shadow: 0 -8px 18px color-mix(in srgb, var(--neutral-900) 8%, transparent);
}
.cf-data-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  border-top: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}
.cf-data-table-pagination .cf-pagination-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cf-data-table-pagination .cf-pagination-size { display: inline-flex; align-items: center; gap: 6px; }
.cf-data-table-pagination .cf-btn[disabled] { opacity: .45; }

/* Disabled controls must remain visibly inactive across every button variant. */
.cf-btn:disabled,
.cf-btn[aria-disabled="true"] {
  border-color: var(--interaction-disabled-border);
  background: var(--interaction-disabled-surface);
  color: var(--interaction-disabled-foreground);
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
  filter: none;
}
/* Paint nested button content from the disabled role explicitly: WebKit can
   retain the previous inherited currentColor after a native disabled change. */
.cf-btn:disabled > :is(svg, span, kbd),
.cf-btn[aria-disabled="true"] > :is(svg, span, kbd) {
  color: var(--interaction-disabled-foreground);
  -webkit-text-fill-color: currentColor;
}
@media (forced-colors: active) {
  .cf-btn:disabled,
  .cf-btn[aria-disabled="true"],
  .cf-btn:disabled > :is(svg, span, kbd),
  .cf-btn[aria-disabled="true"] > :is(svg, span, kbd) { color: GrayText; }
}
.cf-btn[aria-busy="true"] { cursor: progress; }

@media (max-width: 639px) {
  .cf-error-row-heading { flex-wrap: wrap; align-items: flex-start; }
  .cf-error-row-actions {
    order: 10;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (max-width: 639px), (pointer: coarse) {
  .cf-global-search-close { min-width: 44px; min-height: 44px; }
  #help-drawer .cf-icon-btn { min-width: 44px; min-height: 44px; }
}
.ai-spend-stat { min-width: 0; overflow: hidden; }
/* Summary values are neutral facts; only explicit evidence colours captions. */
.ai-spend-stat .ai-spend-caption { color: var(--text-supporting-foreground); }
.ai-spend-stat [data-metric-evidence="connected"] { color: var(--success-700); }
.ai-spend-stat [data-metric-evidence="connection-error"],
.ai-spend-stat [data-metric-evidence="failures"] { color: var(--danger-700); }

.ai-spend-stat dd { font-size: clamp(1.45rem, 2vw, 1.9rem); line-height: 1.05; overflow-wrap: anywhere; }
.ai-spend-stat dd.ai-spend-status-value { font-size: clamp(1.25rem, 1.8vw, 1.65rem); line-height: 1.08; }

@media (max-width: 767px) {
  .cf-data-table-header,
  .cf-data-table-pagination { align-items: stretch; flex-direction: column; }
  .cf-data-table-controls,
  .cf-data-table-pagination .cf-pagination-controls { justify-content: flex-start; }
  .cf-data-table-controls { width: 100%; }
  .cf-data-table-toolbar-end { margin-left: 0; width: 100%; }
  .cf-data-table-toolbar-end > * { flex: 1 1 140px; }
  .cf-data-table-pagination .cf-pagination-controls { flex-wrap: wrap; }
}

@media (forced-colors: active) {
  .cf-data-table-shell,
  .cf-data-table-header,
  .cf-data-table-pagination,
  .cf-data-table-sticky-actions { border-color: CanvasText; }
  .cf-data-table-shell .cf-table tbody tr:focus-within td,
  .cf-data-table-shell .cf-table tbody tr[aria-selected="true"] td,
  .cf-data-table-shell .cf-table tbody tr.is-selected td { outline: 2px solid Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-data-table-spinner { animation: none; border-top-color: var(--neutral-200); }
}

/* Bounded list and table pagination */
.cf-date-range { position: relative; }
.cf-date-range-trigger { white-space: nowrap; }
.cf-date-range-panel {
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 420px;
  z-index: 60;
}
.cf-date-range-panel[hidden] { display: none; }
.cf-date-range-presets {
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  min-width: 0;
  padding: 0;
}
.cf-date-range-presets legend,
.cf-date-range-fields label {
  color: var(--neutral-600);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cf-date-range-presets legend { grid-column: 1 / -1; margin-bottom: 2px; }
.cf-date-range-preset {
  align-items: center;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  color: var(--neutral-700);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  min-height: 44px;
  padding: 8px;
}
.cf-date-range-preset:hover { background: var(--neutral-100); color: var(--cf-black); }
.cf-date-range-preset:focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline);
  outline-offset: var(--interaction-focus-outline-offset);
}
.cf-date-range-fields {
  align-items: center;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: auto minmax(0, 1fr);
}
.cf-date-range-compare {
  align-items: center;
  color: var(--neutral-700);
  display: flex;
  font-size: 13px;
  gap: 8px;
}
.cf-date-range-error {
  background: var(--danger-50);
  border: 1px solid color-mix(in srgb, var(--danger-700) 20%, transparent);
  border-radius: var(--radius-md);
  color: var(--danger-700);
  font-size: 12px;
  margin: 0;
  padding: 8px 10px;
}
.cf-date-range-actions {
  border-top: 1px solid var(--neutral-100);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
}
@media (max-width: 479px) {
  .cf-date-range-panel { position: fixed; right: 16px; top: 72px; width: calc(100vw - 32px); }
  .cf-date-range-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cf-pagination {
  align-items: center;
  background: var(--neutral-50);
  border-top: 1px solid var(--neutral-200);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 16px;
}
.cf-pagination-summary,
.cf-pagination-page,
.cf-pagination-size {
  color: var(--neutral-600);
  font-size: var(--fs-xs);
  font-weight: 600;
  margin: 0;
}
.cf-pagination-controls,
.cf-pagination-size {
  align-items: center;
  display: flex;
  gap: 8px;
}
.cf-pagination-size label { white-space: nowrap; }
.cf-pagination-size .cf-select { min-width: 68px; }
.cf-pagination-table-header { flex-direction: column; }
.cf-pagination-table-copy { flex: 1; min-width: 0; }
.cf-pagination-search {
  display: flex;
  gap: 8px;
  width: 100%;
}
.cf-pagination-search .cf-input { flex: 1; min-width: 0; }
@media (min-width: 640px) {
  .cf-pagination-table-header { flex-direction: row; }
  .cf-pagination-search { max-width: 384px; }
}
@media (max-width: 639px) {
  .cf-pagination { align-items: stretch; }
  .cf-pagination-summary { width: 100%; }
  .cf-pagination-controls { flex-wrap: wrap; width: 100%; }
  .cf-pagination-size { margin-left: 0; width: 100%; }
  .cf-pagination-size .cf-select { flex: 1; }
}

.cf-horizontal-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.cf-horizontal-scroll:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.cf-horizontal-scroll-hint {
  display: none;
  margin-bottom: 0.5rem;
  color: var(--neutral-600);
  font-size: 0.75rem;
  font-weight: 600;
}
@media (max-width: 767px) {
  .cf-horizontal-scroll-hint { display: block; }
}
.cf-table-compact th { padding: 8px 12px; }
.cf-table-compact td { padding: 9px 12px; }
.cf-table .cf-num,
.cf-table .cf-table-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cf-table .cf-actions,
.cf-table .cf-table-actions {
  text-align: right;
  white-space: nowrap;
}
.cf-month-cell {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
}
.cf-month-cell-active { background: var(--success-50); color: var(--success-700); }
.cf-month-cell-current { background: var(--interaction-action-fill); color: var(--interaction-inverse-foreground); }
.cf-month-cell-idle { background: var(--neutral-100); color: var(--neutral-400); }
.cf-row-list {
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.cf-row-list > * + * { border-top: 1px solid var(--neutral-100); }
.cf-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.cf-row:hover { background: var(--neutral-50); }
.cf-brand-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: start;
  justify-content: stretch;
  gap: 14px;
  padding: 16px;
}
.cf-brand-list-main {
  flex: 1 1 auto;
  min-width: 0;
}
.cf-brand-list-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.cf-brand-list-title {
  flex-wrap: wrap;
  min-width: 0;
  row-gap: 4px;
}
.cf-brand-list-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  white-space: nowrap;
}
.cf-brand-list-meta {
  max-width: 100%;
}
.cf-brand-list-meta > form,
.cf-brand-list-meta > span:not(.min-w-0) {
  flex: 0 0 auto;
  white-space: nowrap;
}
.cf-brand-list-slug {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-brand-list-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 560px;
}
.cf-brand-list-actions > * {
  flex: 0 0 auto;
}
.cf-brand-list-actions .cf-btn {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .cf-brand-list-row {
    grid-template-columns: 1fr;
  }
  .cf-brand-list-actions {
    justify-content: flex-start;
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  .cf-brand-list-header {
    flex-direction: column;
    align-items: stretch;
  }
  .cf-brand-list-filters {
    width: 100%;
    justify-content: flex-start;
  }
  .cf-brand-list-filters .cf-select {
    width: 100% !important;
  }
  .cf-brand-list-row {
    align-items: stretch;
  }
  .cf-brand-list-main {
    width: 100%;
    align-items: flex-start;
  }
  .cf-brand-list-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .cf-brand-list-pending {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}
.cf-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.cf-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cf-segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-pill);
  background: var(--cf-white);
}
.cf-segmented-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  color: var(--neutral-600);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.cf-segmented-option:hover { color: var(--cf-black); background: var(--neutral-100); }
.cf-segmented-option.is-active {
  background: var(--cf-black);
  color: var(--cf-lime);
}
.cf-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  font-size: 13px;
}
.cf-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--neutral-100);
  color: var(--neutral-500);
  font-weight: 600;
}
.cf-step.is-active {
  background: var(--cf-black);
  color: var(--cf-lime);
}
.cf-step.is-complete {
  background: var(--success-50);
  color: var(--success-700);
}

/* ── Page meta row · author · workspace · next-run + synced dot ─────── */
.cf-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: var(--fs-small);
  color: var(--neutral-600);
  font-family: var(--font-sans);
}
.cf-page-meta > span { white-space: nowrap; }
.cf-page-meta strong { color: var(--cf-black); font-weight: 600; }
.cf-page-meta .cf-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success-700);
}
.cf-page-meta .cf-sync .cf-dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success-500);
  animation: cf-pulse 1.4s infinite;
}

/* ==========================================================================
   Email calendar category pills — brand-palette fill for Mission Update
   (bg-teal-100 was purged from the Tailwind build). Other categories use
   surviving Tailwind utilities directly.
   ========================================================================== */
.cf-cat-mission-update { background: var(--cf-lilac); color: #6e3b82; }

/* ==========================================================================
   Admin variants — semantic stat + banner tints keyed to functional colors.
   Needed for admin/debug pages (metrics, errors, audit_trail) where the
   summary cards communicate state (errors=danger, unreviewed=warning,
   fixed=success, info=neutral blue) rather than brand hierarchy.
   ========================================================================== */

.cf-stat.cf-stat-success { background: var(--success-50);  border-color: #a7f3d0; }
.cf-stat.cf-stat-success dt { color: var(--success-700); }
.cf-stat.cf-stat-success dd { color: var(--success-700); }

.cf-stat.cf-stat-warning { background: var(--warning-50);  border-color: #fde68a; }
.cf-stat.cf-stat-warning dt { color: var(--warning-700); }
.cf-stat.cf-stat-warning dd { color: var(--warning-700); }

.cf-stat.cf-stat-danger  { background: var(--danger-50);   border-color: #fecaca; }
.cf-stat.cf-stat-danger  dt { color: var(--danger-700); }
.cf-stat.cf-stat-danger  dd { color: var(--danger-700); }

.cf-stat.cf-stat-info    { background: var(--cf-blue-tint); border-color: #bfdcff; }
.cf-stat.cf-stat-info    dt { color: var(--cf-blue-600); }
.cf-stat.cf-stat-info    dd { color: var(--cf-blue-600); }

/* Info banner — tinted blue, for in-page callouts (e.g. bulk-action bars). */
.cf-banner-info { background: var(--cf-blue-tint); border: 1px solid #bfdcff; }
.cf-banner-info .cf-banner-ic { background: var(--cf-blue); color: #fff; }
.cf-banner-info .cf-banner-t  { color: var(--cf-blue-600); }
.cf-banner-info .cf-banner-s  { color: var(--neutral-600); }

/* ==========================================================================
   Focus states — one solid semantic outline plus offset. The translucent
   halo is decorative only; the outline remains the required indicator.
   :focus-visible restricts the treatment to keyboard navigation.
   ========================================================================== */

:where(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: var(--interaction-focus-outline-width) solid var(--interaction-focus-outline) !important;
  outline-offset: var(--interaction-focus-outline-offset) !important;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--interaction-focus-outline) !important;
  box-shadow: var(--shadow-focus) !important;
}

/* Button focus (non-cf-btn buttons — catches all the raw <button>s that
   haven't been converted yet). cf-btn variants already have this via their
   own :focus-visible rules above. */
button:focus-visible:not([class*="cf-btn"]) {
  box-shadow: var(--shadow-focus);
}

/* Links are also primary keyboard targets throughout navigation, tabs, and
   linked cards. Keep the same visible brand focus treatment as controls. */
a:focus-visible {
  box-shadow: var(--shadow-focus);
}

/* Checkboxes + radios: Tailwind's `text-blue-600` and `focus:ring-blue-500`
   utilities are brand-incorrect. Realign at the DOM level. */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--cf-blue);
}

/* Skip-to-content link (keyboard-only escape hatch). Visually hidden until
   focus; then drops into the top-left corner with a brand-blue pill. */
.cf-skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 100;
  background: var(--interaction-action-fill);
  color: var(--interaction-inverse-foreground);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms var(--ease-out);
}
.cf-skip-link:focus,
.cf-skip-link:focus-visible {
  top: 8px;
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ==========================================================================
   Empty state — unifies the "no data yet / nothing here yet" patterns.
   Default: card on white with shadow + ring. Use cf-empty-state-bare for
   borderless centered layouts (e.g. inside an existing card).

   <div class="cf-empty-state">
     <div class="cf-empty-state-icon" style="background: var(--cf-blue-tint); color: var(--cf-blue-600);">
       <svg ...></svg>
     </div>
     <h2 class="cf-empty-state-title">No retailers waiting</h2>
     <p class="cf-empty-state-body">Scan your segments to find new ones.</p>
     <a class="cf-btn cf-btn-primary cf-empty-state-action" href="/foo">Scan now</a>
   </div>
   ========================================================================== */
.cf-empty-state {
  background: var(--cf-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-100);
  padding: 40px 32px;
  text-align: center;
}
.cf-empty-state-compact {
  padding: 28px 20px;
  border-radius: var(--radius-lg);
}
.cf-empty-state-compact .cf-empty-state-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
}
.cf-empty-state-compact .cf-empty-state-title {
  font-size: 15px;
}
.cf-empty-state-compact .cf-empty-state-body {
  font-size: 12.5px;
}
.cf-empty-state-flat {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.cf-empty-state-bare {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 64px 32px;
  text-align: center;
}
.cf-empty-state-icon, .cf-empty-state-bare .cf-empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  margin: 0 auto 16px;
  background: var(--cf-lime-tint);
  color: var(--cf-black);
}
.cf-empty-state-title, .cf-empty-state-bare .cf-empty-state-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--neutral-900);
  margin: 0;
}
.cf-empty-state-body, .cf-empty-state-bare .cf-empty-state-body {
  font-size: 14px;
  color: var(--neutral-600);
  margin: 6px auto 0;
  max-width: 480px;
  line-height: 1.55;
}
.cf-empty-state-action {
  margin-top: 20px;
}

/* ==========================================================================
   Form fields — opt-in classes that document intent. The global
   :focus-visible rules above already paint the brand-blue ring on every
   form control, so cf-input mostly enforces typography / spacing / radius
   so forms across pages match.

   <label class="cf-label">Sender email</label>
   <input class="cf-input" type="email" placeholder="you@brand.com">
   <select class="cf-select"><option>…</option></select>
   <textarea class="cf-textarea" rows="3"></textarea>
   <p class="cf-field-help">Used as the From: address when emails go out.</p>
   <p class="cf-field-error">Required field</p>
   ========================================================================== */
.cf-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: var(--cf-field-gap);
  letter-spacing: 0;
}
.cf-label > span:first-child {
  min-width: 0;
}
.cf-field-required {
  color: var(--danger-700);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}
.cf-label-required::after {
  content: ' *';
  color: var(--danger-500);
}

.cf-input,
.cf-select,
.cf-textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: var(--cf-control-height-desktop);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--field-boundary-idle);
  background: var(--cf-white);
  color: var(--neutral-900);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.cf-input::placeholder,
.cf-textarea::placeholder {
  color: var(--field-placeholder-foreground);
  opacity: 1;
}
.cf-input:hover:not(:disabled):not(:focus):not(.cf-input-warning),
.cf-select:hover:not(:disabled):not(:focus):not(.cf-select-warning),
.cf-textarea:hover:not(:disabled):not(:focus):not(.cf-textarea-warning) {
  border-color: var(--field-boundary-hover);
}
/* Focus styles inherit from the global :focus-visible block — keeps the
   brand-blue ring consistent with raw <input>s elsewhere. */

.cf-input:disabled,
.cf-select:disabled,
.cf-textarea:disabled {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
  color: var(--neutral-500);
  cursor: not-allowed;
}
.cf-input[readonly],
.cf-textarea[readonly] {
  background: var(--neutral-50);
  color: var(--neutral-700);
  cursor: default;
}

.cf-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

.cf-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23525252' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}

.cf-input-error,
.cf-select-error,
.cf-textarea-error {
  border-color: var(--danger-500) !important;
}
.cf-input-error:focus-visible,
.cf-select-error:focus-visible,
.cf-textarea-error:focus-visible {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.22) !important;
}
.cf-input-warning,
.cf-select-warning,
.cf-textarea-warning {
  border-color: var(--warning-500);
}
.cf-input-warning:focus-visible,
.cf-select-warning:focus-visible,
.cf-textarea-warning:focus-visible {
  box-shadow: 0 0 0 3px rgba(217,119,6,0.2) !important;
}

.cf-field-help {
  margin-top: var(--cf-field-gap);
  font-size: 12px;
  color: var(--neutral-600);
}
.cf-field-success,
.cf-field-error {
  margin-top: var(--cf-field-gap);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cf-field-success { color: var(--success-700); }
.cf-field-error { color: var(--danger-700); }
.cf-field-warning,
.cf-field-unavailable {
  align-items: center;
  color: var(--warning-700);
  display: flex;
  font-size: 12px;
  gap: 4px;
  margin-top: var(--cf-field-gap);
}
.cf-field-unavailable {
  color: var(--neutral-600);
}
.cf-field-message-icon {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 16px;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  height: 16px;
  justify-content: center;
  line-height: 1;
  width: 16px;
}
.cf-field-state-unavailable .cf-label {
  color: var(--neutral-600);
}

/* Compact field group with consistent vertical rhythm */
.cf-field { margin-bottom: var(--cf-space-4); }
.cf-field:last-child { margin-bottom: 0; }
/* This adopted grid already owns its row gap; retain the original geometry. */
.cf-brand-core-fields > .cf-field { min-width: 0; margin-bottom: 0; }
/* Native focus scrolling must clear the fixed mobile navigation. */
.cf-brand-core-fields .cf-input { scroll-margin-block: calc(96px + env(safe-area-inset-bottom, 0px)); }
.cf-input-sm,
.cf-select-sm,
.cf-textarea-sm {
  padding: 7px 10px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .cf-input,
  .cf-select,
  .cf-textarea {
    transition: none;
  }
}

@media (pointer: coarse) {
  .cf-input,
  .cf-select,
  .cf-textarea {
    min-height: var(--cf-control-target-coarse);
  }
}

@media (forced-colors: active) {
  .cf-input,
  .cf-select,
  .cf-textarea,
  .cf-field-message-icon {
    border-color: CanvasText;
    forced-color-adjust: auto;
  }
  .cf-input:focus-visible,
  .cf-select:focus-visible,
  .cf-textarea:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
  .cf-input:disabled,
  .cf-select:disabled,
  .cf-textarea:disabled {
    color: GrayText;
  }
}

/* Native choice controls. The input remains the submitted control; custom
   paint is removed in forced-colour mode so the platform can draw it. */
.cf-choice-field,
.cf-choice-group {
  border: 0;
  margin: 0 0 var(--cf-space-4);
  min-width: 0;
  padding: 0;
}
.cf-choice-field:last-child,
.cf-choice-group:last-child { margin-bottom: 0; }
.cf-choice-legend {
  color: var(--neutral-700);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 var(--cf-field-gap);
  padding: 0;
}
.cf-choice-options {
  display: grid;
  gap: var(--cf-space-1);
}
.cf-choice-label,
.cf-switch-label {
  align-items: flex-start;
  box-sizing: border-box;
  color: var(--neutral-800);
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  min-height: 28px;
  min-width: 28px;
  padding: 4px 2px;
  position: relative;
}
.cf-choice-label-compact {
  align-items: center;
  height: 28px;
  justify-content: center;
  padding: 4px;
  width: 28px;
}
.cf-choice-field-compact {
  height: 28px;
  margin: 0;
  width: 28px;
}
.cf-choice-copy {
  display: grid;
  gap: 2px;
  line-height: 1.35;
  min-width: 0;
}
.cf-choice-title {
  color: inherit;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
}
.cf-choice-hint {
  color: var(--neutral-600);
  font-size: 12px;
}
.cf-choice-input {
  appearance: none;
  -webkit-appearance: none;
  background: var(--cf-white);
  border: 2px solid var(--neutral-500);
  box-sizing: border-box;
  color: var(--interaction-action-foreground);
  cursor: pointer;
  flex: 0 0 auto;
  margin: 0;
  position: relative;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.cf-checkbox,
.cf-radio {
  height: 20px;
  width: 20px;
}
.cf-checkbox { border-radius: 6px; }
.cf-checkbox::before {
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: '';
  height: 10px;
  left: 6px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  width: 5px;
}
.cf-checkbox:checked,
.cf-checkbox[data-cf-indeterminate="true"] {
  background: var(--interaction-selected-indicator);
  border-color: var(--interaction-selected-border);
}
.cf-checkbox:checked::before { transform: rotate(45deg) scale(1); }
.cf-checkbox[data-cf-indeterminate="true"]::before {
  border: 0;
  border-radius: 1px;
  background: currentColor;
  height: 2px;
  left: 4px;
  top: 7px;
  transform: none;
  width: 8px;
}
.cf-radio { border-radius: 50%; }
.cf-radio::before {
  background: var(--interaction-selected-indicator);
  border-radius: 50%;
  content: '';
  height: 10px;
  left: 3px;
  position: absolute;
  top: 3px;
  transform: scale(0);
  width: 10px;
}
.cf-radio:checked { border-color: var(--interaction-selected-border); }
.cf-radio:checked::before { transform: scale(1); }
.cf-switch-input {
  background: var(--neutral-200);
  border-radius: var(--radius-pill);
  height: 20px;
  width: 36px;
}
.cf-switch-input::before {
  background: var(--cf-white);
  border: 1px solid var(--neutral-400);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  content: '';
  height: 14px;
  left: 1px;
  position: absolute;
  top: 1px;
  transition: transform var(--dur-fast) var(--ease-out);
  width: 14px;
}
.cf-switch-input:checked {
  background: var(--interaction-selected-indicator);
  border-color: var(--interaction-selected-border);
}
.cf-switch-input:checked::before {
  border-color: var(--cf-white);
  transform: translateX(16px);
}
.cf-choice-label:hover .cf-choice-input:not(:disabled),
.cf-switch-label:hover .cf-choice-input:not(:disabled) {
  border-color: var(--interaction-selected-border);
}
.cf-choice-label:active .cf-choice-input:not(:disabled),
.cf-switch-label:active .cf-choice-input:not(:disabled) { transform: scale(.94); }
.cf-choice-input:disabled {
  background: var(--interaction-disabled-surface);
  border-color: var(--interaction-disabled-border);
  color: var(--interaction-disabled-foreground);
  cursor: not-allowed;
}
.cf-switch-input:disabled::before { background: var(--neutral-400); border-color: var(--neutral-500); }
.cf-choice-label:has(.cf-choice-input:disabled),
.cf-switch-label:has(.cf-choice-input:disabled) {
  color: var(--interaction-disabled-foreground);
  cursor: not-allowed;
}
.cf-choice-state-success .cf-choice-input:not(:checked):not([data-cf-indeterminate="true"]) { border-color: var(--success-500); }
.cf-choice-state-warning .cf-choice-input:not(:checked):not([data-cf-indeterminate="true"]) { border-color: var(--warning-500); }
.cf-choice-state-error .cf-choice-input:not(:checked):not([data-cf-indeterminate="true"]) { border-color: var(--danger-500); }
.cf-choice-state-error .cf-choice-input:focus-visible { box-shadow: 0 0 0 3px rgba(239,68,68,.22) !important; }
.cf-choice-state-warning .cf-choice-input:focus-visible { box-shadow: 0 0 0 3px rgba(217,119,6,.2) !important; }
.cf-choice-state-unavailable .cf-choice-input,
.cf-choice-option-unavailable .cf-choice-input { border-style: dashed; }
.cf-choice-state-destructive .cf-choice-input:checked,
.cf-choice-option-destructive .cf-choice-input:checked {
  background: var(--danger-700);
  border-color: var(--danger-700);
}
.cf-choice-option-destructive { color: var(--danger-700); }
[data-intake-row].is-selected { background: var(--interaction-selected-surface); }
[data-intake-row].is-selected:hover { background: var(--interaction-selected-surface); }

@media (pointer: coarse) {
  .cf-choice-label,
  .cf-switch-label,
  .cf-choice-label-compact,
  .cf-choice-field-compact {
    min-height: var(--cf-control-target-coarse);
    min-width: var(--cf-control-target-coarse);
  }
  .cf-choice-label-compact,
  .cf-choice-field-compact {
    height: var(--cf-control-target-coarse);
    width: var(--cf-control-target-coarse);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf-choice-input,
  .cf-switch-input::before { transition: none; }
}

@media (forced-colors: active) {
  .cf-choice-input,
  .cf-checkbox,
  .cf-radio,
  .cf-switch-input {
    appearance: auto;
    -webkit-appearance: auto;
    background: Canvas;
    border-color: CanvasText;
    forced-color-adjust: auto;
  }
  .cf-choice-input::before { display: none; }
  .cf-choice-input:disabled { color: GrayText; }
  .cf-choice-input:focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px !important;
  }
}

.cf-option-select {
  width: auto;
  min-height: 38px;
  padding: 7px 34px 7px 12px;
  border-width: 1.5px;
  border-radius: var(--radius-md);
  color: var(--neutral-900);
  font-weight: 500;
  background-color: var(--cf-white);
  background-position: right 12px center;
  box-shadow: 0 1px 2px rgba(33,33,33,0.04);
}
.cf-option-select:hover:not(:disabled):not(:focus) {
  border-color: var(--neutral-400);
  box-shadow: var(--shadow-sm);
}
.cf-option-select-active {
  border-width: 2px;
  border-color: var(--cf-blue);
  color: var(--cf-blue-600);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230062d1' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  box-shadow: 0 0 0 1px rgba(0,122,255,0.08);
}
.cf-option-select-active:hover:not(:disabled):not(:focus) {
  border-color: var(--cf-blue);
}
.cf-option-select-fill {
  width: 100%;
}
.cf-search-field {
  position: relative;
  min-width: min(280px, 100%);
}
.cf-search-field .cf-input {
  padding-left: 34px;
}
.cf-search-field > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--neutral-400);
  pointer-events: none;
}
.review-star-filter {
  flex: 0 0 auto;
  min-width: 112px;
  padding-right: 30px;
}
.cf-file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--neutral-300);
  border-radius: var(--radius-lg);
  background: var(--neutral-50);
}
.cf-file-upload-confirmable {
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.cf-file-upload-check {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--success-700);
  background: var(--success-50);
}
.cf-file-upload-check svg {
  width: 16px;
  height: 16px;
}
.cf-file-upload-confirmable[data-upload-state="selected"],
.cf-file-upload-confirmable[data-upload-state="uploaded"] {
  border-color: var(--success-500);
  background: var(--success-50);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.22);
}
.cf-file-upload-confirmable[data-upload-state="selected"] .cf-file-upload-check,
.cf-file-upload-confirmable[data-upload-state="uploaded"] .cf-file-upload-check {
  display: inline-flex;
}
.cf-file-upload-confirmable[data-upload-state="selected"] input[type="file"]::file-selector-button,
.cf-file-upload-confirmable[data-upload-state="uploaded"] input[type="file"]::file-selector-button {
  color: var(--success-700);
  background: var(--cf-white);
}
.cf-file-upload-confirmable[data-upload-state="uploading"] {
  border-color: var(--cf-blue);
  background: var(--cf-blue-tint);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}
.cf-file-upload-confirmable[data-upload-state="error"] {
  border-color: var(--danger-500);
  background: var(--danger-50);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
}
.cf-file-upload input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: var(--neutral-600);
}
.cf-file-upload input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--cf-white);
  color: var(--cf-black);
  padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.cf-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-600);
  font-size: 13px;
}
.cf-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--cf-blue);
  animation: cf-spin 0.7s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

/* Shared shape-matched loading placeholders. */
.cf-skeleton {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--neutral-100);
  position: relative;
}
.cf-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: cf-skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes cf-skeleton-shimmer { to { transform: translateX(100%); } }
.cf-skeleton-label { width: 42%; height: 0.75rem; }
.cf-skeleton-value { width: 68%; height: 2rem; margin-top: 0.9rem; }
.cf-skeleton-pill { width: 54%; height: 1.35rem; margin-top: 0.75rem; border-radius: var(--radius-pill); }
.cf-skeleton-line { width: min(18rem, 78%); height: 0.7rem; margin-top: 0.45rem; }
.cf-skeleton-kpi { min-height: 148px; }
.cf-skeleton-copy { width: 100%; }
.cf-skeleton-chart { min-height: 286px; }
.cf-skeleton-chart-plot { height: 205px; padding: 1.25rem; display: flex; align-items: end; gap: clamp(0.45rem, 2vw, 1rem); }
.cf-skeleton-chart-plot > span { flex: 1; min-width: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--neutral-100); }
.cf-skeleton-table { min-height: 286px; }
.cf-skeleton-table-head, .cf-skeleton-table-row { min-height: 42px; display: grid; grid-template-columns: minmax(7rem, 1.5fr) 1fr 0.8fr; align-items: center; gap: 1rem; padding: 0 1.25rem; border-top: 1px solid var(--neutral-100); }
.cf-skeleton-table-head > .cf-skeleton, .cf-skeleton-table-row > .cf-skeleton { width: 72%; height: 0.7rem; }
.cf-skeleton-table-row { min-height: 49px; }
@media (prefers-reduced-motion: reduce) { .cf-skeleton::after { animation: none; display: none; } }

/* ==========================================================================
   Modal — structure comes from components/modal.html; lifecycle, dismissal,
   focus, feedback and return-focus policy come from cf-modal.js. Legacy
   cf-modal markup is still enhanced, but new call sites use data-modal-*.
   ========================================================================== */
.cf-modal {
  position: fixed;
  inset: 0;
  z-index: var(--layer-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(33,33,33,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: cf-fade-in var(--dur-slow) var(--ease-out);
}
.cf-modal.hidden { display: none; }
body.cf-modal-open { overflow: hidden; }

.cf-modal[data-modal-phase="closed"] { pointer-events: none; }
.cf-modal.is-opening,
.cf-modal.is-open { pointer-events: auto; }

.cf-modal-panel {
  width: 100%;
  max-width: 520px;
  background: var(--cf-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  animation: cf-modal-pop 220ms var(--ease-out);
}
.cf-modal.is-destructive .cf-modal-panel {
  border-top: 4px solid var(--danger-700);
}
@keyframes cf-modal-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.cf-modal-sm  { max-width: 380px; }
.cf-modal-md  { max-width: 520px; }
.cf-modal-lg  { max-width: 720px; }
.cf-modal-xl  { max-width: 920px; }

.cf-modal-gallery {
  flex-direction: column;
  justify-content: stretch;
  padding: 16px;
  background: rgba(17, 24, 39, 0.82);
}
.cf-modal-gallery-toolbar,
.cf-modal-gallery-canvas {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}
.cf-modal-gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--cf-white);
  padding: 12px 16px;
  box-shadow: var(--shadow-xs);
}
.cf-modal-gallery-canvas {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--neutral-100);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

/* Page-owned behaviour expressed through shared CSS rather than local style
   blocks. Selectors remain scoped to their owning workflow. */
#intake-brand-picker { min-width: 0; }
#intake-brand-picker > [data-cf-menu-trigger] {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--cf-white);
  padding: 5px 9px;
  box-shadow: none;
}
#intake-brand-picker > [data-cf-menu-trigger]:hover {
  border-color: var(--neutral-400);
  background: var(--cf-white);
  box-shadow: none;
}
#intake-brand-picker .cf-workspace-chip-action { margin-left: auto; background: transparent; color: var(--neutral-500); padding: 0; font-size: var(--fs-eyebrow); }
#intake-brand-picker .cf-brand-dropdown { width: 340px; max-width: calc(100vw - 2rem); }
[data-intake-row] > div:last-child > span { min-width: 58px; justify-content: center; border-radius: 999px; white-space: nowrap; }
[data-intake-row] .mt-1.flex.gap-1 { display: none; }
[data-intake-row]:hover .mt-1.flex.gap-1,
[data-intake-row]:focus-within .mt-1.flex.gap-1 { display: flex; }
#bulk-intake-form:not(.has-selection) { display: none; }
#action-review-original { position: static; max-height: none; }
#action-review-original pre { max-height: 420px; overflow: auto; border-radius: 10px; background: var(--neutral-50); padding: 16px; }
#duplicate-scan-form.htmx-request [data-duplicate-scan-label] { display: none; }
#operator-dock.dock-collapsed .cf-card > div:nth-child(n+2) { display: none; }
#operator-dock.dock-collapsed .cf-card > div:first-child { border-bottom: 0; }
#operator-dock.dock-collapsed .dock-toggle-icon { transform: rotate(-90deg); }
@media (min-width: 768px) {
  .px-5.py-3:has(#intake-search) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px 180px auto;
    align-items: center;
  }
}
@media (min-width: 1280px) {
  body[data-operator-dock="true"] #help-fab { bottom: 18rem !important; }
}

.cf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--neutral-100);
}
.cf-modal-heading {
  min-width: 0;
  flex: 1 1 auto;
}
.cf-modal-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--neutral-900);
  margin: 0;
}
.cf-modal-description {
  max-width: 58ch;
  margin: 6px 0 0;
  color: var(--neutral-600);
  font-size: 13px;
  line-height: 1.5;
}
.cf-modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-supporting-foreground);
  border: 0;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.cf-modal-close:disabled {
  cursor: not-allowed;
  opacity: 1;
  color: var(--interaction-disabled-foreground);
  background: var(--interaction-disabled-surface);
}
.cf-modal-close:hover:not(:disabled) { background: var(--neutral-100); color: var(--neutral-900); }
.cf-modal-close:active:not(:disabled) { background: var(--neutral-200); }
.cf-modal-close:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.cf-modal-close-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}
.cf-modal-close-icon {
  width: 16px;
  height: 16px;
}

.cf-modal-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 22px 0;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  padding: 10px 12px;
  color: var(--neutral-700);
  font-size: 13px;
  line-height: 1.45;
}
.cf-modal-feedback[hidden] { display: none; }
.cf-modal-feedback[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success-700) 28%, white);
  background: var(--success-50);
  color: var(--success-700);
}
.cf-modal-feedback[data-tone="warning"] {
  border-color: color-mix(in srgb, var(--warning-700) 28%, white);
  background: var(--warning-50);
  color: var(--warning-700);
}
.cf-modal-feedback[data-tone="error"] {
  border-color: #fecaca;
  background: var(--danger-50);
  color: var(--danger-700);
}

.cf-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  font-size: 14px;
  color: var(--neutral-700);
  line-height: 1.55;
}

.cf-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}
.cf-modal-actions {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* Action roles come from cf-btn variants, including neutral unavailable
   states. Loading feedback must not fade readable consequence text. */
.cf-modal-footer-spread {
  justify-content: space-between;
}

@media (max-width: 479px) {
  .cf-modal { padding: 12px; }
  .cf-modal-panel { max-height: calc(100dvh - 24px); }
  .cf-modal-header,
  .cf-modal-body,
  .cf-modal-footer { padding-inline: 16px; }
  .cf-modal-feedback { margin-inline: 16px; }
  .cf-modal-footer,
  .cf-modal-actions { flex-wrap: wrap; }
  .cf-modal-actions .cf-btn { justify-content: center; }
  /* The shared regular dialog needs one scrollable panel when its heading,
     consequence and actions cannot fit at zoom. Drawers retain body scrolling. */
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-panel { overflow-y: auto; }
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-header { flex-wrap: wrap; }
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-heading { flex-basis: 12rem; overflow-wrap: anywhere; }
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-header,
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-feedback,
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-body,
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-footer { flex-shrink: 0; }
  .cf-modal[data-cf-modal]:not(.cf-modal-drawer) .cf-modal-body { overflow: visible; }
}

/* Shared drawer: same width as the existing side drawer, viewport shell,
   and a header outside the only scrolling region. No local lifecycle. */
.cf-modal.cf-modal-drawer {
  padding: 0;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(17, 24, 39, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}
.cf-modal-drawer .cf-modal-panel {
  position: relative;
  inset: auto;
  max-width: min(720px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  overflow: hidden;
  animation: none;
}
.cf-modal-drawer .cf-modal-header {
  flex-wrap: wrap;
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--cf-white);
}
.cf-modal-drawer .cf-modal-body {
  min-height: 0;
  padding: 20px;
  overscroll-behavior: contain;
}
.cf-modal-drawer .cf-service-drawer-title { overflow-wrap: normal; }
.cf-service-drawer-row { flex-wrap: wrap; }
.cf-service-drawer-row > .min-w-0 { flex: 1 1 12rem; }
.cf-modal-drawer .cf-modal-heading { flex-basis: 12rem; overflow-wrap: break-word; }
@media (min-width: 1280px) {
  .cf-modal-drawer .cf-modal-panel { max-width: min(760px, 44vw); }
}
.cf-modal .cf-menu { z-index: var(--layer-popover); }
[data-modal-open][aria-busy="true"] { cursor: progress; opacity: .72; }
@media (pointer: coarse) {
  .cf-modal-drawer .cf-btn { min-height: 44px; min-width: 44px; }
}

@media (forced-colors: active) {
  .cf-modal { background: Canvas; }
  .cf-modal-panel,
  .cf-modal-feedback,
  .cf-modal-close { border: 1px solid CanvasText; }
  .cf-modal.is-destructive .cf-modal-panel { border-top: 4px solid CanvasText; }
  .cf-modal-close:focus-visible,
  .cf-modal :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-modal,
  .cf-modal-panel,
  .cf-modal .cf-spinner { animation: none !important; }
}


/* ── Access command center (mockup 1: bold black hero) ──────────────
 *
 * Used by every page under /access/* and the /my-access page. The hero
 * is a full-bleed black card with mint accents, KPI stat strip, tab
 * nav. Below it, white cards host the actual content (matrix grid,
 * member table, brand cards, etc).
 * --------------------------------------------------------------- */

.cf-access-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cf-access-hero {
  background: var(--cf-black);
  color: var(--cf-white);
  border-radius: var(--radius-2xl);
  padding: 28px 32px 0;
  position: relative;
  overflow: hidden;
}

.cf-access-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.cf-access-eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
}

.cf-access-eyebrow > .cf-pill,
.cf-access-context {
  flex-shrink: 0;
  white-space: nowrap;
}

.cf-access-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.cf-access-actor {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cf-access-sep {
  flex-shrink: 0;
  opacity: 0.5;
}

.cf-access-role,
.cf-access-actor {
  color: rgba(255, 255, 255, 0.85);
}

.cf-access-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-access-h1 {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--cf-white);
}

@media (max-width: 640px) {
  .cf-access-h1 {
    font-size: 32px;
  }
  .cf-access-hero {
    padding: 20px 18px 0;
  }
}

.cf-access-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 20px;
  max-width: 720px;
}

.cf-access-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cf-access-headline-text {
  flex: 1 1 28rem;
  min-width: 0;
}

.cf-access-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.cf-access-actions .cf-btn {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 900px) {
  .cf-access-headline {
    flex-direction: column;
    align-items: stretch;
  }
  .cf-access-headline-text {
    flex: 0 1 auto;
    width: 100%;
  }
  .cf-access-actions {
    margin-top: 0;
    margin-bottom: 8px;
  }
}

.cf-access-actions .cf-btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--cf-white);
}
.cf-access-actions .cf-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* KPI strip — sits inside the hero */
.cf-access-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 22px;
}

@media (max-width: 1024px) {
  .cf-access-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cf-access-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The narrow documentation example must respond to its own width. */
.cf-access-example {
  max-width: 390px;
  container: access-example / inline-size;
}
@container access-example (max-width: 390px) {
  .cf-access-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container access-example (max-width: 300px) {
  .cf-access-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Variant of cf-stat that reads on the dark hero — outline + dim text */
.cf-stat-outline-on-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cf-white);
}
.cf-stat-outline-on-dark dt {
  color: rgba(255, 255, 255, 0.55);
}
.cf-stat-outline-on-dark dd {
  color: var(--cf-white);
}
.cf-stat-outline-on-dark dd .cf-unit {
  color: rgba(255, 255, 255, 0.55);
}
.cf-stat-outline-on-dark .cf-stat-delta {
  color: rgba(255, 255, 255, 0.6);
}
.cf-stat-warn {
  background: rgba(255, 180, 60, 0.12);
  border-color: rgba(255, 180, 60, 0.4);
}

/* Tab strip */
.cf-access-tabs {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 -32px;
  padding: 0 32px;
  overflow-x: auto;
}

@media (max-width: 640px) {
  .cf-access-tabs {
    margin: 0 -18px;
    padding: 0 18px;
  }
}

.cf-access-tab {
  position: relative;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cf-access-tab:hover {
  color: var(--cf-white);
}

.cf-access-tab.is-active {
  color: var(--cf-lime);
  border-bottom-color: var(--cf-lime);
}

.cf-access-tab .cf-tab-num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 999px;
}

.cf-access-tab.is-active .cf-tab-num {
  background: var(--cf-lime);
  color: var(--cf-black);
}

/* ── Access content cards (white, below hero) ───────────────────── */

.cf-access-card {
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

.cf-access-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--neutral-100);
  gap: 12px;
  flex-wrap: wrap;
}

.cf-access-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--cf-black);
  letter-spacing: -0.01em;
}

.cf-access-card-sub {
  font-size: 13px;
  color: var(--neutral-600);
  margin: 4px 0 0;
}

.cf-access-card-body {
  padding: 18px 22px;
}

.cf-access-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.cf-access-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--cf-white);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-base) ease, background var(--dur-base) ease;
}

.cf-access-row:hover {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
}

.cf-access-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--neutral-600);
}

.cf-legend-text {
  margin-right: 8px;
}

/* ── Matrix grid (mockup 1) ──────────────────────────────────────── */

.cf-matrix-scroll {
  overflow-x: auto;
}

.cf-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cf-matrix thead th {
  position: sticky;
  top: 0;
  background: var(--cf-white);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.cf-matrix-col-member {
  min-width: 220px;
}

.cf-matrix-col-role {
  min-width: 110px;
}

.cf-matrix-col-brand {
  width: 56px;
  text-align: center !important;
  vertical-align: bottom;
}

.cf-matrix-brand-label {
  display: block;
  font-size: var(--fs-eyebrow);
  color: var(--neutral-400);
  margin-top: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-matrix tbody tr:hover {
  background: var(--neutral-50);
}

.cf-matrix-row-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--neutral-100);
  white-space: nowrap;
}

.cf-matrix tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
}

.cf-matrix-cell-td {
  text-align: center;
  padding: 4px !important;
}

.cf-matrix-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--cf-black);
  color: var(--cf-lime);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.cf-matrix-name-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
}

.cf-matrix-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-black);
}

.cf-matrix-handle {
  font-size: 11px;
  color: var(--neutral-500);
  font-family: var(--font-mono, ui-monospace, monospace);
}

/* ── Who can see this · stacked initials on a header button, then the list in a cf-modal ── */
.cf-who-stack { gap: 8px; }
.cf-who-faces { display: inline-flex; }
.cf-who-faces .cf-matrix-avatar {
  width: 24px;
  height: 24px;
  font-size: 9px;
  box-shadow: 0 0 0 2px var(--cf-white);
}
.cf-who-faces .cf-matrix-avatar + .cf-matrix-avatar { margin-left: -2px; }
.cf-who-faces .cf-who-more { background: var(--neutral-200); color: var(--neutral-700); }
.cf-who-group + .cf-who-group { margin-top: 20px; }
.cf-who-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--cf-black); }
.cf-who-note { margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--neutral-600); }
.cf-who-list { margin-top: 8px; }
.cf-who-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--neutral-100);
}
.cf-who-row .cf-matrix-name-stack { min-width: 0; }
.cf-who-row .cf-matrix-handle { overflow-wrap: anywhere; }
.cf-who-why { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; color: var(--neutral-600); text-align: right; }
@media (max-width: 480px) {
  .cf-who-row { grid-template-columns: 28px minmax(0, 1fr); }
  .cf-who-why { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; text-align: left; }
}

.cf-matrix-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) ease;
}

.cf-matrix-cell:hover {
  transform: scale(1.05);
}

.cf-matrix-cell-empty {
  cursor: pointer;
}

.cf-matrix-cell-wildcard {
  cursor: not-allowed;
}

.cf-matrix-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-matrix-chip-empty {
  display: inline-block;
  width: 36px;
  height: 22px;
  border: 1px dashed var(--neutral-300);
  border-radius: var(--radius-sm);
  background: transparent;
}

.cf-matrix-cell-empty:hover .cf-matrix-chip-empty {
  border-color: var(--cf-blue);
  background: var(--cf-blue-tint, rgba(0, 122, 255, 0.08));
}

/* Role select dropdown — looks like a cf-pill but acts like a <select> */
.cf-matrix-role-select {
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23000' fill-opacity='0.55' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 8px;
  font-family: inherit;
  transition: filter var(--dur-fast) ease;
}

.cf-matrix-role-select:hover {
  filter: brightness(0.96);
}

.cf-matrix-role-select:focus {
  outline: 2px solid var(--cf-blue);
  outline-offset: 1px;
}

.cf-matrix-role-select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── Brand chip (the BK / PR / WM tag) ───────────────────────────── */

.cf-brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  color: var(--cf-black);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-brand-chip-lg {
  width: 40px;
  height: 40px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

/* ── Brand grid (Brands tab) ─────────────────────────────────────── */

.cf-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.cf-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--cf-white);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-base) ease, transform var(--dur-base) ease;
}

.cf-brand-card:hover {
  border-color: var(--cf-blue);
  transform: translateY(-1px);
}

.cf-brand-card-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  flex-shrink: 0;
}

.cf-brand-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cf-brand-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cf-black);
}

.cf-brand-card-slug {
  font-size: 11px;
  color: var(--neutral-500);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-brand-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.cf-eyebrow { margin: 0 0 6px; overflow-wrap: anywhere; }

/* ── Policy grid ─────────────────────────────────────────────────── */

.cf-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.cf-policy-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--cf-white);
}

.cf-policy-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cf-policy-desc {
  font-size: 13px;
  color: var(--neutral-700);
  margin: 0 0 12px;
  line-height: 1.5;
}

.cf-policy-perms summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-blue);
  cursor: pointer;
  user-select: none;
}

.cf-policy-perms ul {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cf-policy-perms li code {
  font-size: var(--fs-eyebrow);
  background: var(--neutral-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--neutral-700);
}

/* ── Misc ────────────────────────────────────────────────────────── */

.cf-link {
  color: var(--interaction-action-fill);
  text-decoration: none;
}
.cf-link:hover {
  color: var(--interaction-action-fill-hover);
  text-decoration: underline;
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 3px solid Highlight !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
  }
  .cf-data-table-shell .cf-table tbody tr[aria-selected="true"] td:first-child::before,
  .cf-data-table-shell .cf-table tbody tr.is-selected td:first-child::before {
    color: Highlight;
  }
}


/* ── Users tab — filter bar, bulk action bar, member table ─────────── */

.cf-users-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--neutral-100);
  background: var(--neutral-50);
  flex-wrap: wrap;
}

.cf-users-filter-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.cf-users-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cf-users-filter-sep {
  color: var(--neutral-300);
  margin: 0 4px;
}

.cf-users-filter-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cf-white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  color: var(--neutral-500);
}

.cf-users-filter-search .cf-input {
  border: none;
  padding: 4px 0;
  font-size: 13px;
  width: 180px;
  background: transparent;
}

.cf-users-filter-search .cf-input:focus {
  outline: none;
  box-shadow: none;
}

/* Bulk-action bar — sticky just below the filter bar when active */
.cf-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--cf-black);
  color: var(--cf-white);
  flex-wrap: wrap;
  position: sticky;
  top: 56px;
  z-index: 10;
}

.cf-bulk-bar.hidden {
  display: none;
}

.cf-bulk-count {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cf-bulk-sep {
  flex: 1;
  height: 1px;
}

.cf-bulk-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cf-bulk-form .cf-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--cf-white);
}

.cf-bulk-form .cf-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--cf-white);
}

.cf-bulk-clear {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
}

.cf-bulk-clear:hover {
  color: var(--cf-white);
}

/* Member table */
.cf-users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cf-users-table thead th {
  background: var(--cf-white);
  font-size: 11px;
  font-weight: 600;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.cf-users-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
}

.cf-users-row:hover {
  background: var(--neutral-50);
}

/* Suspension is record state, not disabled administrative UI. */
.cf-users-row-suspended {
  opacity: 1;
}
.cf-users-row-suspended .cf-matrix-handle {
  color: var(--text-supporting-foreground);
}
.cf-users-row-suspended .cf-users-row-member:hover .cf-matrix-name {
  color: var(--interaction-action-fill);
}

.cf-users-th-check,
.cf-users-td-check {
  width: 36px;
  padding-left: 22px !important;
}

.cf-users-th-kebab,
.cf-users-td-kebab {
  width: 36px;
  text-align: right;
  padding-right: 22px !important;
}

.cf-users-row-member {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.cf-users-row-member:hover .cf-matrix-name {
  color: var(--cf-blue);
}

.cf-users-brands {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}


/* ── Brand detail — two-column layout + identity form ──────────── */

.cf-brand-detail-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
}

.cf-brand-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 18px 22px;
}

@media (max-width: 768px) {
  .cf-brand-detail-grid {
    grid-template-columns: 1fr;
  }
}

.cf-brand-identity-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 100px;
  gap: 12px;
  align-items: end;
}

@media (max-width: 768px) {
  .cf-brand-identity-form {
    grid-template-columns: 1fr;
  }
}

.cf-color-picker {
  width: 44px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--cf-white);
}


/* ── /my-access page (mockup 3 — non-admin scoped view) ────────── */

.cf-my-access-hero {
  background: var(--cf-black);
  color: var(--cf-white);
  border-radius: var(--radius-2xl);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

@media (max-width: 640px) {
  .cf-my-access-hero {
    grid-template-columns: 1fr;
    padding: 20px 18px;
  }
}

.cf-my-access-role {
  font-size: 36px;
  font-weight: 700;
  margin: 4px 0;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--cf-lime);
}

.cf-my-access-summary {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  max-width: 540px;
}

.cf-my-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--cf-white);
}

.cf-my-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  flex-shrink: 0;
}

.cf-my-brand-info {
  flex: 1;
  min-width: 0;
}

.cf-my-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--cf-black);
}

.cf-my-brand-meta {
  font-size: 12px;
  color: var(--neutral-500);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.cf-my-brand-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.cf-can-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 640px) {
  .cf-can-grid {
    grid-template-columns: 1fr;
  }
}

.cf-can-list,
.cf-cant-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-can-list li,
.cf-cant-list li {
  font-size: 13px;
  color: var(--cf-black);
  padding: 6px 0;
  border-bottom: 1px solid var(--neutral-100);
}

.cf-cant-list li {
  color: var(--neutral-500);
  text-decoration: line-through;
  text-decoration-color: var(--neutral-300);
}

/* ── Superuser ops approvals compact rows ───────────────────────────── */

.su-approval-row {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--cf-white);
}

.su-approval-row:hover {
  background: var(--neutral-50);
}

.su-approval-brand,
.su-approval-main {
  min-width: 0;
}

.su-approval-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.su-approval-brand-name {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--neutral-500);
  font-size: 12px;
  line-height: 18px;
}

.su-approval-main {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  padding: 2px 0;
}

.su-approval-main:hover .su-approval-store,
.su-approval-preview-btn:hover {
  color: var(--cf-black);
}

.su-approval-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.su-approval-store {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cf-black);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.su-approval-segment,
.su-approval-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  line-height: 14px;
}

.su-approval-segment {
  flex-shrink: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--neutral-100);
  color: var(--neutral-600);
  padding: 2px 8px;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
}

.su-approval-message {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--neutral-500);
  font-size: 12px;
  line-height: 18px;
}

.su-approval-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.su-approval-tag {
  padding: 2px 8px;
  font-size: var(--fs-eyebrow);
}

.su-approval-tag-neutral {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.su-approval-tag-info {
  background: var(--cf-blue-tint);
  color: var(--cf-blue-600);
}

.su-approval-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.su-approval-actions form {
  margin: 0;
}

.su-approval-preview-btn,
.su-approval-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.su-approval-preview-btn {
  color: var(--neutral-600);
}

.su-approval-preview-btn:hover {
  background: var(--neutral-100);
}

.su-approval-open-btn {
  border: 1px solid var(--neutral-300);
  background: var(--cf-white);
  color: var(--cf-black);
}

.su-approval-open-btn:hover {
  border-color: var(--cf-black);
  background: var(--cf-black);
  color: var(--cf-white);
}

.su-approval-main:focus-visible,
.su-approval-preview-btn:focus-visible,
.su-approval-open-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

@media (max-width: 900px) {
  .su-approval-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .su-approval-actions {
    justify-content: flex-start;
  }
}

/* Shared approval workflow presentation; meaning also lives in text/icons. */
.approval-workflow-status { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.approval-workflow-status svg { flex-shrink:0; }
@media (forced-colors: active) {
  .approval-workflow-status { border:1px solid CanvasText; }
}

/* Keep the existing selected rail edge visible when fills are suppressed. */
@media (forced-colors: active) {
  #app-sidebar a[aria-current="page"]::before {
    border-left: 3px solid CanvasText;
  }
}

/* Legacy small utilities share the readable label floor. */
[class~="text-[8px]"], [class~="text-[8.5px]"],
[class~="text-[9px]"], [class~="text-[9.5px]"],
[class~="text-[10px]"], [class~="text-[10.5px]"] {
  font-size: var(--fs-eyebrow) !important;
}
/* Display utilities must not expose deferred or zero-count badges. */
[data-nav-badge][hidden] { display: none !important; }

.cf-next-step-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--cf-control-height-desktop);
  padding-block: 8px;
  color: var(--interaction-action-fill);
  font-size: var(--fs-small);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cf-next-step-link:hover { color: var(--interaction-action-fill-hover); }
.cf-next-step-link:focus-visible { outline: 3px solid var(--interaction-focus-outline); outline-offset: 2px; }
.cf-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-account-more summary { list-style: none; cursor: pointer; }
.cf-account-more summary::-webkit-details-marker { display: none; }
.cf-account-more-links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 639px) {
  /* Clear the help button (44px) and bottom navigation when scrolling. */
  .cf-page-shell {
    padding-bottom: max(144px, calc(var(--cf-mobile-nav-clearance, 4.5rem) + 64px + env(safe-area-inset-bottom, 0px))) !important;
  }
  .cf-account-more[open] { flex-basis: 100%; }
  .cf-account-more-links { margin-top: 8px; }
}

.cf-account-stats .cf-stat dd { font-size: var(--fs-h1); }
@media (max-width: 639px) {
  .cf-account-stats .cf-stat dd { font-size: var(--fs-h2); }
}
