/* ============================================================
   WebBlocks UI — Design Tokens (Light mode defaults)
   All CSS custom properties live here.
   ============================================================ */

:root {
  color-scheme: light;

  /* ── Surfaces ─────────────────────────────────────────── */
  --wb-bg:        #f4f6fb;
  --wb-surface:   #ffffff;
  --wb-surface-2: #edf1f7;
  --wb-surface-3: #e2e8f2;

  /* ── Text ─────────────────────────────────────────────── */
  --wb-text:  #18212f;
  --wb-muted: #5a6a84;

  /* ── Border ───────────────────────────────────────────── */
  --wb-border: #d6e0ee;

  /* ── Accent (rich token set — driven by data-accent) ─────
     Default = blue; overridden per-accent in accents.css.
     Components that still read --wb-primary* are covered by
     the backward-compat aliases at the bottom of this block. */
  --wb-accent:           #2563eb;
  --wb-accent-hover:     #1d4ed8;
  --wb-accent-active:    #1e40af;
  --wb-accent-soft:      #dbeafe;
  --wb-accent-softer:    #eff6ff;
  --wb-accent-border:    #93c5fd;
  --wb-accent-text:      #1d4ed8;
  --wb-accent-on:        #ffffff;
  --wb-accent-ring:      rgb(37 99 235);
  --wb-accent-ring-rgb:  37 99 235;
  --wb-accent-selection: #dbeafe;
  --wb-accent-glow-rgb:  37 99 235;

  /* Backward-compat: existing components read --wb-primary* */
  --wb-primary:      var(--wb-accent);
  --wb-primary-dark: var(--wb-accent-hover);
  --wb-primary-soft: var(--wb-accent-soft);

  /* ── Semantic ─────────────────────────────────────────── */
  --wb-success:      #15803d;
  --wb-success-dark: #166534;
  --wb-success-soft: #dcfce7;

  --wb-warning:      #b45309;
  --wb-warning-dark: #92400e;
  --wb-warning-soft: #ffedd5;

  --wb-danger:       #b91c1c;
  --wb-danger-dark:  #991b1b;
  --wb-danger-soft:  #fee2e2;

  --wb-info:         #0369a1;
  --wb-info-dark:    #075985;
  --wb-info-soft:    #e0f2fe;

  /* ── Typography ───────────────────────────────────────── */
  --wb-font:         Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: var(--wb-font);
  --wb-font-mono:    ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  --wb-font-size-xs: 0.75rem;   /* 12px */
  --wb-font-size-sm: 0.875rem;  /* 14px */
  --wb-font-size-md: 1rem;      /* 16px */
  --wb-font-size-lg: 1.125rem;  /* 18px */
  --wb-font-size-xl: 1.25rem;   /* 20px */

  --wb-line-height-base:    1.5;
  --wb-line-height-tight:   1.25;
  --wb-line-height-relaxed: 1.75;

  /* ── Spacing (4px base) ───────────────────────────────── */
  --wb-s1:  0.25rem;  /* 4px  */
  --wb-s2:  0.5rem;   /* 8px  */
  --wb-s3:  0.75rem;  /* 12px */
  --wb-s4:  1rem;     /* 16px */
  --wb-s5:  1.25rem;  /* 20px */
  --wb-s6:  1.5rem;   /* 24px */
  --wb-s8:  2rem;     /* 32px */
  --wb-s10: 2.5rem;   /* 40px */
  --wb-s12: 3rem;     /* 48px */
  --wb-s16: 4rem;     /* 64px */
  --wb-s20: 5rem;     /* 80px */

  /* ── Border Radius ────────────────────────────────────── */
  --wb-r-sm:   5px;
  --wb-r-md:   9px;
  --wb-r-lg:   14px;
  --wb-r-xl:   20px;
  --wb-r-full: 9999px;

  /* ── Shadows ──────────────────────────────────────────── */
  --wb-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --wb-shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --wb-shadow-lg: 0 12px 36px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --wb-shadow-xl: 0 24px 64px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);

  /* ── Transitions ──────────────────────────────────────── */
  --wb-t:   0.18s ease;
  --wb-t-f: 0.10s ease;

  /* ── Z-index ──────────────────────────────────────────── */
  --wb-z-dropdown: 100;
  --wb-z-modal:    200;
  --wb-z-toast:    300;

  /* ── Layout ───────────────────────────────────────────── */
  --wb-sidebar-w:  260px;
  --wb-content-w:  1200px;
  --wb-content-sm: 720px;
}
/* ============================================================
   WebBlocks UI — Dark Mode Overrides
   Activated by: html[data-mode="dark"]  (explicit dark)
   Auto fallback: @media prefers-color-scheme with data-mode="auto"
   ============================================================ */

html[data-mode="dark"] {
  color-scheme: dark;

  --wb-bg:        #0c111d;
  --wb-surface:   #131929;
  --wb-surface-2: #1a2235;
  --wb-surface-3: #202c42;

  --wb-text:  #e4ecfa;
  --wb-muted: #8b9bb8;

  --wb-border: #29364f;

  /* Default (no data-accent) dark soft for primary/accent */
  --wb-accent-soft:  rgba(37,99,235,0.18);
  --wb-success-soft: rgba(21,128,61,0.18);
  --wb-warning-soft: rgba(180,83,9,0.20);
  --wb-danger-soft:  rgba(185,28,28,0.22);
  --wb-info-soft:    rgba(3,105,161,0.20);

  --wb-shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --wb-shadow-md: 0 4px 14px rgba(0,0,0,0.35);
  --wb-shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
  --wb-shadow-xl: 0 24px 64px rgba(0,0,0,0.55);
}

/* ── Auto mode: CSS-native dark when OS prefers dark ──────── */
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"] {
    color-scheme: dark;

    --wb-bg:        #0c111d;
    --wb-surface:   #131929;
    --wb-surface-2: #1a2235;
    --wb-surface-3: #202c42;

    --wb-text:  #e4ecfa;
    --wb-muted: #8b9bb8;

    --wb-border: #29364f;

    /* Default (no data-accent) dark soft for primary/accent */
    --wb-accent-soft:  rgba(37,99,235,0.18);
    --wb-success-soft: rgba(21,128,61,0.18);
    --wb-warning-soft: rgba(180,83,9,0.20);
    --wb-danger-soft:  rgba(185,28,28,0.22);
    --wb-info-soft:    rgba(3,105,161,0.20);

    --wb-shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
    --wb-shadow-md: 0 4px 14px rgba(0,0,0,0.35);
    --wb-shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
    --wb-shadow-xl: 0 24px 64px rgba(0,0,0,0.55);
  }
}
/* ============================================================
   WebBlocks UI — Named Presets
   Applied via: html[data-preset="name"]

   Each preset is a self-contained bundle: primary color, border
   radius, spacing density, shadows, and font stack — all in one
   attribute.

   CASCADE RULE: Individual axis files (accents.css, radius.css,
   density.css, shadow.css, font.css) are loaded AFTER this file.
   Any explicit data-accent / data-radius / etc. attribute on <html>
   will therefore override the corresponding preset values.

   DARK MODE: Each preset includes dark-mode variants for primary-soft
   and (where relevant) shadow values.
   ============================================================ */

/* ── Modern ────────────────────────────────────────────────
   Ocean teal · Balanced defaults · Inter
   ──────────────────────────────────────────────────────── */
html[data-preset="modern"] {
  --wb-primary:      #0d9488;
  --wb-primary-dark: #0f766e;
  --wb-primary-soft: #ccfbf1;
  --wb-font:         Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Radius, density, shadow: tokens.css defaults apply */
}
html[data-mode="dark"][data-preset="modern"] {
  --wb-primary-soft: rgba(13,148,136,0.20);
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-preset="modern"] {
    --wb-primary-soft: rgba(13,148,136,0.20);
  }
}

/* ── Minimal ───────────────────────────────────────────────
   Slate gray · Sharp corners · Compact · Flat shadows · System font
   ──────────────────────────────────────────────────────── */
html[data-preset="minimal"] {
  /* Color */
  --wb-primary:      #475569;
  --wb-primary-dark: #334155;
  --wb-primary-soft: #e2e8f0;

  /* Radius: sharp */
  --wb-r-sm: 2px;
  --wb-r-md: 4px;
  --wb-r-lg: 6px;
  --wb-r-xl: 10px;

  /* Density: compact */
  --wb-s1:  0.125rem;
  --wb-s2:  0.25rem;
  --wb-s3:  0.375rem;
  --wb-s4:  0.625rem;
  --wb-s5:  0.75rem;
  --wb-s6:  1rem;
  --wb-s8:  1.25rem;
  --wb-s10: 1.5rem;
  --wb-s12: 2rem;
  --wb-s16: 2.5rem;
  --wb-s20: 3rem;

  /* Shadow: flat */
  --wb-shadow-sm: none;
  --wb-shadow-md: 0 1px 2px rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 2px 6px rgba(0,0,0,0.08);
  --wb-shadow-xl: 0 4px 12px rgba(0,0,0,0.10);

  /* Font: system */
  --wb-font:         ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-mode="dark"][data-preset="minimal"] {
  --wb-primary-soft: rgba(71,85,105,0.22);
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-preset="minimal"] {
    --wb-primary-soft: rgba(71,85,105,0.22);
  }
}

/* ── Editorial ─────────────────────────────────────────────
   Warm orange · Soft radius · Comfortable · Deep shadows · Georgia headings
   ──────────────────────────────────────────────────────── */
html[data-preset="editorial"] {
  /* Color */
  --wb-primary:      #ea580c;
  --wb-primary-dark: #c2410c;
  --wb-primary-soft: #ffedd5;

  /* Radius: soft */
  --wb-r-sm: 8px;
  --wb-r-md: 14px;
  --wb-r-lg: 20px;
  --wb-r-xl: 28px;

  /* Density: comfortable */
  --wb-s1:  0.375rem;
  --wb-s2:  0.75rem;
  --wb-s3:  1rem;
  --wb-s4:  1.25rem;
  --wb-s5:  1.5rem;
  --wb-s6:  2rem;
  --wb-s8:  2.5rem;
  --wb-s10: 3rem;
  --wb-s12: 4rem;
  --wb-s16: 5rem;
  --wb-s20: 6rem;

  /* Shadow: soft */
  --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.08), 0 1px 3px  rgba(0,0,0,0.06);
  --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.12), 0 3px 8px  rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.14), 0 6px 16px rgba(0,0,0,0.06);
  --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.18), 0 12px 28px rgba(0,0,0,0.08);

  /* Font: editorial — Georgia headings, system body */
  --wb-font:         ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: Georgia, "Times New Roman", Times, serif;
}
html[data-mode="dark"][data-preset="editorial"] {
  --wb-primary-soft: rgba(234,88,12,0.20);
  --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.40), 0 1px 3px  rgba(0,0,0,0.30);
  --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.50), 0 3px 8px  rgba(0,0,0,0.30);
  --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.30);
  --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.60), 0 12px 28px rgba(0,0,0,0.35);
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-preset="editorial"] {
    --wb-primary-soft: rgba(234,88,12,0.20);
    --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.40), 0 1px 3px  rgba(0,0,0,0.30);
    --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.50), 0 3px 8px  rgba(0,0,0,0.30);
    --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.30);
    --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.60), 0 12px 28px rgba(0,0,0,0.35);
  }
}

/* ── Playful ───────────────────────────────────────────────
   Rose · Soft radius · Comfortable · Deep shadows · Inter
   ──────────────────────────────────────────────────────── */
html[data-preset="playful"] {
  /* Color */
  --wb-primary:      #e11d48;
  --wb-primary-dark: #be123c;
  --wb-primary-soft: #ffe4e6;

  /* Radius: soft */
  --wb-r-sm: 8px;
  --wb-r-md: 14px;
  --wb-r-lg: 20px;
  --wb-r-xl: 28px;

  /* Density: comfortable */
  --wb-s1:  0.375rem;
  --wb-s2:  0.75rem;
  --wb-s3:  1rem;
  --wb-s4:  1.25rem;
  --wb-s5:  1.5rem;
  --wb-s6:  2rem;
  --wb-s8:  2.5rem;
  --wb-s10: 3rem;
  --wb-s12: 4rem;
  --wb-s16: 5rem;
  --wb-s20: 6rem;

  /* Shadow: soft */
  --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.08), 0 1px 3px  rgba(0,0,0,0.06);
  --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.12), 0 3px 8px  rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.14), 0 6px 16px rgba(0,0,0,0.06);
  --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.18), 0 12px 28px rgba(0,0,0,0.08);

  /* Font: modern (Inter) */
  --wb-font:         Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-mode="dark"][data-preset="playful"] {
  --wb-primary-soft: rgba(225,29,72,0.20);
  --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.40), 0 1px 3px  rgba(0,0,0,0.30);
  --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.50), 0 3px 8px  rgba(0,0,0,0.30);
  --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.30);
  --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.60), 0 12px 28px rgba(0,0,0,0.35);
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-preset="playful"] {
    --wb-primary-soft: rgba(225,29,72,0.20);
    --wb-shadow-sm: 0 2px 8px  rgba(0,0,0,0.40), 0 1px 3px  rgba(0,0,0,0.30);
    --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.50), 0 3px 8px  rgba(0,0,0,0.30);
    --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.30);
    --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.60), 0 12px 28px rgba(0,0,0,0.35);
  }
}

/* ── Corporate ─────────────────────────────────────────────
   Royal indigo · Sharp · Default density · Flat shadows · System font
   ──────────────────────────────────────────────────────── */
html[data-preset="corporate"] {
  /* Color */
  --wb-primary:      #4f46e5;
  --wb-primary-dark: #4338ca;
  --wb-primary-soft: #e0e7ff;

  /* Radius: sharp */
  --wb-r-sm: 2px;
  --wb-r-md: 4px;
  --wb-r-lg: 6px;
  --wb-r-xl: 10px;

  /* Density: default (tokens.css applies) */

  /* Shadow: flat */
  --wb-shadow-sm: none;
  --wb-shadow-md: 0 1px 2px rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 2px 6px rgba(0,0,0,0.08);
  --wb-shadow-xl: 0 4px 12px rgba(0,0,0,0.10);

  /* Font: system */
  --wb-font:         ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-mode="dark"][data-preset="corporate"] {
  --wb-primary-soft: rgba(79,70,229,0.20);
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-preset="corporate"] {
    --wb-primary-soft: rgba(79,70,229,0.20);
  }
}
/* ============================================================
   WebBlocks UI — Accent Color Schemes  (V2)
   Applied via: html[data-accent="name"]

   Token set per accent:
     --wb-accent            Primary action color
     --wb-accent-hover      Hover state
     --wb-accent-active     Pressed / active state
     --wb-accent-soft       Subtle tinted background
     --wb-accent-softer     Very subtle tinted background
     --wb-accent-border     Tinted border / divider
     --wb-accent-text       Text color on light surface
     --wb-accent-on         Text/icon on accent background
     --wb-accent-ring       Focus ring (full rgb(...) value)
     --wb-accent-ring-rgb   Focus ring components (r g b)
     --wb-accent-selection  ::selection background
     --wb-accent-glow-rgb   Glow / shadow tint components

   Dark mode: html[data-mode="dark"] or html[data-mode="auto"]
   Accents:   ocean | forest | sunset | royal | mint | amber | rose | slate-fire
   ============================================================ */

/* Global ::selection uses the active accent's selection color */
::selection {
  background: var(--wb-accent-selection);
}

/* ── Ocean ──────────────────────────────────────────────── */
html[data-accent="ocean"] {
  --wb-accent:           #118AB2;
  --wb-accent-hover:     #0F7A9D;
  --wb-accent-active:    #0B6482;
  --wb-accent-soft:      #D9F0F7;
  --wb-accent-softer:    #EEF9FC;
  --wb-accent-border:    #9FD4E5;
  --wb-accent-text:      #0A4D63;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(17 138 178);
  --wb-accent-ring-rgb:  17 138 178;
  --wb-accent-selection: #CBEAF4;
  --wb-accent-glow-rgb:  17 138 178;
}
html[data-mode="dark"][data-accent="ocean"] {
  --wb-accent:           #4CC9F0;
  --wb-accent-hover:     #3AB8DF;
  --wb-accent-active:    #2BA3C8;
  --wb-accent-soft:      #0F2530;
  --wb-accent-softer:    #0A1B24;
  --wb-accent-border:    #1E5264;
  --wb-accent-text:      #A8EAFB;
  --wb-accent-on:        #06202A;
  --wb-accent-ring:      rgb(76 201 240);
  --wb-accent-ring-rgb:  76 201 240;
  --wb-accent-selection: #123342;
  --wb-accent-glow-rgb:  76 201 240;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="ocean"] {
    --wb-accent:           #4CC9F0;
    --wb-accent-hover:     #3AB8DF;
    --wb-accent-active:    #2BA3C8;
    --wb-accent-soft:      #0F2530;
    --wb-accent-softer:    #0A1B24;
    --wb-accent-border:    #1E5264;
    --wb-accent-text:      #A8EAFB;
    --wb-accent-on:        #06202A;
    --wb-accent-ring:      rgb(76 201 240);
    --wb-accent-ring-rgb:  76 201 240;
    --wb-accent-selection: #123342;
    --wb-accent-glow-rgb:  76 201 240;
  }
}

/* ── Forest ─────────────────────────────────────────────── */
html[data-accent="forest"] {
  --wb-accent:           #2E8B57;
  --wb-accent-hover:     #27764A;
  --wb-accent-active:    #1F603C;
  --wb-accent-soft:      #DCEFE4;
  --wb-accent-softer:    #F1F8F4;
  --wb-accent-border:    #A9D3B9;
  --wb-accent-text:      #1F5A39;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(46 139 87);
  --wb-accent-ring-rgb:  46 139 87;
  --wb-accent-selection: #CFE6D8;
  --wb-accent-glow-rgb:  46 139 87;
}
html[data-mode="dark"][data-accent="forest"] {
  --wb-accent:           #52B788;
  --wb-accent-hover:     #45A97B;
  --wb-accent-active:    #38966B;
  --wb-accent-soft:      #12241B;
  --wb-accent-softer:    #0C1913;
  --wb-accent-border:    #295542;
  --wb-accent-text:      #BEEFD4;
  --wb-accent-on:        #0A1812;
  --wb-accent-ring:      rgb(82 183 136);
  --wb-accent-ring-rgb:  82 183 136;
  --wb-accent-selection: #173025;
  --wb-accent-glow-rgb:  82 183 136;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="forest"] {
    --wb-accent:           #52B788;
    --wb-accent-hover:     #45A97B;
    --wb-accent-active:    #38966B;
    --wb-accent-soft:      #12241B;
    --wb-accent-softer:    #0C1913;
    --wb-accent-border:    #295542;
    --wb-accent-text:      #BEEFD4;
    --wb-accent-on:        #0A1812;
    --wb-accent-ring:      rgb(82 183 136);
    --wb-accent-ring-rgb:  82 183 136;
    --wb-accent-selection: #173025;
    --wb-accent-glow-rgb:  82 183 136;
  }
}

/* ── Sunset ──────────────────────────────────────────────── */
html[data-accent="sunset"] {
  --wb-accent:           #F97316;
  --wb-accent-hover:     #EA670D;
  --wb-accent-active:    #D45A08;
  --wb-accent-soft:      #FDE6D6;
  --wb-accent-softer:    #FFF3EB;
  --wb-accent-border:    #F7BE97;
  --wb-accent-text:      #9A4410;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(249 115 22);
  --wb-accent-ring-rgb:  249 115 22;
  --wb-accent-selection: #FAD9C3;
  --wb-accent-glow-rgb:  249 115 22;
}
html[data-mode="dark"][data-accent="sunset"] {
  --wb-accent:           #FB923C;
  --wb-accent-hover:     #F28327;
  --wb-accent-active:    #E56F0F;
  --wb-accent-soft:      #2B170C;
  --wb-accent-softer:    #1C1008;
  --wb-accent-border:    #6B381B;
  --wb-accent-text:      #FFD1AB;
  --wb-accent-on:        #2A1407;
  --wb-accent-ring:      rgb(251 146 60);
  --wb-accent-ring-rgb:  251 146 60;
  --wb-accent-selection: #3A1F10;
  --wb-accent-glow-rgb:  251 146 60;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="sunset"] {
    --wb-accent:           #FB923C;
    --wb-accent-hover:     #F28327;
    --wb-accent-active:    #E56F0F;
    --wb-accent-soft:      #2B170C;
    --wb-accent-softer:    #1C1008;
    --wb-accent-border:    #6B381B;
    --wb-accent-text:      #FFD1AB;
    --wb-accent-on:        #2A1407;
    --wb-accent-ring:      rgb(251 146 60);
    --wb-accent-ring-rgb:  251 146 60;
    --wb-accent-selection: #3A1F10;
    --wb-accent-glow-rgb:  251 146 60;
  }
}

/* ── Royal ──────────────────────────────────────────────── */
html[data-accent="royal"] {
  --wb-accent:           #4F46E5;
  --wb-accent-hover:     #4338CA;
  --wb-accent-active:    #3730A3;
  --wb-accent-soft:      #E2E6FF;
  --wb-accent-softer:    #F1F3FF;
  --wb-accent-border:    #B8C1FF;
  --wb-accent-text:      #2F2A8B;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(79 70 229);
  --wb-accent-ring-rgb:  79 70 229;
  --wb-accent-selection: #D9DEFF;
  --wb-accent-glow-rgb:  79 70 229;
}
html[data-mode="dark"][data-accent="royal"] {
  --wb-accent:           #818CF8;
  --wb-accent-hover:     #6F7BF1;
  --wb-accent-active:    #5B67E6;
  --wb-accent-soft:      #15172E;
  --wb-accent-softer:    #0E1020;
  --wb-accent-border:    #31376A;
  --wb-accent-text:      #D7DCFF;
  --wb-accent-on:        #0C0F1C;
  --wb-accent-ring:      rgb(129 140 248);
  --wb-accent-ring-rgb:  129 140 248;
  --wb-accent-selection: #1D2140;
  --wb-accent-glow-rgb:  129 140 248;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="royal"] {
    --wb-accent:           #818CF8;
    --wb-accent-hover:     #6F7BF1;
    --wb-accent-active:    #5B67E6;
    --wb-accent-soft:      #15172E;
    --wb-accent-softer:    #0E1020;
    --wb-accent-border:    #31376A;
    --wb-accent-text:      #D7DCFF;
    --wb-accent-on:        #0C0F1C;
    --wb-accent-ring:      rgb(129 140 248);
    --wb-accent-ring-rgb:  129 140 248;
    --wb-accent-selection: #1D2140;
    --wb-accent-glow-rgb:  129 140 248;
  }
}

/* ── Mint ────────────────────────────────────────────────── */
html[data-accent="mint"] {
  --wb-accent:           #14B8A6;
  --wb-accent-hover:     #0FA594;
  --wb-accent-active:    #0B8A7C;
  --wb-accent-soft:      #D8F4F0;
  --wb-accent-softer:    #ECFBF8;
  --wb-accent-border:    #98DED6;
  --wb-accent-text:      #0D6158;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(20 184 166);
  --wb-accent-ring-rgb:  20 184 166;
  --wb-accent-selection: #C8EEE8;
  --wb-accent-glow-rgb:  20 184 166;
}
html[data-mode="dark"][data-accent="mint"] {
  --wb-accent:           #2DD4BF;
  --wb-accent-hover:     #21C5B0;
  --wb-accent-active:    #18AC9A;
  --wb-accent-soft:      #0D231F;
  --wb-accent-softer:    #081715;
  --wb-accent-border:    #256A61;
  --wb-accent-text:      #BFF8F0;
  --wb-accent-on:        #071513;
  --wb-accent-ring:      rgb(45 212 191);
  --wb-accent-ring-rgb:  45 212 191;
  --wb-accent-selection: #10332E;
  --wb-accent-glow-rgb:  45 212 191;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="mint"] {
    --wb-accent:           #2DD4BF;
    --wb-accent-hover:     #21C5B0;
    --wb-accent-active:    #18AC9A;
    --wb-accent-soft:      #0D231F;
    --wb-accent-softer:    #081715;
    --wb-accent-border:    #256A61;
    --wb-accent-text:      #BFF8F0;
    --wb-accent-on:        #071513;
    --wb-accent-ring:      rgb(45 212 191);
    --wb-accent-ring-rgb:  45 212 191;
    --wb-accent-selection: #10332E;
    --wb-accent-glow-rgb:  45 212 191;
  }
}

/* ── Amber ──────────────────────────────────────────────── */
html[data-accent="amber"] {
  --wb-accent:           #F59E0B;
  --wb-accent-hover:     #E08E07;
  --wb-accent-active:    #C97A04;
  --wb-accent-soft:      #FDECC8;
  --wb-accent-softer:    #FFF7E6;
  --wb-accent-border:    #F4CD82;
  --wb-accent-text:      #8A5A03;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(245 158 11);
  --wb-accent-ring-rgb:  245 158 11;
  --wb-accent-selection: #F8E1B6;
  --wb-accent-glow-rgb:  245 158 11;
}
html[data-mode="dark"][data-accent="amber"] {
  --wb-accent:           #FBBF24;
  --wb-accent-hover:     #F4B10F;
  --wb-accent-active:    #E59D05;
  --wb-accent-soft:      #271B08;
  --wb-accent-softer:    #191205;
  --wb-accent-border:    #6A4F17;
  --wb-accent-text:      #FFE2A0;
  --wb-accent-on:        #221705;
  --wb-accent-ring:      rgb(251 191 36);
  --wb-accent-ring-rgb:  251 191 36;
  --wb-accent-selection: #34250A;
  --wb-accent-glow-rgb:  251 191 36;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="amber"] {
    --wb-accent:           #FBBF24;
    --wb-accent-hover:     #F4B10F;
    --wb-accent-active:    #E59D05;
    --wb-accent-soft:      #271B08;
    --wb-accent-softer:    #191205;
    --wb-accent-border:    #6A4F17;
    --wb-accent-text:      #FFE2A0;
    --wb-accent-on:        #221705;
    --wb-accent-ring:      rgb(251 191 36);
    --wb-accent-ring-rgb:  251 191 36;
    --wb-accent-selection: #34250A;
    --wb-accent-glow-rgb:  251 191 36;
  }
}

/* ── Rose ────────────────────────────────────────────────── */
html[data-accent="rose"] {
  --wb-accent:           #E11D48;
  --wb-accent-hover:     #CD153E;
  --wb-accent-active:    #AE1235;
  --wb-accent-soft:      #F9DCE3;
  --wb-accent-softer:    #FFF1F4;
  --wb-accent-border:    #F0B1C1;
  --wb-accent-text:      #8E1230;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(225 29 72);
  --wb-accent-ring-rgb:  225 29 72;
  --wb-accent-selection: #F5CED9;
  --wb-accent-glow-rgb:  225 29 72;
}
html[data-mode="dark"][data-accent="rose"] {
  --wb-accent:           #FB7185;
  --wb-accent-hover:     #F85E75;
  --wb-accent-active:    #F04462;
  --wb-accent-soft:      #2B1117;
  --wb-accent-softer:    #1B0B0F;
  --wb-accent-border:    #6D2332;
  --wb-accent-text:      #FFD1DA;
  --wb-accent-on:        #250D12;
  --wb-accent-ring:      rgb(251 113 133);
  --wb-accent-ring-rgb:  251 113 133;
  --wb-accent-selection: #39151D;
  --wb-accent-glow-rgb:  251 113 133;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="rose"] {
    --wb-accent:           #FB7185;
    --wb-accent-hover:     #F85E75;
    --wb-accent-active:    #F04462;
    --wb-accent-soft:      #2B1117;
    --wb-accent-softer:    #1B0B0F;
    --wb-accent-border:    #6D2332;
    --wb-accent-text:      #FFD1DA;
    --wb-accent-on:        #250D12;
    --wb-accent-ring:      rgb(251 113 133);
    --wb-accent-ring-rgb:  251 113 133;
    --wb-accent-selection: #39151D;
    --wb-accent-glow-rgb:  251 113 133;
  }
}

/* ── Slate-Fire ──────────────────────────────────────────── */
html[data-accent="slate-fire"] {
  --wb-accent:           #DC2626;
  --wb-accent-hover:     #C51F1F;
  --wb-accent-active:    #A61B1B;
  --wb-accent-soft:      #F7DDDD;
  --wb-accent-softer:    #FFF3F3;
  --wb-accent-border:    #EDB0B0;
  --wb-accent-text:      #8A1919;
  --wb-accent-on:        #FFFFFF;
  --wb-accent-ring:      rgb(220 38 38);
  --wb-accent-ring-rgb:  220 38 38;
  --wb-accent-selection: #F4CFCF;
  --wb-accent-glow-rgb:  220 38 38;
}
html[data-mode="dark"][data-accent="slate-fire"] {
  --wb-accent:           #F87171;
  --wb-accent-hover:     #F35E5E;
  --wb-accent-active:    #E74747;
  --wb-accent-soft:      #2C1212;
  --wb-accent-softer:    #1C0B0B;
  --wb-accent-border:    #6F2828;
  --wb-accent-text:      #FFD1D1;
  --wb-accent-on:        #250D0D;
  --wb-accent-ring:      rgb(248 113 113);
  --wb-accent-ring-rgb:  248 113 113;
  --wb-accent-selection: #391717;
  --wb-accent-glow-rgb:  248 113 113;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"][data-accent="slate-fire"] {
    --wb-accent:           #F87171;
    --wb-accent-hover:     #F35E5E;
    --wb-accent-active:    #E74747;
    --wb-accent-soft:      #2C1212;
    --wb-accent-softer:    #1C0B0B;
    --wb-accent-border:    #6F2828;
    --wb-accent-text:      #FFD1D1;
    --wb-accent-on:        #250D0D;
    --wb-accent-ring:      rgb(248 113 113);
    --wb-accent-ring-rgb:  248 113 113;
    --wb-accent-selection: #391717;
    --wb-accent-glow-rgb:  248 113 113;
  }
}
/* ============================================================
   WebBlocks UI — Radius Axis
   Attribute: html[data-radius="sharp|default|soft"]
   Default (no attribute) = balanced, set in tokens.css
   ============================================================ */

/* Sharp — nearly square corners */
html[data-radius="sharp"] {
  --wb-r-sm:   2px;
  --wb-r-md:   4px;
  --wb-r-lg:   6px;
  --wb-r-xl:   10px;
}

/* Default is defined in tokens.css — no override needed */

/* Soft — pronounced rounded corners */
html[data-radius="soft"] {
  --wb-r-sm:   8px;
  --wb-r-md:   14px;
  --wb-r-lg:   20px;
  --wb-r-xl:   28px;
}
/* ============================================================
   WebBlocks UI — Density Axis
   Attribute: html[data-density="compact|comfortable"]
   Default (no attribute) = comfortable baseline from tokens.css
   ============================================================ */

/* Compact — tighter spacing for data-dense UIs */
html[data-density="compact"] {
  --wb-s1:  0.125rem;  /* 2px  */
  --wb-s2:  0.25rem;   /* 4px  */
  --wb-s3:  0.375rem;  /* 6px  */
  --wb-s4:  0.625rem;  /* 10px */
  --wb-s5:  0.75rem;   /* 12px */
  --wb-s6:  1rem;      /* 16px */
  --wb-s8:  1.25rem;   /* 20px */
  --wb-s10: 1.5rem;    /* 24px */
  --wb-s12: 2rem;      /* 32px */
  --wb-s16: 2.5rem;    /* 40px */
  --wb-s20: 3rem;      /* 48px */
}

/* Default is defined in tokens.css — no override needed */

/* Comfortable — extra generous spacing for spacious UIs */
html[data-density="comfortable"] {
  --wb-s1:  0.375rem;  /* 6px  */
  --wb-s2:  0.75rem;   /* 12px */
  --wb-s3:  1rem;      /* 16px */
  --wb-s4:  1.25rem;   /* 20px */
  --wb-s5:  1.5rem;    /* 24px */
  --wb-s6:  2rem;      /* 32px */
  --wb-s8:  2.5rem;    /* 40px */
  --wb-s10: 3rem;      /* 48px */
  --wb-s12: 4rem;      /* 64px */
  --wb-s16: 5rem;      /* 80px */
  --wb-s20: 6rem;      /* 96px */
}
/* ============================================================
   WebBlocks UI — Shadow Axis
   Attribute: html[data-shadow="flat|soft"]
   Default (no attribute) = subtle shadows from tokens.css
   ============================================================ */

/* Flat — minimal / no shadows for clean, flat designs */
html[data-shadow="flat"] {
  --wb-shadow-sm: none;
  --wb-shadow-md: 0 1px 2px rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 2px 6px rgba(0,0,0,0.08);
  --wb-shadow-xl: 0 4px 12px rgba(0,0,0,0.10);
}

/* Default is defined in tokens.css — no override needed */

/* Soft — pronounced depth and elevated surfaces */
html[data-shadow="soft"] {
  --wb-shadow-sm: 0 2px 8px rgba(0,0,0,0.08),  0 1px 3px rgba(0,0,0,0.06);
  --wb-shadow-md: 0 8px 24px rgba(0,0,0,0.12),  0 3px 8px rgba(0,0,0,0.06);
  --wb-shadow-lg: 0 20px 48px rgba(0,0,0,0.14), 0 6px 16px rgba(0,0,0,0.06);
  --wb-shadow-xl: 0 36px 80px rgba(0,0,0,0.18), 0 12px 28px rgba(0,0,0,0.08);
}
/* ============================================================
   WebBlocks UI — Font Axis
   Attribute: html[data-font="system|modern|editorial"]
   Default (no attribute) = modern (Inter stack) from tokens.css
   ============================================================ */

/* System — OS native fonts, zero external loading */
html[data-font="system"] {
  --wb-font:         ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Modern — Inter (default, matches tokens.css baseline) */
html[data-font="modern"] {
  --wb-font:         Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Editorial — Georgia serif for headings, system sans for body */
html[data-font="editorial"] {
  --wb-font:         ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wb-font-heading: Georgia, "Times New Roman", Times, serif;
}
/* ============================================================
   WebBlocks UI — Border Presets
   Applied via: html[data-border="preset"]
   Controls border width, border style, and surface border color.
   ============================================================ */

/* ── None — borderless ────────────────────────────────────── */
html[data-border="none"] {
  --wb-border: transparent;
}

/* ── Subtle (default-like, very light) ────────────────────── */
html[data-border="subtle"] {
  --wb-border: color-mix(in srgb, var(--wb-text) 8%, transparent);
}

/* ── Medium (slightly more visible) ──────────────────────────*/
html[data-border="medium"] {
  --wb-border: color-mix(in srgb, var(--wb-text) 15%, transparent);
}

/* ── Strong (high contrast) ───────────────────────────────── */
html[data-border="strong"] {
  --wb-border: color-mix(in srgb, var(--wb-text) 28%, transparent);
}

/* ── Accent — primary-colored borders ────────────────────── */
html[data-border="accent"] {
  --wb-border: var(--wb-primary);
}

/* ── Dashed — dashed borders globally ────────────────────── */
html[data-border="dashed"] {
  --wb-border-style: dashed;
}

/* ── CSS custom property for border style ─────────────────── */
:root {
  --wb-border-style: solid;
  --wb-border-width: 1px;
}

/* ── Individual border width utilities ────────────────────── */

.wb-border        { border: var(--wb-border-width) var(--wb-border-style) var(--wb-border); }
.wb-border-t      { border-top:    var(--wb-border-width) var(--wb-border-style) var(--wb-border); }
.wb-border-b      { border-bottom: var(--wb-border-width) var(--wb-border-style) var(--wb-border); }
.wb-border-l      { border-left:   var(--wb-border-width) var(--wb-border-style) var(--wb-border); }
.wb-border-r      { border-right:  var(--wb-border-width) var(--wb-border-style) var(--wb-border); }
.wb-border-none   { border: none; }

/* ── Border width scale ───────────────────────────────────── */

.wb-border-1 { --wb-border-width: 1px; }
.wb-border-2 { --wb-border-width: 2px; }
.wb-border-4 { --wb-border-width: 4px; }

/* ── Border style utilities ───────────────────────────────── */

.wb-border-solid  { --wb-border-style: solid; }
.wb-border-dashed { --wb-border-style: dashed; }
.wb-border-dotted { --wb-border-style: dotted; }

/* ── Border color utilities ───────────────────────────────── */

.wb-border-primary { border-color: var(--wb-primary); }
.wb-border-success { border-color: var(--wb-success); }
.wb-border-warning { border-color: var(--wb-warning); }
.wb-border-danger  { border-color: var(--wb-danger);  }
.wb-border-info    { border-color: var(--wb-info);    }
.wb-border-muted   { border-color: var(--wb-muted);   }
/* ============================================================
   WebBlocks UI — Minimal Reset
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  margin: 0;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  display: inline-block;
  max-width: 100%;
}

svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}
/* ============================================================
   WebBlocks UI — Base Element Styles
   Raw HTML should already look good without any class.
   ============================================================ */

body {
  font-family: var(--wb-font);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--wb-bg);
  color: var(--wb-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Headings ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--wb-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* ── Paragraph & inline ───────────────────────────────────── */
p {
  max-width: 70ch;
  color: var(--wb-text);
}

a {
  color: var(--wb-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

strong, b { font-weight: 700; }
em, i     { font-style: italic; }

small { font-size: 0.875em; }

code, kbd, samp, pre {
  font-family: var(--wb-font-mono);
  font-size: 0.875em;
}

code {
  background: var(--wb-surface-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-sm);
  padding: 0.15em 0.4em;
  color: var(--wb-danger);
}

pre {
  background: var(--wb-surface-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  padding: var(--wb-s4);
  overflow-x: auto;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 3px solid var(--wb-primary);
  padding: var(--wb-s2) var(--wb-s4);
  color: var(--wb-muted);
  background: var(--wb-primary-soft);
  border-radius: 0 var(--wb-r-md) var(--wb-r-md) 0;
}

/* ── Lists ────────────────────────────────────────────────── */
ul.wb-list, ol.wb-list {
  list-style: revert;
  padding-left: var(--wb-s6);
  display: grid;
  gap: var(--wb-s1);
}

/* ── Horizontal rule ──────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: var(--wb-s6) 0;
}

/* ── Table ────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: var(--wb-s3) var(--wb-s4);
  text-align: left;
  border-bottom: 1px solid var(--wb-border);
}

th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-muted);
  background: var(--wb-surface-2);
}

/* ── Images ───────────────────────────────────────────────── */
img {
  height: auto;
}

/* ── Form elements (unstyled base, wb-* classes add styling) ─ */
input, textarea, select {
  color: var(--wb-text);
  background: var(--wb-surface);
}

input::placeholder,
textarea::placeholder {
  color: var(--wb-muted);
  opacity: 1;
}

/* ── Focus ring ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: 2px;
}
/* ============================================================
   WebBlocks UI — Button (wb-btn)
   ============================================================ */

.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wb-s2);
  padding: 0.5em 1.1em;
  border: 1px solid transparent;
  border-radius: var(--wb-r-md);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background var(--wb-t),
    border-color var(--wb-t),
    color var(--wb-t),
    box-shadow var(--wb-t),
    transform var(--wb-t-f);
  -webkit-appearance: none;
}

.wb-btn:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: 3px;
}

.wb-btn:active {
  transform: translateY(1px);
}

.wb-btn:disabled,
.wb-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Variants ─────────────────────────────────────────────── */

.wb-btn-primary {
  background: var(--wb-primary);
  color: #fff;
  border-color: var(--wb-primary);
}
.wb-btn-primary:hover {
  background: var(--wb-primary-dark);
  border-color: var(--wb-primary-dark);
  text-decoration: none;
  color: #fff;
}

.wb-btn-secondary {
  background: var(--wb-surface);
  color: var(--wb-text);
  border-color: var(--wb-border);
}
.wb-btn-secondary:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-btn-ghost {
  background: transparent;
  color: var(--wb-text);
  border-color: transparent;
}
.wb-btn-ghost:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-btn-outline {
  background: transparent;
  color: var(--wb-primary);
  border-color: var(--wb-primary);
}
.wb-btn-outline:hover {
  background: var(--wb-primary-soft);
  text-decoration: none;
  color: var(--wb-primary);
}

.wb-btn-danger {
  background: var(--wb-danger);
  color: #fff;
  border-color: var(--wb-danger);
}
.wb-btn-danger:hover {
  background: var(--wb-danger-dark);
  border-color: var(--wb-danger-dark);
  text-decoration: none;
  color: #fff;
}

.wb-btn-success {
  background: var(--wb-success);
  color: #fff;
  border-color: var(--wb-success);
}
.wb-btn-success:hover {
  background: var(--wb-success-dark);
  border-color: var(--wb-success-dark);
  text-decoration: none;
  color: #fff;
}

/* ── Sizes ────────────────────────────────────────────────── */

.wb-btn-sm {
  font-size: 0.8rem;
  padding: 0.35em 0.8em;
  border-radius: var(--wb-r-sm);
  gap: var(--wb-s1);
}

.wb-btn-lg {
  font-size: 1rem;
  padding: 0.65em 1.4em;
  border-radius: var(--wb-r-lg);
}

/* ── Icon-only ────────────────────────────────────────────── */
.wb-btn-icon {
  padding: 0.5em;
  aspect-ratio: 1 / 1;
}
.wb-btn-icon.wb-btn-sm { padding: 0.35em; }
.wb-btn-icon.wb-btn-lg { padding: 0.65em; }

/* ── Group ────────────────────────────────────────────────── */
.wb-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-s2);
}

.wb-btn-group-join {
  display: flex;
  align-items: center;
}
.wb-btn-group-join .wb-btn {
  border-radius: 0;
}
.wb-btn-group-join .wb-btn:first-child {
  border-radius: var(--wb-r-md) 0 0 var(--wb-r-md);
}
.wb-btn-group-join .wb-btn:last-child {
  border-radius: 0 var(--wb-r-md) var(--wb-r-md) 0;
}
.wb-btn-group-join .wb-btn + .wb-btn {
  margin-left: -1px;
}
/* ============================================================
   WebBlocks UI — Badge (wb-badge)
   ============================================================ */

.wb-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s1);
  padding: 0.25em 0.65em;
  border-radius: var(--wb-r-full);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: var(--wb-surface-2);
  color: var(--wb-muted);
  border: 1px solid var(--wb-border);
}

/* ── Variants ─────────────────────────────────────────────── */

.wb-badge-primary {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
  border-color: transparent;
}

.wb-badge-success {
  background: var(--wb-success-soft);
  color: var(--wb-success);
  border-color: transparent;
}

.wb-badge-warning {
  background: var(--wb-warning-soft);
  color: var(--wb-warning);
  border-color: transparent;
}

.wb-badge-danger {
  background: var(--wb-danger-soft);
  color: var(--wb-danger);
  border-color: transparent;
}

.wb-badge-info {
  background: var(--wb-info-soft);
  color: var(--wb-info);
  border-color: transparent;
}

/* ── Dot indicator ────────────────────────────────────────── */
.wb-badge-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--wb-r-full);
  background: currentColor;
  flex-shrink: 0;
}

/* ── Sizes ────────────────────────────────────────────────── */
.wb-badge-lg {
  font-size: 0.875rem;
  padding: 0.35em 0.85em;
}
/* ============================================================
   WebBlocks UI — Card (wb-card)
   ============================================================ */

.wb-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  box-shadow: var(--wb-shadow-sm);
  overflow: hidden;
}

.wb-card-header {
  padding: var(--wb-s4) var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s3);
}

.wb-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--wb-text);
  margin: 0;
}

.wb-card-body {
  padding: var(--wb-s5);
}

.wb-card-footer {
  padding: var(--wb-s3) var(--wb-s5);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
}

/* ── Shorthand: card without header/footer structure ─────── */
.wb-card > .wb-card-body:only-child {
  padding: var(--wb-s5);
}

/* ── Flat card (no shadow) ────────────────────────────────── */
.wb-card-flat {
  box-shadow: none;
}

/* ── Highlighted card ─────────────────────────────────────── */
.wb-card-highlight {
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 1px var(--wb-primary), var(--wb-shadow-sm);
}

/* ── Stat / KPI card ──────────────────────────────────────── */
.wb-stat {
  display: flex;
  flex-direction: column;
  gap: var(--wb-s2);
  padding: var(--wb-s5);
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  box-shadow: var(--wb-shadow-sm);
}

.wb-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-muted);
}

.wb-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--wb-text);
  line-height: 1;
}

.wb-stat-delta {
  font-size: 0.8rem;
  font-weight: 500;
}
.wb-stat-delta-up   { color: var(--wb-success); }
.wb-stat-delta-down { color: var(--wb-danger); }

/* ── Backward-compat aliases ──────────────────────────────── */
.wb-stat-meta  { font-size: 0.8rem; font-weight: 500; color: var(--wb-muted); }
.wb-stat-up    { color: var(--wb-success); font-size: 0.8rem; font-weight: 500; }
.wb-stat-down  { color: var(--wb-danger);  font-size: 0.8rem; font-weight: 500; }
.wb-stat-bar   { margin-top: var(--wb-s3); }
/* ============================================================
   WebBlocks UI — Alert (wb-alert)
   ============================================================ */

.wb-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--wb-s3);
  padding: var(--wb-s3) var(--wb-s4);
  border-radius: var(--wb-r-lg);
  border: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
  color: var(--wb-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.wb-alert-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1em;
}

.wb-alert-title {
  font-weight: 600;
  margin-bottom: var(--wb-s1);
  display: block;
}

/* ── Variants ─────────────────────────────────────────────── */

.wb-alert-info {
  background: var(--wb-info-soft);
  border-color: transparent;
  color: var(--wb-info-dark);
}
html[data-mode="dark"] .wb-alert-info,
html[data-theme="auto"]:not([data-mode="light"]) .wb-alert-info {
  color: #7dd3fc;
}

.wb-alert-success {
  background: var(--wb-success-soft);
  border-color: transparent;
  color: var(--wb-success-dark);
}
html[data-mode="dark"] .wb-alert-success,
html[data-theme="auto"]:not([data-mode="light"]) .wb-alert-success {
  color: #86efac;
}

.wb-alert-warning {
  background: var(--wb-warning-soft);
  border-color: transparent;
  color: var(--wb-warning-dark);
}
html[data-mode="dark"] .wb-alert-warning,
html[data-theme="auto"]:not([data-mode="light"]) .wb-alert-warning {
  color: #fed7aa;
}

.wb-alert-danger {
  background: var(--wb-danger-soft);
  border-color: transparent;
  color: var(--wb-danger-dark);
}
html[data-mode="dark"] .wb-alert-danger,
html[data-theme="auto"]:not([data-mode="light"]) .wb-alert-danger {
  color: #fca5a5;
}

/* ── Dismissible ──────────────────────────────────────────── */
.wb-alert-dismiss {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wb-alert-close {
  flex-shrink: 0;
  margin-left: auto;
  padding: var(--wb-s1);
  border-radius: var(--wb-r-sm);
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  font-size: 1rem;
  transition: opacity var(--wb-t);
}
.wb-alert-close:hover { opacity: 1; }

/* ── Dismiss animation ────────────────────────────────────── */
.wb-alert.is-leaving {
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}
/* ============================================================
   WebBlocks UI — Form Elements
   (wb-input, wb-select, wb-textarea, wb-checkbox, wb-radio,
    wb-switch, wb-label, wb-field, wb-form-row)
   ============================================================ */

/* ── Label ────────────────────────────────────────────────── */
.wb-label {
  display: flex;
  flex-direction: column;
  gap: var(--wb-s1);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wb-text);
}

.wb-label-hint {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--wb-muted);
}

/* ── Field (label + input + hint) ────────────────────────── */
.wb-field {
  display: grid;
  gap: var(--wb-s2);
}

.wb-field-hint {
  font-size: 0.8rem;
  color: var(--wb-muted);
}

.wb-field-error {
  font-size: 0.8rem;
  color: var(--wb-danger);
  font-weight: 500;
}

/* ── Text inputs ──────────────────────────────────────────── */
.wb-input,
.wb-select,
.wb-textarea {
  width: 100%;
  padding: 0.55em 0.85em;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-md);
  background: var(--wb-surface);
  color: var(--wb-text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color var(--wb-t), box-shadow var(--wb-t);
  outline: none;
}

.wb-input::placeholder,
.wb-textarea::placeholder {
  color: var(--wb-muted);
  opacity: 1;
}

.wb-input:focus,
.wb-select:focus,
.wb-textarea:focus {
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px var(--wb-primary-soft);
}

.wb-input:disabled,
.wb-select:disabled,
.wb-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--wb-surface-2);
}

.wb-input-error,
.wb-select-error,
.wb-textarea-error {
  border-color: var(--wb-danger);
}
.wb-input-error:focus,
.wb-select-error:focus,
.wb-textarea-error:focus {
  border-color: var(--wb-danger);
  box-shadow: 0 0 0 3px var(--wb-danger-soft);
}

/* ── Textarea ─────────────────────────────────────────────── */
.wb-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ── Select ───────────────────────────────────────────────── */
.wb-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6a84' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85em center;
  padding-right: 2.2em;
}

/* ── Input sizes ──────────────────────────────────────────── */
.wb-input-sm, .wb-select-sm { font-size: 0.8rem; padding: 0.4em 0.7em; }
.wb-input-lg, .wb-select-lg { font-size: 1rem;   padding: 0.65em 1em; }

/* ── Checkbox & Radio ─────────────────────────────────────── */
.wb-check,
.wb-radio {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--wb-text);
  user-select: none;
}

.wb-check input[type="checkbox"],
.wb-radio input[type="radio"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--wb-primary);
  cursor: pointer;
}

/* ── Switch ───────────────────────────────────────────────── */
.wb-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s2);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--wb-text);
  user-select: none;
}

.wb-switch-track {
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  background: var(--wb-border);
  border-radius: var(--wb-r-full);
  transition: background var(--wb-t);
  flex-shrink: 0;
}

.wb-switch-track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: var(--wb-r-full);
  background: #fff;
  box-shadow: var(--wb-shadow-sm);
  transition: transform var(--wb-t);
}

.wb-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wb-switch input:checked + .wb-switch-track {
  background: var(--wb-primary);
}
.wb-switch input:checked + .wb-switch-track::after {
  transform: translateX(1.05rem);
}
.wb-switch input:focus-visible + .wb-switch-track {
  outline: 2px solid var(--wb-primary);
  outline-offset: 2px;
}

/* ── Input with icon ──────────────────────────────────────── */
.wb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.wb-input-wrap .wb-input {
  padding-left: 2.2em;
}
.wb-input-wrap .wb-input-icon {
  position: absolute;
  left: 0.75em;
  color: var(--wb-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.wb-input-wrap .wb-input-suffix {
  position: absolute;
  right: 0.75em;
  color: var(--wb-muted);
  display: flex;
  align-items: center;
}

/* ── Form row (two-column) ────────────────────────────────── */
.wb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wb-s4);
}
@media (max-width: 600px) {
  .wb-form-row { grid-template-columns: 1fr; }
}

/* ── Form group (label + fields in a row) ─────────────────── */
.wb-form-group {
  display: grid;
  gap: var(--wb-s4);
}
/* ============================================================
   WebBlocks UI — Table (wb-table)
   ============================================================ */

/* ── Wrapper (for scrolling on small screens) ─────────────── */
.wb-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  background: var(--wb-surface);
}

.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wb-table th,
.wb-table td {
  padding: var(--wb-s3) var(--wb-s4);
  text-align: left;
  border-bottom: 1px solid var(--wb-border);
  vertical-align: middle;
  white-space: nowrap;
}

.wb-table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wb-muted);
  background: var(--wb-surface-2);
  white-space: nowrap;
}

.wb-table thead th:first-child { border-radius: var(--wb-r-lg) 0 0 0; }
.wb-table thead th:last-child  { border-radius: 0 var(--wb-r-lg) 0 0; }

.wb-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Hover rows ───────────────────────────────────────────── */
.wb-table-hover tbody tr:hover td {
  background: var(--wb-surface-2);
}

/* ── Striped rows ─────────────────────────────────────────── */
.wb-table-striped tbody tr:nth-child(even) td {
  background: var(--wb-surface-2);
}

/* ── Condensed ────────────────────────────────────────────── */
.wb-table-sm th,
.wb-table-sm td {
  padding: var(--wb-s2) var(--wb-s3);
}

/* ── Sortable header ──────────────────────────────────────── */
.wb-table th[data-wb-sort] {
  cursor: pointer;
  user-select: none;
}
.wb-table th[data-wb-sort]:hover {
  color: var(--wb-text);
}

/* ── Toolbar above table ──────────────────────────────────── */
.wb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-wrap: wrap;
  padding: var(--wb-s3) var(--wb-s4);
  border-bottom: 1px solid var(--wb-border);
  background: var(--wb-surface);
}

.wb-toolbar-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-right: auto;
}

/* ── Filter row ───────────────────────────────────────────── */
.wb-filter-row {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-wrap: wrap;
  padding: var(--wb-s3) var(--wb-s4);
  border-bottom: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
}

.wb-filter-row .wb-input,
.wb-filter-row .wb-select {
  max-width: 220px;
}
/* ============================================================
   WebBlocks UI — Modal (wb-modal)
   JS: data-wb-toggle="modal" data-wb-target="#id"
       data-wb-dismiss="modal"  (close trigger)
   ============================================================ */

.wb-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--wb-z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--wb-s4);
}

.wb-modal.is-open {
  display: flex;
}

.wb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.wb-modal-dialog {
  position: relative;
  z-index: 1;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-xl);
  box-shadow: var(--wb-shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2 * var(--wb-s4));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wb-modal-in 0.18s ease;
}

@keyframes wb-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.wb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s3);
  padding: var(--wb-s4) var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
}

.wb-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.wb-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--wb-r-md);
  color: var(--wb-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--wb-t), color var(--wb-t);
}
.wb-modal-close:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

.wb-modal-body {
  padding: var(--wb-s5);
  overflow-y: auto;
  flex: 1;
}

.wb-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--wb-s2);
  padding: var(--wb-s3) var(--wb-s5);
  border-top: 1px solid var(--wb-border);
  flex-shrink: 0;
  background: var(--wb-surface-2);
}

/* ── Sizes ────────────────────────────────────────────────── */
.wb-modal-sm .wb-modal-dialog { max-width: 380px; }
.wb-modal-lg .wb-modal-dialog { max-width: 720px; }
.wb-modal-xl .wb-modal-dialog { max-width: 960px; }

/* ── Confirmation dialog ──────────────────────────────────── */

.wb-confirm .wb-modal-dialog {
  max-width: 420px;
  text-align: center;
}

.wb-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--wb-r-full);
  margin: 0 auto var(--wb-s4);
  font-size: 1.5rem;
}

.wb-confirm-icon-danger {
  background: var(--wb-danger-soft);
  color: var(--wb-danger);
}

.wb-confirm-icon-warning {
  background: var(--wb-warning-soft);
  color: var(--wb-warning);
}

.wb-confirm-icon-info {
  background: var(--wb-info-soft);
  color: var(--wb-info);
}

.wb-confirm-icon-success {
  background: var(--wb-success-soft);
  color: var(--wb-success);
}

.wb-confirm-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wb-text);
  margin: 0 0 var(--wb-s2);
}

.wb-confirm-message {
  font-size: 0.875rem;
  color: var(--wb-muted);
  line-height: 1.6;
  margin: 0;
}

.wb-confirm .wb-modal-footer {
  justify-content: center;
  gap: var(--wb-s3);
}
/* ============================================================
   WebBlocks UI — Dropdown (wb-dropdown)
   JS: data-wb-dropdown on container; auto-closes on outside click / Escape
   ============================================================ */

.wb-dropdown {
  position: relative;
  display: inline-block;
}

.wb-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--wb-s1));
  left: 0;
  z-index: var(--wb-z-dropdown);
  min-width: 200px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  box-shadow: var(--wb-shadow-lg);
  padding: var(--wb-s1) 0;
  animation: wb-dropdown-in 0.12s ease;
}

.wb-dropdown.is-open .wb-dropdown-menu {
  display: block;
}

@keyframes wb-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.wb-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  padding: var(--wb-s2) var(--wb-s4);
  font-size: 0.9rem;
  color: var(--wb-text);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--wb-t-f);
}
.wb-dropdown-item:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}
.wb-dropdown-item:focus-visible {
  background: var(--wb-primary-soft);
  outline: none;
}

.wb-dropdown-item-danger {
  color: var(--wb-danger);
}
.wb-dropdown-item-danger:hover {
  background: var(--wb-danger-soft);
}

.wb-dropdown-divider {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: var(--wb-s1) 0;
}

.wb-dropdown-label {
  padding: var(--wb-s1) var(--wb-s4);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wb-muted);
}

/* ── Right-align ──────────────────────────────────────────── */
.wb-dropdown-end .wb-dropdown-menu {
  left: auto;
  right: 0;
}

/* ── Backward-compat alias ────────────────────────────────── */
.wb-dropdown-menu-end {
  left: auto;
  right: 0;
}
/* ============================================================
   WebBlocks UI — Tabs (wb-tabs)
   JS: data-wb-tab="panel-id" on buttons, panels have matching id
   ============================================================ */

.wb-tabs {
  display: flex;
  flex-direction: column;
}

.wb-tabs-nav {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 2px solid var(--wb-border);
  overflow-x: auto;
}

.wb-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s1);
  padding: var(--wb-s2) var(--wb-s4);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  color: var(--wb-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--wb-t), border-color var(--wb-t);
}

.wb-tab:hover {
  color: var(--wb-text);
}

.wb-tab.is-active {
  color: var(--wb-primary);
  border-bottom-color: var(--wb-primary);
}

.wb-tab:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: -2px;
}

.wb-tab-panel {
  display: none;
  padding: var(--wb-s5) 0;
}

.wb-tab-panel.is-active {
  display: block;
}

/* ── Pill variant ─────────────────────────────────────────── */
.wb-tabs-pills .wb-tabs-nav {
  border-bottom: none;
  gap: var(--wb-s1);
  padding: var(--wb-s2);
  background: var(--wb-surface-2);
  border-radius: var(--wb-r-lg);
}

.wb-tabs-pills .wb-tab {
  border-bottom: none;
  border-radius: var(--wb-r-md);
  padding: var(--wb-s2) var(--wb-s3);
  margin: 0;
}

.wb-tabs-pills .wb-tab.is-active {
  background: var(--wb-surface);
  color: var(--wb-primary);
  box-shadow: var(--wb-shadow-sm);
}

.wb-tabs-pills .wb-tab-panel {
  padding-top: var(--wb-s4);
}
/* ============================================================
   WebBlocks UI — Accordion (wb-accordion)
   JS: data-wb-accordion-trigger on buttons
   ============================================================ */

.wb-accordion {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  overflow: hidden;
}

.wb-accordion-item {
  border-bottom: 1px solid var(--wb-border);
}
.wb-accordion-item:last-child {
  border-bottom: none;
}

.wb-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--wb-s4) var(--wb-s5);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wb-text);
  text-align: left;
  gap: var(--wb-s3);
  transition: background var(--wb-t);
}

.wb-accordion-trigger:hover {
  background: var(--wb-surface-2);
}

.wb-accordion-trigger:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: -2px;
}

.wb-accordion-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  transition: transform var(--wb-t);
  color: var(--wb-muted);
}

.wb-accordion-item.is-open .wb-accordion-icon {
  transform: rotate(180deg);
}

.wb-accordion-content {
  display: none;
  padding: 0 var(--wb-s5) var(--wb-s5);
  font-size: 0.9rem;
  color: var(--wb-muted);
  line-height: 1.7;
}

.wb-accordion-item.is-open .wb-accordion-content {
  display: block;
}

/* ── Flush (no border, separated items) ──────────────────── */
.wb-accordion-flush {
  border: none;
  border-radius: 0;
}
.wb-accordion-flush .wb-accordion-item {
  border-bottom: 1px solid var(--wb-border);
  border-radius: 0;
}
.wb-accordion-flush .wb-accordion-item:last-child {
  border-bottom: none;
}
/* ============================================================
   WebBlocks UI — Pagination (wb-pagination)
   ============================================================ */

.wb-pagination {
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
  flex-wrap: wrap;
}

.wb-page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 var(--wb-s2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wb-text);
  text-decoration: none;
  background: var(--wb-surface);
  cursor: pointer;
  transition: background var(--wb-t), border-color var(--wb-t), color var(--wb-t);
  user-select: none;
}

.wb-page-item:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-page-item.is-active {
  background: var(--wb-primary);
  border-color: var(--wb-primary);
  color: #fff;
  cursor: default;
}

.wb-page-item.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.wb-page-item:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: 2px;
}

/* ── Simple prev/next ─────────────────────────────────────── */
.wb-pagination-info {
  font-size: 0.875rem;
  color: var(--wb-muted);
  margin-left: auto;
}
/* ============================================================
   WebBlocks UI — Breadcrumb (wb-breadcrumb)
   ============================================================ */

.wb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.875rem;
  color: var(--wb-muted);
  list-style: none;
  padding: 0;
  margin: 0;
}

.wb-breadcrumb-item {
  display: flex;
  align-items: center;
}

.wb-breadcrumb-item + .wb-breadcrumb-item::before {
  content: "/";
  margin: 0 var(--wb-s2);
  color: var(--wb-border);
  font-weight: 400;
}

.wb-breadcrumb-item a {
  color: var(--wb-muted);
  text-decoration: none;
  transition: color var(--wb-t);
}
.wb-breadcrumb-item a:hover {
  color: var(--wb-text);
  text-decoration: underline;
}

.wb-breadcrumb-item.is-active {
  color: var(--wb-text);
  font-weight: 500;
}
/* ============================================================
   WebBlocks UI — Avatar (wb-avatar)
   ============================================================ */

.wb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--wb-r-full);
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
}

.wb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--wb-r-full);
  display: block;
}

/* ── Sizes ────────────────────────────────────────────────── */
.wb-avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.72rem; }
.wb-avatar-lg { width: 3.5rem;  height: 3.5rem;  font-size: 1.1rem;  }
.wb-avatar-xl { width: 5rem;    height: 5rem;    font-size: 1.5rem;  }

/* ── Color variants ───────────────────────────────────────── */
.wb-avatar-success { background: var(--wb-success-soft); color: var(--wb-success); }
.wb-avatar-warning { background: var(--wb-warning-soft); color: var(--wb-warning); }
.wb-avatar-danger  { background: var(--wb-danger-soft);  color: var(--wb-danger);  }
.wb-avatar-info    { background: var(--wb-info-soft);    color: var(--wb-info);    }
.wb-avatar-muted   { background: var(--wb-surface-3);    color: var(--wb-muted);   }

/* ── Avatar group (stacked) ───────────────────────────────── */
.wb-avatar-group {
  display: flex;
  align-items: center;
}
.wb-avatar-group .wb-avatar {
  border: 2px solid var(--wb-surface);
  margin-left: -0.6rem;
}
.wb-avatar-group .wb-avatar:first-child {
  margin-left: 0;
}
/* ============================================================
   WebBlocks UI — Toast / Notification (wb-toast)
   JS: WB.toast(message, type) or manual .is-visible toggle
   ============================================================ */

.wb-toast-container {
  position: fixed;
  bottom: var(--wb-s6);
  right: var(--wb-s6);
  z-index: var(--wb-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--wb-s2);
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 2 * var(--wb-s6));
}

.wb-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--wb-s3);
  padding: var(--wb-s3) var(--wb-s4);
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  box-shadow: var(--wb-shadow-lg);
  pointer-events: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: wb-toast-in 0.22s ease;
}

@keyframes wb-toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0);    }
}

.wb-toast.is-leaving {
  animation: wb-toast-out 0.18s ease forwards;
}

@keyframes wb-toast-out {
  to { opacity: 0; transform: translateX(24px); height: 0; padding: 0; margin: 0; }
}

.wb-toast-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1em;
}

.wb-toast-body {
  flex: 1;
}

.wb-toast-title {
  font-weight: 600;
  display: block;
  margin-bottom: 0.15em;
}

.wb-toast-close {
  flex-shrink: 0;
  padding: var(--wb-s1);
  border-radius: var(--wb-r-sm);
  background: none;
  border: none;
  color: var(--wb-muted);
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity var(--wb-t);
}
.wb-toast-close:hover { opacity: 1; }

/* ── Variants ─────────────────────────────────────────────── */
.wb-toast-success { border-left: 3px solid var(--wb-success); }
.wb-toast-warning { border-left: 3px solid var(--wb-warning); }
.wb-toast-danger  { border-left: 3px solid var(--wb-danger);  }
.wb-toast-info    { border-left: 3px solid var(--wb-info);    }

/* ── Notification stack positions ────────────────────────────
   Default is bottom-right. Use modifier classes to reposition.
   ──────────────────────────────────────────────────────────── */

/* Top-right */
.wb-toast-container-top-right {
  top: var(--wb-s6);
  bottom: auto;
  right: var(--wb-s6);
  left: auto;
}
.wb-toast-container-top-right .wb-toast {
  animation: wb-toast-in-top 0.22s ease;
}
@keyframes wb-toast-in-top {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* Top-center */
.wb-toast-container-top-center {
  top: var(--wb-s6);
  bottom: auto;
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}
.wb-toast-container-top-center .wb-toast {
  animation: wb-toast-in-top 0.22s ease;
}

/* Bottom-center */
.wb-toast-container-bottom-center {
  bottom: var(--wb-s6);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* Top-left */
.wb-toast-container-top-left {
  top: var(--wb-s6);
  bottom: auto;
  right: auto;
  left: var(--wb-s6);
}
.wb-toast-container-top-left .wb-toast {
  animation: wb-toast-in-left 0.22s ease;
}
@keyframes wb-toast-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Bottom-left */
.wb-toast-container-bottom-left {
  bottom: var(--wb-s6);
  right: auto;
  left: var(--wb-s6);
}
.wb-toast-container-bottom-left .wb-toast {
  animation: wb-toast-in-left 0.22s ease;
}
/* ============================================================
   WebBlocks UI — Skeleton Loader (wb-skeleton)
   ============================================================ */

@keyframes wb-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.wb-skeleton {
  display: inline-block;
  width: 100%;
  height: 1em;
  border-radius: var(--wb-r-sm);
  background: linear-gradient(
    90deg,
    var(--wb-surface-2) 25%,
    var(--wb-surface-3) 50%,
    var(--wb-surface-2) 75%
  );
  background-size: 800px 100%;
  animation: wb-shimmer 1.5s infinite linear;
}

/* ── Common shapes ────────────────────────────────────────── */
.wb-skeleton-text   { height: 0.9em; border-radius: var(--wb-r-sm); }
.wb-skeleton-title  { height: 1.4em; width: 60%; border-radius: var(--wb-r-sm); }
.wb-skeleton-circle { border-radius: var(--wb-r-full); aspect-ratio: 1 / 1; }
.wb-skeleton-rect   { border-radius: var(--wb-r-lg); }

/* ── Skeleton card ────────────────────────────────────────── */
.wb-skeleton-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  padding: var(--wb-s5);
  display: grid;
  gap: var(--wb-s3);
}
/* ============================================================
   WebBlocks UI — Empty State (wb-empty)
   ============================================================ */

.wb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--wb-s16) var(--wb-s8);
  gap: var(--wb-s3);
  color: var(--wb-muted);
}

.wb-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--wb-border);
  margin-bottom: var(--wb-s2);
}

.wb-empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--wb-text);
  margin: 0;
}

.wb-empty-text {
  font-size: 0.9rem;
  max-width: 340px;
  line-height: 1.6;
  margin: 0;
}

.wb-empty-action {
  margin-top: var(--wb-s2);
}

/* ── Compact (inside table / list) ───────────────────────── */
.wb-empty-sm {
  padding: var(--wb-s8) var(--wb-s4);
}
.wb-empty-sm .wb-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
}
/* ============================================================
   WebBlocks UI — Nav Group (wb-nav-group)
   Collapsible navigation sections for sidebar and standalone menus.
   JS: data-wb-nav-group on container; triggers toggle on header click.
   ============================================================ */

/* ── Nav group wrapper ────────────────────────────────────── */

.wb-nav-group {
  display: flex;
  flex-direction: column;
}

/* ── Group toggle (clickable header) ──────────────────────── */

.wb-nav-group-toggle {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: 0.45em var(--wb-s3);
  border-radius: var(--wb-r-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wb-muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition:
    background var(--wb-t),
    color var(--wb-t);
  white-space: nowrap;
  overflow: hidden;
  font: inherit;
}

.wb-nav-group-toggle:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

.wb-nav-group-toggle.is-active {
  color: var(--wb-primary);
}

/* ── Toggle icon (chevron) ────────────────────────────────── */

.wb-nav-group-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}

.wb-nav-group-label {
  flex: 1;
}

.wb-nav-group-arrow {
  margin-left: auto;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  opacity: 0.5;
  transition: transform var(--wb-t);
  /* SVG arrow via background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235a6a84' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* ── Open state: rotate arrow ─────────────────────────────── */

.wb-nav-group.is-open > .wb-nav-group-toggle .wb-nav-group-arrow {
  transform: rotate(180deg);
}

/* ── Sub-items panel ──────────────────────────────────────── */

.wb-nav-group-items {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: calc(var(--wb-s3) + 1.2em + var(--wb-s3));
  padding-top: var(--wb-s1);
  padding-bottom: var(--wb-s1);
}

.wb-nav-group.is-open > .wb-nav-group-items {
  display: flex;
}

/* ── Sub-item links ───────────────────────────────────────── */

.wb-nav-group-item {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  padding: 0.35em var(--wb-s3);
  border-radius: var(--wb-r-md);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--wb-muted);
  text-decoration: none;
  transition:
    background var(--wb-t),
    color var(--wb-t);
  white-space: nowrap;
  overflow: hidden;
}

.wb-nav-group-item:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
  text-decoration: none;
}

.wb-nav-group-item.is-active {
  color: var(--wb-primary);
  font-weight: 600;
}

/* ── Nested badge ─────────────────────────────────────────── */

.wb-nav-group-item .wb-nav-group-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--wb-surface-2);
  color: var(--wb-muted);
  padding: 0.1em 0.5em;
  border-radius: var(--wb-r-full);
  flex-shrink: 0;
}

/* ── Standalone menu (not inside sidebar) ─────────────────── */

.wb-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--wb-s1) 0;
}

.wb-menu-item {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: 0.45em var(--wb-s3);
  border-radius: var(--wb-r-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wb-text);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  transition:
    background var(--wb-t),
    color var(--wb-t);
}

.wb-menu-item:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-menu-item.is-active {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
  font-weight: 600;
}

.wb-menu-item-danger {
  color: var(--wb-danger);
}
.wb-menu-item-danger:hover {
  background: var(--wb-danger-soft);
  color: var(--wb-danger);
}

.wb-menu-divider {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: var(--wb-s1) 0;
}

.wb-menu-label {
  padding: var(--wb-s1) var(--wb-s3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wb-muted);
  user-select: none;
}

/* ── Submenu (nested wb-menu inside wb-nav-group-items) ───── */

.wb-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: var(--wb-s4);
  border-left: 2px solid var(--wb-border);
  margin-left: var(--wb-s2);
  margin-top: 2px;
}

.wb-submenu .wb-menu-item {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--wb-muted);
}

/* ── Topbar actions (right-side navbar area) ──────────────── */

.wb-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
}

.wb-topbar-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--wb-r-md);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wb-muted);
  font-size: 1rem;
  transition:
    background var(--wb-t),
    color var(--wb-t);
}

.wb-topbar-action:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

/* Notification dot */
.wb-topbar-action-dot {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 8px;
  height: 8px;
  border-radius: var(--wb-r-full);
  background: var(--wb-danger);
  border: 2px solid var(--wb-surface);
}

/* ── User profile button (navbar) ─────────────────────────── */

.wb-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  padding: 0.25em 0.5em 0.25em 0.25em;
  border-radius: var(--wb-r-lg);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wb-text);
  text-decoration: none;
  transition: background var(--wb-t);
}

.wb-topbar-user:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-topbar-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.3;
}

.wb-topbar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--wb-text);
}

.wb-topbar-user-role {
  font-size: 0.75rem;
  color: var(--wb-muted);
}
/* ============================================================
   WebBlocks UI — Filter Bar & Search Bar (wb-filter-bar, wb-search-bar)
   Used for data tables, listing pages, and admin interfaces.
   ============================================================ */

/* ── Filter bar wrapper ───────────────────────────────────── */

.wb-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-wrap: wrap;
  padding: var(--wb-s3) var(--wb-s4);
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
}

/* Attached to a table (no bottom radius) */
.wb-filter-bar-attached {
  border-bottom: none;
  border-radius: var(--wb-r-lg) var(--wb-r-lg) 0 0;
}

/* ── Filter bar sections ──────────────────────────────────── */

.wb-filter-bar-start {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.wb-filter-bar-end {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-shrink: 0;
}

/* ── Search bar ───────────────────────────────────────────── */

.wb-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.wb-search-bar-input {
  width: 100%;
  padding: 0.45em 0.85em 0.45em 2.2em;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-md);
  background: var(--wb-surface);
  color: var(--wb-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color var(--wb-t), box-shadow var(--wb-t);
  outline: none;
}

.wb-search-bar-input::placeholder {
  color: var(--wb-muted);
}

.wb-search-bar-input:focus {
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px var(--wb-primary-soft);
}

.wb-search-bar-icon {
  position: absolute;
  left: 0.7em;
  color: var(--wb-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.wb-search-bar-clear {
  position: absolute;
  right: 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: var(--wb-r-sm);
  background: none;
  border: none;
  color: var(--wb-muted);
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.7;
  transition: opacity var(--wb-t), background var(--wb-t);
}

.wb-search-bar-clear:hover {
  opacity: 1;
  background: var(--wb-surface-2);
}

/* ── Size variants ────────────────────────────────────────── */

.wb-search-bar-sm .wb-search-bar-input {
  font-size: 0.8rem;
  padding: 0.35em 0.7em 0.35em 2em;
}

.wb-search-bar-lg .wb-search-bar-input {
  font-size: 1rem;
  padding: 0.6em 1em 0.6em 2.4em;
}

/* Expanded (full-width) */
.wb-search-bar-full {
  width: 100%;
}

/* ── Filter chip ──────────────────────────────────────────── */

.wb-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s1);
  padding: 0.3em 0.65em;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--wb-text);
  background: var(--wb-surface);
  cursor: pointer;
  user-select: none;
  transition:
    background var(--wb-t),
    border-color var(--wb-t),
    color var(--wb-t);
  white-space: nowrap;
}

.wb-filter-chip:hover {
  background: var(--wb-surface-2);
}

.wb-filter-chip.is-active {
  background: var(--wb-primary-soft);
  border-color: var(--wb-primary);
  color: var(--wb-primary);
}

.wb-filter-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  border-radius: var(--wb-r-full);
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 0.85em;
  opacity: 0.6;
  transition: opacity var(--wb-t);
}

.wb-filter-chip-remove:hover {
  opacity: 1;
}

/* ── Filter select ────────────────────────────────────────── */

.wb-filter-select {
  padding: 0.4em 2em 0.4em 0.75em;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-md);
  background: var(--wb-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6a84' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65em center;
  color: var(--wb-text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  outline: none;
  transition: border-color var(--wb-t), box-shadow var(--wb-t);
}

.wb-filter-select:focus {
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px var(--wb-primary-soft);
}

/* ── Filter count badge ───────────────────────────────────── */

.wb-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 0.3em;
  border-radius: var(--wb-r-full);
  background: var(--wb-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Results info ─────────────────────────────────────────── */

.wb-filter-results {
  font-size: 0.8rem;
  color: var(--wb-muted);
  white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 600px) {
  .wb-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .wb-filter-bar-start,
  .wb-filter-bar-end {
    width: 100%;
  }

  .wb-search-bar-full {
    width: 100%;
  }
}
/* ============================================================
   WebBlocks UI — Action Menu (wb-action-menu)
   Inline row-level action menus for data tables and list views.
   JS: uses wb-dropdown.js behavior (data-wb-dropdown)
   ============================================================ */

/* ── Inline action group (row actions) ────────────────────── */

.wb-action-group {
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
}

/* ── Action button (icon-only) ────────────────────────────── */

.wb-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--wb-r-md);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--wb-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    background var(--wb-t),
    border-color var(--wb-t),
    color var(--wb-t);
  flex-shrink: 0;
}

.wb-action-btn:hover {
  background: var(--wb-surface-2);
  border-color: var(--wb-border);
  color: var(--wb-text);
  text-decoration: none;
}

.wb-action-btn:focus-visible {
  outline: 2px solid var(--wb-primary);
  outline-offset: 2px;
}

/* ── Semantic variants ────────────────────────────────────── */

.wb-action-btn-view:hover {
  background: var(--wb-info-soft);
  border-color: transparent;
  color: var(--wb-info);
}

.wb-action-btn-edit:hover {
  background: var(--wb-primary-soft);
  border-color: transparent;
  color: var(--wb-primary);
}

.wb-action-btn-delete:hover {
  background: var(--wb-danger-soft);
  border-color: transparent;
  color: var(--wb-danger);
}

/* ── Inline action with label ─────────────────────────────── */

.wb-action-link {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s1);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--wb-primary);
  text-decoration: none;
  padding: 0.2em 0.4em;
  border-radius: var(--wb-r-sm);
  transition:
    background var(--wb-t),
    color var(--wb-t);
}

.wb-action-link:hover {
  background: var(--wb-primary-soft);
  text-decoration: none;
}

.wb-action-link-danger {
  color: var(--wb-danger);
}

.wb-action-link-danger:hover {
  background: var(--wb-danger-soft);
}

/* ── More actions (kebab) dropdown ───────────────────────────
   Wraps wb-dropdown to provide a standard "⋯" trigger.
   ──────────────────────────────────────────────────────────── */

.wb-action-more {
  position: relative;
  display: inline-block;
}

.wb-action-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--wb-r-md);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--wb-muted);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  transition:
    background var(--wb-t),
    border-color var(--wb-t),
    color var(--wb-t);
}

.wb-action-more-btn:hover {
  background: var(--wb-surface-2);
  border-color: var(--wb-border);
  color: var(--wb-text);
}

/* The dropdown panel for action-more reuses wb-dropdown-menu */
.wb-action-more .wb-dropdown-menu {
  min-width: 160px;
  right: 0;
  left: auto;
}

/* ── Status pill (inline row status) ─────────────────────────
   Extends wb-badge with a status-dot indicator for table rows.
   ──────────────────────────────────────────────────────────── */

.wb-status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s1);
  padding: 0.22em 0.65em;
  border-radius: var(--wb-r-full);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.wb-status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--wb-r-full);
  background: currentColor;
  flex-shrink: 0;
}

/* Variants */
.wb-status-active {
  background: var(--wb-success-soft);
  color: var(--wb-success);
}

.wb-status-inactive {
  background: var(--wb-surface-2);
  color: var(--wb-muted);
}

.wb-status-pending {
  background: var(--wb-warning-soft);
  color: var(--wb-warning);
}

.wb-status-error {
  background: var(--wb-danger-soft);
  color: var(--wb-danger);
}

.wb-status-info {
  background: var(--wb-info-soft);
  color: var(--wb-info);
}

/* ── Row selection checkbox area ──────────────────────────── */

.wb-table-check-cell {
  width: 2.5rem;
  padding: 0 var(--wb-s3);
}
/* ============================================================
   WebBlocks UI — Loading Overlay (wb-loading)
   Full-screen or scoped loading states.
   ============================================================ */

/* ── Spinner ──────────────────────────────────────────────── */

.wb-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--wb-border);
  border-top-color: var(--wb-primary);
  border-radius: var(--wb-r-full);
  animation: wb-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes wb-spin {
  to { transform: rotate(360deg); }
}

/* ── Spinner sizes ────────────────────────────────────────── */

.wb-spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 1.5px;
}

.wb-spinner-lg {
  width: 2.25rem;
  height: 2.25rem;
  border-width: 3px;
}

.wb-spinner-xl {
  width: 3rem;
  height: 3rem;
  border-width: 3.5px;
}

/* ── Spinner color variants ───────────────────────────────── */

.wb-spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}

.wb-spinner-muted {
  border-color: var(--wb-surface-3);
  border-top-color: var(--wb-muted);
}

/* ── Inline loading state ─────────────────────────────────── */

.wb-loading-inline {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  font-size: 0.875rem;
  color: var(--wb-muted);
}

/* ── Scoped overlay (inside a card, section, etc.) ────────── */

.wb-loading-overlay {
  position: relative;
}

.wb-loading-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--wb-surface) 75%, transparent);
  border-radius: inherit;
  z-index: 10;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.wb-loading-overlay .wb-loading-spinner-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11;
}

/* ── Full-screen loading overlay ──────────────────────────── */

.wb-loading-screen {
  position: fixed;
  inset: 0;
  z-index: calc(var(--wb-z-modal) + 100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wb-s4);
  background: color-mix(in srgb, var(--wb-surface) 90%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wb-loading-screen-text {
  font-size: 0.9rem;
  color: var(--wb-muted);
  font-weight: 500;
}

/* Hide when not active */
.wb-loading-screen:not(.is-visible) {
  display: none;
}

/* ── Progress bar (determinate loading) ───────────────────── */

.wb-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--wb-surface-2);
  border-radius: var(--wb-r-full);
  overflow: hidden;
}

.wb-progress-bar-fill {
  height: 100%;
  background: var(--wb-primary);
  border-radius: var(--wb-r-full);
  transition: width 0.3s ease;
}

/* ── Indeterminate progress bar ───────────────────────────── */

.wb-progress-bar-indeterminate .wb-progress-bar-fill {
  width: 40%;
  animation: wb-progress-slide 1.4s ease infinite;
}

@keyframes wb-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ── Progress bar variants ────────────────────────────────── */

.wb-progress-bar-thin { height: 3px; }
.wb-progress-bar-thick { height: 10px; }

.wb-progress-bar-success .wb-progress-bar-fill { background: var(--wb-success); }
.wb-progress-bar-danger  .wb-progress-bar-fill { background: var(--wb-danger); }
.wb-progress-bar-warning .wb-progress-bar-fill { background: var(--wb-warning); }

/* ── Page-level top loading bar ───────────────────────────── */

.wb-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--wb-primary);
  z-index: calc(var(--wb-z-toast) + 100);
  animation: wb-loading-bar-in 0.2s ease;
  transform-origin: left center;
}

.wb-loading-bar.is-done {
  animation: wb-loading-bar-done 0.3s ease forwards;
}

@keyframes wb-loading-bar-in {
  from { transform: scaleX(0); }
}

@keyframes wb-loading-bar-done {
  to { opacity: 0; transform: scaleX(1); }
}
/* ============================================================
   WebBlocks UI — Popover (wb-popover)
   Floating contextual panels anchored to a trigger element.
   JS: data-wb-popover on wrapper; toggles .is-open on trigger click.
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────────── */

.wb-popover {
  position: relative;
  display: inline-block;
}

/* ── Popover panel ────────────────────────────────────────── */

.wb-popover-panel {
  display: none;
  position: absolute;
  top: calc(100% + var(--wb-s2));
  left: 0;
  z-index: var(--wb-z-dropdown);
  min-width: 240px;
  max-width: 320px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  box-shadow: var(--wb-shadow-lg);
  padding: var(--wb-s4);
  animation: wb-popover-in 0.14s ease;
}

.wb-popover.is-open .wb-popover-panel {
  display: block;
}

@keyframes wb-popover-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Placement variants ───────────────────────────────────── */

/* Right-aligned */
.wb-popover-end .wb-popover-panel {
  left: auto;
  right: 0;
}

/* Above trigger */
.wb-popover-top .wb-popover-panel {
  top: auto;
  bottom: calc(100% + var(--wb-s2));
  animation-name: wb-popover-in-top;
}
@keyframes wb-popover-in-top {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* Right of trigger */
.wb-popover-right .wb-popover-panel {
  top: 0;
  left: calc(100% + var(--wb-s2));
  animation-name: wb-popover-in-right;
}
@keyframes wb-popover-in-right {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0);    }
}

/* Left of trigger */
.wb-popover-left .wb-popover-panel {
  top: 0;
  right: calc(100% + var(--wb-s2));
  left: auto;
  animation-name: wb-popover-in-left;
}
@keyframes wb-popover-in-left {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0);   }
}

/* ── Popover inner sections ───────────────────────────────── */

.wb-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s2);
  padding-bottom: var(--wb-s3);
  margin-bottom: var(--wb-s3);
  border-bottom: 1px solid var(--wb-border);
}

.wb-popover-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wb-text);
  margin: 0;
}

.wb-popover-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--wb-r-sm);
  background: none;
  border: none;
  color: var(--wb-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--wb-t), color var(--wb-t);
}
.wb-popover-close:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

.wb-popover-body {
  font-size: 0.875rem;
  color: var(--wb-text);
  line-height: 1.6;
}

.wb-popover-footer {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  padding-top: var(--wb-s3);
  margin-top: var(--wb-s3);
  border-top: 1px solid var(--wb-border);
}

/* ── Arrow / caret ────────────────────────────────────────── */

.wb-popover-arrow {
  position: absolute;
  top: -6px;
  left: 1.25rem;
  width: 12px;
  height: 6px;
  overflow: visible;
  pointer-events: none;
}

.wb-popover-arrow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  transform: rotate(45deg) translate(-2px, 2px);
  border-bottom-right-radius: 2px;
}

.wb-popover-end .wb-popover-arrow {
  left: auto;
  right: 1.25rem;
}
/* ============================================================
   WebBlocks UI — Drawer / Offcanvas (wb-drawer)
   Slide-in panels from any edge of the viewport.
   JS: data-wb-toggle="drawer" data-wb-target="#id"
       data-wb-dismiss="drawer" (close trigger)
   ============================================================ */

/* ── Backdrop ─────────────────────────────────────────────── */

.wb-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: calc(var(--wb-z-modal) - 10);
}

.wb-drawer-backdrop.is-open {
  display: block;
  animation: wb-fade-in 0.2s ease;
}

@keyframes wb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Drawer panel ─────────────────────────────────────────── */

.wb-drawer {
  position: fixed;
  z-index: var(--wb-z-modal);
  background: var(--wb-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--wb-shadow-xl);
  transition: transform 0.25s ease;
  overflow: hidden;
}

/* ── Placement: right (default) ───────────────────────────── */

.wb-drawer,
.wb-drawer-right {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  transform: translateX(100%);
  border-left: 1px solid var(--wb-border);
}

.wb-drawer.is-open,
.wb-drawer-right.is-open {
  transform: translateX(0);
}

/* ── Placement: left ──────────────────────────────────────── */

.wb-drawer-left {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: min(420px, 90vw);
  transform: translateX(-100%);
  border-right: 1px solid var(--wb-border);
  border-left: none;
}

.wb-drawer-left.is-open {
  transform: translateX(0);
}

/* ── Placement: bottom ────────────────────────────────────── */

.wb-drawer-bottom {
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  width: auto;
  height: min(480px, 85vh);
  transform: translateY(100%);
  border-top: 1px solid var(--wb-border);
  border-bottom: none;
  border-radius: var(--wb-r-xl) var(--wb-r-xl) 0 0;
}

.wb-drawer-bottom.is-open {
  transform: translateY(0);
}

/* ── Placement: top ───────────────────────────────────────── */

.wb-drawer-top {
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  height: min(360px, 85vh);
  transform: translateY(-100%);
  border-bottom: 1px solid var(--wb-border);
  border-top: none;
  border-radius: 0 0 var(--wb-r-xl) var(--wb-r-xl);
}

.wb-drawer-top.is-open {
  transform: translateY(0);
}

/* ── Size variants (right/left only) ──────────────────────── */

.wb-drawer-sm { width: min(320px, 90vw); }
.wb-drawer-lg { width: min(560px, 90vw); }
.wb-drawer-xl { width: min(720px, 90vw); }

/* ── Inner sections ───────────────────────────────────────── */

.wb-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s3);
  padding: var(--wb-s4) var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
}

.wb-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--wb-text);
}

.wb-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--wb-r-md);
  color: var(--wb-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--wb-t), color var(--wb-t);
}
.wb-drawer-close:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

.wb-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--wb-s5);
}

.wb-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--wb-s2);
  padding: var(--wb-s3) var(--wb-s5);
  border-top: 1px solid var(--wb-border);
  flex-shrink: 0;
  background: var(--wb-surface-2);
}

/* ── Bottom sheet drag handle ─────────────────────────────── */

.wb-drawer-handle {
  display: flex;
  justify-content: center;
  padding: var(--wb-s3) 0 0;
  flex-shrink: 0;
}

.wb-drawer-handle::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  border-radius: var(--wb-r-full);
  background: var(--wb-border);
}
/* ============================================================
   WebBlocks UI — Command Palette (wb-cmd)
   Full-screen search/command interface triggered by keyboard
   shortcut or button. JS: command-palette.js
   ============================================================ */

/* ── Backdrop ─────────────────────────────────────────────── */

.wb-cmd-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--wb-z-modal) + 50);
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(3rem, 12vh, 8rem);
  padding-inline: var(--wb-s4);
}

.wb-cmd-backdrop.is-open {
  display: flex;
  animation: wb-cmd-backdrop-in 0.15s ease;
}

@keyframes wb-cmd-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Dialog ───────────────────────────────────────────────── */

.wb-cmd-dialog {
  width: 100%;
  max-width: 580px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-xl);
  box-shadow: var(--wb-shadow-xl);
  overflow: hidden;
  animation: wb-cmd-in 0.18s ease;
  display: flex;
  flex-direction: column;
  max-height: min(560px, 70vh);
}

@keyframes wb-cmd-in {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Search input area ────────────────────────────────────── */

.wb-cmd-search {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: var(--wb-s3) var(--wb-s4);
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
}

.wb-cmd-search-icon {
  color: var(--wb-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.wb-cmd-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--wb-text);
  line-height: 1.5;
}

.wb-cmd-input::placeholder {
  color: var(--wb-muted);
}

.wb-cmd-shortcut-hint {
  font-size: 0.72rem;
  color: var(--wb-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
}

/* ── Results panel ────────────────────────────────────────── */

.wb-cmd-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--wb-s1) 0;
}

/* ── Result group ─────────────────────────────────────────── */

.wb-cmd-group {
  padding: var(--wb-s1) var(--wb-s2);
}

.wb-cmd-group + .wb-cmd-group {
  border-top: 1px solid var(--wb-border);
  margin-top: var(--wb-s1);
  padding-top: var(--wb-s2);
}

.wb-cmd-group-label {
  padding: var(--wb-s1) var(--wb-s2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--wb-muted);
  user-select: none;
}

/* ── Result item ──────────────────────────────────────────── */

.wb-cmd-item {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: var(--wb-s2) var(--wb-s3);
  border-radius: var(--wb-r-md);
  font-size: 0.9rem;
  color: var(--wb-text);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  transition: background var(--wb-t-f);
}

.wb-cmd-item:hover,
.wb-cmd-item.is-selected {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-cmd-item.is-selected {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
}

.wb-cmd-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--wb-r-md);
  background: var(--wb-surface-2);
  color: var(--wb-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: background var(--wb-t-f), color var(--wb-t-f);
}

.wb-cmd-item.is-selected .wb-cmd-item-icon {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
}

.wb-cmd-item-text {
  flex: 1;
  min-width: 0;
}

.wb-cmd-item-title {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-cmd-item-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--wb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-cmd-item-kbd {
  font-size: 0.7rem;
  color: var(--wb-muted);
  background: var(--wb-surface-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-sm);
  padding: 0.1em 0.4em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Highlight matched text ───────────────────────────────── */

.wb-cmd-match {
  color: var(--wb-primary);
  font-weight: 600;
}

/* ── Empty state ──────────────────────────────────────────── */

.wb-cmd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--wb-s8) var(--wb-s4);
  gap: var(--wb-s2);
  color: var(--wb-muted);
  font-size: 0.875rem;
}

/* ── Footer (keyboard hints) ──────────────────────────────── */

.wb-cmd-footer {
  display: flex;
  align-items: center;
  gap: var(--wb-s4);
  padding: var(--wb-s2) var(--wb-s4);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
  flex-shrink: 0;
}

.wb-cmd-footer-hint {
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
  font-size: 0.72rem;
  color: var(--wb-muted);
}

.wb-cmd-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  height: 1.2em;
  padding: 0 0.25em;
  font-size: 0.7rem;
  color: var(--wb-muted);
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: 3px;
  font-family: var(--wb-font-mono);
}
/* ============================================================
   WebBlocks UI — Divider (wb-divider)
   Horizontal and vertical separators with optional label.
   ============================================================ */

/* ── Horizontal divider ───────────────────────────────────── */

.wb-divider {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: var(--wb-s4) 0;
}

/* ── Labeled divider ──────────────────────────────────────── */

.wb-divider-label {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  margin: var(--wb-s4) 0;
  color: var(--wb-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wb-divider-label::before,
.wb-divider-label::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--wb-border);
}

/* Label only before */
.wb-divider-label-start::after { display: none; }
.wb-divider-label-start::before { flex: 0 0 1rem; }

/* ── Vertical divider ─────────────────────────────────────── */

.wb-divider-v {
  display: inline-block;
  width: 1px;
  background: var(--wb-border);
  align-self: stretch;
  margin-inline: var(--wb-s2);
  flex-shrink: 0;
}

/* ── Size variants ────────────────────────────────────────── */

.wb-divider-sm { margin: var(--wb-s2) 0; }
.wb-divider-lg { margin: var(--wb-s6) 0; }

/* ── Style variants ───────────────────────────────────────── */

.wb-divider-dashed {
  border-top-style: dashed;
}

.wb-divider-dotted {
  border-top-style: dotted;
}
/* ============================================================
   WebBlocks UI — List Group (wb-list)
   Structured vertical lists for navigation, settings, and data.
   ============================================================ */

/* ── Base list ────────────────────────────────────────────── */

.wb-list {
  display: flex;
  flex-direction: column;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  overflow: hidden;
}

/* ── List item ────────────────────────────────────────────── */

.wb-list-item {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: var(--wb-s3) var(--wb-s4);
  border-bottom: 1px solid var(--wb-border);
  font-size: 0.9rem;
  color: var(--wb-text);
  background: var(--wb-surface);
  text-decoration: none;
  transition: background var(--wb-t-f);
  min-width: 0;
}

.wb-list-item:last-child {
  border-bottom: none;
}

/* ── Interactive (clickable) items ───────────────────────────
   Add .wb-list-item-action to make the item a button/link.
   ──────────────────────────────────────────────────────────── */

.wb-list-item-action {
  cursor: pointer;
}

.wb-list-item-action:hover {
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-list-item-action.is-active {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
}

/* ── Item icon ────────────────────────────────────────────── */

.wb-list-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--wb-r-md);
  background: var(--wb-surface-2);
  color: var(--wb-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ── Item text block ──────────────────────────────────────── */

.wb-list-item-text {
  flex: 1;
  min-width: 0;
}

.wb-list-item-title {
  display: block;
  font-weight: 500;
  color: var(--wb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-list-item-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--wb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1em;
}

/* ── Item end content (badge, arrow, etc.) ────────────────── */

.wb-list-item-end {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-shrink: 0;
  margin-left: auto;
  color: var(--wb-muted);
  font-size: 0.85rem;
}

/* ── Variants ─────────────────────────────────────────────── */

/* Flush (no border, no border-radius) */
.wb-list-flush {
  border: none;
  border-radius: 0;
}
.wb-list-flush .wb-list-item {
  padding-inline: 0;
}

/* Bordered items only (no outer border) */
.wb-list-inset {
  border: none;
}

/* Compact */
.wb-list-sm .wb-list-item {
  padding: var(--wb-s2) var(--wb-s3);
  font-size: 0.85rem;
}

/* ── List group header ────────────────────────────────────── */

.wb-list-header {
  padding: var(--wb-s2) var(--wb-s4);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--wb-muted);
  background: var(--wb-surface-2);
  border-bottom: 1px solid var(--wb-border);
  user-select: none;
}

/* ── Numbered list ────────────────────────────────────────── */

.wb-list-numbered {
  counter-reset: wb-list;
}

.wb-list-numbered .wb-list-item::before {
  counter-increment: wb-list;
  content: counter(wb-list);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--wb-r-full);
  background: var(--wb-surface-2);
  color: var(--wb-muted);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
/* ============================================================
   WebBlocks UI — Tooltip (wb-tooltip)
   Pure CSS tooltips — no JavaScript required.

   Usage:
     <button data-wb-tooltip="Save changes">Save</button>
     <span data-wb-tooltip="Helpful info" data-wb-tooltip-placement="bottom">?</span>

   Placement options (data-wb-tooltip-placement):
     top     (default)
     bottom
     left
     right

   Works on any element. The tooltip text is read from the
   data-wb-tooltip attribute via CSS attr().
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */

[data-wb-tooltip] {
  position: relative;
}

/* Tooltip bubble */
[data-wb-tooltip]::before {
  content: attr(data-wb-tooltip);
  position: absolute;
  z-index: calc(var(--wb-z-toast) + 50);
  padding: 0.35em 0.65em;
  background: var(--wb-text);
  color: var(--wb-surface);
  font-size: var(--wb-font-size-xs);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: var(--wb-r-md);
  box-shadow: var(--wb-shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

/* Arrow */
[data-wb-tooltip]::after {
  content: "";
  position: absolute;
  z-index: calc(var(--wb-z-toast) + 49);
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

/* Show on hover / focus-visible */
[data-wb-tooltip]:hover::before,
[data-wb-tooltip]:hover::after,
[data-wb-tooltip]:focus-visible::before,
[data-wb-tooltip]:focus-visible::after {
  opacity: 1;
}

/* ── Placement: top (default) ─────────────────────────────── */

[data-wb-tooltip]:not([data-wb-tooltip-placement])::before,
[data-wb-tooltip][data-wb-tooltip-placement="top"]::before {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}

[data-wb-tooltip]:not([data-wb-tooltip-placement]):hover::before,
[data-wb-tooltip][data-wb-tooltip-placement="top"]:hover::before,
[data-wb-tooltip]:not([data-wb-tooltip-placement]):focus-visible::before,
[data-wb-tooltip][data-wb-tooltip-placement="top"]:focus-visible::before {
  transform: translateX(-50%) translateY(0);
}

[data-wb-tooltip]:not([data-wb-tooltip-placement])::after,
[data-wb-tooltip][data-wb-tooltip-placement="top"]::after {
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--wb-text);
}

/* ── Placement: bottom ────────────────────────────────────── */

[data-wb-tooltip][data-wb-tooltip-placement="bottom"]::before {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
}

[data-wb-tooltip][data-wb-tooltip-placement="bottom"]:hover::before,
[data-wb-tooltip][data-wb-tooltip-placement="bottom"]:focus-visible::before {
  transform: translateX(-50%) translateY(0);
}

[data-wb-tooltip][data-wb-tooltip-placement="bottom"]::after {
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--wb-text);
}

/* ── Placement: left ──────────────────────────────────────── */

[data-wb-tooltip][data-wb-tooltip-placement="left"]::before {
  top: 50%;
  right: calc(100% + 8px);
  left: auto;
  transform: translateY(-50%) translateX(4px);
}

[data-wb-tooltip][data-wb-tooltip-placement="left"]:hover::before,
[data-wb-tooltip][data-wb-tooltip-placement="left"]:focus-visible::before {
  transform: translateY(-50%) translateX(0);
}

[data-wb-tooltip][data-wb-tooltip-placement="left"]::after {
  top: 50%;
  right: calc(100% + 4px);
  left: auto;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid var(--wb-text);
}

/* ── Placement: right ─────────────────────────────────────── */

[data-wb-tooltip][data-wb-tooltip-placement="right"]::before {
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%) translateX(-4px);
}

[data-wb-tooltip][data-wb-tooltip-placement="right"]:hover::before,
[data-wb-tooltip][data-wb-tooltip-placement="right"]:focus-visible::before {
  transform: translateY(-50%) translateX(0);
}

[data-wb-tooltip][data-wb-tooltip-placement="right"]::after {
  top: 50%;
  left: calc(100% + 4px);
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid var(--wb-text);
}

/* ── Multiline tooltip ────────────────────────────────────── */

[data-wb-tooltip-wrap]::before {
  white-space: normal;
  max-width: 220px;
  text-align: center;
}
/* ============================================================
   WebBlocks UI — Toolbar Component
   ============================================================ */

/*
  A horizontal action bar used above data tables or content areas.
  Combines search, filters, and bulk/page-level actions.

  Structure:
  <div class="wb-toolbar">
    <div class="wb-toolbar-start">
      <h2 class="wb-toolbar-title">Users</h2>
    </div>
    <div class="wb-toolbar-end">
      <button class="wb-btn wb-btn-primary wb-btn-sm">Add User</button>
    </div>
  </div>

  With bulk actions (visible when rows are selected):
  <div class="wb-toolbar">
    <div class="wb-toolbar-bulk is-active">
      <span class="wb-toolbar-bulk-count">3 selected</span>
      <button class="wb-btn wb-btn-ghost wb-btn-sm">Export</button>
      <button class="wb-btn wb-btn-ghost wb-btn-sm wb-text-danger">Delete</button>
      <button class="wb-toolbar-bulk-clear">✕ Clear</button>
    </div>
    <div class="wb-toolbar-start">
      <h2 class="wb-toolbar-title">Users</h2>
    </div>
    <div class="wb-toolbar-end">
      <button class="wb-btn wb-btn-primary wb-btn-sm">Add User</button>
    </div>
  </div>
*/

/* ── Base toolbar ─────────────────────────────────────────── */

.wb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  margin-bottom: var(--wb-s4);
  flex-wrap: wrap;
  position: relative;
}

.wb-toolbar-start {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.wb-toolbar-end {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Toolbar title ────────────────────────────────────────── */

.wb-toolbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--wb-text);
  margin: 0;
  white-space: nowrap;
}

.wb-toolbar-subtitle {
  font-size: 0.8rem;
  color: var(--wb-muted);
  margin: 0;
}

/* ── Toolbar divider (vertical) ───────────────────────────── */

.wb-toolbar-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--wb-border);
  flex-shrink: 0;
  margin: 0 var(--wb-s1);
}

/* ── Bulk action bar ──────────────────────────────────────── */

.wb-toolbar-bulk {
  display: none;
  align-items: center;
  gap: var(--wb-s2);
  position: absolute;
  inset: 0;
  background: var(--wb-accent-softer);
  border: 1px solid var(--wb-accent-border);
  border-radius: var(--wb-r-md);
  padding: 0 var(--wb-s3);
  z-index: 1;
  flex-wrap: wrap;
}

.wb-toolbar-bulk.is-active {
  display: flex;
}

.wb-toolbar-bulk-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wb-accent-text);
  margin-right: var(--wb-s1);
}

.wb-toolbar-bulk-clear {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--wb-muted);
  cursor: pointer;
  padding: var(--wb-s1) var(--wb-s2);
  border-radius: var(--wb-r-sm);
  font-family: inherit;
  transition: color var(--wb-t), background var(--wb-t);
}

.wb-toolbar-bulk-clear:hover {
  color: var(--wb-text);
  background: var(--wb-surface-2);
}

/* ── Compact toolbar variant ──────────────────────────────── */

.wb-toolbar-sm {
  gap: var(--wb-s2);
  margin-bottom: var(--wb-s3);
}

.wb-toolbar-sm .wb-toolbar-title {
  font-size: 0.875rem;
}

/* ── Bordered toolbar (sits on top of a card/table) ──────── */

.wb-toolbar-inset {
  padding: var(--wb-s3) var(--wb-s4);
  background: var(--wb-surface-2);
  border-bottom: 1px solid var(--wb-border);
  margin-bottom: 0;
  border-radius: var(--wb-r-lg) var(--wb-r-lg) 0 0;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .wb-toolbar {
    align-items: flex-start;
  }

  .wb-toolbar-end {
    width: 100%;
  }
}
/* ============================================================
   WebBlocks UI — Icon System
   ============================================================
   Designed for use with the WebBlocks icon sprite:
     dist/webblocks-icons.svg

   Usage (sprite):
     <svg class="wb-icon" aria-hidden="true">
       <use href="/dist/webblocks-icons.svg#settings"></use>
     </svg>

   Usage (inline SVG — paste SVG markup directly):
     <svg class="wb-icon" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2"
          stroke-linecap="round" stroke-linejoin="round"
          aria-hidden="true">...</svg>

   Sizes:
     wb-icon-xs  — 0.875rem (14px)
     wb-icon-sm  — 1rem     (16px)
     (default)   — 1.125rem (18px)
     wb-icon-lg  — 1.5rem   (24px)
     wb-icon-xl  — 2rem     (32px)
     wb-icon-2xl — 2.5rem   (40px)

   Color helpers:
     wb-icon-muted    — dimmed (0.55 opacity)
     wb-icon-accent   — var(--wb-accent)
     wb-icon-success  — var(--wb-success)
     wb-icon-warning  — var(--wb-warning)
     wb-icon-danger   — var(--wb-danger)
     wb-icon-info     — var(--wb-info)

   Layout helpers:
     wb-icon-btn      — inline-flex row with gap (icon + text in button)
     wb-icon-card     — flex row with larger gap (icon + content block)
     wb-icon-solo     — centered block display (standalone icon)
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */

/*
  Two usage patterns are supported simultaneously:

  1. SVG sprite (semantic, accessible):
     <svg class="wb-icon" aria-hidden="true">
       <use href="/dist/webblocks-icons.svg#settings"></use>
     </svg>

  2. Bootstrap-style <i> tag (requires webblocks-icons.css):
     <i class="wb-icon wb-icon-settings"></i>
     <i class="wb-icon wb-icon-settings wb-icon-lg wb-icon-accent"></i>
*/

.wb-icon {
  display: inline-block;
  width:  var(--wb-icon-size, 1.125rem);
  height: var(--wb-icon-size, 1.125rem);
  flex-shrink: 0;
  vertical-align: middle;
  color: currentColor;
}

/* SVG sprite mode (<svg class="wb-icon">) — stroke-based (Lucide) */
svg.wb-icon {
  stroke:         currentColor;
  stroke-width:   var(--wb-icon-stroke, 2);
  stroke-linecap: round;
  stroke-linejoin: round;
  fill:           none;
  background:     none;
  overflow:       visible;
}

/* Bootstrap-style <i> tag mode — requires webblocks-icons.css */
i.wb-icon {
  -webkit-mask-repeat:   no-repeat;
  mask-repeat:           no-repeat;
  -webkit-mask-size:     100% 100%;
  mask-size:             100% 100%;
  -webkit-mask-position: center;
  mask-position:         center;
  background-color:      currentColor;
}

/* ── Sizes ─────────────────────────────────────────────────── */

.wb-icon-xs  { --wb-icon-size: 0.875rem; }
.wb-icon-sm  { --wb-icon-size: 1rem; }
.wb-icon-lg  { --wb-icon-size: 1.5rem; }
.wb-icon-xl  { --wb-icon-size: 2rem; }
.wb-icon-2xl { --wb-icon-size: 2.5rem; }

/* ── Stroke weight ─────────────────────────────────────────── */

.wb-icon-thin   { --wb-icon-stroke: 1; }
.wb-icon-medium { --wb-icon-stroke: 2; }   /* default */
.wb-icon-bold   { --wb-icon-stroke: 2.5; }

/* ── Color helpers ─────────────────────────────────────────── */

/*
  For SVG sprite: color sets stroke via currentColor
  For <i> mask mode: background-color provides the visible color
  Both are set together so either pattern works automatically.
*/

.wb-icon-muted   { opacity: 0.55; }
.wb-icon-accent  { color: var(--wb-accent);   background-color: var(--wb-accent); }
.wb-icon-success { color: var(--wb-success);  background-color: var(--wb-success); }
.wb-icon-warning { color: var(--wb-warning);  background-color: var(--wb-warning); }
.wb-icon-danger  { color: var(--wb-danger);   background-color: var(--wb-danger); }
.wb-icon-info    { color: var(--wb-info);      background-color: var(--wb-info); }
.wb-icon-on      { color: var(--wb-accent-on); background-color: var(--wb-accent-on); }

/* ── Layout helpers ────────────────────────────────────────── */

/* Inline button/link: icon sits next to text */
.wb-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-s2);
}

/* Card-style row: larger icon with a content block beside it */
.wb-icon-card {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
}

/* Standalone centered icon (e.g. empty-state icon) */
.wb-icon-solo {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Badge-style icon wrapper ──────────────────────────────── */

/* Colored rounded background behind an icon */
.wb-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width:  2.25rem;
  height: 2.25rem;
  border-radius: var(--wb-r-md);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-text);
  flex-shrink: 0;
}

.wb-icon-wrap-sm {
  width:  1.75rem;
  height: 1.75rem;
  border-radius: var(--wb-r-sm);
}

.wb-icon-wrap-lg {
  width:  3rem;
  height: 3rem;
  border-radius: var(--wb-r-lg);
}

.wb-icon-wrap-circle {
  border-radius: var(--wb-r-full);
}

.wb-icon-wrap-success { background: var(--wb-success-soft); color: var(--wb-success); }
.wb-icon-wrap-warning { background: var(--wb-warning-soft); color: var(--wb-warning); }
.wb-icon-wrap-danger  { background: var(--wb-danger-soft);  color: var(--wb-danger); }
.wb-icon-wrap-info    { background: var(--wb-info-soft);    color: var(--wb-info); }
.wb-icon-wrap-muted   { background: var(--wb-surface-2);    color: var(--wb-muted); }
/* ============================================================
   WebBlocks UI — Container & Layout Primitives
   ============================================================ */

/* ── Container ────────────────────────────────────────────── */

.wb-container {
  width: 100%;
  max-width: var(--wb-container-max, 1200px);
  margin-inline: auto;
  padding-inline: var(--wb-s6);
}

.wb-container-sm  { max-width: 680px; }
.wb-container-md  { max-width: 900px; }
.wb-container-lg  { max-width: 1200px; }
.wb-container-xl  { max-width: 1440px; }
.wb-container-full { max-width: none; }

/* ── Section ──────────────────────────────────────────────── */

.wb-section {
  padding-block: var(--wb-s12);
}

.wb-section-sm { padding-block: var(--wb-s6); }
.wb-section-lg { padding-block: calc(var(--wb-s12) * 2); }

/* ── Stack — vertical spacing ─────────────────────────────── */
/* Children spaced vertically; no margin on last child */

.wb-stack {
  display: flex;
  flex-direction: column;
}

.wb-stack > * + * { margin-top: var(--wb-s4); }

.wb-stack-1 > * + * { margin-top: var(--wb-s1); }
.wb-stack-2 > * + * { margin-top: var(--wb-s2); }
.wb-stack-3 > * + * { margin-top: var(--wb-s3); }
.wb-stack-4 > * + * { margin-top: var(--wb-s4); }
.wb-stack-6 > * + * { margin-top: var(--wb-s6); }
.wb-stack-8 > * + * { margin-top: var(--wb-s8); }

/* ── Cluster — horizontal wrapping flex ───────────────────── */

.wb-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-s3);
}

.wb-cluster-2  { gap: var(--wb-s2); }
.wb-cluster-4  { gap: var(--wb-s4); }
.wb-cluster-6  { gap: var(--wb-s6); }
.wb-cluster-end   { justify-content: flex-end; }
.wb-cluster-center { justify-content: center; }
.wb-cluster-between { justify-content: space-between; }

/* ── Split — two-sided horizontal layout ─────────────────── */

.wb-split {
  display: flex;
  align-items: center;
  gap: var(--wb-s4);
}

.wb-split > :first-child { flex: 1; }
.wb-split > :last-child  { flex-shrink: 0; }

/* ── Grid ─────────────────────────────────────────────────── */

.wb-grid {
  display: grid;
  gap: var(--wb-s6);
}

.wb-grid-2 { display: grid; gap: var(--wb-s6); grid-template-columns: repeat(2, 1fr); }
.wb-grid-3 { display: grid; gap: var(--wb-s6); grid-template-columns: repeat(3, 1fr); }
.wb-grid-4 { display: grid; gap: var(--wb-s6); grid-template-columns: repeat(4, 1fr); }

/* Responsive auto-grid (min 280px per column) */
.wb-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--wb-s6);
}

.wb-grid-auto-sm {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.wb-grid-auto-lg {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

/* ── Breakpoint collapse ──────────────────────────────────── */

@media (max-width: 900px) {
  .wb-grid-3,
  .wb-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .wb-grid-2,
  .wb-grid-3,
  .wb-grid-4 {
    grid-template-columns: 1fr;
  }

  .wb-container {
    padding-inline: var(--wb-s4);
  }
}

/* ── Divider ──────────────────────────────────────────────── */

.wb-divider {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin-block: var(--wb-s4);
}

.wb-divider-sm { margin-block: var(--wb-s2); }
.wb-divider-lg { margin-block: var(--wb-s8); }
/* ============================================================
   WebBlocks UI — Navbar / Topbar
   ============================================================ */

/* ── Base navbar ──────────────────────────────────────────── */

.wb-navbar {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  height: var(--wb-navbar-h, 56px);
  padding-inline: var(--wb-s6);
  background: var(--wb-surface);
  border-bottom: 1px solid var(--wb-border);
  position: sticky;
  top: 0;
  z-index: var(--wb-z-navbar, 100);
}

/* Frosted-glass variant */
.wb-navbar-glass {
  background: color-mix(in srgb, var(--wb-surface) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Filled / branded variant */
.wb-navbar-filled {
  background: var(--wb-primary);
  border-bottom-color: transparent;
  color: #fff;
}
.wb-navbar-filled .wb-navbar-link {
  color: rgba(255, 255, 255, 0.85);
}
.wb-navbar-filled .wb-navbar-link:hover,
.wb-navbar-filled .wb-navbar-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ── Brand / logo ─────────────────────────────────────────── */

.wb-navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--wb-text);
  flex-shrink: 0;
}

.wb-navbar-brand:hover {
  text-decoration: none;
  color: var(--wb-text);
}

.wb-navbar-brand img,
.wb-navbar-brand svg {
  height: 28px;
  width: auto;
}

/* ── Spacer — pushes right side ───────────────────────────── */

.wb-navbar-spacer {
  flex: 1;
}

/* ── Nav links ────────────────────────────────────────────── */

.wb-navbar-links {
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
}

.wb-navbar-link {
  display: flex;
  align-items: center;
  gap: var(--wb-s1);
  padding: 0.35em 0.75em;
  border-radius: var(--wb-r-md);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wb-muted);
  transition:
    background var(--wb-t),
    color var(--wb-t);
  white-space: nowrap;
}

.wb-navbar-link:hover {
  color: var(--wb-text);
  background: var(--wb-surface-2);
  text-decoration: none;
}

.wb-navbar-link.is-active {
  color: var(--wb-primary);
  background: var(--wb-primary-soft);
}

/* ── Right-side controls ──────────────────────────────────── */

.wb-navbar-end {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-shrink: 0;
}

/* ── Mobile toggle (hamburger) ────────────────────────────── */

.wb-navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--wb-r-md);
  color: var(--wb-text);
}

.wb-navbar-toggle:hover {
  background: var(--wb-surface-2);
}

.wb-navbar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--wb-t), opacity var(--wb-t);
}

/* Animated X when open */
.wb-navbar-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.wb-navbar-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.wb-navbar-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile drawer ────────────────────────────────────────── */

.wb-navbar-drawer {
  display: none;
  flex-direction: column;
  gap: var(--wb-s1);
  padding: var(--wb-s3) var(--wb-s4);
  background: var(--wb-surface);
  border-bottom: 1px solid var(--wb-border);
}

.wb-navbar-drawer.is-open {
  display: flex;
}

.wb-navbar-drawer .wb-navbar-link {
  width: 100%;
  padding: 0.6em 0.75em;
}

/* ── Responsive: hide desktop links, show toggle ──────────── */

@media (max-width: 768px) {
  .wb-navbar-links {
    display: none;
  }

  .wb-navbar-toggle {
    display: flex;
  }
}

@media (min-width: 769px) {
  .wb-navbar-drawer {
    display: none !important;
  }
}
/* ============================================================
   WebBlocks UI — Sidebar
   ============================================================ */

/* ── Sidebar shell ────────────────────────────────────────── */

.wb-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--wb-sidebar-w, 260px);
  min-height: 100%;
  background: var(--wb-surface);
  border-right: 1px solid var(--wb-border);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Narrow / icon-only sidebar */
.wb-sidebar-narrow {
  width: var(--wb-sidebar-narrow-w, 64px);
}

/* ── Sidebar header (brand area) ──────────────────────────── */

.wb-sidebar-header,
.wb-sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  height: var(--wb-navbar-h, 56px);
  padding-inline: var(--wb-s4);
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--wb-text);
  text-decoration: none;
}

.wb-sidebar-header:hover,
.wb-sidebar-brand:hover {
  text-decoration: none;
  color: var(--wb-text);
}

/* ── Nav sections ─────────────────────────────────────────── */

.wb-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--wb-s1);
  padding: var(--wb-s3) var(--wb-s2);
  flex: 1;
}

.wb-sidebar-section {
  margin-top: var(--wb-s4);
}

.wb-sidebar-label {
  display: block;
  padding: 0 var(--wb-s2);
  margin-bottom: var(--wb-s1);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wb-muted);
  user-select: none;
}

/* ── Nav links ────────────────────────────────────────────── */

.wb-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  padding: 0.45em var(--wb-s3);
  border-radius: var(--wb-r-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wb-muted);
  text-decoration: none;
  transition:
    background var(--wb-t),
    color var(--wb-t);
  white-space: nowrap;
  overflow: hidden;
}

.wb-sidebar-link:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
  text-decoration: none;
}

.wb-sidebar-link.is-active {
  background: var(--wb-primary-soft);
  color: var(--wb-primary);
  font-weight: 600;
}

.wb-sidebar-link .wb-sidebar-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}

.wb-sidebar-link .wb-sidebar-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Sub-links (nested) ───────────────────────────────────── */

.wb-sidebar-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: calc(var(--wb-s3) + 1.2em + var(--wb-s3));
  margin-top: 2px;
}

.wb-sidebar-sub .wb-sidebar-link {
  font-size: 0.85rem;
  padding-block: 0.35em;
  color: var(--wb-muted);
}

.wb-sidebar-sub .wb-sidebar-link.is-active {
  color: var(--wb-primary);
  background: transparent;
  font-weight: 600;
}

/* ── Sidebar footer ───────────────────────────────────────── */

.wb-sidebar-footer {
  padding: var(--wb-s3) var(--wb-s2);
  border-top: 1px solid var(--wb-border);
  flex-shrink: 0;
}

/* ── Backdrop (mobile overlay) ────────────────────────────── */

.wb-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: calc(var(--wb-z-sidebar, 200) - 1);
}

.wb-sidebar-backdrop.is-open {
  display: block;
}

/* ── Mobile: off-canvas ───────────────────────────────────── */

@media (max-width: 768px) {
  .wb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: var(--wb-z-sidebar, 200);
    transform: translateX(-100%);
    transition: transform var(--wb-t-sidebar, 0.25s ease);
    box-shadow: var(--wb-shadow-lg);
  }

  .wb-sidebar.is-open {
    transform: translateX(0);
  }
}
/* ============================================================
   WebBlocks UI — Dashboard Shell Layout
   ============================================================ */

/*
  Structure:
  <div class="wb-dashboard-shell">
    <aside class="wb-sidebar"> ... </aside>
    <div class="wb-dashboard-body">
      <header class="wb-navbar"> ... </header>
      <main class="wb-dashboard-main">
        <div class="wb-container"> ... </div>
      </main>
    </div>
  </div>
*/

.wb-dashboard-shell {
  display: flex;
  height: 100vh;       /* fixed viewport height — enables internal scroll */
  overflow: hidden;    /* children handle their own scroll */
  background: var(--wb-bg);
}

/* ── Body area (right of sidebar) ─────────────────────────── */

.wb-dashboard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* prevent flex overflow */
  overflow: hidden;
  height: 100%;        /* fill shell height */
}

/* ── Main content area ────────────────────────────────────── */

.wb-dashboard-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--wb-s6);
}

/* ── Page header (title + actions row) ────────────────────── */

.wb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--wb-s4);
  margin-bottom: var(--wb-s6);
  flex-wrap: wrap;
}

.wb-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wb-text);
  margin: 0;
  line-height: 1.3;
}

.wb-page-subtitle {
  font-size: 0.9rem;
  color: var(--wb-muted);
  margin-top: var(--wb-s1);
}

.wb-page-actions {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  flex-shrink: 0;
}

/* ── Stat card row ────────────────────────────────────────── */

.wb-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--wb-s4);
  margin-bottom: var(--wb-s6);
}

/* ── Dashboard panel (card variant) ──────────────────────── */

.wb-panel {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  overflow: hidden;
}

.wb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s3);
  padding: var(--wb-s4) var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
}

.wb-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wb-text);
  margin: 0;
}

.wb-panel-body {
  padding: var(--wb-s5);
}

.wb-panel-footer {
  padding: var(--wb-s3) var(--wb-s5);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
  font-size: 0.85rem;
  color: var(--wb-muted);
}

/* ── Mobile: sidebar collapses, main takes full width ─────── */

@media (max-width: 768px) {
  .wb-dashboard-main {
    padding: var(--wb-s4);
  }

  .wb-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .wb-page-actions {
    flex-wrap: wrap;
  }
}

/* ── Backward-compat aliases ──────────────────────────────── */
.wb-shell       { display: flex; height: 100vh; overflow: hidden; background: var(--wb-bg); }
.wb-shell-main  { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; height: 100%; }
.wb-shell-body  { flex: 1; overflow-y: auto; padding: var(--wb-s6); }
/* ============================================================
   WebBlocks UI — Auth Shell Layout
   ============================================================ */

/*
  Structure (centered card):
  <div class="wb-auth-shell">
    <div class="wb-auth-card">
      <div class="wb-auth-logo"> ... </div>
      <div class="wb-auth-body"> ... </div>
      <div class="wb-auth-footer"> ... </div>
    </div>
  </div>

  Structure (split layout):
  <div class="wb-auth-shell wb-auth-split">
    <div class="wb-auth-panel"> ... brand / illustration ... </div>
    <div class="wb-auth-form-area">
      <div class="wb-auth-card"> ... </div>
    </div>
  </div>
*/

/* ── Centered shell ───────────────────────────────────────── */

.wb-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wb-s6);
  background: var(--wb-bg);
}

/* ── Auth card ────────────────────────────────────────────── */

.wb-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-xl);
  box-shadow: var(--wb-shadow-md);
  overflow: hidden;
}

.wb-auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wb-s2);
  padding: var(--wb-s8) var(--wb-s6) var(--wb-s4);
  text-align: center;
}

.wb-auth-logo img,
.wb-auth-logo svg {
  height: 40px;
  width: auto;
}

.wb-auth-logo-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--wb-text);
  margin: 0;
}

.wb-auth-logo-subtitle {
  font-size: 0.875rem;
  color: var(--wb-muted);
  margin: 0;
}

.wb-auth-body {
  padding: var(--wb-s4) var(--wb-s6) var(--wb-s6);
}

.wb-auth-footer {
  padding: var(--wb-s4) var(--wb-s6);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
  text-align: center;
  font-size: 0.875rem;
  color: var(--wb-muted);
}

/* ── Social / OAuth buttons ───────────────────────────────── */

.wb-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  margin-block: var(--wb-s4);
  font-size: 0.8rem;
  color: var(--wb-muted);
}

.wb-auth-divider::before,
.wb-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--wb-border);
}

/* ── Split layout ─────────────────────────────────────────── */

.wb-auth-split {
  padding: 0;
  align-items: stretch;
  min-height: 100vh;
}

.wb-auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--wb-s12);
  background: var(--wb-primary);
  color: #fff;
  text-align: center;
}

.wb-auth-panel-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--wb-s4);
  line-height: 1.2;
}

.wb-auth-panel-text {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 360px;
}

.wb-auth-form-area {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wb-s8);
  background: var(--wb-bg);
}

.wb-auth-form-area .wb-auth-card {
  border: none;
  box-shadow: none;
  background: transparent;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .wb-auth-split {
    flex-direction: column;
  }

  .wb-auth-panel {
    padding: var(--wb-s8) var(--wb-s6);
    min-height: 220px;
  }

  .wb-auth-form-area {
    flex: 1;
    padding: var(--wb-s6) var(--wb-s4);
  }

  .wb-auth-shell:not(.wb-auth-split) {
    align-items: flex-start;
    padding-top: var(--wb-s8);
  }
}
/* ============================================================
   WebBlocks UI — Settings Shell Layout
   ============================================================ */

/*
  Structure (sidebar nav + content):
  <div class="wb-settings-shell">
    <aside class="wb-settings-nav">
      <div class="wb-settings-nav-header">Account</div>
      <a class="wb-settings-nav-link is-active" href="#">Profile</a>
      <a class="wb-settings-nav-link" href="#">Security</a>
    </aside>
    <div class="wb-settings-body">
      <div class="wb-settings-header">
        <h1 class="wb-settings-title">Profile</h1>
        <p class="wb-settings-desc">Manage your personal information.</p>
      </div>
      <div class="wb-settings-section">
        ...
      </div>
    </div>
  </div>
*/

/* ── Outer shell ──────────────────────────────────────────── */

.wb-settings-shell {
  display: flex;
  align-items: flex-start;
  gap: var(--wb-s8);
  max-width: 960px;
  margin: 0 auto;
  padding: var(--wb-s8) var(--wb-s6);
  min-height: calc(100vh - 64px);
}

/* ── Sidebar nav ──────────────────────────────────────────── */

.wb-settings-nav {
  flex: 0 0 220px;
  position: sticky;
  top: var(--wb-s6);
}

.wb-settings-nav-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wb-muted);
  padding: 0 var(--wb-s3) var(--wb-s2);
  margin-bottom: var(--wb-s1);
}

.wb-settings-nav-link {
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
  padding: var(--wb-s2) var(--wb-s3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wb-muted);
  border-radius: var(--wb-r-md);
  text-decoration: none;
  transition: background var(--wb-t), color var(--wb-t);
  line-height: 1.4;
  margin-bottom: 2px;
}

.wb-settings-nav-link:hover {
  background: var(--wb-surface-2);
  color: var(--wb-text);
}

.wb-settings-nav-link.is-active {
  background: var(--wb-accent-softer);
  color: var(--wb-accent-text);
  font-weight: 600;
}

.wb-settings-nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.wb-settings-nav-section {
  margin-top: var(--wb-s4);
}

.wb-settings-nav-divider {
  margin: var(--wb-s3) 0;
  border: none;
  border-top: 1px solid var(--wb-border);
}

/* ── Body area ────────────────────────────────────────────── */

.wb-settings-body {
  flex: 1;
  min-width: 0;
}

/* ── Page header ──────────────────────────────────────────── */

.wb-settings-header {
  margin-bottom: var(--wb-s6);
  padding-bottom: var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
}

.wb-settings-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--wb-text);
  margin: 0 0 var(--wb-s1);
  line-height: 1.3;
}

.wb-settings-desc {
  font-size: 0.875rem;
  color: var(--wb-muted);
  margin: 0;
}

/* ── Settings section (card-like block) ───────────────────── */

.wb-settings-section {
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-lg);
  overflow: hidden;
  margin-bottom: var(--wb-s5);
}

.wb-settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--wb-s4);
  padding: var(--wb-s4) var(--wb-s5);
  border-bottom: 1px solid var(--wb-border);
}

.wb-settings-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wb-text);
  margin: 0 0 var(--wb-s1);
}

.wb-settings-section-desc {
  font-size: 0.8rem;
  color: var(--wb-muted);
  margin: 0;
}

.wb-settings-section-body {
  padding: var(--wb-s5);
}

.wb-settings-section-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--wb-s2);
  padding: var(--wb-s3) var(--wb-s5);
  border-top: 1px solid var(--wb-border);
  background: var(--wb-surface-2);
}

/* ── Settings row (label + control side by side) ──────────── */

.wb-settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--wb-s6);
  padding: var(--wb-s4) 0;
  border-bottom: 1px solid var(--wb-border);
}

.wb-settings-row:last-child {
  border-bottom: none;
}

.wb-settings-row-label {
  flex: 1;
}

.wb-settings-row-label strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wb-text);
  margin-bottom: 2px;
}

.wb-settings-row-label span {
  font-size: 0.8rem;
  color: var(--wb-muted);
}

.wb-settings-row-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--wb-s2);
}

/* ── Danger zone section ──────────────────────────────────── */

.wb-settings-danger {
  border-color: var(--wb-danger);
}

.wb-settings-danger .wb-settings-section-header {
  border-bottom-color: var(--wb-danger);
}

.wb-settings-danger .wb-settings-section-title {
  color: var(--wb-danger);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .wb-settings-shell {
    flex-direction: column;
    padding: var(--wb-s4);
    gap: var(--wb-s4);
  }

  .wb-settings-nav {
    flex: none;
    width: 100%;
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: var(--wb-s1);
  }

  .wb-settings-nav-header {
    width: 100%;
    padding-bottom: var(--wb-s1);
  }

  .wb-settings-nav-link {
    padding: var(--wb-s1) var(--wb-s3);
    font-size: 0.8rem;
  }

  .wb-settings-row {
    flex-direction: column;
    gap: var(--wb-s2);
  }

  .wb-settings-row-control {
    width: 100%;
  }
}
/* ============================================================
   WebBlocks UI — Content Shell Layout
   ============================================================ */

/*
  A centered document/article/blog-style layout.
  Narrower than a full dashboard — ideal for:
    - documentation pages
    - blog posts / articles
    - legal/about pages
    - onboarding flows

  Structure:
  <div class="wb-content-shell">
    <header class="wb-content-header">
      <nav class="wb-content-breadcrumb"> ... </nav>
      <h1 class="wb-content-title">Page Title</h1>
      <p class="wb-content-meta"> ... </p>
    </header>
    <div class="wb-content-body">
      ... article content ...
    </div>
    <footer class="wb-content-footer">
      ... prev/next, back link, etc ...
    </footer>
  </div>

  Narrow content shell (docs / onboarding):
  <div class="wb-content-shell wb-content-shell-narrow"> ... </div>
*/

/* ── Outer shell ──────────────────────────────────────────── */

.wb-content-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--wb-s10) var(--wb-s6);
}

.wb-content-shell-narrow {
  max-width: 620px;
}

.wb-content-shell-wide {
  max-width: 1040px;
}

/* ── Content header ───────────────────────────────────────── */

.wb-content-header {
  margin-bottom: var(--wb-s8);
  padding-bottom: var(--wb-s6);
  border-bottom: 1px solid var(--wb-border);
}

.wb-content-breadcrumb {
  margin-bottom: var(--wb-s4);
}

.wb-content-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--wb-text);
  line-height: 1.2;
  margin: 0 0 var(--wb-s3);
}

.wb-content-subtitle {
  font-size: 1.05rem;
  color: var(--wb-muted);
  margin: 0 0 var(--wb-s4);
  line-height: 1.6;
}

.wb-content-meta {
  display: flex;
  align-items: center;
  gap: var(--wb-s3);
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--wb-muted);
}

.wb-content-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--wb-muted);
  opacity: 0.4;
}

/* ── Content body (prose) ─────────────────────────────────── */

.wb-content-body {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--wb-text);
}

.wb-content-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: var(--wb-s8) 0 var(--wb-s3);
  color: var(--wb-text);
}

.wb-content-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: var(--wb-s6) 0 var(--wb-s2);
  color: var(--wb-text);
}

.wb-content-body p {
  margin: 0 0 var(--wb-s4);
}

.wb-content-body ul,
.wb-content-body ol {
  padding-left: var(--wb-s6);
  margin: 0 0 var(--wb-s4);
}

.wb-content-body li {
  margin-bottom: var(--wb-s1);
}

.wb-content-body a {
  color: var(--wb-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wb-content-body a:hover {
  color: var(--wb-accent-hover);
}

.wb-content-body code {
  font-family: var(--wb-font-mono);
  font-size: 0.85em;
  background: var(--wb-surface-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-sm);
  padding: 0.1em 0.4em;
  color: var(--wb-accent-text);
}

.wb-content-body pre {
  background: var(--wb-surface-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-r-md);
  padding: var(--wb-s4);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 0 0 var(--wb-s4);
}

.wb-content-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.wb-content-body blockquote {
  border-left: 3px solid var(--wb-accent-border);
  margin: var(--wb-s4) 0;
  padding: var(--wb-s2) var(--wb-s4);
  color: var(--wb-muted);
  font-style: italic;
}

.wb-content-body hr {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: var(--wb-s8) 0;
}

/* ── Content footer (prev/next nav) ───────────────────────── */

.wb-content-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-s4);
  margin-top: var(--wb-s10);
  padding-top: var(--wb-s6);
  border-top: 1px solid var(--wb-border);
  flex-wrap: wrap;
}

.wb-content-prev,
.wb-content-next {
  display: flex;
  flex-direction: column;
  gap: var(--wb-s1);
  text-decoration: none;
  color: var(--wb-text);
  max-width: 240px;
}

.wb-content-next {
  text-align: right;
  margin-left: auto;
}

.wb-content-prev-label,
.wb-content-next-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--wb-muted);
}

.wb-content-prev-title,
.wb-content-next-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wb-accent-text);
}

.wb-content-prev:hover .wb-content-prev-title,
.wb-content-next:hover .wb-content-next-title {
  color: var(--wb-accent-hover);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .wb-content-shell {
    padding: var(--wb-s6) var(--wb-s4);
  }

  .wb-content-footer {
    flex-direction: column;
  }

  .wb-content-next {
    text-align: left;
    margin-left: 0;
  }
}
/* ============================================================
   WebBlocks UI — Utility Helpers
   ============================================================ */

/* ── Display ──────────────────────────────────────────────── */

.wb-hidden        { display: none !important; }
.wb-block         { display: block !important; }
.wb-inline        { display: inline !important; }
.wb-inline-block  { display: inline-block !important; }
.wb-flex          { display: flex !important; }
.wb-inline-flex   { display: inline-flex !important; }
.wb-grid-display  { display: grid !important; }

/* ── Flex helpers ─────────────────────────────────────────── */

.wb-flex-col      { flex-direction: column; }
.wb-flex-row      { flex-direction: row; }
.wb-flex-wrap     { flex-wrap: wrap; }
.wb-flex-nowrap   { flex-wrap: nowrap; }
.wb-flex-1        { flex: 1; }
.wb-flex-shrink-0 { flex-shrink: 0; }
.wb-items-start   { align-items: flex-start; }
.wb-items-center  { align-items: center; }
.wb-items-end     { align-items: flex-end; }
.wb-justify-start   { justify-content: flex-start; }
.wb-justify-center  { justify-content: center; }
.wb-justify-end     { justify-content: flex-end; }
.wb-justify-between { justify-content: space-between; }
.wb-gap-1  { gap: var(--wb-s1); }
.wb-gap-2  { gap: var(--wb-s2); }
.wb-gap-3  { gap: var(--wb-s3); }
.wb-gap-4  { gap: var(--wb-s4); }
.wb-gap-6  { gap: var(--wb-s6); }
.wb-gap-8  { gap: var(--wb-s8); }

/* ── Width / height ───────────────────────────────────────── */

.wb-w-full  { width: 100%; }
.wb-w-auto  { width: auto; }
.wb-h-full  { height: 100%; }
.wb-min-w-0 { min-width: 0; }

/* ── Overflow ─────────────────────────────────────────────── */

.wb-overflow-hidden  { overflow: hidden; }
.wb-overflow-auto    { overflow: auto; }
.wb-overflow-scroll  { overflow: scroll; }
.wb-overflow-x-auto  { overflow-x: auto; }
.wb-overflow-y-auto  { overflow-y: auto; }
.wb-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Spacing (margin) ─────────────────────────────────────── */

.wb-m-0   { margin: 0 !important; }
.wb-mt-0  { margin-top: 0 !important; }
.wb-mb-0  { margin-bottom: 0 !important; }
.wb-mt-1  { margin-top: var(--wb-s1) !important; }
.wb-mt-2  { margin-top: var(--wb-s2) !important; }
.wb-mt-3  { margin-top: var(--wb-s3) !important; }
.wb-mt-4  { margin-top: var(--wb-s4) !important; }
.wb-mt-5  { margin-top: var(--wb-s5) !important; }
.wb-mt-6  { margin-top: var(--wb-s6) !important; }
.wb-mt-8  { margin-top: var(--wb-s8) !important; }
.wb-mb-1  { margin-bottom: var(--wb-s1) !important; }
.wb-mb-2  { margin-bottom: var(--wb-s2) !important; }
.wb-mb-3  { margin-bottom: var(--wb-s3) !important; }
.wb-mb-4  { margin-bottom: var(--wb-s4) !important; }
.wb-mb-5  { margin-bottom: var(--wb-s5) !important; }
.wb-mb-6  { margin-bottom: var(--wb-s6) !important; }
.wb-mb-8  { margin-bottom: var(--wb-s8) !important; }
.wb-ms-auto { margin-inline-start: auto !important; }
.wb-me-auto { margin-inline-end: auto !important; }
.wb-mx-auto { margin-inline: auto !important; }

/* ── Spacing (padding) ────────────────────────────────────── */

.wb-p-0  { padding: 0 !important; }
.wb-p-2  { padding: var(--wb-s2) !important; }
.wb-p-3  { padding: var(--wb-s3) !important; }
.wb-p-4  { padding: var(--wb-s4) !important; }
.wb-p-6  { padding: var(--wb-s6) !important; }
.wb-px-4 { padding-inline: var(--wb-s4) !important; }
.wb-px-6 { padding-inline: var(--wb-s6) !important; }
.wb-py-2 { padding-block: var(--wb-s2) !important; }
.wb-py-4 { padding-block: var(--wb-s4) !important; }
.wb-py-6 { padding-block: var(--wb-s6) !important; }

/* ── Typography ───────────────────────────────────────────── */

.wb-text-xs   { font-size: 0.75rem; }
.wb-text-sm   { font-size: 0.85rem; }
.wb-text-base { font-size: 1rem; }
.wb-text-lg   { font-size: 1.125rem; }
.wb-text-xl   { font-size: 1.25rem; }
.wb-text-2xl  { font-size: 1.5rem; }
.wb-text-3xl  { font-size: 1.875rem; }
.wb-text-4xl  { font-size: 2.25rem; }

.wb-font-normal  { font-weight: 400; }
.wb-font-medium  { font-weight: 500; }
.wb-font-semibold { font-weight: 600; }
.wb-font-bold    { font-weight: 700; }

.wb-text-left    { text-align: left; }
.wb-text-center  { text-align: center; }
.wb-text-right   { text-align: right; }

.wb-leading-tight  { line-height: 1.25; }
.wb-leading-normal { line-height: 1.5; }
.wb-leading-loose  { line-height: 2; }

.wb-no-decoration  { text-decoration: none !important; }
.wb-uppercase      { text-transform: uppercase; }
.wb-lowercase      { text-transform: lowercase; }
.wb-capitalize     { text-transform: capitalize; }
.wb-nowrap         { white-space: nowrap; }

/* ── Color helpers ────────────────────────────────────────── */

.wb-text-primary  { color: var(--wb-primary) !important; }
.wb-text-success  { color: var(--wb-success) !important; }
.wb-text-warning  { color: var(--wb-warning) !important; }
.wb-text-danger   { color: var(--wb-danger) !important; }
.wb-text-muted    { color: var(--wb-muted) !important; }
.wb-text-default  { color: var(--wb-text) !important; }

.wb-bg-surface    { background: var(--wb-surface) !important; }
.wb-bg-surface-2  { background: var(--wb-surface-2) !important; }
.wb-bg-primary    { background: var(--wb-primary) !important; color: #fff !important; }
.wb-bg-success    { background: var(--wb-success) !important; color: #fff !important; }
.wb-bg-danger     { background: var(--wb-danger) !important; color: #fff !important; }
.wb-bg-warning    { background: var(--wb-warning) !important; }

/* ── Border ───────────────────────────────────────────────── */

.wb-border        { border: 1px solid var(--wb-border) !important; }
.wb-border-top    { border-top: 1px solid var(--wb-border) !important; }
.wb-border-bottom { border-bottom: 1px solid var(--wb-border) !important; }
.wb-border-0      { border: none !important; }
.wb-rounded       { border-radius: var(--wb-r-md) !important; }
.wb-rounded-sm    { border-radius: var(--wb-r-sm) !important; }
.wb-rounded-lg    { border-radius: var(--wb-r-lg) !important; }
.wb-rounded-xl    { border-radius: var(--wb-r-xl) !important; }
.wb-rounded-full  { border-radius: 9999px !important; }

/* ── Shadow ───────────────────────────────────────────────── */

.wb-shadow-sm { box-shadow: var(--wb-shadow-sm) !important; }
.wb-shadow    { box-shadow: var(--wb-shadow-md) !important; }
.wb-shadow-lg { box-shadow: var(--wb-shadow-lg) !important; }
.wb-shadow-0  { box-shadow: none !important; }

/* ── Position ─────────────────────────────────────────────── */

.wb-relative  { position: relative; }
.wb-absolute  { position: absolute; }
.wb-fixed     { position: fixed; }
.wb-sticky    { position: sticky; }
.wb-inset-0   { inset: 0; }

/* ── Cursor ───────────────────────────────────────────────── */

.wb-cursor-pointer  { cursor: pointer; }
.wb-cursor-default  { cursor: default; }
.wb-cursor-not-allowed { cursor: not-allowed; }

/* ── Opacity ──────────────────────────────────────────────── */

.wb-opacity-50  { opacity: 0.5; }
.wb-opacity-75  { opacity: 0.75; }
.wb-opacity-100 { opacity: 1; }

/* ── SR only (accessible hidden) ─────────────────────────── */

.wb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Responsive visibility ────────────────────────────────── */

@media (max-width: 600px) {
  .wb-hidden-sm { display: none !important; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .wb-hidden-md { display: none !important; }
}

@media (min-width: 901px) {
  .wb-hidden-lg { display: none !important; }
}

@media (max-width: 768px) {
  .wb-visible-desktop { display: none !important; }
}

@media (min-width: 769px) {
  .wb-visible-mobile { display: none !important; }
}
