/*!
 * Persolz – App Design System
 * "Beziehungen, die verkaufen."
 *
 * One file, no build step. Sections:
 *   01 Fonts                 12 Badges, dots, chips, avatars   23 Pickers & meters
 *   02 Tokens (light/dark)   13 Alerts & banners               24 Auth layout
 *   03 Reset & base          14 Tabs                           25 Blank layout & errors
 *   04 Typography            15 Modals                         26 Charts
 *   05 App shell             16 Dropdowns & palette            27 UI kit helpers
 *   06 Page header           17 Toasts & tooltips              28 Utilities
 *   07 Layout grids          18 Empty states                   29 Responsive
 *   08 Cards                 19 Progress, skeleton, spinner    30 Print
 *   09 Stats                 20 Timeline & list group          31 Motion preferences
 *   10 Buttons               21 Pagination, toolbar, bulk bar
 *   11 Forms                 22 Locked, AI panel, preview
 */

/* ==========================================================================
   01 Fonts (self-hosted, DSGVO-safe)
   ========================================================================== */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/jakarta-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/jakarta-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   02 Tokens
   ========================================================================== */
:root {
  color-scheme: light;

  /* Brand */
  --pz-primary: #5B3DF5;
  --pz-primary-600: #4B2EE6;
  --pz-primary-700: #3D22C4;
  --pz-primary-50: #F3F0FF;
  --pz-primary-100: #E7E1FF;
  --pz-primary-200: #D2C8FF;
  --pz-violet: #9B5CFF;
  --pz-accent: #FF6B4A;
  --pz-accent-600: #F04F2C;
  --pz-accent-700: #D4401E; /* Glut 700 – CTA buttons with white text (4.6:1, WCAG AA) */
  --pz-accent-800: #BF3618; /* Glut 800 – hover of Glut 700 (5.6:1) */
  --pz-ink: #0E1024;
  --pz-gold: #FFB547;
  --pz-mint: #18C29C;
  --pz-success: #16A34A;
  --pz-warning: #F59E0B;
  --pz-danger: #E11D48;
  --pz-info: #0EA5E9;
  --pz-gradient: linear-gradient(135deg, #5B3DF5 0%, #9B5CFF 55%, #FF6B4A 100%);
  --pz-gradient-soft: linear-gradient(135deg, rgba(91, 61, 245, .10) 0%, rgba(155, 92, 255, .08) 55%, rgba(255, 107, 74, .10) 100%);
  --pz-gradient-text: linear-gradient(100deg, #5B3DF5 0%, #9B5CFF 50%, #FF6B4A 100%);

  /* Surfaces & text */
  --pz-bg: #F6F6FB;
  --pz-surface: #FFFFFF;
  --pz-surface-2: #FAFAFD;
  --pz-surface-3: #F2F2F8;
  --pz-surface-raised: #FFFFFF;
  --pz-overlay: rgba(14, 16, 36, .45);
  --pz-border: #E7E7F0;
  --pz-border-strong: #D4D4E3;
  --pz-text: #121430;
  --pz-heading: #0E1024;
  --pz-text-2: #3E4163;
  --pz-muted: #676B8C;
  --pz-faint: #7A7E9E; /* tertiary text: ≥ 3.5:1 on all light surfaces (was #9599B5 = 2.6:1) */
  --pz-link: #4B2EE6;
  --pz-link-hover: #3D22C4;
  --pz-ring: 0 0 0 3px rgba(91, 61, 245, .28);
  --pz-ring-danger: 0 0 0 3px rgba(225, 29, 72, .22);
  --pz-selection: rgba(91, 61, 245, .18);

  /* Soft status tints (backgrounds) + readable text tones */
  --pz-primary-soft: #F3F0FF;
  --pz-primary-text: #4B2EE6;
  --pz-accent-soft: #FFF0EB;
  --pz-accent-text: #C93E1C;
  --pz-success-soft: #EBFAF1;
  --pz-success-text: #15803D;
  --pz-warning-soft: #FFF7E6;
  --pz-warning-text: #A65A06;
  --pz-danger-soft: #FFF0F3;
  --pz-danger-text: #BE123C;
  --pz-info-soft: #E9F6FD;
  --pz-info-text: #0369A1;
  --pz-neutral-soft: #F0F1F6;
  --pz-neutral-text: #4A4E70;

  /* Sidebar (ink in both themes) */
  --pz-sidebar-bg: #0E1024;
  --pz-sidebar-bg-2: #13162F;
  --pz-sidebar-border: rgba(255, 255, 255, .07);
  --pz-sidebar-text: #C3C5E0;
  --pz-sidebar-muted: #7A7EA6;
  --pz-sidebar-hover: rgba(255, 255, 255, .06);
  --pz-sidebar-active: rgba(155, 92, 255, .18);
  --pz-sidebar-active-text: #FFFFFF;

  /* Charts (validated categorical order) */
  --pz-chart-1: #5B3DF5;
  --pz-chart-2: #EE5A33;
  --pz-chart-3: #0F9C7F;
  --pz-chart-4: #DB8C00;
  --pz-chart-5: #2385DB;
  --pz-chart-6: #D24B91;
  --pz-chart-7: #2E7D32;
  --pz-chart-8: #9F86FF;
  --pz-chart-grid: #ECECF4;
  --pz-chart-axis: #8A8EAD;
  --pz-chart-seq: 91, 61, 245;

  /* Typography */
  --pz-font-heading: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pz-font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pz-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --pz-text-xs: 12px;
  --pz-text-sm: 13px;
  --pz-text-base: 14px;
  --pz-text-md: 15px;
  --pz-text-lg: 17px;

  /* Shape & depth */
  --pz-radius: 12px;
  --pz-radius-sm: 10px;
  --pz-radius-xs: 8px;
  --pz-radius-lg: 16px;
  --pz-radius-xl: 20px;
  --pz-radius-pill: 999px;
  --pz-shadow-xs: 0 1px 2px rgba(16, 18, 48, .05);
  --pz-shadow-sm: 0 1px 2px rgba(16, 18, 48, .04), 0 1px 3px rgba(16, 18, 48, .06);
  --pz-shadow-md: 0 1px 2px rgba(16, 18, 48, .04), 0 6px 20px -6px rgba(16, 18, 48, .12);
  --pz-shadow-lg: 0 2px 6px rgba(16, 18, 48, .05), 0 18px 44px -10px rgba(16, 18, 48, .20);
  --pz-shadow-xl: 0 28px 70px -14px rgba(16, 18, 48, .34);
  --pz-shadow-primary: 0 6px 18px -6px rgba(91, 61, 245, .55);
  --pz-shadow-accent: 0 6px 18px -6px rgba(240, 79, 44, .55);

  /* Layout */
  --pz-sidebar-w: 264px;
  --pz-sidebar-rail: 76px;
  --pz-topbar-h: 64px;
  --pz-content-max: 1440px;
  --pz-gutter: 32px;
  --pz-control-h: 40px;
  --pz-control-h-sm: 32px;
  --pz-control-h-lg: 48px;

  /* Motion */
  --pz-ease: cubic-bezier(.2, .8, .2, 1);
  --pz-ease-out: cubic-bezier(.16, 1, .3, 1);
  --pz-fast: .12s;
  --pz-med: .2s;
  --pz-slow: .35s;

  /* Layers */
  --pz-z-sticky: 20;
  --pz-z-sidebar: 40;
  --pz-z-dropdown: 60;
  --pz-z-modal: 80;
  --pz-z-toast: 100;
  --pz-z-tooltip: 110;
}

/* Dark theme – explicit toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --pz-primary-50: #1D1A44;
  --pz-primary-100: #262158;
  --pz-primary-200: #3A3280;
  --pz-gradient-soft: linear-gradient(135deg, rgba(123, 100, 255, .16) 0%, rgba(155, 92, 255, .10) 55%, rgba(255, 107, 74, .12) 100%);
  --pz-gradient-text: linear-gradient(100deg, #8B74FF 0%, #B78CFF 50%, #FF8A6B 100%);
  --pz-bg: #0B0D1D;
  --pz-surface: #14172E;
  --pz-surface-2: #171A34;
  --pz-surface-3: #1E2241;
  --pz-surface-raised: #1A1D39;
  --pz-overlay: rgba(4, 5, 14, .66);
  --pz-border: #262A4B;
  --pz-border-strong: #353A62;
  --pz-text: #E9EAF6;
  --pz-heading: #F6F6FC;
  --pz-text-2: #BFC2DE;
  --pz-muted: #9296BA;
  --pz-faint: #7479A0;
  --pz-link: #A898FF;
  --pz-link-hover: #C4B9FF;
  --pz-ring: 0 0 0 3px rgba(139, 116, 255, .42);
  --pz-ring-danger: 0 0 0 3px rgba(251, 113, 133, .32);
  --pz-selection: rgba(139, 116, 255, .32);
  --pz-primary-soft: rgba(123, 100, 255, .16);
  --pz-primary-text: #B9ABFF;
  --pz-accent-soft: rgba(255, 107, 74, .15);
  --pz-accent-text: #FF9878;
  --pz-success-soft: rgba(34, 197, 94, .14);
  --pz-success-text: #5EE08F;
  --pz-warning-soft: rgba(245, 158, 11, .15);
  --pz-warning-text: #FBC756;
  --pz-danger-soft: rgba(244, 63, 94, .15);
  --pz-danger-text: #FF8DA3;
  --pz-info-soft: rgba(14, 165, 233, .15);
  --pz-info-text: #5FCBF7;
  --pz-neutral-soft: rgba(148, 152, 190, .14);
  --pz-neutral-text: #C3C6E2;
  --pz-sidebar-bg: #090A18;
  --pz-sidebar-bg-2: #0E1024;
  --pz-sidebar-border: rgba(255, 255, 255, .06);
  --pz-chart-1: #7B64FF;
  --pz-chart-2: #E0582F;
  --pz-chart-3: #129C7E;
  --pz-chart-4: #C28200;
  --pz-chart-5: #2F86D8;
  --pz-chart-6: #CF4B8F;
  --pz-chart-7: #368E3C;
  --pz-chart-8: #8F76FA;
  --pz-chart-grid: #232746;
  --pz-chart-axis: #7E82A8;
  --pz-chart-seq: 139, 116, 255;
  --pz-shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --pz-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
  --pz-shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .55);
  --pz-shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 20px 48px -12px rgba(0, 0, 0, .65);
  --pz-shadow-xl: 0 30px 80px -16px rgba(0, 0, 0, .75);
}

/* Dark theme – OS preference (unless the user picked light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --pz-primary-50: #1D1A44;
    --pz-primary-100: #262158;
    --pz-primary-200: #3A3280;
    --pz-gradient-soft: linear-gradient(135deg, rgba(123, 100, 255, .16) 0%, rgba(155, 92, 255, .10) 55%, rgba(255, 107, 74, .12) 100%);
    --pz-gradient-text: linear-gradient(100deg, #8B74FF 0%, #B78CFF 50%, #FF8A6B 100%);
    --pz-bg: #0B0D1D;
    --pz-surface: #14172E;
    --pz-surface-2: #171A34;
    --pz-surface-3: #1E2241;
    --pz-surface-raised: #1A1D39;
    --pz-overlay: rgba(4, 5, 14, .66);
    --pz-border: #262A4B;
    --pz-border-strong: #353A62;
    --pz-text: #E9EAF6;
    --pz-heading: #F6F6FC;
    --pz-text-2: #BFC2DE;
    --pz-muted: #9296BA;
    --pz-faint: #7479A0;
    --pz-link: #A898FF;
    --pz-link-hover: #C4B9FF;
    --pz-ring: 0 0 0 3px rgba(139, 116, 255, .42);
    --pz-ring-danger: 0 0 0 3px rgba(251, 113, 133, .32);
    --pz-selection: rgba(139, 116, 255, .32);
    --pz-primary-soft: rgba(123, 100, 255, .16);
    --pz-primary-text: #B9ABFF;
    --pz-accent-soft: rgba(255, 107, 74, .15);
    --pz-accent-text: #FF9878;
    --pz-success-soft: rgba(34, 197, 94, .14);
    --pz-success-text: #5EE08F;
    --pz-warning-soft: rgba(245, 158, 11, .15);
    --pz-warning-text: #FBC756;
    --pz-danger-soft: rgba(244, 63, 94, .15);
    --pz-danger-text: #FF8DA3;
    --pz-info-soft: rgba(14, 165, 233, .15);
    --pz-info-text: #5FCBF7;
    --pz-neutral-soft: rgba(148, 152, 190, .14);
    --pz-neutral-text: #C3C6E2;
    --pz-sidebar-bg: #090A18;
    --pz-sidebar-bg-2: #0E1024;
    --pz-sidebar-border: rgba(255, 255, 255, .06);
    --pz-chart-1: #7B64FF;
    --pz-chart-2: #E0582F;
    --pz-chart-3: #129C7E;
    --pz-chart-4: #C28200;
    --pz-chart-5: #2F86D8;
    --pz-chart-6: #CF4B8F;
    --pz-chart-7: #368E3C;
    --pz-chart-8: #8F76FA;
    --pz-chart-grid: #232746;
    --pz-chart-axis: #7E82A8;
    --pz-chart-seq: 139, 116, 255;
    --pz-shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --pz-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
    --pz-shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .55);
    --pz-shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 20px 48px -12px rgba(0, 0, 0, .65);
    --pz-shadow-xl: 0 30px 80px -16px rgba(0, 0, 0, .75);
  }
}

/* ==========================================================================
   03 Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--pz-bg);
  color: var(--pz-text);
  font-family: var(--pz-font-body);
  font-size: var(--pz-text-base);
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--pz-link); text-decoration: none; transition: color var(--pz-fast) ease; }
a:hover { color: var(--pz-link-hover); }
hr { border: 0; border-top: 1px solid var(--pz-border); margin: 24px 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: var(--pz-selection); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--pz-primary); outline-offset: 2px; border-radius: 4px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--pz-ring); }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -.2em; flex: none; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }
.icon-2xl { width: 40px; height: 40px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px;
  background: var(--pz-surface); color: var(--pz-text); border-radius: var(--pz-radius-sm);
  box-shadow: var(--pz-shadow-lg); font-weight: 600; transition: top var(--pz-med) var(--pz-ease);
}
.skip-link:focus { top: 12px; }

/* Thin, unobtrusive scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--pz-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--pz-border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   04 Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--pz-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--pz-heading);
  letter-spacing: -.015em;
}
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 22px; letter-spacing: -.02em; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--pz-muted); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: var(--pz-text-sm); }
strong, b { font-weight: 650; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li + li { margin-top: .25em; }
code, kbd, samp, pre { font-family: var(--pz-font-mono); font-size: .92em; }
:not(pre) > code {
  padding: .12em .4em; border-radius: 6px; background: var(--pz-surface-3);
  color: var(--pz-text); border: 1px solid var(--pz-border); overflow-wrap: anywhere;
}
blockquote {
  margin: 0 0 1em; padding: 12px 16px; border-left: 3px solid var(--pz-primary);
  background: var(--pz-primary-soft); border-radius: 0 var(--pz-radius-sm) var(--pz-radius-sm) 0; color: var(--pz-text-2);
}
.lead { font-size: var(--pz-text-lg); color: var(--pz-text-2); line-height: 1.6; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--pz-primary-text);
}
.text-gradient {
  background: var(--pz-gradient-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--pz-primary);
}
.prose { max-width: 72ch; color: var(--pz-text-2); line-height: 1.7; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.tabular, .num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   05 App shell – sidebar, topbar, content, footer
   ========================================================================== */
.app-shell { min-height: 100vh; display: flex; }

/* --- Sidebar ------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: var(--pz-z-sidebar);
  width: var(--pz-sidebar-w);
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(91, 61, 245, .16) 0%, transparent 60%),
    radial-gradient(90% 30% at 100% 100%, rgba(255, 107, 74, .08) 0%, transparent 70%),
    var(--pz-sidebar-bg);
  color: var(--pz-sidebar-text);
  border-right: 1px solid var(--pz-sidebar-border);
  transition: width var(--pz-med) var(--pz-ease), transform var(--pz-slow) var(--pz-ease-out);
}
.sidebar a:not(.btn) { color: inherit; }
.sidebar-header {
  height: var(--pz-topbar-h); flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 14px 0 20px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: var(--pz-radius-sm); }
.sidebar-brand img { height: 32px; width: auto; }
.sidebar-brand .brand-mark { display: none; height: 36px; }
.sidebar-collapse-btn, .sidebar-close-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--pz-radius-xs);
  color: var(--pz-sidebar-muted); transition: background var(--pz-fast), color var(--pz-fast);
}
.sidebar-collapse-btn:hover, .sidebar-close-btn:hover { background: var(--pz-sidebar-hover); color: #fff; }
.sidebar-close-btn { display: none; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 16px; scrollbar-color: rgba(255,255,255,.14) transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); background-clip: padding-box; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-label {
  padding: 0 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--pz-sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--pz-med);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: var(--pz-radius-sm); font-weight: 500; font-size: 14px; white-space: nowrap;
  color: var(--pz-sidebar-text); transition: background var(--pz-fast) ease, color var(--pz-fast) ease;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: var(--pz-sidebar-hover); color: #fff; }
.nav-item .nav-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--pz-sidebar-muted); transition: color var(--pz-fast); }
.nav-item .nav-icon .icon { width: 19px; height: 19px; }
.nav-item:hover .nav-icon { color: #fff; }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-lock { display: inline-grid; place-items: center; color: var(--pz-sidebar-muted); opacity: .85; }
.nav-lock .icon { width: 14px; height: 14px; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pz-radius-pill);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, .1); color: #fff;
}
.nav-badge.is-accent { background: var(--pz-accent); }
.nav-item.is-active {
  background: var(--pz-sidebar-active); color: var(--pz-sidebar-active-text); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(155, 92, 255, .22);
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--pz-gradient);
  box-shadow: 0 0 14px rgba(155, 92, 255, .8);
}
.nav-item.is-active .nav-icon { color: #fff; }
.nav-item.is-locked .nav-label { opacity: .78; }

.sidebar-footer { flex: none; padding: 12px; border-top: 1px solid var(--pz-sidebar-border); }
.plan-card {
  position: relative; overflow: hidden; padding: 14px; border-radius: var(--pz-radius);
  background: linear-gradient(160deg, rgba(91, 61, 245, .30) 0%, rgba(155, 92, 255, .16) 50%, rgba(255, 107, 74, .18) 100%);
  border: 1px solid rgba(255, 255, 255, .10); color: #fff;
}
.plan-card::after {
  content: ""; position: absolute; width: 120px; height: 120px; right: -40px; top: -50px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 74, .45), transparent 70%); pointer-events: none;
}
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.plan-card-label { font-family: var(--pz-font-heading); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.plan-card-text { font-size: 12.5px; color: rgba(255, 255, 255, .78); margin-bottom: 10px; line-height: 1.45; }
.plan-card .progress { background: rgba(255, 255, 255, .14); height: 6px; margin-bottom: 12px; }
.plan-card .progress-bar { background: linear-gradient(90deg, #FFB547, #FF6B4A); }
.plan-card .btn { width: 100%; }
.plan-card .ai-meter { color: #fff; }
.plan-card .ai-meter-text, .plan-card .ai-meter-sub { color: rgba(255, 255, 255, .8); }
.plan-card .ai-meter .progress { margin-bottom: 0; }
.plan-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--pz-radius-pill);
  background: rgba(255, 255, 255, .14); font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.sidebar-mini-plan { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: calc(var(--pz-z-sidebar) - 1); background: var(--pz-overlay);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity var(--pz-med), visibility var(--pz-med);
}

/* Collapsed icon rail (desktop) */
@media (min-width: 1024px) {
  html.sidebar-collapsed .sidebar { width: var(--pz-sidebar-rail); }
  html.sidebar-collapsed .main { margin-left: var(--pz-sidebar-rail); }
  html.sidebar-collapsed .sidebar-header { padding: 0; justify-content: center; flex-direction: column; height: auto; min-height: var(--pz-topbar-h); gap: 4px; padding-top: 14px; }
  html.sidebar-collapsed .sidebar-brand .brand-full { display: none; }
  html.sidebar-collapsed .sidebar-brand .brand-mark { display: block; }
  html.sidebar-collapsed .sidebar-collapse-btn .icon { transform: scaleX(-1); }
  html.sidebar-collapsed .sidebar-nav { padding-left: 14px; padding-right: 14px; }
  html.sidebar-collapsed .nav-group-label { opacity: 0; height: 10px; padding: 0; }
  html.sidebar-collapsed .nav-group + .nav-group { margin-top: 10px; border-top: 1px solid var(--pz-sidebar-border); padding-top: 10px; }
  html.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
  html.sidebar-collapsed .nav-item .nav-label,
  html.sidebar-collapsed .nav-item .nav-badge { display: none; }
  html.sidebar-collapsed .nav-item .nav-lock { position: absolute; right: 4px; top: 4px; }
  html.sidebar-collapsed .nav-item .nav-lock .icon { width: 11px; height: 11px; }
  html.sidebar-collapsed .nav-item.is-active::before { left: -14px; }
  html.sidebar-collapsed .plan-card { display: none; }
  html.sidebar-collapsed .sidebar-mini-plan { display: grid; place-items: center; }
}
.sidebar-mini-plan a {
  width: 44px; height: 44px; border-radius: var(--pz-radius); display: grid; place-items: center;
  background: var(--pz-gradient); color: #fff; box-shadow: var(--pz-shadow-primary);
}

/* --- Main column & topbar ------------------------------------------------ */
.main {
  flex: 1 1 auto; min-width: 0; margin-left: var(--pz-sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh; overflow-x: clip;
  transition: margin-left var(--pz-med) var(--pz-ease);
}
.topbar {
  position: sticky; top: 0; z-index: var(--pz-z-sticky);
  height: var(--pz-topbar-h); flex: none;
  display: flex; align-items: center; gap: 12px; padding: 0 var(--pz-gutter);
  background: color-mix(in srgb, var(--pz-bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--pz-border) 70%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: var(--pz-bg); }
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.topbar-btn.topbar-menu-btn { display: none; }
.topbar-title {
  font-family: var(--pz-font-heading); font-weight: 700; font-size: 15px; color: var(--pz-heading);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch;
}
.topbar-search { position: relative; flex: 1 1 auto; max-width: 420px; margin-left: 12px; }
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pz-faint); pointer-events: none; width: 17px; height: 17px; }
.topbar-search .input {
  height: 38px; padding-left: 38px; padding-right: 44px; background: var(--pz-surface);
  border-color: var(--pz-border); border-radius: var(--pz-radius-pill); box-shadow: var(--pz-shadow-xs);
}
.topbar-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.topbar-btn {
  position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center;
  border-radius: var(--pz-radius-sm); color: var(--pz-text-2);
  transition: background var(--pz-fast), color var(--pz-fast);
}
.topbar-btn:hover, .dropdown.is-open > .topbar-btn { background: var(--pz-surface-3); color: var(--pz-heading); }
.topbar-btn .icon { width: 19px; height: 19px; }
.topbar-btn .count {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--pz-radius-pill); background: var(--pz-accent); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--pz-bg);
}
.topbar-divider { width: 1px; height: 24px; background: var(--pz-border); margin: 0 6px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline-block; }
}
.user-chip {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 4px; border-radius: var(--pz-radius-pill);
  color: var(--pz-text); transition: background var(--pz-fast);
}
.user-chip:hover, .dropdown.is-open > .user-chip { background: var(--pz-surface-3); }
.user-chip-name { font-weight: 600; font-size: 13.5px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .icon { color: var(--pz-faint); width: 16px; height: 16px; }
.user-menu-head { padding: 12px 14px 10px; display: flex; gap: 12px; align-items: center; }
.user-menu-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.user-menu-name { font-weight: 650; color: var(--pz-heading); line-height: 1.3; }
.user-menu-email { font-size: 12.5px; color: var(--pz-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }

/* --- Content & footer ---------------------------------------------------- */
.content {
  flex: 1 0 auto; width: 100%; max-width: var(--pz-content-max); margin: 0 auto;
  padding: 28px var(--pz-gutter) 48px;
}
.content:focus, .content:focus-visible { outline: none; box-shadow: none; }
.content-narrow { max-width: 880px; }
.content-full { max-width: none; }
.app-footer {
  flex: none; width: 100%; max-width: var(--pz-content-max); margin: 0 auto;
  padding: 18px var(--pz-gutter) 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  color: var(--pz-faint); font-size: 12.5px; border-top: 1px solid var(--pz-border);
}
.app-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.app-footer a { color: var(--pz-muted); }
.app-footer a:hover { color: var(--pz-text); }
.app-footer .version { font-family: var(--pz-font-mono); font-size: 11.5px; padding: 2px 8px; border-radius: var(--pz-radius-pill); background: var(--pz-surface-3); color: var(--pz-muted); }

/* --- Banners (impersonation, trial) -------------------------------------- */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 9px var(--pz-gutter); font-size: 13.5px; font-weight: 500; text-align: center;
}
.banner .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.banner-close { margin-left: 4px; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; opacity: .8; }
.banner-close:hover { opacity: 1; background: rgba(255, 255, 255, .15); }
.banner-impersonate { background: repeating-linear-gradient(-45deg, #2A1B0B, #2A1B0B 12px, #33210D 12px, #33210D 24px); color: #FFD9A0; }
.banner-impersonate strong { color: #fff; }
.banner-impersonate .btn { background: #FFB547; color: #2A1B0B; border-color: transparent; }
.banner-trial { background: var(--pz-gradient); color: #fff; position: relative; }
.banner-trial .btn { background: #fff; color: var(--pz-primary-700); border-color: transparent; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.banner-trial .btn:hover { background: #fff; color: var(--pz-accent-600); }
.banner-warning { background: var(--pz-warning-soft); color: var(--pz-warning-text); border-bottom: 1px solid color-mix(in srgb, var(--pz-warning) 30%, transparent); }

/* ==========================================================================
   06 Page header & breadcrumbs
   ========================================================================== */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-header > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-title .badge { font-family: var(--pz-font-body); letter-spacing: 0; }
.page-subtitle { margin: 6px 0 0; color: var(--pz-muted); font-size: 14.5px; max-width: 70ch; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; color: var(--pz-muted); }
.breadcrumbs li { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: ""; width: 14px; height: 14px; background: currentColor; opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.breadcrumbs a { color: var(--pz-muted); }
.breadcrumbs a:hover { color: var(--pz-text); }
.breadcrumbs [aria-current] { color: var(--pz-text-2); font-weight: 500; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-title h2, .section-title h3 { margin: 0; }

/* ==========================================================================
   07 Layout grids – .grid .stack .row .split
   ========================================================================== */
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-tight { gap: 12px; }
.grid > .span-2 { grid-column: span 2; }
.grid > .span-3 { grid-column: span 3; }
.grid > .span-full { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { gap: 10px; }
.stack-lg { gap: 32px; }
.stack > * { margin: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.row-nowrap { flex-wrap: nowrap; }
.row > .grow, .grow { flex: 1 1 auto; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split-wide-aside { grid-template-columns: minmax(0, 1fr) 400px; }
.split-left { grid-template-columns: 300px minmax(0, 1fr); }
.split > aside, .split .aside-sticky { position: sticky; top: calc(var(--pz-topbar-h) + 20px); }
.divider { height: 1px; background: var(--pz-border); margin: 20px 0; border: 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--pz-faint); font-size: 12.5px; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--pz-border); }

/* ==========================================================================
   08 Cards
   ========================================================================== */
.card {
  position: relative; background: var(--pz-surface); border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius); box-shadow: var(--pz-shadow-sm); min-width: 0;
  display: flex; flex-direction: column;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--pz-border); min-height: 60px;
}
.card-header > div:first-child { min-width: 0; }
.card-title { margin: 0; font-family: var(--pz-font-heading); font-size: 15.5px; font-weight: 700; color: var(--pz-heading); display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card-title .icon { color: var(--pz-primary); }
.card-subtitle { margin: 2px 0 0; color: var(--pz-muted); font-size: 13px; }
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 20px; flex: 1 1 auto; min-width: 0; }
.card-body + .card-body { border-top: 1px solid var(--pz-border); }
.card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--pz-border); background: var(--pz-surface-2);
  border-radius: 0 0 var(--pz-radius) var(--pz-radius);
}
.card-footer.justify-end { justify-content: flex-end; }
.card-flush .card-body { padding: 0; }
.card-flush > .table-wrap, .card > .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--pz-radius) var(--pz-radius); }
.card > .table-wrap:first-child { border-radius: var(--pz-radius) var(--pz-radius) 0 0; }
.card-hover { transition: transform var(--pz-med) var(--pz-ease), box-shadow var(--pz-med) var(--pz-ease), border-color var(--pz-med); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--pz-shadow-lg); border-color: var(--pz-border-strong); }
a.card { color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-muted { background: var(--pz-surface-2); box-shadow: none; }
.card-gradient { background: var(--pz-gradient); color: #fff; border: 0; box-shadow: var(--pz-shadow-primary); }
.card-gradient .card-title, .card-gradient h2, .card-gradient h3 { color: #fff; }
.card-gradient .muted { color: rgba(255, 255, 255, .78) !important; } /* beats the global .muted !important */
.card-ink { background: var(--pz-ink); color: #E7E8F7; border-color: transparent; }
.card-ink .card-title, .card-ink h2, .card-ink h3 { color: #fff; }
.card-accent-top { position: relative; }
.card-accent-top::before { /* 3px gradient bar that follows the card's rounded top corners */
  content: ""; position: absolute; z-index: 1; top: -1px; left: -1px; right: -1px; height: calc(var(--pz-radius) + 1px);
  border-radius: var(--pz-radius) var(--pz-radius) 0 0; background: var(--pz-gradient);
  clip-path: inset(0 0 calc(100% - 3px) 0); pointer-events: none;
}
.card-section-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pz-faint); margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--pz-muted); }
.kv dd { margin: 0; color: var(--pz-text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ==========================================================================
   09 Stats (KPI tiles)
   ========================================================================== */
.stat {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; background: var(--pz-surface); border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius); box-shadow: var(--pz-shadow-sm); min-width: 0;
}
.stat-label { font-size: 13px; font-weight: 550; color: var(--pz-muted); display: flex; align-items: center; gap: 6px; }
.stat-value {
  font-family: var(--pz-font-heading); font-size: 28px; font-weight: 800; color: var(--pz-heading);
  letter-spacing: -.03em; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere;
}
.stat-value small { font-size: 15px; font-weight: 700; color: var(--pz-muted); letter-spacing: 0; margin-left: 2px; }
.stat-meta { font-size: 12.5px; color: var(--pz-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: var(--pz-radius-pill);
  font-size: 12px; font-weight: 700; background: var(--pz-neutral-soft); color: var(--pz-neutral-text);
}
.stat-trend .icon { width: 13px; height: 13px; }
.stat-trend.up { background: var(--pz-success-soft); color: var(--pz-success-text); }
.stat-trend.down { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.stat-trend.up.is-bad { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.stat-trend.down.is-good { background: var(--pz-success-soft); color: var(--pz-success-text); }
.stat-icon {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; background: var(--pz-primary-soft); color: var(--pz-primary-text);
}
.stat-icon .icon { width: 20px; height: 20px; }
.stat-icon.is-accent { background: var(--pz-accent-soft); color: var(--pz-accent-text); }
.stat-icon.is-success { background: var(--pz-success-soft); color: var(--pz-success-text); }
.stat-icon.is-warning { background: var(--pz-warning-soft); color: var(--pz-warning-text); }
.stat-icon.is-info { background: var(--pz-info-soft); color: var(--pz-info-text); }
.stat-icon.is-gradient { background: var(--pz-gradient); color: #fff; box-shadow: var(--pz-shadow-primary); }
.stat:has(.stat-icon) .stat-label { padding-right: 48px; }
.stat-spark { margin-top: 10px; height: 36px; }
.stat-highlight { background: var(--pz-gradient); border-color: transparent; color: #fff; box-shadow: var(--pz-shadow-primary); }
.stat-highlight .stat-label, .stat-highlight .stat-meta { color: rgba(255, 255, 255, .82); }
.stat-highlight .stat-value { color: #fff; }
.stat-highlight .stat-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.stat-highlight .stat-trend { background: rgba(255, 255, 255, .2); color: #fff; }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ==========================================================================
   10 Buttons
   ========================================================================== */
.btn {
  --btn-bg: var(--pz-surface); --btn-fg: var(--pz-text); --btn-bd: var(--pz-border-strong);
  --btn-bg-h: var(--pz-surface-3); --btn-fg-h: var(--pz-heading); --btn-bd-h: var(--pz-border-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--pz-control-h); padding: 0 16px; border-radius: var(--pz-radius-sm);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--pz-font-body); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none; vertical-align: middle;
  transition: background var(--pz-fast) ease, color var(--pz-fast) ease, border-color var(--pz-fast) ease,
              box-shadow var(--pz-med) var(--pz-ease), transform var(--pz-fast) ease;
}
.btn:hover { background: var(--btn-bg-h); color: var(--btn-fg-h); border-color: var(--btn-bd-h); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--pz-ring); }
.btn .icon { width: 17px; height: 17px; }
.btn[disabled], .btn.is-disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; box-shadow: none; }
.btn-primary {
  --btn-bg: var(--pz-primary); --btn-fg: #fff; --btn-bd: transparent;
  --btn-bg-h: var(--pz-primary-600); --btn-fg-h: #fff; --btn-bd-h: transparent;
  box-shadow: 0 1px 2px rgba(61, 34, 196, .25), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover { box-shadow: var(--pz-shadow-primary), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-accent {
  /* Glut 700 so white button text meets WCAG AA (4.6:1 instead of 2.8:1 on #FF6B4A) – docs/BRANDING.md 13.3 */
  --btn-bg: var(--pz-accent-700); --btn-fg: #fff; --btn-bd: transparent;
  --btn-bg-h: var(--pz-accent-800); --btn-fg-h: #fff; --btn-bd-h: transparent;
  box-shadow: 0 1px 2px rgba(240, 79, 44, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-accent:hover { box-shadow: var(--pz-shadow-accent); }
.btn-secondary { --btn-bg: var(--pz-surface); --btn-fg: var(--pz-text); --btn-bd: var(--pz-border-strong); box-shadow: var(--pz-shadow-xs); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--pz-text-2); --btn-bg-h: var(--pz-surface-3); --btn-bd-h: transparent; }
.btn-danger {
  --btn-bg: var(--pz-danger); --btn-fg: #fff; --btn-bd: transparent;
  --btn-bg-h: #C8103B; --btn-fg-h: #fff; --btn-bd-h: transparent;
  box-shadow: 0 1px 2px rgba(225, 29, 72, .3);
}
.btn-danger-soft { --btn-bg: var(--pz-danger-soft); --btn-fg: var(--pz-danger-text); --btn-bd: transparent; --btn-bg-h: var(--pz-danger); --btn-fg-h: #fff; --btn-bd-h: transparent; }
.btn-success {
  --btn-bg: var(--pz-success); --btn-fg: #fff; --btn-bd: transparent;
  --btn-bg-h: #12893E; --btn-fg-h: #fff; --btn-bd-h: transparent;
  box-shadow: 0 1px 2px rgba(22, 163, 74, .3);
}
.btn-soft { --btn-bg: var(--pz-primary-soft); --btn-fg: var(--pz-primary-text); --btn-bd: transparent; --btn-bg-h: var(--pz-primary-100); --btn-fg-h: var(--pz-primary-text); --btn-bd-h: transparent; }
.btn-gradient {
  --btn-fg: #fff; --btn-fg-h: #fff; --btn-bd: transparent; --btn-bd-h: transparent;
  background: var(--pz-gradient); background-size: 140% 140%; background-position: 0% 50%;
  box-shadow: var(--pz-shadow-primary); transition: background-position var(--pz-slow) var(--pz-ease), box-shadow var(--pz-med), transform var(--pz-fast);
}
.btn-gradient:hover { background: var(--pz-gradient); background-size: 140% 140%; background-position: 100% 50%; }
.btn-light {
  --btn-bg: #FFFFFF; --btn-fg: var(--pz-primary-700); --btn-bd: transparent;
  --btn-bg-h: #FFFFFF; --btn-fg-h: var(--pz-accent-600); --btn-bd-h: transparent;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, .3);
}
.btn-link { --btn-bg: transparent; --btn-bd: transparent; --btn-bg-h: transparent; --btn-bd-h: transparent; --btn-fg: var(--pz-link); --btn-fg-h: var(--pz-link-hover); padding: 0 4px; height: auto; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* AI button – gradient border, sparkle feel */
.btn-ai {
  --btn-fg: var(--pz-primary-text); --btn-fg-h: var(--pz-primary-text); --btn-bd: transparent; --btn-bd-h: transparent;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--pz-surface), var(--pz-surface)) padding-box, var(--pz-gradient) border-box;
  box-shadow: 0 1px 2px rgba(91, 61, 245, .12), 0 0 0 0 rgba(155, 92, 255, 0);
  overflow: hidden; isolation: isolate;
}
.btn-ai::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pz-gradient-soft); opacity: .9;
  transition: opacity var(--pz-med);
}
.btn-ai::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); transition: left .6s var(--pz-ease);
}
.btn-ai:hover {
  background: linear-gradient(var(--pz-surface), var(--pz-surface)) padding-box, var(--pz-gradient) border-box;
  box-shadow: 0 4px 18px -4px rgba(155, 92, 255, .55);
}
.btn-ai:hover::after { left: 120%; }
.btn-ai .icon { color: var(--pz-violet); }
.btn-ai:hover .icon { animation: pz-twinkle 1.2s ease-in-out infinite; }
.btn-ai.is-loading .icon { animation: none; }
:root[data-theme="dark"] .btn-ai::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .14), transparent); }
@keyframes pz-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }

.btn-sm { height: var(--pz-control-h-sm); padding: 0 12px; font-size: 13px; border-radius: var(--pz-radius-xs); gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs .icon { width: 13px; height: 13px; }
.btn-lg { height: var(--pz-control-h-lg); padding: 0 22px; font-size: 15px; border-radius: var(--pz-radius); gap: 10px; }
.btn-lg .icon { width: 19px; height: 19px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: var(--pz-control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--pz-control-h-sm); }
.btn-icon.btn-xs { width: 26px; }
.btn-icon.btn-lg { width: var(--pz-control-h-lg); }
.btn-pill { border-radius: var(--pz-radius-pill); }
.btn-group { display: inline-flex; isolation: isolate; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--pz-radius-sm) 0 0 var(--pz-radius-sm); margin-left: 0; }
.btn-group > .btn:last-child { border-radius: 0 var(--pz-radius-sm) var(--pz-radius-sm) 0; }
.btn-group > .btn:hover, .btn-group > .btn:focus-visible { z-index: 1; }
.btn-group > .btn.is-active { --btn-bg: var(--pz-primary-soft); --btn-fg: var(--pz-primary-text); --btn-bg-h: var(--pz-primary-soft); --btn-fg-h: var(--pz-primary-text); z-index: 2; border-color: var(--pz-primary); }
.btn-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 11.5px; font-weight: 700; }
.btn-secondary .btn-badge, .btn-ghost .btn-badge { background: var(--pz-primary-soft); color: var(--pz-primary-text); }

/* Loading state (data-loading / Persolz.loading) */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after,
.btn-ai.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  color: var(--btn-fg); animation: pz-spin .7s linear infinite; visibility: visible;
  background: none; transform: none; z-index: 1;
}
.btn-primary.is-loading::after, .btn-accent.is-loading::after, .btn-danger.is-loading::after,
.btn-success.is-loading::after, .btn-gradient.is-loading::after { color: #fff; }
.btn-ai.is-loading::after { color: var(--pz-primary); }
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn-spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: pz-spin .7s linear infinite; flex: none;
}
@keyframes pz-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   11 Forms
   ========================================================================== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: flex; align-items: baseline; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--pz-heading); }
.form-label .optional { margin-left: auto; font-weight: 450; color: var(--pz-faint); font-size: 12.5px; }
.form-label .required { color: var(--pz-danger); }
.form-group > .segmented, .form-group > .btn-group, .form-group > .switch, .form-group > .check { align-self: flex-start; }
.form-hint { font-size: 12.5px; color: var(--pz-muted); line-height: 1.45; margin: 0; }
.form-error { font-size: 12.5px; color: var(--pz-danger-text); font-weight: 550; display: flex; align-items: center; gap: 5px; margin: 0; }
.form-error .icon { width: 14px; height: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
/* stacked on phones the last field of a row must keep its spacing to the next field */
.form-row:not(:last-child) > .form-group:last-child, .form-row-3:not(:last-child) > .form-group:last-child { margin-bottom: 18px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.form-actions.is-sticky { position: sticky; bottom: 0; z-index: 5; padding: 14px 0; background: linear-gradient(to top, var(--pz-bg) 70%, transparent); }
.fieldset { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 12px; font-family: var(--pz-font-heading); font-weight: 700; font-size: 15px; color: var(--pz-heading); }

.input, .select, .textarea {
  display: block; width: 100%; min-width: 0; height: var(--pz-control-h); padding: 0 12px;
  background: var(--pz-surface); color: var(--pz-text); border: 1px solid var(--pz-border-strong);
  border-radius: var(--pz-radius-sm); font-size: 14px; line-height: 1.4;
  box-shadow: var(--pz-shadow-xs);
  transition: border-color var(--pz-fast) ease, box-shadow var(--pz-fast) ease, background var(--pz-fast) ease;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--pz-faint); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--pz-primary) 35%, var(--pz-border-strong)); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--pz-primary); box-shadow: var(--pz-ring); outline: none; }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--pz-surface-3); color: var(--pz-muted); cursor: not-allowed; box-shadow: none; }
.input[readonly] { cursor: default; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid,
.form-group.has-error .input, .form-group.has-error .select, .form-group.has-error .textarea { border-color: var(--pz-danger); }
.input.is-invalid:focus, .form-group.has-error .input:focus, .form-group.has-error .textarea:focus { box-shadow: var(--pz-ring-danger); }
.input.is-valid { border-color: var(--pz-success); }
.textarea { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.textarea.is-code, .input.is-code { font-family: var(--pz-font-mono); font-size: 13px; }
.select {
  padding-right: 36px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23878AA8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
.select[multiple] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
.select[multiple] option { padding: 6px 8px; border-radius: 6px; }
.input-sm, .select.input-sm { height: var(--pz-control-h-sm); font-size: 13px; border-radius: var(--pz-radius-xs); }
.input-lg { height: var(--pz-control-h-lg); font-size: 15px; padding: 0 16px; border-radius: var(--pz-radius); }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { padding-right: 10px; }
input[type="color"].input { padding: 4px; width: 56px; cursor: pointer; }
input[type="file"].input { padding: 6px; height: auto; cursor: pointer; }
input[type="file"].input::file-selector-button {
  margin-right: 12px; height: 28px; padding: 0 12px; border: 0; border-radius: 7px;
  background: var(--pz-primary-soft); color: var(--pz-primary-text); font-weight: 600; cursor: pointer;
}
input[type="search"].input::-webkit-search-cancel-button { cursor: pointer; }
input[type="number"].input { font-variant-numeric: tabular-nums; }

/* Input group with addons */
.input-group { display: flex; align-items: stretch; width: 100%; position: relative; }
.input-group > .input, .input-group > .select { flex: 1 1 auto; border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--pz-radius-sm); border-bottom-left-radius: var(--pz-radius-sm); }
.input-group > :last-child { border-top-right-radius: var(--pz-radius-sm); border-bottom-right-radius: var(--pz-radius-sm); }
.input-group > * + * { margin-left: -1px; }
.input-group > .input:focus, .input-group > .select:focus { z-index: 1; }
.input-addon {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; flex: none; white-space: nowrap;
  background: var(--pz-surface-3); border: 1px solid var(--pz-border-strong); color: var(--pz-muted); font-size: 13.5px;
}
.input-group > .btn { border-radius: 0; height: auto; min-height: var(--pz-control-h); }
.input-group > .btn:last-child { border-radius: 0 var(--pz-radius-sm) var(--pz-radius-sm) 0; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pz-faint); pointer-events: none; width: 17px; height: 17px; }
.input-icon > .input { padding-left: 38px; }
.input-icon-right > .icon { left: auto; right: 12px; }
.input-icon-right > .input { padding-left: 12px; padding-right: 38px; }
.char-count { font-size: 11.5px; color: var(--pz-faint); text-align: right; margin-top: -2px; font-variant-numeric: tabular-nums; }
.char-count.is-near { color: var(--pz-warning-text); }
.char-count.is-over { color: var(--pz-danger-text); font-weight: 650; }

/* Checkbox & radio */
.check {
  display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--pz-text);
  line-height: 1.45; user-select: none; position: relative;
}
.check input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.check > span { position: relative; padding-left: 28px; min-height: 20px; display: inline-block; }
.check > span::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--pz-border-strong); background: var(--pz-surface); box-shadow: var(--pz-shadow-xs);
  transition: background var(--pz-fast), border-color var(--pz-fast), box-shadow var(--pz-fast);
}
.check > span::after {
  content: ""; position: absolute; left: 3px; top: 4px; width: 12px; height: 12px; opacity: 0; transform: scale(.6);
  background: #fff; transition: opacity var(--pz-fast), transform var(--pz-fast) var(--pz-ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.check input[type="radio"] + span::before { border-radius: 50%; }
.check input[type="radio"] + span::after { -webkit-mask: none; mask: none; border-radius: 50%; width: 8px; height: 8px; left: 5px; top: 6px; }
.check:hover > span::before { border-color: var(--pz-primary); }
.check input:checked + span::before { background: var(--pz-primary); border-color: var(--pz-primary); }
.check input:checked + span::after { opacity: 1; transform: scale(1); }
.check input[type="checkbox"]:indeterminate + span::before { background: var(--pz-primary); border-color: var(--pz-primary); }
.check input[type="checkbox"]:indeterminate + span::after { opacity: 1; transform: none; -webkit-mask: none; mask: none; width: 10px; height: 2px; left: 4px; top: 9px; border-radius: 2px; }
.check input:focus-visible + span::before { box-shadow: var(--pz-ring); }
.check input:disabled + span { opacity: .55; cursor: not-allowed; }
.check-only > span { padding-left: 18px; }
.check-hint { display: block; font-size: 12.5px; color: var(--pz-muted); margin-top: 1px; }
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-inline { display: flex; flex-wrap: wrap; gap: 10px 20px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; position: relative; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-slider {
  position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--pz-border-strong);
  transition: background var(--pz-med) var(--pz-ease); box-shadow: inset 0 1px 2px rgba(16, 18, 48, .12);
}
.switch-slider::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 18, 48, .3); transition: transform var(--pz-med) var(--pz-ease);
}
.switch input:checked + .switch-slider { background: var(--pz-primary); }
.switch input:checked + .switch-slider::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-slider { box-shadow: var(--pz-ring); }
.switch input:disabled ~ * { opacity: .55; cursor: not-allowed; }
.switch-label { color: var(--pz-text); line-height: 1.4; }
.switch-label small { display: block; color: var(--pz-muted); font-size: 12.5px; }
.switch-sm .switch-slider { width: 30px; height: 18px; }
.switch-sm .switch-slider::after { width: 12px; height: 12px; }
.switch-sm input:checked + .switch-slider::after { transform: translateX(12px); }

/* Choice cards (radio cards) */
.choice-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice-cards.is-compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice-card { position: relative; display: block; cursor: pointer; margin: 0; }
.choice-card > input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card-body {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px 14px 16px;
  border: 1.5px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface);
  transition: border-color var(--pz-fast), box-shadow var(--pz-med), background var(--pz-fast);
  padding-right: 40px;
}
.choice-card-body::after {
  content: ""; position: absolute; right: 14px; top: 14px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--pz-border-strong); background: var(--pz-surface); transition: all var(--pz-fast);
}
.choice-card > input[type="checkbox"] + .choice-card-body::after { border-radius: 6px; }
.choice-card:hover .choice-card-body { border-color: var(--pz-border-strong); box-shadow: var(--pz-shadow-sm); }
.choice-card > input:checked + .choice-card-body {
  border-color: var(--pz-primary); background: linear-gradient(var(--pz-primary-soft), var(--pz-primary-soft)), var(--pz-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-primary) 14%, transparent);
}
.choice-card > input:checked + .choice-card-body::after {
  border-color: var(--pz-primary); background: var(--pz-primary);
  box-shadow: inset 0 0 0 3.5px var(--pz-surface);
}
.choice-card > input[type="checkbox"]:checked + .choice-card-body::after {
  box-shadow: none;
  background: var(--pz-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.choice-card > input:focus-visible + .choice-card-body { box-shadow: var(--pz-ring); }
.choice-card > input:disabled + .choice-card-body { opacity: .55; cursor: not-allowed; }
.choice-card-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--pz-surface-3); color: var(--pz-muted); transition: all var(--pz-fast);
}
.choice-card > input:checked + .choice-card-body .choice-card-icon { background: var(--pz-gradient); color: #fff; }
.choice-card-title { font-weight: 650; color: var(--pz-heading); font-size: 14px; }
.choice-card-text { font-size: 12.5px; color: var(--pz-muted); line-height: 1.45; }
.choice-card .badge { align-self: flex-start; margin-top: 4px; }

/* Range */
input[type="range"].range { width: 100%; accent-color: var(--pz-primary); height: 24px; cursor: pointer; }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--pz-radius-sm); background: var(--pz-surface-3); border: 1px solid var(--pz-border); }
.segmented > button, .segmented > label, .segmented > a {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--pz-muted); cursor: pointer; transition: all var(--pz-fast); position: relative;
}
.segmented > label > input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > .is-active, .segmented > label:has(input:checked) { background: var(--pz-surface); color: var(--pz-heading); box-shadow: var(--pz-shadow-sm); }
.segmented .icon { width: 16px; height: 16px; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
  position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--pz-surface); border: 1px solid var(--pz-border); border-radius: var(--pz-radius);
  box-shadow: var(--pz-shadow-sm);
}
.table-wrap.is-sticky { max-height: 560px; overflow-y: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--pz-border); }
.table thead th {
  position: relative; background: var(--pz-surface-2); color: var(--pz-muted); font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; height: 44px; padding-top: 10px; padding-bottom: 10px;
}
.table-wrap.is-sticky thead th, .table.table-sticky thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--pz-border); }
.table tbody tr:last-child > td { border-bottom: 0; }
.table tbody tr { transition: background var(--pz-fast); }
.table-hover tbody tr:hover > td { background: var(--pz-surface-2); }
.table tbody tr.is-selected > td { background: var(--pz-primary-soft); }
.table tbody tr[data-href] { cursor: pointer; }
.table td strong, .table td .cell-title { color: var(--pz-heading); font-weight: 600; }
.table .cell-title { display: block; }
.table .cell-sub { display: block; font-size: 12.5px; color: var(--pz-muted); margin-top: 1px; }
.table a.cell-title:hover { color: var(--pz-link); }
.table-compact th, .table-compact td { padding: 8px 12px; }
.table-compact thead th { height: 36px; }
.table tfoot td { background: var(--pz-surface-2); font-weight: 600; border-top: 1px solid var(--pz-border); border-bottom: 0; }
.cell-actions { text-align: right !important; white-space: nowrap; width: 1%; }
.cell-actions > * + * { margin-left: 4px; }
.cell-actions .btn, .cell-actions .dropdown { vertical-align: middle; }
.cell-muted { color: var(--pz-muted); }
.cell-check { width: 44px; padding-right: 0 !important; }
.cell-check .check > span { padding-left: 18px; }
.cell-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-nowrap { white-space: nowrap; }
.cell-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table th.is-sortable a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th.is-sortable a:hover { color: var(--pz-text); }
.table th.is-sorted { color: var(--pz-primary-text); }
.table-empty td { text-align: center; padding: 48px 16px; color: var(--pz-muted); }
.table-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table-person .avatar { flex: none; }

/* ==========================================================================
   12 Badges, status dots, chips, avatars, kbd
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--pz-radius-pill);
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
  background: var(--pz-neutral-soft); color: var(--pz-neutral-text);
}
.badge .icon { width: 13px; height: 13px; }
.badge .dot { width: 6px; height: 6px; box-shadow: none; background: currentColor; }
.badge-primary { background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.badge-accent { background: var(--pz-accent-soft); color: var(--pz-accent-text); }
.badge-success { background: var(--pz-success-soft); color: var(--pz-success-text); }
.badge-warning { background: var(--pz-warning-soft); color: var(--pz-warning-text); }
.badge-danger { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.badge-info { background: var(--pz-info-soft); color: var(--pz-info-text); }
.badge-neutral { background: var(--pz-neutral-soft); color: var(--pz-neutral-text); }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--pz-border-strong); color: var(--pz-text-2); }
.badge-gradient { background: var(--pz-gradient); color: #fff; }
.badge-pro { background: var(--pz-gradient); color: #fff; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; height: 20px; padding: 0 8px; }
.badge-lg { height: 28px; padding: 0 12px; font-size: 13px; }
.badge-sm { height: 18px; padding: 0 7px; font-size: 11px; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pz-faint); flex: none;
  vertical-align: middle;
}
.dot-success, .dot.is-success { background: var(--pz-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-success) 18%, transparent); }
.dot-warning, .dot.is-warning { background: var(--pz-warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-warning) 18%, transparent); }
.dot-danger, .dot.is-danger { background: var(--pz-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-danger) 18%, transparent); }
.dot-info, .dot.is-info { background: var(--pz-info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-info) 18%, transparent); }
.dot-primary, .dot.is-primary { background: var(--pz-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pz-primary) 18%, transparent); }
.dot-accent, .dot.is-accent { background: var(--pz-accent); }
.dot-neutral, .dot.is-neutral { background: var(--pz-faint); }
.dot-pulse { position: relative; }
.dot-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pz-pulse 1.8s ease-out infinite; }
@keyframes pz-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--pz-text-2); white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--pz-radius-pill);
  background: var(--pz-surface-3); color: var(--pz-text-2); font-size: 12.5px; font-weight: 550; border: 1px solid var(--pz-border);
  white-space: nowrap; max-width: 100%; transition: background var(--pz-fast), border-color var(--pz-fast), color var(--pz-fast);
}
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip .icon { width: 14px; height: 14px; }
a.chip:hover, button.chip:hover { border-color: var(--pz-border-strong); color: var(--pz-heading); }
.chip.is-active, .chip-primary { background: var(--pz-primary-soft); color: var(--pz-primary-text); border-color: color-mix(in srgb, var(--pz-primary) 30%, transparent); }
.chip-remove {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: -4px; border-radius: 50%;
  color: inherit; opacity: .6; transition: opacity var(--pz-fast), background var(--pz-fast);
}
.chip-remove:hover { opacity: 1; background: rgba(0, 0, 0, .08); }
.chip-remove .icon { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-color { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.avatar {
  --avatar-size: 32px;
  display: inline-grid; place-items: center; flex: none; width: var(--avatar-size); height: var(--avatar-size);
  border-radius: 50%; overflow: hidden; background: var(--pz-gradient); color: #fff; font-family: var(--pz-font-heading);
  font-size: calc(var(--avatar-size) * .38); font-weight: 700; letter-spacing: .01em; text-transform: uppercase; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --avatar-size: 22px; }
.avatar-sm { --avatar-size: 28px; }
.avatar-lg { --avatar-size: 44px; }
.avatar-xl { --avatar-size: 64px; }
.avatar-square { border-radius: 10px; }
.avatar.is-soft { background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.avatar[data-tone="1"] { background: linear-gradient(135deg, #5B3DF5, #9B5CFF); }
.avatar[data-tone="2"] { background: linear-gradient(135deg, #FF6B4A, #FFB547); }
.avatar[data-tone="3"] { background: linear-gradient(135deg, #0F9C7F, #18C29C); }
.avatar[data-tone="4"] { background: linear-gradient(135deg, #2385DB, #0EA5E9); }
.avatar[data-tone="5"] { background: linear-gradient(135deg, #D24B91, #FF6B4A); }
.avatar[data-tone="6"] { background: linear-gradient(135deg, #0E1024, #3D22C4); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--pz-surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; border: 1px solid var(--pz-border-strong); border-bottom-width: 2px; background: var(--pz-surface);
  color: var(--pz-muted); font-family: var(--pz-font-body); font-size: 11.5px; font-weight: 600; line-height: 1;
}
.code-block {
  position: relative; margin: 0; padding: 16px 18px; overflow: auto; border-radius: var(--pz-radius-sm);
  background: #0E1024; color: #E3E5FF; font-family: var(--pz-font-mono); font-size: 12.5px; line-height: 1.65;
  border: 1px solid rgba(255, 255, 255, .06); white-space: pre; tab-size: 2;
}
:root[data-theme="dark"] .code-block { background: #070814; }
.code-block .c-key { color: #B9A9FF; }
.code-block .c-str { color: #7EE0B8; }
.code-block .c-num { color: #FFC27A; }
.code-block .c-com { color: #7479A3; font-style: italic; }
.code-block-copy { position: absolute; top: 8px; right: 8px; }
.code-block-copy .btn { background: rgba(255, 255, 255, .08); color: #E3E5FF; border-color: rgba(255, 255, 255, .12); }
.code-block-copy .btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ==========================================================================
   13 Alerts
   ========================================================================== */
.alert {
  --alert-bg: var(--pz-info-soft); --alert-fg: var(--pz-info-text); --alert-bd: color-mix(in srgb, var(--pz-info) 25%, transparent);
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: var(--pz-radius); background: var(--alert-bg); color: var(--pz-text);
  border: 1px solid var(--alert-bd); font-size: 13.5px; line-height: 1.5;
}
.alert > .icon { color: var(--alert-fg); width: 20px; height: 20px; margin-top: 0; flex: none; }
.alert-body, .alert > div { flex: 1 1 auto; min-width: 0; }
.alert-title { display: block; font-weight: 700; color: var(--pz-heading); margin-bottom: 2px; font-size: 14px; }
.alert p { margin: 0; color: var(--pz-text-2); }
.alert p + p { margin-top: 6px; }
.alert a:not(.btn) { color: var(--alert-fg); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.alert-info { --alert-bg: var(--pz-info-soft); --alert-fg: var(--pz-info-text); --alert-bd: color-mix(in srgb, var(--pz-info) 25%, transparent); }
.alert-success { --alert-bg: var(--pz-success-soft); --alert-fg: var(--pz-success-text); --alert-bd: color-mix(in srgb, var(--pz-success) 25%, transparent); }
.alert-warning { --alert-bg: var(--pz-warning-soft); --alert-fg: var(--pz-warning-text); --alert-bd: color-mix(in srgb, var(--pz-warning) 30%, transparent); }
.alert-danger { --alert-bg: var(--pz-danger-soft); --alert-fg: var(--pz-danger-text); --alert-bd: color-mix(in srgb, var(--pz-danger) 25%, transparent); }
.alert-primary { --alert-bg: var(--pz-primary-soft); --alert-fg: var(--pz-primary-text); --alert-bd: color-mix(in srgb, var(--pz-primary) 22%, transparent); }
.alert-close, .alert [data-dismiss] {
  flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; display: inline-grid; place-items: center;
  border-radius: 8px; color: var(--pz-muted); transition: background var(--pz-fast), color var(--pz-fast);
}
.alert-close:hover, .alert [data-dismiss]:hover { background: rgba(0, 0, 0, .06); color: var(--pz-text); }
.alert.is-dismissing { animation: pz-fade-out .22s ease forwards; }
.alert-sm { padding: 10px 12px; font-size: 13px; border-radius: var(--pz-radius-sm); }
.alert-sm > .icon { width: 17px; height: 17px; }
@keyframes pz-fade-out { to { opacity: 0; transform: translateY(-4px); } }

/* ==========================================================================
   14 Tabs (underline + pills)
   ========================================================================== */
.tabs {
  display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--pz-border); margin-bottom: 20px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
  color: var(--pz-muted); font-size: 14px; font-weight: 600; white-space: nowrap; border-radius: 8px 8px 0 0;
  transition: color var(--pz-fast), background var(--pz-fast);
}
.tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--pz-gradient); transform: scaleX(0); transition: transform var(--pz-med) var(--pz-ease);
}
.tab:hover { color: var(--pz-heading); background: var(--pz-surface-3); }
.tab.is-active { color: var(--pz-heading); }
.tab.is-active::after { transform: scaleX(1); }
.tab .icon { width: 16px; height: 16px; }
.tab .badge { height: 20px; padding: 0 7px; font-size: 11px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: pz-fade-in var(--pz-med) var(--pz-ease); }
.tabs-pills { border-bottom: 0; margin-bottom: 16px; gap: 4px; padding: 4px; background: var(--pz-surface-3); border-radius: var(--pz-radius-sm); display: inline-flex; max-width: 100%; align-items: center; }
.tabs-pills .tab { height: 34px; border-radius: 8px; font-size: 13.5px; padding: 0 14px; }
.tabs-pills .tab::after { display: none; }
.tabs-pills .tab:hover { background: color-mix(in srgb, var(--pz-surface) 60%, transparent); }
.tabs-pills .tab.is-active { background: var(--pz-surface); color: var(--pz-heading); box-shadow: var(--pz-shadow-sm); }
.card-header .tabs { margin: -16px 0 -17px; border-bottom: 0; align-self: stretch; align-items: flex-end; }
.card-header .tabs .tab { height: 59px; }
@keyframes pz-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   15 Modals
   ========================================================================== */
.modal {
  position: fixed; inset: 0; z-index: var(--pz-z-modal); display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 24px; overflow-y: auto; background: var(--pz-overlay);
  backdrop-filter: blur(6px) saturate(120%); -webkit-backdrop-filter: blur(6px) saturate(120%);
  opacity: 0; transition: opacity var(--pz-med) ease;
}
.modal.is-open { opacity: 1; }
.modal-dialog {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--pz-surface-raised); border: 1px solid var(--pz-border); border-radius: var(--pz-radius-lg);
  box-shadow: var(--pz-shadow-xl); transform: translateY(12px) scale(.98);
  transition: transform var(--pz-slow) var(--pz-ease-out);
}
.modal.is-open .modal-dialog { transform: none; }
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1120px; }
.modal-full { max-width: none; width: calc(100vw - 48px); min-height: calc(100vh - 14vh); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; }
.modal-title { margin: 0; font-size: 17px; font-weight: 750; display: flex; align-items: center; gap: 10px; }
.modal-close {
  flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--pz-radius-xs);
  color: var(--pz-muted); font-size: 22px; line-height: 1; transition: background var(--pz-fast), color var(--pz-fast); margin-right: -6px;
}
.modal-close:hover { background: var(--pz-surface-3); color: var(--pz-heading); }
.modal-body { padding: 4px 22px 20px; color: var(--pz-text-2); min-width: 0; }
.modal-body > p:first-child { margin-top: 0; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 22px;
  border-top: 1px solid var(--pz-border); background: var(--pz-surface-2); border-radius: 0 0 var(--pz-radius-lg) var(--pz-radius-lg);
}
.modal-footer .mr-auto { margin-right: auto; }
.modal-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--pz-primary-soft); color: var(--pz-primary-text);
}
.modal-icon.is-danger { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.modal-confirm .modal-body { display: flex; gap: 16px; align-items: flex-start; padding-top: 22px; }
.modal-confirm .modal-title { font-size: 16px; margin-bottom: 4px; }
body.has-modal { overflow: hidden; }

/* ==========================================================================
   16 Dropdowns & command palette
   ========================================================================== */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--pz-z-dropdown); min-width: 220px; max-width: min(360px, calc(100vw - 24px));
  display: none; padding: 6px; background: var(--pz-surface-raised); border: 1px solid var(--pz-border); border-radius: var(--pz-radius);
  box-shadow: var(--pz-shadow-lg); transform-origin: top left;
}
.dropdown-menu-right, .dropdown-menu.is-right { left: auto; right: 0; transform-origin: top right; }
.dropdown-menu.is-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dropdown.is-open > .dropdown-menu { display: block; animation: pz-menu-in .18s var(--pz-ease-out); }
@keyframes pz-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 7px 10px; border-radius: 8px;
  color: var(--pz-text); font-size: 13.5px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer;
  transition: background var(--pz-fast), color var(--pz-fast); border: 0; background: none;
}
.dropdown-item .icon { width: 17px; height: 17px; color: var(--pz-muted); }
.dropdown-item:hover, .dropdown-item:focus-visible, .dropdown-item.is-focused { background: var(--pz-surface-3); color: var(--pz-heading); box-shadow: none; }
.dropdown-item:hover .icon { color: var(--pz-primary); }
.dropdown-item.is-active { color: var(--pz-primary-text); font-weight: 600; }
.dropdown-item.is-danger, .dropdown-item.text-danger { color: var(--pz-danger-text); }
.dropdown-item.is-danger .icon { color: currentColor; }
.dropdown-item.is-danger:hover { background: var(--pz-danger-soft); }
.dropdown-item .kbd, .dropdown-item .badge { margin-left: auto; }
.dropdown-item-desc { display: block; font-size: 12px; color: var(--pz-muted); font-weight: 450; white-space: normal; }
.dropdown-item-icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--pz-primary-soft); color: var(--pz-primary-text);
}
.dropdown-item-icon .icon { color: inherit !important; }
.dropdown-divider { height: 1px; margin: 6px -6px; background: var(--pz-border); }
.dropdown-header { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pz-faint); }
.dropdown-menu form { margin: 0; }

.palette .modal-dialog { max-width: 620px; overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--pz-border); }
.palette-search .icon { color: var(--pz-primary); width: 20px; height: 20px; }
.palette-search input { flex: 1; border: 0; background: none; font-size: 16px; color: var(--pz-heading); outline: none; min-width: 0; }
.palette-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pz-faint); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--pz-text); cursor: pointer; }
.palette-item .icon { color: var(--pz-muted); }
.palette-item .palette-hint { margin-left: auto; font-size: 12px; color: var(--pz-faint); }
.palette-item.is-focused { background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.palette-item.is-focused .icon { color: var(--pz-primary-text); }
.palette-empty { padding: 28px; text-align: center; color: var(--pz-muted); }
.palette-footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--pz-border); background: var(--pz-surface-2); font-size: 12px; color: var(--pz-muted); }
.palette-footer span { display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   17 Toasts & tooltips
   ========================================================================== */
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--pz-z-toast); display: flex; flex-direction: column-reverse;
  gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  --toast-c: var(--pz-success);
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
  background: var(--pz-surface-raised); color: var(--pz-text); border: 1px solid var(--pz-border); border-radius: var(--pz-radius);
  box-shadow: var(--pz-shadow-lg); pointer-events: auto; font-size: 13.5px; line-height: 1.45;
  animation: pz-toast-in .35s var(--pz-ease-out);
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--toast-c); }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: -3px;
  background: color-mix(in srgb, var(--toast-c) 14%, transparent); color: var(--toast-c); }
.toast-icon .icon { width: 16px; height: 16px; }
.toast-body { flex: 1 1 auto; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast-title { display: block; font-weight: 700; color: var(--pz-heading); margin-bottom: 1px; }
.toast-close { flex: none; width: 24px; height: 24px; margin: -3px -3px 0 0; border-radius: 6px; display: grid; place-items: center; color: var(--pz-faint); }
.toast-close:hover { background: var(--pz-surface-3); color: var(--pz-text); }
.toast-close .icon { width: 15px; height: 15px; }
.toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--toast-c); opacity: .35; transform-origin: left; }
.toast-success { --toast-c: var(--pz-success); }
.toast-error { --toast-c: var(--pz-danger); }
.toast-warning { --toast-c: var(--pz-warning); }
.toast-info { --toast-c: var(--pz-info); }
.toast.is-leaving { animation: pz-toast-out .25s ease forwards; }
@keyframes pz-toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pz-toast-out { to { opacity: 0; transform: translateX(24px); } }

.tooltip {
  position: fixed; z-index: var(--pz-z-tooltip); max-width: 260px; padding: 6px 10px; border-radius: 8px;
  background: #0E1024; color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.4; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(2px); transition: opacity .12s ease, transform .12s ease;
  white-space: normal; text-align: left;
}
:root[data-theme="dark"] .tooltip { background: #2A2E52; }
.tooltip.is-visible { opacity: 1; transform: none; }
/* CSS-only fallback before JS is ready */
.no-js [data-tooltip] { position: relative; }
.no-js [data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 5px 9px; border-radius: 7px; background: #0E1024; color: #fff; font-size: 12px; white-space: nowrap; z-index: 50;
}

/* ==========================================================================
   18 Empty states
   ========================================================================== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; max-width: 520px; margin: 0 auto;
}
.empty-state-icon {
  position: relative; width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--pz-gradient-soft); color: var(--pz-primary); border: 1px solid color-mix(in srgb, var(--pz-primary) 14%, transparent);
}
.empty-state-icon::after {
  content: ""; position: absolute; inset: -10px; border-radius: 28px; border: 1px dashed color-mix(in srgb, var(--pz-primary) 22%, transparent);
}
.empty-state-icon .icon { width: 32px; height: 32px; }
.empty-state-illustration { width: 180px; height: auto; margin-bottom: 16px; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { color: var(--pz-muted); margin: 0; max-width: 46ch; }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.empty-state.is-compact { padding: 28px 16px; }
.empty-state.is-compact .empty-state-icon { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 14px; }
.empty-state.is-compact .empty-state-icon::after { display: none; }
.empty-state.is-compact .empty-state-icon .icon { width: 24px; height: 24px; }
.card .empty-state { padding-top: 40px; padding-bottom: 40px; }

/* ==========================================================================
   19 Progress, skeleton, spinner
   ========================================================================== */
.progress { position: relative; width: 100%; height: 8px; border-radius: 999px; background: var(--pz-primary-100); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: inherit; background: var(--pz-gradient); background-size: 200% 100%;
  transition: width .6s var(--pz-ease-out);
}
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }
.progress-success { background: var(--pz-success-soft); }
.progress-success .progress-bar { background: var(--pz-success); }
.progress-warning { background: var(--pz-warning-soft); }
.progress-warning .progress-bar { background: var(--pz-warning); }
.progress-danger { background: var(--pz-danger-soft); }
.progress-danger .progress-bar { background: var(--pz-danger); }
.progress-striped .progress-bar {
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%), var(--pz-gradient);
  background-size: 16px 16px, 100% 100%; animation: pz-stripes 1s linear infinite;
}
.progress-indeterminate .progress-bar { width: 40% !important; animation: pz-indeterminate 1.3s var(--pz-ease) infinite; }
@keyframes pz-stripes { to { background-position: 16px 0, 0 0; } }
@keyframes pz-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--pz-muted); margin-bottom: 6px; }
.progress-label strong { color: var(--pz-heading); font-weight: 650; }

.skeleton {
  display: block; border-radius: 8px; min-height: 12px;
  background: linear-gradient(90deg, var(--pz-surface-3) 0%, color-mix(in srgb, var(--pz-surface-3) 40%, var(--pz-surface)) 50%, var(--pz-surface-3) 100%);
  background-size: 200% 100%; animation: pz-shimmer 1.4s ease-in-out infinite; color: transparent !important; user-select: none;
}
.skeleton-text { height: 12px; margin-bottom: 10px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 20px; width: 45%; margin-bottom: 14px; }
.skeleton-circle { border-radius: 50%; }
@keyframes pz-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.spinner {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  border: 2.5px solid var(--pz-primary-100); border-top-color: var(--pz-primary); animation: pz-spin .7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
.loading-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: color-mix(in srgb, var(--pz-surface) 70%, transparent); border-radius: inherit; }
.is-refreshing { opacity: .55; pointer-events: none; transition: opacity var(--pz-med); }

/* ==========================================================================
   20 Timeline & list group
   ========================================================================== */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; padding: 0 0 22px 36px; margin: 0; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--pz-border); }
.timeline-item:last-child::before { display: none; }
.timeline-marker, .timeline-item::after {
  position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pz-surface); border: 2px solid var(--pz-border-strong); color: var(--pz-muted);
}
.timeline-item::after { content: ""; left: 6px; top: 6px; width: 12px; height: 12px; border-width: 2px; }
.timeline-item:has(.timeline-marker)::after { display: none; }
.timeline-marker .icon { width: 13px; height: 13px; }
.timeline-marker.is-primary { background: var(--pz-primary); border-color: var(--pz-primary); color: #fff; }
.timeline-marker.is-success { background: var(--pz-success); border-color: var(--pz-success); color: #fff; }
.timeline-marker.is-warning { background: var(--pz-warning); border-color: var(--pz-warning); color: #fff; }
.timeline-marker.is-danger { background: var(--pz-danger); border-color: var(--pz-danger); color: #fff; }
.timeline-marker.is-accent { background: var(--pz-accent); border-color: var(--pz-accent); color: #fff; }
.timeline-marker.is-gradient { background: var(--pz-gradient); border-color: transparent; color: #fff; }
.timeline-title { font-weight: 650; color: var(--pz-heading); font-size: 14px; line-height: 1.4; }
.timeline-time { font-size: 12px; color: var(--pz-faint); margin-top: 1px; }
.timeline-body { margin-top: 6px; font-size: 13.5px; color: var(--pz-text-2); }
.timeline-body .card, .timeline-body .code-block { margin-top: 8px; }

.list-group { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 20px; margin: 0; border-bottom: 1px solid var(--pz-border);
  color: var(--pz-text); min-width: 0; transition: background var(--pz-fast);
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .list-item.is-clickable:hover { background: var(--pz-surface-2); color: var(--pz-text); }
.list-item.is-active { background: var(--pz-primary-soft); }
.list-item-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--pz-surface-3); color: var(--pz-muted);
}
.list-item-icon.is-primary { background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.list-item-icon.is-accent { background: var(--pz-accent-soft); color: var(--pz-accent-text); }
.list-item-icon.is-success { background: var(--pz-success-soft); color: var(--pz-success-text); }
.list-item-icon.is-warning { background: var(--pz-warning-soft); color: var(--pz-warning-text); }
.list-item-icon.is-danger { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.list-item-icon.is-info { background: var(--pz-info-soft); color: var(--pz-info-text); }
.list-item-body { flex: 1 1 auto; min-width: 0; }
.list-item-title { font-weight: 600; color: var(--pz-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-item-text { font-size: 12.5px; color: var(--pz-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-item-meta { flex: none; font-size: 12.5px; color: var(--pz-muted); text-align: right; display: flex; align-items: center; gap: 8px; }
.list-group.is-inset { border: 1px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface); overflow: hidden; }
.list-group.is-compact .list-item { padding: 9px 14px; }

/* ==========================================================================
   21 Pagination, toolbar, filters, bulk bar
   ========================================================================== */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 18px; }
.card > .pagination, .card-footer .pagination { margin: 0; }
.card > .pagination { padding: 12px 20px; border-top: 1px solid var(--pz-border); }
.pagination-info { font-size: 13px; color: var(--pz-muted); }
.pagination-info strong { color: var(--pz-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pagination-pages { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pagination-pages li { margin: 0; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: var(--pz-radius-xs); border: 1px solid transparent; color: var(--pz-text-2); font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; transition: background var(--pz-fast), color var(--pz-fast), border-color var(--pz-fast);
}
a.page-link:hover { background: var(--pz-surface); border-color: var(--pz-border-strong); color: var(--pz-heading); }
.page-link.is-active { background: var(--pz-primary); color: #fff; box-shadow: var(--pz-shadow-primary); }
.page-link.is-disabled { color: var(--pz-faint); pointer-events: none; opacity: .6; }
.page-link .icon { width: 16px; height: 16px; }
.page-gap { color: var(--pz-faint); padding: 0 4px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .toolbar-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.toolbar .toolbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pz-faint); width: 17px; height: 17px; pointer-events: none; }
.toolbar .toolbar-search .input { padding-left: 38px; }
.toolbar-spacer { flex: 1 1 auto; }
.card-header .toolbar, .card-body > .toolbar:first-child { margin-bottom: 0; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .select, .filters .input { width: auto; min-width: 150px; height: 36px; font-size: 13.5px; }
.filters .chip { height: 32px; cursor: pointer; }
.filter-label { font-size: 12.5px; color: var(--pz-muted); font-weight: 600; }

.bulk-bar {
  position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px auto 0; padding: 10px 12px 10px 18px; width: fit-content; max-width: 100%;
  background: var(--pz-ink); color: #fff; border-radius: var(--pz-radius); box-shadow: var(--pz-shadow-xl);
  animation: pz-toast-in .3s var(--pz-ease-out);
}
:root[data-theme="dark"] .bulk-bar { background: #2A2E52; }
.bulk-bar[hidden] { display: none !important; }
.bulk-bar-count { font-weight: 600; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.bulk-bar-count strong { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--pz-gradient); font-size: 12.5px; }
.bulk-bar-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bulk-bar .btn { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .14); --btn-bg-h: rgba(255, 255, 255, .2); --btn-fg-h: #fff; --btn-bd-h: rgba(255, 255, 255, .24); height: 34px; font-size: 13px; }
.bulk-bar .btn-danger { --btn-bg: var(--pz-danger); --btn-bd: transparent; --btn-bg-h: #C8103B; }
.bulk-bar .select { height: 34px; width: auto; background-color: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .14); font-size: 13px; }
.bulk-bar .select option { color: var(--pz-text); background: var(--pz-surface); }
.bulk-bar-close { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: rgba(255, 255, 255, .7); }
.bulk-bar-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ==========================================================================
   22 Locked upgrade box, AI panel, preview frame
   ========================================================================== */
.locked {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 22px; padding: 28px;
  border-radius: var(--pz-radius-lg); color: #fff; isolation: isolate;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 107, 74, .55) 0%, transparent 60%),
    radial-gradient(60% 80% at 0% 100%, rgba(155, 92, 255, .55) 0%, transparent 60%),
    linear-gradient(135deg, #2A1A8F 0%, #5B3DF5 50%, #7A3FE0 100%);
  box-shadow: 0 18px 50px -18px rgba(91, 61, 245, .6);
}
.locked::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000 100%); mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
}
.locked-icon {
  flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.locked-icon .icon { width: 26px; height: 26px; }
.locked-body { flex: 1 1 auto; min-width: 0; }
.locked-kicker { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.locked-title { margin: 0 0 6px; color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.locked-text { margin: 0; color: rgba(255, 255, 255, .85); max-width: 62ch; font-size: 14.5px; }
.locked-benefits { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 18px; }
.locked-benefits li { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: rgba(255, 255, 255, .92); }
.locked-benefits .icon { width: 17px; height: 17px; color: #FFD27A; margin-top: 1px; }
.locked-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.locked-actions .btn-primary { --btn-bg: #fff; --btn-fg: var(--pz-primary-700); --btn-bg-h: #fff; --btn-fg-h: var(--pz-accent-600); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35); }
.locked-actions .btn-ghost { --btn-fg: #fff; --btn-fg-h: #fff; --btn-bg-h: rgba(255, 255, 255, .14); }
.locked-price { font-size: 13px; color: rgba(255, 255, 255, .78); }
.locked-price strong { color: #fff; font-size: 15px; }
.locked.is-compact { padding: 18px 20px; gap: 14px; align-items: center; }
.locked.is-compact .locked-icon { width: 44px; height: 44px; border-radius: 12px; }
.locked.is-compact .locked-title { font-size: 16px; margin-bottom: 2px; }
.locked.is-compact .locked-text { font-size: 13px; }
.locked.is-compact .locked-actions { margin-top: 0; flex: none; }

.ai-panel {
  position: relative; border-radius: var(--pz-radius-lg); padding: 1.5px;
  background: var(--pz-gradient); box-shadow: 0 12px 34px -16px rgba(155, 92, 255, .55);
}
.ai-panel-inner, .ai-panel > .ai-panel-header + .ai-panel-body { position: relative; }
.ai-panel > * { background: var(--pz-surface); }
.ai-panel > :first-child { border-radius: calc(var(--pz-radius-lg) - 1.5px) calc(var(--pz-radius-lg) - 1.5px) 0 0; }
.ai-panel > :last-child { border-radius: 0 0 calc(var(--pz-radius-lg) - 1.5px) calc(var(--pz-radius-lg) - 1.5px); }
.ai-panel > :only-child { border-radius: calc(var(--pz-radius-lg) - 1.5px); }
.ai-panel-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background-color: var(--pz-surface); background-image: var(--pz-gradient-soft);
  border-bottom: 1px solid var(--pz-border);
}
.ai-panel-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--pz-gradient); color: #fff; box-shadow: var(--pz-shadow-primary);
}
.ai-panel-icon .icon { width: 20px; height: 20px; }
.ai-panel-title { margin: 0; font-size: 15.5px; font-weight: 750; }
.ai-panel-subtitle { margin: 1px 0 0; font-size: 12.5px; color: var(--pz-muted); }
.ai-panel-header .ai-panel-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ai-panel-body { padding: 18px 20px; }
.ai-panel-footer { padding: 12px 20px; border-top: 1px solid var(--pz-border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; font-size: 12.5px; color: var(--pz-muted); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-suggestions .chip { cursor: pointer; background: var(--pz-surface); }
.ai-suggestions .chip:hover { border-color: var(--pz-primary); color: var(--pz-primary-text); }
.ai-output {
  position: relative; padding: 14px 16px; border-radius: var(--pz-radius-sm); background: var(--pz-surface-2);
  border: 1px solid var(--pz-border); color: var(--pz-text); font-size: 14px; line-height: 1.65; white-space: pre-wrap;
}
.ai-output:empty::before { content: attr(data-placeholder); color: var(--pz-faint); }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 6px 2px; }
.ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--pz-violet); animation: pz-typing 1.2s ease-in-out infinite; }
.ai-typing span:nth-child(2) { animation-delay: .15s; background: #B27BFF; }
.ai-typing span:nth-child(3) { animation-delay: .3s; background: var(--pz-accent); }
@keyframes pz-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--pz-primary-text); background: var(--pz-gradient-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pz-violet) 35%, transparent); }
.ai-badge .icon { width: 12px; height: 12px; }

.preview-frame { border: 1px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface); overflow: hidden; box-shadow: var(--pz-shadow-sm); }
.preview-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--pz-border); background: var(--pz-surface-2); }
.preview-meta { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--pz-muted); }
.preview-meta strong { display: block; color: var(--pz-heading); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-stage {
  display: flex; justify-content: center; padding: 20px; min-height: 360px; overflow: auto;
  background: repeating-conic-gradient(var(--pz-surface-3) 0% 25%, var(--pz-surface-2) 0% 50%) 50% / 18px 18px;
}
.preview-device {
  width: 100%; max-width: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--pz-shadow-md);
  transition: width .35s var(--pz-ease-out), border-radius .35s, box-shadow .35s;
}
.preview-device iframe { width: 100%; height: var(--preview-h, 640px); border: 0; background: #fff; }
.preview-frame.is-mobile .preview-device {
  width: 410px; /* 390px viewport + 2 × 10px device frame */ border-radius: 34px; border: 10px solid #0E1024; box-shadow: 0 24px 60px -18px rgba(16, 18, 48, .5);
}
.preview-frame.is-mobile .preview-device iframe { height: var(--preview-h-mobile, 720px); }

/* ==========================================================================
   23 Pickers & meters (audience, SMTP, attachments, schedule, AI credit, notifications)
   ========================================================================== */
.picker { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.picker-section { border: 1px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface-2); padding: 14px; }
.picker-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--pz-text-2); }

/* Audience */
.audience-lists { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-height: 300px; overflow-y: auto; padding: 2px; }
.audience-list { position: relative; display: block; cursor: pointer; margin: 0; }
.audience-list > input { position: absolute; opacity: 0; pointer-events: none; }
.audience-list-body {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--pz-radius-sm); background: var(--pz-surface);
  border: 1.5px solid var(--pz-border); transition: border-color var(--pz-fast), background var(--pz-fast), box-shadow var(--pz-fast);
}
.audience-list-body::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--pz-border-strong); background: var(--pz-surface);
  transition: all var(--pz-fast);
}
.audience-list:hover .audience-list-body { border-color: var(--pz-border-strong); }
.audience-list > input:checked + .audience-list-body { border-color: var(--pz-primary); background: linear-gradient(var(--pz-primary-soft), var(--pz-primary-soft)), var(--pz-surface); }
.audience-list > input:checked + .audience-list-body::before {
  border-color: var(--pz-primary);
  background: var(--pz-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.audience-list > input:focus-visible + .audience-list-body { box-shadow: var(--pz-ring); }
.audience-list-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 13.5px; color: var(--pz-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audience-list-count { flex: none; font-size: 12px; font-weight: 600; color: var(--pz-muted); font-variant-numeric: tabular-nums; background: var(--pz-surface-3); padding: 2px 8px; border-radius: 999px; }
.audience-search { position: relative; }
.audience-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--pz-z-dropdown); max-height: 280px; overflow-y: auto;
  padding: 6px; background: var(--pz-surface-raised); border: 1px solid var(--pz-border); border-radius: var(--pz-radius-sm); box-shadow: var(--pz-shadow-lg);
}
.audience-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--pz-text); }
.audience-result:hover, .audience-result.is-focused { background: var(--pz-primary-soft); }
.audience-result .avatar { --avatar-size: 28px; }
.audience-result-name { display: block; font-weight: 600; font-size: 13.5px; color: var(--pz-heading); }
.audience-result-email { display: block; font-size: 12px; color: var(--pz-muted); }
.audience-result.is-added { opacity: .5; }
.audience-chips:empty::before { content: attr(data-empty); font-size: 12.5px; color: var(--pz-faint); }
.audience-chips { margin-top: 10px; }
.audience-manual > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--pz-link);
}
.audience-manual > summary::-webkit-details-marker { display: none; }
.audience-manual > summary .icon { width: 15px; height: 15px; transition: transform var(--pz-fast); }
.audience-manual[open] > summary .icon { transform: rotate(45deg); }
.audience-manual .textarea { margin-top: 10px; min-height: 84px; }
.audience-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--pz-radius);
  background: var(--pz-gradient-soft); border: 1px solid color-mix(in srgb, var(--pz-primary) 18%, transparent);
}
.audience-summary-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--pz-gradient); color: #fff; flex: none; }
.audience-summary-icon .icon { width: 18px; height: 18px; }
.audience-count { font-family: var(--pz-font-heading); font-size: 17px; font-weight: 800; color: var(--pz-heading); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.audience-desc { font-size: 12.5px; color: var(--pz-muted); display: block; }
.audience-summary .spinner { margin-left: auto; }

/* SMTP */
.smtp-picker-field { position: relative; }
.smtp-picker-field .dot { position: absolute; left: 14px; top: 50%; margin-top: -4px; pointer-events: none; z-index: 1; }
.smtp-picker-field .select { padding-left: 34px; }
.smtp-picker-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--pz-muted); }
.smtp-picker-meta a { font-weight: 600; }

/* Attachments */
.attachment-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding: 1px; }
.attachment-item { position: relative; display: block; margin: 0; cursor: pointer; }
.attachment-item > input { position: absolute; opacity: 0; pointer-events: none; }
.attachment-item-body {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--pz-radius-sm); border: 1.5px solid var(--pz-border);
  background: var(--pz-surface); transition: border-color var(--pz-fast), background var(--pz-fast);
}
.attachment-item-body::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--pz-border-strong); background: var(--pz-surface); }
.attachment-item:hover .attachment-item-body { border-color: var(--pz-border-strong); }
.attachment-item > input:checked + .attachment-item-body { border-color: var(--pz-primary); background: linear-gradient(var(--pz-primary-soft), var(--pz-primary-soft)), var(--pz-surface); }
.attachment-item > input:checked + .attachment-item-body::before {
  border-color: var(--pz-primary);
  background: var(--pz-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.attachment-item > input:disabled + .attachment-item-body { cursor: default; opacity: .85; }
.attachment-item > input:focus-visible + .attachment-item-body { box-shadow: var(--pz-ring); }
.attachment-item.is-new .attachment-item-body { animation: pz-flash 1.4s ease; }
@keyframes pz-flash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pz-success) 35%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.file-icon {
  flex: none; width: 34px; height: 40px; border-radius: 6px 12px 6px 6px; display: grid; place-items: end center; padding-bottom: 5px;
  background: var(--pz-primary-soft); color: var(--pz-primary-text); font-size: 9.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  position: relative;
}
.file-icon::after { content: ""; position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-radius: 0 12px 0 6px; background: color-mix(in srgb, var(--pz-primary) 22%, transparent); }
.file-icon[data-ext="pdf"] { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.file-icon[data-ext="pdf"]::after { background: color-mix(in srgb, var(--pz-danger) 25%, transparent); }
.file-icon[data-ext="jpg"], .file-icon[data-ext="jpeg"], .file-icon[data-ext="png"], .file-icon[data-ext="gif"], .file-icon[data-ext="webp"], .file-icon[data-ext="svg"] { background: var(--pz-success-soft); color: var(--pz-success-text); }
.file-icon[data-ext="doc"], .file-icon[data-ext="docx"], .file-icon[data-ext="txt"], .file-icon[data-ext="odt"] { background: var(--pz-info-soft); color: var(--pz-info-text); }
.file-icon[data-ext="xls"], .file-icon[data-ext="xlsx"], .file-icon[data-ext="csv"] { background: var(--pz-success-soft); color: var(--pz-success-text); }
.file-icon[data-ext="zip"] { background: var(--pz-warning-soft); color: var(--pz-warning-text); }
.attachment-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 13.5px; color: var(--pz-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { flex: none; font-size: 12px; color: var(--pz-muted); font-variant-numeric: tabular-nums; }
.attachment-default-note { font-size: 11.5px; color: var(--pz-muted); }
.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--pz-radius);
  border: 1.5px dashed var(--pz-border-strong); background: var(--pz-surface); color: var(--pz-muted); font-size: 13.5px; cursor: pointer;
  transition: border-color var(--pz-fast), background var(--pz-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--pz-primary); background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.dropzone-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--pz-primary-soft); color: var(--pz-primary-text); flex: none; }
.dropzone strong { color: var(--pz-heading); font-weight: 650; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .progress { margin-top: 8px; display: block; }
.dropzone .progress-bar { display: block; }
.dropzone.is-uploading { pointer-events: none; }
.quota { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--pz-muted); }

/* Schedule */
.schedule-when { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.schedule-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.schedule-presets .chip { cursor: pointer; }
.schedule-presets .chip:hover { border-color: var(--pz-primary); color: var(--pz-primary-text); }
.schedule-human { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pz-text-2); font-weight: 550; }
.schedule-human .icon { color: var(--pz-primary); width: 16px; height: 16px; }
.schedule-picker .input[type="datetime-local"] { max-width: 280px; }

/* AI credit meter */
.ai-meter { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ai-meter-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pz-text-2); }
.ai-meter-head .icon { width: 16px; height: 16px; color: var(--pz-violet); }
.ai-meter-text strong { color: var(--pz-heading); font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-card .ai-meter-text strong { color: #fff; }
.ai-meter-sub { font-size: 12px; color: var(--pz-muted); }
.ai-meter .progress-bar.is-low { background: var(--pz-warning); }
.ai-meter .progress-bar.is-empty { background: var(--pz-danger); }
.ai-meter-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; flex: none; white-space: nowrap;
  border: 1px solid var(--pz-border); background: var(--pz-surface); color: var(--pz-text-2); font-size: 12.5px; font-weight: 650;
  box-shadow: var(--pz-shadow-xs); transition: border-color var(--pz-fast), box-shadow var(--pz-fast);
}
.ai-meter-pill:hover, .dropdown.is-open > .ai-meter-pill { border-color: color-mix(in srgb, var(--pz-violet) 45%, var(--pz-border)); color: var(--pz-heading); }
.ai-meter-pill .icon { width: 15px; height: 15px; color: var(--pz-violet); }
.ai-meter-pill .mini-bar { width: 38px; height: 5px; border-radius: 999px; background: var(--pz-primary-100); overflow: hidden; }
.ai-meter-pill .mini-bar > span { display: block; height: 100%; background: var(--pz-gradient); border-radius: inherit; }
.ai-meter-pill .mini-bar > span.is-low { background: var(--pz-warning); }
.ai-meter-pill .mini-bar > span.is-empty { background: var(--pz-danger); }
.ai-meter-menu { width: 300px; padding: 14px; }
.ai-meter.is-full { padding: 18px 20px; border: 1px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface); gap: 10px; }
.ai-meter.is-full .ai-meter-head { font-size: 14px; }
.ai-meter.is-full .ai-meter-text strong { font-size: 20px; font-family: var(--pz-font-heading); }

/* Notifications */
.notif-menu { width: 380px; padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--pz-border); }
.notif-head strong { font-family: var(--pz-font-heading); font-size: 14.5px; color: var(--pz-heading); }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.notif-item {
  position: relative; display: flex; gap: 12px; width: 100%; padding: 10px 28px 10px 10px; border-radius: 10px; text-align: left;
  color: var(--pz-text); transition: background var(--pz-fast);
}
.notif-item:hover { background: var(--pz-surface-3); color: var(--pz-text); }
.notif-item.is-unread { background: color-mix(in srgb, var(--pz-primary-soft) 70%, transparent); }
.notif-item.is-unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--pz-primary); }
.notif-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--pz-primary-soft); color: var(--pz-primary-text); }
.notif-icon .icon { width: 17px; height: 17px; }
.notif-icon.is-success { background: var(--pz-success-soft); color: var(--pz-success-text); }
.notif-icon.is-warning { background: var(--pz-warning-soft); color: var(--pz-warning-text); }
.notif-icon.is-error, .notif-icon.is-danger { background: var(--pz-danger-soft); color: var(--pz-danger-text); }
.notif-icon.is-info { background: var(--pz-info-soft); color: var(--pz-info-text); }
.notif-icon.is-ai { background: var(--pz-gradient); color: #fff; }
.notif-body { flex: 1 1 auto; min-width: 0; }
.notif-title { display: block; font-weight: 600; font-size: 13.5px; color: var(--pz-heading); line-height: 1.35; }
.notif-text { display: block; font-size: 12.5px; color: var(--pz-muted); margin-top: 2px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-time { display: block; font-size: 11.5px; color: var(--pz-faint); margin-top: 3px; }
.notif-empty { padding: 32px 20px; text-align: center; color: var(--pz-muted); font-size: 13px; }
.notif-empty .icon { width: 28px; height: 28px; color: var(--pz-faint); margin: 0 auto 8px; }

/* ==========================================================================
   24 Auth layout (split screen)
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 46%) 1fr; }
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 56px; background: #0E1024; color: #D9DBF3; isolation: isolate;
}
.auth-brand::before {
  content: ""; position: absolute; z-index: -1; width: 640px; height: 640px; left: -220px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 61, 245, .75) 0%, rgba(91, 61, 245, 0) 65%); filter: blur(10px);
}
.auth-brand::after {
  content: ""; position: absolute; z-index: -1; width: 560px; height: 560px; right: -220px; bottom: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 74, .55) 0%, rgba(255, 107, 74, 0) 65%); filter: blur(10px);
}
.auth-brand-grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
}
.auth-logo img { height: 40px; width: auto; }
.auth-claim { max-width: 480px; }
.auth-claim h1 { color: #fff; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 14px; }
.auth-claim h1 span { background: linear-gradient(100deg, #A996FF 0%, #C99BFF 45%, #FF8F6E 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-claim p { font-size: 16.5px; color: #B8BBDD; margin: 0; line-height: 1.55; }
.auth-benefits { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-benefits li { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.auth-benefit-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #CDBFFF; }
.auth-benefit-icon .icon { width: 18px; height: 18px; }
.auth-benefits strong { display: block; color: #fff; font-weight: 650; font-size: 14.5px; }
.auth-benefits div > span { display: block; font-size: 13.5px; color: #A9ACD2; line-height: 1.5; }
.auth-quote {
  position: relative; max-width: 480px; padding: 20px 22px; border-radius: var(--pz-radius-lg);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.auth-quote p { margin: 0 0 14px; color: #E7E8FA; font-size: 14.5px; line-height: 1.6; }
.auth-quote footer { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #A9ACD2; }
.auth-quote footer strong { display: block; color: #fff; font-weight: 650; }
.auth-quote .stars { display: flex; gap: 2px; color: #FFB547; margin-bottom: 10px; }
.auth-quote .stars .icon { width: 15px; height: 15px; fill: currentColor; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--pz-bg); position: relative; }
.auth-main-top { position: absolute; top: 20px; right: 24px; display: flex; align-items: center; gap: 8px; }
.auth-mobile-logo { display: none; margin-bottom: 24px; }
.auth-mobile-logo img { height: 36px; width: auto; }
.auth-card {
  width: 100%; max-width: 440px; padding: 36px; background: var(--pz-surface); border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius-xl); box-shadow: var(--pz-shadow-lg);
}
.auth-card.is-wide { max-width: 560px; }
.auth-title { margin: 0 0 6px; font-size: 25px; font-weight: 800; letter-spacing: -.025em; }
.auth-subtitle { margin: 0 0 26px; color: var(--pz-muted); font-size: 14.5px; }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .btn-block { margin-top: 8px; }
.auth-footer { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--pz-muted); }
.auth-footer a { font-weight: 600; }
.auth-legal { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; }
.auth-legal a { color: var(--pz-faint); }
.auth-legal a:hover { color: var(--pz-text); }
.auth-alerts { width: 100%; max-width: 440px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   25 Blank layout & error pages
   ========================================================================== */
.blank {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 40px 16px;
  background:
    radial-gradient(50% 40% at 15% 0%, color-mix(in srgb, var(--pz-primary) 12%, transparent) 0%, transparent 70%),
    radial-gradient(40% 35% at 100% 100%, color-mix(in srgb, var(--pz-accent) 10%, transparent) 0%, transparent 70%),
    var(--pz-bg);
}
.blank-header img { height: 36px; width: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
.blank-card {
  width: 100%; max-width: 560px; padding: 40px; background: var(--pz-surface); border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius-xl); box-shadow: var(--pz-shadow-lg);
}
.blank-card.is-wide { max-width: 760px; }
.blank-card > h1:first-child, .blank-card > h2:first-child { margin-top: 0; }
.blank-footer { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; color: var(--pz-faint); }
.blank-footer a { color: var(--pz-faint); }
.blank-footer a:hover { color: var(--pz-text); }

.error-page { text-align: center; }
.error-illustration { width: 220px; max-width: 70%; height: auto; margin: -6px auto 18px; }
.error-code {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; margin-bottom: 14px;
  background: var(--pz-primary-soft); color: var(--pz-primary-text); font-size: 12px; font-weight: 750; letter-spacing: .08em;
}
.error-title { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.error-text { color: var(--pz-muted); font-size: 15px; max-width: 46ch; margin: 0 auto; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.error-hints { margin: 26px 0 0; padding: 16px 0 0; border-top: 1px solid var(--pz-border); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.error-debug {
  margin-top: 24px; text-align: left; border: 1px solid color-mix(in srgb, var(--pz-danger) 30%, transparent); border-radius: var(--pz-radius);
  background: var(--pz-danger-soft); overflow: hidden;
}
.error-debug-head { padding: 10px 14px; font-size: 12.5px; font-weight: 700; color: var(--pz-danger-text); display: flex; align-items: center; gap: 8px; }
.error-debug pre { margin: 0; padding: 12px 14px; max-height: 340px; overflow: auto; font-size: 12px; line-height: 1.55; background: var(--pz-surface); color: var(--pz-text); white-space: pre-wrap; word-break: break-word; border-top: 1px solid var(--pz-border); }

/* ==========================================================================
   26 Charts (PersolzCharts)
   ========================================================================== */
.pz-chart { position: relative; width: 100%; min-height: 40px; color: var(--pz-chart-axis); font-family: var(--pz-font-body); }
.pz-chart > svg { display: block; width: 100%; overflow: visible; }
.pz-chart text { font-family: var(--pz-font-body); font-size: 11.5px; fill: var(--pz-chart-axis); font-variant-numeric: tabular-nums; }
.pz-chart .pz-axis-label { font-size: 11.5px; }
.pz-chart .pz-value-label { fill: var(--pz-text-2); font-weight: 600; font-size: 11.5px; }
.pz-chart .pz-grid line { stroke: var(--pz-chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.pz-chart .pz-baseline { stroke: var(--pz-border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.pz-chart .pz-crosshair { stroke: var(--pz-border-strong); stroke-width: 1; pointer-events: none; }
.pz-chart .pz-hit { fill: transparent; cursor: crosshair; }
.pz-chart .pz-bar, .pz-chart .pz-seg, .pz-chart .pz-cell, .pz-chart .pz-funnel-step { transition: opacity var(--pz-fast), filter var(--pz-fast); cursor: default; }
.pz-chart.is-hovering .pz-bar:not(.is-hover), .pz-chart.is-hovering .pz-seg:not(.is-hover), .pz-chart.is-hovering .pz-funnel-step:not(.is-hover) { opacity: .45; }
.pz-chart .pz-cell.is-hover { stroke: var(--pz-heading); stroke-width: 1.5; }
.pz-chart .pz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pz-chart .pz-dot { stroke: var(--pz-surface); stroke-width: 2; }
.pz-chart .pz-series.is-muted { opacity: .15; }
.pz-chart .pz-center-value { font-family: var(--pz-font-heading); font-weight: 800; font-size: 24px; fill: var(--pz-heading); letter-spacing: -.02em; }
.pz-chart .pz-center-label { font-size: 12px; fill: var(--pz-muted); }
.pz-chart .pz-funnel-label { fill: var(--pz-text); font-size: 12.5px; font-weight: 600; }
.pz-chart .pz-funnel-value { fill: var(--pz-heading); font-size: 13px; font-weight: 750; }
.pz-chart .pz-funnel-rate { fill: var(--pz-muted); font-size: 11.5px; font-weight: 600; }
.pz-anim-draw { animation: pz-draw 1.1s var(--pz-ease-out) forwards; }
.pz-anim-fade { opacity: 0; animation: pz-fade .7s var(--pz-ease-out) .2s forwards; }
.pz-anim-grow { transform-box: fill-box; transform-origin: 50% 100%; animation: pz-grow-y .7s var(--pz-ease-out) both; }
.pz-anim-grow-x { transform-box: fill-box; transform-origin: 0% 50%; animation: pz-grow-x .7s var(--pz-ease-out) both; }
.pz-anim-pop { transform-box: fill-box; transform-origin: center; animation: pz-pop .5s var(--pz-ease-out) both; }
@keyframes pz-draw { to { stroke-dashoffset: 0; } }
@keyframes pz-fade { to { opacity: 1; } }
@keyframes pz-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pz-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pz-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pz-chart-tooltip {
  position: absolute; z-index: 5; left: 0; top: 0; min-width: 140px; max-width: 260px; padding: 9px 12px; border-radius: 10px;
  background: var(--pz-surface-raised); border: 1px solid var(--pz-border); box-shadow: var(--pz-shadow-lg);
  color: var(--pz-text); font-size: 12.5px; line-height: 1.45; pointer-events: none; opacity: 0;
  transition: opacity .12s ease; white-space: nowrap;
}
.pz-chart-tooltip.is-visible { opacity: 1; }
.pz-tt-title { font-size: 11.5px; font-weight: 600; color: var(--pz-muted); margin-bottom: 4px; }
.pz-tt-row { display: flex; align-items: center; gap: 8px; }
.pz-tt-row + .pz-tt-row { margin-top: 2px; }
.pz-tt-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.pz-tt-key.is-box { height: 10px; width: 10px; border-radius: 3px; }
.pz-tt-value { font-weight: 750; color: var(--pz-heading); font-variant-numeric: tabular-nums; }
.pz-tt-name { color: var(--pz-text-2); margin-left: auto; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; }
.pz-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--pz-text-2); justify-content: flex-start; }
.pz-chart-legend.is-top { margin: 0 0 10px; }
.pz-legend-item { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; padding: 2px 4px; border-radius: 6px; transition: opacity var(--pz-fast), background var(--pz-fast); user-select: none; }
.pz-legend-item:hover { background: var(--pz-surface-3); }
.pz-legend-item.is-off { opacity: .4; }
.pz-legend-item.is-static { cursor: default; }
.pz-legend-item.is-static:hover { background: none; }
.pz-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pz-legend-swatch.is-line { width: 14px; height: 3px; border-radius: 2px; }
.pz-legend-value { font-weight: 700; color: var(--pz-heading); font-variant-numeric: tabular-nums; }
.pz-legend-pct { color: var(--pz-muted); font-variant-numeric: tabular-nums; }
.pz-chart-legend.is-list { flex-direction: column; gap: 8px; }
.pz-chart-legend.is-list .pz-legend-item { justify-content: flex-start; width: 100%; }
.pz-chart-legend.is-list .pz-legend-value { margin-left: auto; }
.pz-donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.pz-donut-wrap > svg { flex: none; width: auto; }
.pz-donut-wrap .pz-chart-legend { flex: 1 1 160px; margin-top: 0; }
.pz-donut-wrap.is-column .pz-chart-legend { flex-basis: auto; } /* legend below: 160px would become a min height */
.pz-heat-scale { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--pz-muted); justify-content: flex-end; }
.pz-heat-scale span.cell { width: 14px; height: 14px; border-radius: 3px; }
.pz-chart-empty { display: grid; place-items: center; min-height: 160px; color: var(--pz-faint); font-size: 13px; border: 1px dashed var(--pz-border); border-radius: var(--pz-radius-sm); }
.chart-card .card-body { padding-top: 14px; }

/* ==========================================================================
   27 UI kit helpers
   ========================================================================== */
.kit-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.kit-nav { position: sticky; top: calc(var(--pz-topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; max-height: calc(100vh - 120px); overflow-y: auto; }
.kit-nav a { padding: 6px 12px; border-radius: 8px; color: var(--pz-muted); font-weight: 550; }
.kit-nav a:hover { background: var(--pz-surface-3); color: var(--pz-heading); }
.kit-section { scroll-margin-top: calc(var(--pz-topbar-h) + 20px); margin-bottom: 44px; }
.kit-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 4px; }
.kit-section > p.muted { margin-bottom: 18px; }
.kit-demo { padding: 24px; border: 1px solid var(--pz-border); border-radius: var(--pz-radius); background: var(--pz-surface); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.kit-demo.is-col { flex-direction: column; align-items: stretch; }
.kit-demo.is-plain { display: block; }
.kit-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pz-faint); margin: 18px 0 8px; }
.kit-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kit-swatch { border: 1px solid var(--pz-border); border-radius: var(--pz-radius); overflow: hidden; background: var(--pz-surface); }
.kit-swatch-color { height: 64px; }
.kit-swatch-meta { padding: 8px 10px; font-size: 12px; }
.kit-swatch-meta strong { display: block; color: var(--pz-heading); font-size: 12.5px; }
.kit-swatch-meta code { font-size: 11px; border: 0; padding: 0; background: none; color: var(--pz-muted); white-space: normal; overflow-wrap: anywhere; }
.kit-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.kit-icon { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 10px; border: 1px solid var(--pz-border); border-radius: var(--pz-radius-sm); background: var(--pz-surface); font-size: 11px; color: var(--pz-muted); cursor: copy; text-align: center; word-break: break-all; transition: border-color var(--pz-fast), color var(--pz-fast); }
.kit-icon:hover { border-color: var(--pz-primary); color: var(--pz-primary-text); }
.kit-icon .icon { width: 22px; height: 22px; color: var(--pz-heading); }
.kit-type-sample > * { margin: 0 0 10px; }

/* ==========================================================================
   28 Utilities
   ========================================================================== */
.muted { color: var(--pz-muted) !important; }
.faint { color: var(--pz-faint) !important; }
.text-xs { font-size: var(--pz-text-xs) !important; }
.text-sm { font-size: var(--pz-text-sm) !important; }
.text-base { font-size: var(--pz-text-base) !important; }
.text-lg { font-size: var(--pz-text-lg) !important; }
.text-xl { font-size: 20px !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.text-primary { color: var(--pz-primary-text) !important; }
.text-accent { color: var(--pz-accent-text) !important; }
.text-success { color: var(--pz-success-text) !important; }
.text-warning { color: var(--pz-warning-text) !important; }
.text-danger { color: var(--pz-danger-text) !important; }
.text-info { color: var(--pz-info-text) !important; }
.text-heading { color: var(--pz-heading) !important; }
.font-heading { font-family: var(--pz-font-heading) !important; }
.font-mono { font-family: var(--pz-font-mono) !important; }
.uppercase { text-transform: uppercase; letter-spacing: .06em; }
.nowrap { white-space: nowrap !important; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; min-width: 0; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 4px !important; } .mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 16px !important; } .mt-4 { margin-top: 24px !important; } .mt-5 { margin-top: 32px !important; } .mt-6 { margin-top: 48px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px !important; } .mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 16px !important; } .mb-4 { margin-bottom: 24px !important; } .mb-5 { margin-bottom: 32px !important; } .mb-6 { margin-bottom: 48px !important; }
.ml-auto { margin-left: auto !important; } .mr-auto { margin-right: auto !important; } .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.p-0 { padding: 0 !important; } .p-2 { padding: 8px !important; } .p-3 { padding: 16px !important; } .p-4 { padding: 24px !important; }
.gap-0 { gap: 0 !important; } .gap-1 { gap: 4px !important; } .gap-2 { gap: 8px !important; } .gap-3 { gap: 16px !important; } .gap-4 { gap: 24px !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.grid-inline { display: inline-grid !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 1 0% !important; min-width: 0; }
.flex-none { flex: none !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.max-w-sm { max-width: 420px !important; } .max-w-md { max-width: 640px !important; } .max-w-lg { max-width: 880px !important; }
.h-full { height: 100% !important; }
.hidden { display: none !important; }
.relative { position: relative !important; }
.rounded { border-radius: var(--pz-radius) !important; }
.rounded-full { border-radius: 999px !important; }
.shadow { box-shadow: var(--pz-shadow-md) !important; }
.border { border: 1px solid var(--pz-border) !important; }
.border-top { border-top: 1px solid var(--pz-border) !important; }
.bg-surface { background: var(--pz-surface) !important; }
.bg-subtle { background: var(--pz-surface-2) !important; }
.bg-gradient { background: var(--pz-gradient) !important; color: #fff; }
.cursor-pointer { cursor: pointer !important; }
.select-all { user-select: all; }
.show-mobile { display: none !important; }
[hidden] { display: none !important; } /* keep [hidden] stronger than display utilities */

/* ==========================================================================
   29 Responsive
   ========================================================================== */
@media (max-width: 1279px) {
  /* topbar: the actions need ~520px – below 1280px the search box squeezed the page title to ~40px.
     Contact search stays one click away via the command palette (button + Ctrl/Cmd+K, "Kontakte durchsuchen"). */
  .topbar-search { display: none; }
  .topbar-left { flex: 1 1 auto; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) 300px; }
  .split-wide-aside { grid-template-columns: minmax(0, 1fr) 340px; }
  .kit-layout { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  :root { --pz-gutter: 24px; }
  .sidebar { transform: translateX(-102%); box-shadow: var(--pz-shadow-xl); width: min(var(--pz-sidebar-w), 86vw); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }
  .sidebar-collapse-btn { display: none; }
  .sidebar-close-btn { display: inline-grid; }
  .main { margin-left: 0; }
  .topbar-btn.topbar-menu-btn { display: inline-grid; }
  .topbar-title { max-width: 30vw; }
  .split, .split-wide-aside, .split-left { grid-template-columns: minmax(0, 1fr); }
  .split > aside, .split .aside-sticky { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 32px 28px; gap: 26px; }
  .auth-quote { display: none; }
  .kit-layout { grid-template-columns: minmax(0, 1fr); }
  .kit-nav { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
}
@media (max-width: 767px) {
  :root { --pz-gutter: 16px; --pz-topbar-h: 58px; }
  body { font-size: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid > .span-2, .grid > .span-3 { grid-column: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-icon { display: none; }
  .stat:has(.stat-icon) .stat-label { padding-right: 0; }
  .form-row, .form-row-3 { grid-template-columns: minmax(0, 1fr); }
  .content { padding-top: 20px; padding-bottom: 32px; }
  .page-header { margin-bottom: 18px; align-items: stretch; }
  .page-title { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions > .btn { flex: 1 1 auto; }
  .topbar { gap: 4px; }
  .topbar-search { display: none; }
  .topbar-title { max-width: 42vw; font-size: 14.5px; }
  .user-chip-name, .user-chip > .icon { display: none; }
  .ai-meter-pill-text, .ai-meter-pill .mini-bar { display: none; }
  .topbar-divider { display: none; }
  .quick-create-label { display: none; }
  .topbar-btn.theme-toggle { display: none; } /* also in the user menu ("Darstellung") – frees room for the title */
  .card-header, .card-body, .card-footer { padding-left: 16px; padding-right: 16px; }
  .modal { padding: 16px 10px; align-items: flex-end; }
  .modal-dialog { border-radius: var(--pz-radius-lg); }
  .modal-full { width: 100%; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-footer > .btn { flex: 1 1 auto; }
  .toast-stack { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .locked { flex-direction: column; padding: 22px; }
  .locked.is-compact { flex-direction: row; flex-wrap: wrap; }
  .pagination { justify-content: center; }
  .pagination-info { width: 100%; text-align: center; }
  .pagination-pages .page-num:not(.is-active):not(.is-edge) { display: none; }
  .bulk-bar { left: 0; right: 0; width: 100%; border-radius: var(--pz-radius); }
  .notif-menu, .ai-meter-menu { width: calc(100vw - 24px); position: fixed; left: 12px !important; right: 12px !important; top: calc(var(--pz-topbar-h) + 4px); }
  .dropdown-menu.is-mobile-fixed { position: fixed; left: 12px; right: 12px; top: calc(var(--pz-topbar-h) + 4px); }
  .auth-brand { display: none; }
  .banner { padding-top: 8px; padding-bottom: 8px; font-size: 13px; gap: 8px; }
  .banner > .icon { display: none; }
  .banner-trial .banner-extra { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-main { justify-content: flex-start; padding-top: 36px; }
  .auth-card { padding: 26px 22px; border-radius: var(--pz-radius-lg); }
  .blank-card { padding: 28px 20px; }
  .preview-stage { padding: 10px; }
  .preview-frame.is-mobile .preview-device { width: 100%; max-width: 390px; }
  .table th, .table td { padding: 10px 12px; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: initial !important; }
  .audience-lists { grid-template-columns: minmax(0, 1fr); }
  .app-footer { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet { display: none !important; }
}

/* ==========================================================================
   30 Print
   ========================================================================== */
@media print {
  :root { --pz-bg: #fff; --pz-surface: #fff; --pz-surface-2: #fff; --pz-shadow-sm: none; --pz-shadow-md: none; --pz-shadow-lg: none; color-scheme: light; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .sidebar, .sidebar-backdrop, .topbar, .app-footer, .banner, .toast-stack, .bulk-bar, .page-actions, .card-actions,
  .cell-actions, .pagination-pages, .btn, .modal, .tooltip, .no-print, .kit-nav, .dropdown-menu { display: none !important; }
  .main { margin: 0 !important; }
  .content { max-width: none; padding: 0; }
  .card, .stat, .table-wrap { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: underline; }
  .table thead th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge, .progress-bar, .pz-chart svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tab-panel { display: block !important; }
  .page-title { font-size: 20pt; }
}

/* ==========================================================================
   31 Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .pz-anim-draw { stroke-dashoffset: 0 !important; }
  .pz-anim-fade { opacity: 1 !important; }
}

