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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --color-red-100: oklch(93.6% .032 17.717);
  --color-red-200: oklch(88.5% .062 18.334);
  --color-red-300: oklch(80.8% .114 19.571);
  --color-red-500: oklch(63.7% .237 25.331);
  --color-red-600: oklch(57.7% .245 27.325);
  --color-red-700: oklch(50.5% .213 27.518);
  --color-amber-100: oklch(96.2% .059 95.617);
  --color-amber-500: oklch(76.9% .188 70.08);
  --color-amber-600: oklch(66.6% .179 58.318);
  --color-amber-700: oklch(55.5% .163 48.998);
  --color-yellow-400: oklch(85.2% .199 91.936);
  --color-yellow-900: oklch(42.1% .095 57.708);
  --color-green-100: oklch(96.2% .044 156.743);
  --color-green-500: oklch(72.3% .219 149.579);
  --color-green-600: oklch(62.7% .194 149.214);
  --color-green-700: oklch(52.7% .154 150.069);
  --color-green-800: oklch(44.8% .119 151.328);
  --color-blue-300: oklch(80.9% .105 251.813);
  --color-blue-400: oklch(70.7% .165 254.624);
  --color-blue-500: oklch(62.3% .214 259.815);
  --color-blue-600: oklch(54.6% .245 262.881);
  --color-blue-700: oklch(48.8% .243 264.376);
  --color-blue-800: oklch(42.4% .199 265.638);
  --color-blue-900: oklch(37.9% .146 265.522);
  --color-indigo-500: oklch(58.5% .233 277.117);
  --color-purple-600: oklch(55.8% .288 302.321);
  --color-purple-700: oklch(49.6% .265 301.924);
  --color-slate-100: oklch(96.8% .007 247.896);
  --color-slate-300: oklch(86.9% .022 252.894);
  --color-slate-600: oklch(44.6% .043 257.281);
  --color-slate-700: oklch(37.2% .044 257.287);
  --color-gray-50: oklch(98.5% .002 247.839);
  --color-gray-100: oklch(96.7% .003 264.542);
  --color-gray-200: oklch(92.8% .006 264.531);
  --color-gray-300: oklch(87.2% .01 258.338);
  --color-gray-400: oklch(70.7% .022 261.325);
  --color-gray-500: oklch(55.1% .027 264.364);
  --color-gray-600: oklch(44.6% .03 256.802);
  --color-gray-700: oklch(37.3% .034 259.733);
  --color-gray-800: oklch(27.8% .033 256.848);
  --color-gray-900: oklch(21% .034 264.665);
  --color-black: #000;
  --color-white: #fff;

  --background:          0 0% 100%;
  --foreground:          222.2 84% 4.9%;
  --card:                0 0% 100%;
  --card-foreground:     222.2 84% 4.9%;
  --popover:             0 0% 100%;
  --popover-foreground:  222.2 84% 4.9%;
  --primary:             #0385ff;
  --primary-foreground:  210 40% 98%;
  --secondary:           210 40% 96.1%;
  --secondary-foreground:222.2 47.4% 11.2%;
  --muted-hsl:           260 20% 97%;
  --muted-foreground:    215.4 16.3% 46.9%;
  --accent:              210 40% 96.1%;
  --accent-foreground:   222.2 47.4% 11.2%;
  --destructive:         0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border-hsl:          214.3 31.8% 91.4%;
  --input-hsl:           214.3 31.8% 91.4%;
  --ring:                221.2 83.2% 53.3%;
  --radius:              .5rem;

  --color-background:    hsl(var(--background));
  --color-foreground:    hsl(var(--foreground));
  --color-muted:         hsl(var(--muted-hsl));
  --color-muted-fg:      hsl(var(--muted-foreground));
  --color-border:        hsl(var(--border-hsl));
  --color-ring:          hsl(var(--ring));
  --color-primary:       var(--primary);
  --color-primary-foreground: hsl(var(--primary-foreground));

  --green:      #0385ff;
  --green-dk:   #0270d9;
  --blue:       #0385ff;
  --blue-dk:    #0270d9;
  --navy:       #1E293B;
  --orange:     #F59E0B;
  --border:     hsl(var(--border-hsl));
  --text:       hsl(var(--foreground));
  --heading:    #0f172a;
  --text-secondary: #64748b;
  --muted:      hsl(var(--muted-foreground));
  --bg:         hsl(var(--muted-hsl));
  --white:      #fff;

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: .75rem;
  --radius-2xl: 1rem;
  --font-ui: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-hero: 'Inter', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --shadow-centered-sm: 0 0 0 1px rgba(148, 163, 184, .12), 0 0 18px rgba(15, 23, 42, .04), 0 0 38px rgba(15, 23, 42, .05);
  --shadow-centered-md: 0 0 0 1px rgba(148, 163, 184, .12), 0 0 24px rgba(15, 23, 42, .05), 0 0 54px rgba(15, 23, 42, .06);
  --shadow-centered-lg: 0 0 0 1px rgba(148, 163, 184, .11), 0 0 30px rgba(15, 23, 42, .06), 0 0 68px rgba(15, 23, 42, .07);
  --shadow-centered-xl: 0 0 0 1px rgba(148, 163, 184, .10), 0 0 40px rgba(15, 23, 42, .07), 0 0 84px rgba(15, 23, 42, .08);
  --shadow-centered-dark: 0 0 0 1px rgba(15, 23, 42, .08), 0 0 28px rgba(15, 23, 42, .12), 0 0 60px rgba(15, 23, 42, .14);
  --shadow-centered-green: 0 0 0 1px rgba(3, 133, 255, .16), 0 0 18px rgba(3, 133, 255, .18), 0 0 36px rgba(3, 133, 255, .22);
  --shadow-elev-1: 0 0 0 1px rgba(148, 163, 184, .12), 0 0 26px rgba(15, 23, 42, .05), 0 0 58px rgba(15, 23, 42, .07);
  --shadow-elev-2: 0 0 0 1px rgba(148, 163, 184, .12), 0 0 18px rgba(15, 23, 42, .04), 0 0 38px rgba(15, 23, 42, .05);
  --shadow-elev-3: 0 0 0 1px rgba(148, 163, 184, .10), 0 0 12px rgba(15, 23, 42, .03), 0 0 24px rgba(15, 23, 42, .04);

  --site-container: 1200px;
  --site-container-wide: 1440px;
  --site-container-narrow: 1100px;
  --site-gutter-x: clamp(1rem, 3vw, 1.5rem);
  --site-shell-y: clamp(1.5rem, 2.8vw, 2.5rem);
  --site-touch-target: 48px;
  --site-admin-sidebar-width: 320px;
  --site-admin-sidebar-compact-width: 92px;
  --site-account-sidebar-width: 300px;
  --site-account-panel-width: 300px;
  --site-account-workspace-gap: 1.15rem;
}

/* ── Ensure the HTML hidden attribute always wins over explicit display rules ── */
[hidden] { display: none !important; }

body {
  font-family: var(--font-ui);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: clamp(15px, .94rem, 16px);
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: block;
  padding: 0;
  background: transparent;
}

.ps-header {
  background: rgba(255,255,255,.92);
  color: var(--text);
  padding: 0 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(148, 163, 184, .18), 0 0 26px rgba(15, 23, 42, .05), 0 0 58px rgba(15, 23, 42, .06);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.ps-header--admin,
.ps-header--account {
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,251,255,.92));
  box-shadow: 0 1px 0 rgba(148, 163, 184, .16), 0 0 24px rgba(15, 23, 42, .05), 0 0 52px rgba(15, 23, 42, .05);
}

.ps-header--storefront-glass {
  background: transparent;
  box-shadow: none;
  border-bottom-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

.shell-storefront .ps-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: transparent;
  box-shadow: none;
  border-bottom-color: rgba(255, 255, 255, .22);
}

/* Utility pages (login, verify, access denied) — minimal chrome */
.ps-header--utility {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

.ps-header--utility .ps-header-nav__cluster {
  display: none;
}

.ps-header--utility .ps-header-menu-toggle,
.ps-header--utility .ps-header-cta,
.ps-header--utility .nav-cart-btn {
  display: none;
}

html[data-theme='dark'] .ps-header--utility {
  background: rgba(15, 23, 42, .96);
}

.ps-footer--utility {
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: .4rem;
  min-height: auto;
  padding: 1rem 2rem;
}

.ps-footer--utility .ps-footer-links {
  justify-content: center;
}

.shell-main {
  min-width: 0;
}

.shell-main--storefront-offset {
  padding-top: calc(66px + 1.2rem);
}

/* Logo */
.ps-logo-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  flex: 0 0 auto;
  max-width: min(220px, 40vw);
  min-width: 0;
}
.ps-logo-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}
.ps-logo-image {
  display: block;
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.ps-logo-text {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  white-space: nowrap;
}
.ps-logo-text strong {
  font-weight: 900;
  color: var(--green);
}

.ps-header-context {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: .65rem;
  padding: .3rem .62rem;
  border-radius: 999px;
  background: rgba(3, 133, 255, .08);
  color: var(--blue);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .12);
}

/* Nav links */
.ps-header nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.ps-header-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: .25rem;
  min-width: 0;
}

.ps-header-nav--admin,
.ps-header-nav--account {
  gap: .4rem;
}

.ps-header nav a {
  color: #62597b;
  text-decoration: none;
  padding: .36rem .62rem;
  font-size: .82rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.ps-header nav a:hover { color: var(--primary); background: rgba(3, 133, 255, .08); }
.ps-header nav a.is-active {
  color: #0f172a;
  background: rgba(15, 23, 42, .06);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .14);
}

.ps-header-link--utility {
  color: #475569 !important;
  background: rgba(255,255,255,.74);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .12);
}

.shell-storefront .ps-header nav a[href$="/PayStubs"] {
  background: linear-gradient(135deg, rgba(3, 133, 255, .14), rgba(96, 165, 250, .12));
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(3, 133, 255, .14);
}

.shell-storefront .ps-header nav a[href$="/PayStubs"]:hover,
.shell-storefront .ps-header nav a[href$="/PayStubs"].is-active {
  background: linear-gradient(135deg, rgba(3, 133, 255, .18), rgba(96, 165, 250, .16));
  color: var(--blue-dk);
}

.ps-header--admin .ps-logo-link,
.ps-header--account .ps-logo-link {
  position: relative;
}

.ps-header--admin .ps-logo-link::after,
.ps-header--account .ps-logo-link::after {
  content: "";
  position: absolute;
  right: -1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 34px;
  background: rgba(148, 163, 184, .22);
}

/* Icon-only nav buttons (account, dashboard) */
.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #6b7280 !important;
  padding: 0 !important;
  transition: color .15s, background .15s;
}
.nav-icon-link:hover { color: var(--primary) !important; background: rgba(3, 133, 255, .08) !important; }
.nav-account { color: var(--green) !important; }
.nav-account:hover { color: var(--blue-dk) !important; background: rgba(3,133,255,.12) !important; }

.nav-account-menu {
  position: relative;
}

.nav-account-menu summary {
  list-style: none;
}

.nav-account-menu summary::-webkit-details-marker {
  display: none;
}

.nav-account-menu[open] .nav-account {
  color: var(--blue-dk) !important;
  background: rgba(3,133,255,.12) !important;
}

.nav-account-menu__panel {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: min(320px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: .95rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at top right, rgba(3, 133, 255, .08), transparent 30%),
    rgba(255, 255, 255, .98);
  box-shadow: 0 24px 56px rgba(15, 23, 42, .16);
  display: grid;
  gap: .7rem;
  z-index: 40;
}

.nav-account-menu__meta {
  padding: .1rem .2rem .65rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.nav-account-menu__meta strong {
  display: block;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: 1rem;
}

.nav-account-menu__meta span {
  display: block;
  margin-top: .18rem;
  color: #64748b;
  font-size: .77rem;
  line-height: 1.5;
}

.nav-account-menu__links {
  display: grid;
  gap: .25rem;
}

.nav-account-menu__section-label {
  padding: .45rem .82rem .1rem;
  color: #64748b;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-account-menu__links a,
.nav-account-menu__logout {
  display: block;
  padding: .66rem .82rem !important;
  border-radius: 14px;
  color: #334155 !important;
  text-decoration: none;
  font-size: .86rem !important;
  font-weight: 700 !important;
}

.nav-account-menu__links a:hover,
.nav-account-menu__logout:hover {
  background: #f8fafc !important;
  color: var(--blue) !important;
}

.nav-account-menu__logout {
  border-top: 1px solid rgba(148, 163, 184, .18);
  padding-top: .8rem !important;
  color: #b91c1c !important;
}

.nav-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #6b7280;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-logout:hover { color: #EF4444; background: rgba(239,68,68,.08); }

/* Cart icon button */
.nav-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(3, 133, 255, .08);
  border: 1px solid rgba(3, 133, 255, .16);
  border-radius: 8px;
  color: var(--blue);
  cursor: pointer;
  margin-left: .25rem;
  transition: background .15s, color .15s;
}
.nav-cart-btn:hover { background: rgba(3, 133, 255, .14); color: var(--blue-dk); }
.nav-cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--orange);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
}
.ps-header-cart-btn {
  position: relative;
}
.ps-header-cart-btn__cart,
.ps-header-cart-btn__close {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ps-header-cart-btn__close {
  opacity: 0;
  transform: scale(.72) rotate(-90deg);
}
.ps-header-cart-btn__close-line {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.ps-header-cart-btn__close-line--first {
  transform: rotate(45deg);
}
.ps-header-cart-btn__close-line--second {
  transform: rotate(-45deg);
}
.ps-header-cart-btn[aria-expanded='true'] .ps-header-cart-btn__cart {
  opacity: 0;
  transform: scale(.72);
}
.ps-header-cart-btn[aria-expanded='true'] .ps-header-cart-btn__close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.shell-admin .ps-header nav a,
.shell-account .ps-header nav a {
  border-radius: 999px;
  padding: .48rem .82rem;
  font-size: .8rem;
  font-weight: 700;
}

.shell-admin .ps-header nav a.is-active,
.shell-account .ps-header nav a.is-active {
  background: linear-gradient(135deg, rgba(3, 133, 255, .11), rgba(96, 165, 250, .08));
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(3, 133, 255, .12);
}

.ps-hero { display: none; }
.ps-hero-banner {
  position: relative;
  height: 220px;
  width: 100%;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
}
.ps-hero-inner { text-align: center; padding: 0 1rem; }
.ps-hero-title {
  font-size: 2.2rem;
  font-weight: 600;
  text-shadow: 0 4px 4px rgba(0,0,0,.25);
  margin-bottom: .5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.ps-hero-title a { color: inherit; text-decoration: none; }
.ps-hero-sub {
  font-size: 1.05rem;
  opacity: .9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}

.ps-page-body {
  
  max-width: var(--site-container);
  width: 100%;
  margin: 0 auto;
  padding: .45rem 0 2rem;
}

.home-promo-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr);
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
}
.home-promo-copy,
.home-promo-highlights {
  border-radius: 24px;
  overflow: hidden;
}
.home-promo-copy {
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.28), transparent 32%),
    linear-gradient(135deg, #0f4c81 0%, #0f6fa5 46%, #0385ff 100%);
  color: #fff;
  box-shadow: 0 24px 54px rgba(15, 76, 129, .16);
}
.home-promo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .38rem .78rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-promo-copy h1 {
  margin: .85rem 0 .7rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -.05em;
}
.home-promo-copy p {
  margin: 0;
  max-width: 62ch;
  color: rgba(255,255,255,.9);
  font-size: .98rem;
  line-height: 1.75;
}
.home-promo-strike {
  text-decoration: line-through;
  opacity: .7;
}
.home-promo-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}
.home-promo-actions .btn-acc-secondary {
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.home-promo-actions .btn-acc-secondary:hover {
  border-color: rgba(255,255,255,.45);
  color: #fff;
}
.home-promo-code {
  display: inline-grid;
  gap: .12rem;
  margin-top: 1.1rem;
  padding: .85rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.12);
}
.home-promo-code span,
.home-promo-code small {
  color: rgba(255,255,255,.74);
}
.home-promo-code strong {
  font-size: 1.35rem;
  letter-spacing: .08em;
}
.home-promo-highlights {
  display: grid;
  gap: 1rem;
}
.home-highlight-card {
  padding: 1.2rem 1.25rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(148,163,184,.14);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}
.home-highlight-card strong {
  display: block;
  margin-bottom: .45rem;
  color: #0f172a;
  font-size: 1rem;
}
.home-highlight-card p {
  margin: 0;
  color: #475569;
  line-height: 1.7;
  font-size: .87rem;
}

.wiz-progress-wrap {
  width: 100%;
  max-width: var(--site-container);
  margin: 0 auto;
}

.ps-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  padding: 0 var(--site-gutter-x) 2rem;
  max-width: var(--site-container);
  margin: 0 auto;
  overflow: visible;
}
.ps-form-col {
  flex: 0 0 66%;
  max-width: 66%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}
.ps-preview-col {
  flex: 0 0 31.8%;
  max-width: 31.8%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0;
  padding-bottom: 3rem;
}
@media (max-width: 1024px) {
  .home-promo-shell { grid-template-columns: 1fr; padding: 1rem 1rem .75rem; }
  .ps-layout { flex-direction: column; }
  .ps-form-col { flex: none; max-width: 100%; width: 100%; }
  .ps-preview-col { flex: none; max-width: 100%; padding-top: 0; }
}


.ps-form-col form { width: 100%; position: relative; }
.step-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elev-1);
  overflow: visible;
  position: relative;
  margin-bottom: 0;
  width: 100%;
}
.step-card-header {
  display: none; /* replaced by step badge */
}
.step-num { display: none; }
.step-card-body { padding: 2rem; }
.step-card--library { /* library variant — inherits base .step-card */ }
.step-card--flush .step-card-body { padding: 0; }
.step-card--spaced .step-card-body { padding: 2rem; }
.step-card--spaced-sm .step-card-body { padding: 1.15rem; }
.step-card-body--flush-top { padding-top: 0; }
@media (min-width: 1025px) {
  .step-card-body { padding: 2.5rem; }
  .step-card--flush .step-card-body { padding: 0; }
  .step-card--spaced .step-card-body { padding: 2.5rem; }
  .step-card--spaced-sm .step-card-body { padding: 1.35rem; }
}


.step-badge {
  position: absolute;
  top: 0.5rem;
  left: -1.25rem;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.15rem 0.75rem;
  border-radius: 4px;
  transform: rotate(-45deg);
  z-index: 5;
  white-space: nowrap;
}
@media (min-width: 1025px) {
  .step-badge {
    padding: 0.2rem 1.25rem;
    font-size: 1.1rem;
  }
}

.ps-row { display: grid; gap: .7rem; margin-bottom: .7rem; }
.ps-row.one   { grid-template-columns: 1fr; }
.ps-row.two   { grid-template-columns: 1fr 1fr; }
.ps-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .ps-row.two,
  .ps-row.three { grid-template-columns: 1fr; }
}

.ps-field { display: flex; flex-direction: column; gap: .25rem; }
.ps-field label { font-size: 0.75rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }

.logo-upload-box {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-md);
  background: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  overflow: hidden;
  transition: border-color .15s;
}
.logo-upload-box:hover { border-color: var(--blue); }
.logo-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.logo-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  color: var(--muted);
  font-size: .75rem;
  pointer-events: none;
  padding: .75rem;
}
.logo-upload-icon { font-size: 1.4rem; }
.logo-upload-preview {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
  padding: .5rem;
}
.logo-clear-btn {
  margin-top: .3rem;
  font-size: .7rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  align-self: flex-start;
}
.logo-clear-btn:hover { color: #dc2626; }

.ps-field input,
.ps-field select,
.ps-check-row + div input {
  border: 1px solid #6a7282;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  height: 2.25rem;
  color: var(--text);
  outline: none;
  background: var(--color-muted);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
@media (max-width: 768px) {
  .ps-field input,
  .ps-field select,
  .ps-check-row + div input {
    min-height: 2.75rem;
    height: 2.75rem;
    font-size: 1rem;
    padding: .7rem .85rem;
  }

  .ps-field label {
    font-size: .82rem;
  }

  .ps-check-row {
    align-items: flex-start;
    gap: .65rem;
  }

  .ps-check-row input[type="checkbox"],
  .generator-consent-check,
  .local-tax-toggle input[type="checkbox"] {
    width: 1.125rem;
    min-width: 1.125rem;
    height: 1.125rem;
    min-height: 1.125rem;
    flex: 0 0 1.125rem;
    margin-top: .18rem;
  }

  .tmpl-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: .25rem .15rem .55rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tmpl-grid::-webkit-scrollbar { display: none; }

  .tmpl-opt--grid {
    flex: 0 0 62%;
    scroll-snap-align: center;
  }

  .tmpl-opt--side .tmpl-card,
  .tmpl-opt--center .tmpl-card {
    transform: none;
    opacity: 1;
  }

  .tmpl-card {
    padding: 0;
    border: none;
    border-radius: .65rem;
    background: transparent;
    box-shadow: none;
  }

  .preview-template-status,
  .preview-summary-bar,
  .generator-preview-header,
  .cart-item__header,
  .cart-item__footer,
  .payment-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .payment-modal__actions > * {
    width: 100%;
  }

  .payment-modal {
    padding: .75rem;
  }

  .payment-modal__dialog {
    width: 100%;
    max-height: calc(100vh - 124px);
    padding: 1rem;
  }

  .payment-modal__element {
    max-height: 45vh;
  }

  .payment-modal__actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: .55rem;
    margin-top: auto;
  }

  .payment-modal__pay {
    min-height: 48px;
    font-size: 1.02rem;
    order: -1;
  }
}

.ps-header nav a,
.nav-icon-link,
.nav-logout,
.nav-cart-btn,
.btn-wiz-back,
.btn-wiz-next,
.btn-wiz-cart,
.btn-wiz-buynow,
.btn-unlock-preview,
.cart-panel__clear,
.cart-panel__promo-btn,
.cart-item__edit,
.cart-item__remove,
.payment-modal__pay,
.payment-modal__cancel {
  min-height: var(--site-touch-target);
}

.nav-icon-link,
.nav-logout,
.nav-cart-btn,
.cart-item__remove {
  min-width: var(--site-touch-target);
}
.ps-field:has(input[data-val-required]) label::after,
.ps-field:has(select[data-val-required]) label::after {
  content: ' *';
  color: #ef4444;
  font-weight: 700;
}
.ps-field input:focus,
.ps-field select:focus {
  border-color: #155dfc;
  background: var(--color-muted);
  outline: 2px solid transparent;
  box-shadow: 0 0 0 1px oklch(54.6% .245 262.881), 0 0 0 3px oklch(54.6% .245 262.881 / .2);
}

.dollar-input {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fafbfc;
}
.dollar-input span {
  padding: .48rem .65rem;
  background: #ecf0f1;
  font-weight: 700;
  color: var(--muted);
  font-size: .88rem;
  border-right: 1.5px solid var(--border);
  white-space: nowrap;
}
.dollar-input input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  background: transparent !important;
}
.dollar-input:focus-within { border-color: var(--green); }

.hrs-input {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fafbfc;
}
.hrs-input input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  background: transparent !important;
  text-align: right;
}
.hrs-input span {
  padding: .48rem .7rem;
  background: #ecf0f1;
  font-weight: 700;
  color: var(--muted);
  font-size: .82rem;
  border-left: 1.5px solid var(--border);
}
.hrs-input:focus-within { border-color: var(--green); }

.pay-type-toggle {
    display: flex;
    
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.pay-type-opt {
    flex: 1 1 calc(50% - 0.5em);
    display: flex;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    padding: .38rem .8rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: #fafbfc;
    transition: all .15s;
}
.pay-type-opt:has(input:checked) {
  border-color: var(--green);
  background: #eafaf1;
  color: var(--green-dk);
}
    .pay-type-opt input[type="radio"] {
        accent-color: var(--green);
        height: 1.5rem !important;
        line-height: 1.25rem;
        min-height: 1.5rem;
        width: 30%;
    }
.pay-type-hint {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}

.ps-check-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  margin-top: .3rem;
}
.ps-check-row input[type="checkbox"] { accent-color: var(--green); width: 15px; height: 15px; }

.year-sep {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .8rem 0 .4rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}
.year-sep::before,
.year-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.acc-item {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: .5rem;
  overflow: hidden;
  background: var(--white);
  box-shadow:
    0 8px 16px -2px rgba(0,0,0,.06),
    0 32px 64px -12px rgba(0,0,0,.1),
    0 64px 120px -20px rgba(0,0,0,.14);
}
.acc-item.acc-open { border-color: #a9d9bc; }

.acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  cursor: pointer;
  background: var(--color-muted);
  user-select: none;
  transition: background .15s;
}
.acc-item.acc-open .acc-header { background: hsl(210 40% 96%); }
.acc-header:hover { background: hsl(210 20% 94%); }
.acc-item.acc-open .acc-header:hover { background: hsl(210 45% 93%); }

.acc-title { display: flex; align-items: center; gap: .8rem; }
.acc-num {
  font-weight: 700;
  font-size: .88rem;
  color: var(--blue);
}
.acc-date {
  font-size: .85rem;
  color: var(--color-muted-fg);
  background: hsl(210 20% 92%);
  padding: .15rem .55rem;
  border-radius: 4px;
  font-family: monospace;
}
.acc-item.acc-open .acc-date { background: hsl(210 50% 90%); color: var(--blue); }
.acc-chevron { color: var(--muted); font-size: .8rem; }

.acc-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.add-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: .6rem 0 .3rem;
}
.btn-add-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  padding: .2rem 0;
  text-decoration: underline;
  display: block;
  margin-top: .4rem;
}
.btn-add-link:hover { color: var(--green-dk); }

.li-header {
  display: grid;
  grid-template-columns: 1fr 1fr 28px;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: .3rem;
}
.li-row {
  display: grid;
  grid-template-columns: 1fr 1fr 28px;
  gap: .4rem;
  align-items: center;
  margin-bottom: .4rem;
}
.li-row > *,
.li-header > * {
  min-width: 0;
}
.li-row--addition { grid-template-columns: 1fr 80px 110px 28px; }
.li-row.li-ded { grid-template-columns: minmax(0, 1fr) minmax(94px, 120px) 28px 32px; gap: .35rem; }
.li-header.li-ded { grid-template-columns: minmax(0, 1fr) minmax(94px, 120px) 28px 32px; }

.li-row input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: .42rem .6rem;
  font-size: .84rem;
  outline: none;
  background: #fafbfc;
  width: 100%;
}
.li-row input:focus { border-color: var(--green); background: var(--white); }
.li-row input.li-num { text-align: right; }

.btn-rm {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  justify-self: center;
}

.li-row.li-ded .btn-rm {
  min-width: 28px;
  min-height: 28px;
}

.btn-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: grab;
  justify-self: center;
  touch-action: none;
}

.btn-drag:active {
  cursor: grabbing;
}

.btn-drag__grip {
  width: 12px;
  height: 18px;
  border-radius: 999px;
  opacity: .72;
  background-image: radial-gradient(currentColor 1.2px, transparent 1.3px);
  background-size: 6px 6px;
  background-position: center;
}

.li-row.li-ded.li-row--dragging {
  opacity: .9;
}

body.deduction-dragging {
  cursor: grabbing;
  user-select: none;
}

.li-order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem;
}

.btn-order {
  border: 1px solid var(--border);
  background: #fafbfc;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
  padding: .35rem 0;
}
.btn-add {
  background: none;
  border: 1.5px dashed var(--green);
  color: var(--green);
  border-radius: 6px;
  padding: .38rem .9rem;
  font-size: .82rem;
  cursor: pointer;
  margin-top: .25rem;
  font-weight: 600;
}
.btn-add:hover { background: #eafaf1; }

.ps-alert {
  background: #fdecea;
  border-left: 4px solid #e74c3c;
  border-radius: 6px;
  padding: .65rem 1rem;
  font-size: .84rem;
  color: #c0392b;
  margin-bottom: 1rem;
}
.ps-alert ul { margin: 0; padding-left: 1.2rem; }

.btn-generate {
  display: block;
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .9rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .18s;
}
.btn-generate:hover { background: var(--green-dk); }

.ps-preview-col {
  overflow: visible;
  position: sticky;
  top: 1rem;
}
.tmpl-changer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.tmpl-changer-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--white);
  border: 2px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-weight: 700;
  font-size: .85rem;
  padding: .35rem 2rem .35rem .75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230385ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  outline: none;
  transition: border-color .18s;
}
.tmpl-changer-select:hover { border-color: var(--green-dk); }

#pdfPreviewWrap {
  overflow: visible;
}
.preview-actions { display: flex; gap: .8rem; margin-bottom: 1rem; }
.btn-print, .btn-download {
  flex: 1;
  padding: .6rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .18s;
}
.btn-print    { background: var(--blue);  color: #fff; }
.btn-download { background: var(--green); color: #fff; }
.btn-print:hover, .btn-download:hover { opacity: .87; }

.stub-wrap {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-y: auto;
  max-height: none;
  position: sticky;
  top: 0;
}

.stub-placeholder {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}
.ph-icon { font-size: 3rem; margin-bottom: 1rem; }
.stub-placeholder p { font-size: .92rem; line-height: 1.6; }

.doc-stub {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 11px;
  color: #222;
  padding: 1.6rem 1.8rem;
  background: var(--white);
}
.doc-stub-paged {
  border-bottom: 3px dashed var(--border);
}
.stub-badge {
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .3rem .8rem;
  border-radius: 5px 5px 0 0;
  letter-spacing: .5px;
  margin-bottom: .6rem;
  display: inline-block;
}

.doc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid var(--green);
  padding-bottom: .9rem;
  margin-bottom: .9rem;
}
.doc-co-name { font-size: 1.15rem; font-weight: 800; color: var(--blue); }
.doc-co-logo { max-height: 40px; max-width: 130px; object-fit: contain; display: block; margin-bottom: .35rem; }
.doc-muted   { color: var(--muted); font-size: .76rem; margin-top: .12rem; }
.doc-title-block { text-align: right; }
.doc-title   { font-size: .92rem; font-weight: 700; color: var(--blue); }

.doc-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .8rem;
  background: #f8f9fa;
  border-radius: 6px;
  padding: .75rem .9rem;
  margin-bottom: .9rem;
}
.doc-ib-label { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: .25rem; }
.doc-ib-val   { font-size: .8rem; font-weight: 600; }

.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .9rem; }

.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th {
  background: var(--blue);
  color: #fff;
  text-align: left;
  padding: .35rem .5rem;
  font-size: .69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.doc-table td {
  padding: .3rem .5rem;
  font-size: .76rem;
  border-bottom: 1px solid #ecf0f1;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:nth-child(even) td { background: #fafbfc; }
.doc-table tfoot td {
  font-weight: 700;
  background: #eafaf1;
  color: var(--green-dk);
  border-top: 2px solid var(--green);
  font-size: .78rem;
}
.ta-r { text-align: right !important; }

.doc-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
  background: var(--blue);
  border-radius: 6px;
  padding: .7rem .9rem;
  margin-bottom: .9rem;
}
.sum-box { text-align: center; }
.sum-label { font-size: .62rem; color: #95a5a6; text-transform: uppercase; letter-spacing: .4px; }
.sum-val   { font-size: .95rem; font-weight: 700; color: #fff; margin-top: .15rem; }
.sum-val.green { color: #2ecc71; }
.sum-val.small { font-size: .76rem; }

.doc-ytd {
  display: flex;
  gap: .4rem;
  background: #f8f9fa;
  border-radius: 6px;
  padding: .6rem .9rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}
.ytd-item { flex: 1; min-width: 80px; text-align: center; }
.ytd-label { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .3px; }
.ytd-val   { font-weight: 700; color: var(--blue); font-size: .82rem; }

.doc-footer {
  border-top: 1px dashed #ccc;
  padding-top: .7rem;
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--muted);
}
.sig-line {
  border-bottom: 1px solid #aaa;
  width: 120px;
  height: 18px;
  display: inline-block;
  margin-left: .4rem;
  vertical-align: bottom;
}

.ps-footer {
  padding: 1.2rem 2rem;
  font-size: .78rem;
  color: var(--text);
  background: linear-gradient(180deg, #fbfdff, #f3f8ff);
  border-top: 1px solid rgba(148, 163, 184, .28);
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.ps-footer-links {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.ps-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #334155;
  text-decoration: none;
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .35rem 1rem;
  transition: color .15s, background .15s;
  border-radius: 999px;
}
.ps-footer-links a + a {
  border-left: 1px solid rgba(148, 163, 184, .24);
}
.ps-footer-links a:hover { color: #0258b5; background: rgba(3, 133, 255, .08); }
.ps-footer-copy {
  font-size: .75rem;
  color: #475569;
}

.shell-account .ps-footer,
.shell-admin .ps-footer {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,249,255,.96));
  border-top-color: rgba(148, 163, 184, .18);
}

.shell-account .ps-footer-links a,
.shell-admin .ps-footer-links a {
  font-weight: 700;
}

.generator-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.btn-add--secondary {
  color: var(--text);
  border-style: solid;
  border-color: var(--border);
}

.shell-account .ps-footer-links a + a,
.shell-admin .ps-footer-links a + a {
  border-left-color: rgba(148, 163, 184, .24);
}

@media (max-width: 1024px) {
  .ps-header-context {
    display: none;
  }
}

.text-center { text-align: center; }
.text-right { text-align: right; }

@media print {
  body { background: #fff; }
  .ps-header, .ps-hero, .ps-form-col, .preview-actions,
  .ps-footer, .no-print, .stub-badge { display: none !important; }
  .ps-page-body { max-width: none; }
  .wiz-progress-wrap, .wiz-progress, .wiz-nav { display: none !important; }
  .ps-layout { display: block; padding: 0; }
  .ps-preview-col { position: static; }
  .stub-wrap { box-shadow: none; border-radius: 0; max-height: none; overflow: visible; }
  .doc-stub  { padding: 1.2cm 1.5cm; font-size: 10pt; }
  .doc-stub-paged { page-break-after: always; border-bottom: none; }
}

.btn-nav {
  background: var(--blue); color: #fff; border: none;
  border-radius: 4px; padding: .25rem .6rem; cursor: pointer; font-size: .85rem;
}
.btn-nav:hover { background: var(--green); }

.template-picker { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.text-uppercase { text-transform: uppercase; }
.tmpl-step-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.65;
}
.tmpl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}
.tmpl-opt { cursor: pointer; }
.tmpl-opt__input,
.tmpl-opt input[type="radio"] { display: none; }
.tmpl-opt--grid {
  display: block;
}
.tmpl-card {
  border: 1.5px solid var(--border);
  border-radius: 1.25rem;
  padding: .85rem .85rem 1rem;
  transition: border-color .32s ease, box-shadow .32s ease, transform .32s cubic-bezier(.22,1,.36,1);
  font-size: .92rem;
  color: var(--text);
  user-select: none;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15,23,42,.06);
}
.tmpl-opt--side .tmpl-card {
  transform: scale(.96);
  opacity: .88;
}
.tmpl-opt--center .tmpl-card {
  transform: translateY(6px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(148,163,184,.10), 0 22px 42px rgba(15,23,42,.07), 0 44px 90px rgba(15,23,42,.09);
}
.tmpl-card:hover {
  border-color: color-mix(in srgb, var(--blue) 52%, white);
  transform: translateY(8px) scale(1.04);
  box-shadow: 0 0 0 1px rgba(3,133,255,.10), 0 24px 48px rgba(15,23,42,.09), 0 48px 96px rgba(15,23,42,.11);
}
.tmpl-opt--side .tmpl-card:hover {
  opacity: 1;
}
.tmpl-opt--grid.is-selected .tmpl-card,
.tmpl-opt input:checked + .tmpl-card {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(110,193,130,.22), 0 18px 40px rgba(15,23,42,.08);
  transform: translateY(6px) scale(1.02);
  opacity: 1;
}
.tmpl-card__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .25rem .62rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  margin-bottom: .7rem;
}
.tmpl-card__label { display: none; }
.tmpl-card__label--quickbooks { color: #0f4c81; }
.tmpl-card__label--adp { color: #5b3fd0; }
.tmpl-card__label--professional { color: #16a34a; }
.tmpl-card__chip--classic,
.tmpl-card__chip--quickbooks {
  background: rgba(3, 133, 255, .1);
  color: #0f4c81;
}
.tmpl-card__chip--modern,
.tmpl-card__chip--adp {
  background: rgba(111, 84, 255, .12);
  color: #5b3fd0;
}
.tmpl-card__chip--professional {
  background: rgba(15, 23, 42, .08);
  color: #1e293b;
}
.tmpl-card__frame {
  width: 100%;
  border-radius: .85rem;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, .5);
  background: #fff;
  margin-bottom: .75rem;
  transition: transform .32s cubic-bezier(.22,1,.36,1);
}
.tmpl-card:hover .tmpl-card__frame {
  transform: scale(1.02);
}
.tmpl-card__frame img {
  display: block;
  width: 100%;
  height: auto;
}
.tmpl-card__copy {
  min-width: 0;
  width: 100%;
  text-align: center;
}
.tmpl-card__title {
  display: block;
  margin-bottom: .3rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.tmpl-card__subtitle {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .tmpl-card__chip { display: none !important; }
  .tmpl-card__copy { display: none !important; }
  .tmpl-card { display: flex; flex-direction: column; }
  .tmpl-card__frame { margin-bottom: 0; border: none; }
  .tmpl-card__label {
    display: block;
    text-align: center;
    margin-bottom: .3rem;
    font-size: .7rem;
    font-weight: 700;
    order: -1;
  }
}
/* ── Order card template backgrounds (dashboard history) ── */
.tmpl-thumb {
  width: 112px; height: 80px; border-radius: 5px; margin: 0 auto .5rem;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.tmpl-thumb--classic,
.tmpl-thumb--quickbooks {
  background: linear-gradient(180deg, rgba(3, 133, 255, .08) 0%, rgba(255,255,255,.98) 100%);
}
.tmpl-thumb--modern,
.tmpl-thumb--adp {
  background: linear-gradient(180deg, rgba(111, 84, 255, .08) 0%, rgba(255,255,255,.98) 100%);
}
.tmpl-thumb--professional {
  background: linear-gradient(180deg, rgba(15, 23, 42, .07) 0%, rgba(255,255,255,.98) 100%);
}

.local-tax-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(110px, .9fr) minmax(110px, .9fr) auto auto;
  gap: .65rem;
  align-items: center;
  margin-bottom: .65rem;
}
.local-tax-row input[type="text"],
.local-tax-row input[type="number"] {
  width: 100%;
}
.local-tax-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 42px;
  padding: 0 .7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: .78rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .local-tax-row {
    grid-template-columns: 1fr 1fr;
  }
  .local-tax-toggle {
    justify-content: center;
    gap: .5rem;
  }
}
@media (max-width: 480px) {
  .success-meta {
    grid-template-columns: 1fr;
  }

  .local-tax-row {
    grid-template-columns: 1fr;
  }

  .local-tax-row > * {
    width: 100%;
  }

  .li-row--addition,
  .li-header {
    grid-template-columns: 1fr;
  }

  .li-row.li-ded,
  .li-header.li-ded {
    grid-template-columns: minmax(0, 1fr) minmax(84px, 112px) 52px 28px;
  }

  .cart-panel {
    width: 100vw;
  }

  .payment-modal {
    padding: .5rem;
    align-items: flex-end;
  }

  .payment-modal__dialog {
    padding: .85rem;
    max-height: 92vh;
    border-radius: .85rem .85rem 0 0;
    width: 100%;
  }

  .payment-modal__title {
    font-size: 1.05rem;
    margin-bottom: .65rem;
  }

  .payment-modal__actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: .65rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
  }

  .payment-modal__pay {
    min-height: 52px;
    font-size: 1.08rem;
    font-weight: 800;
  }

  .payment-summary-table th,
  .payment-summary-table td {
    font-size: .72rem;
    padding: .3rem .2rem;
  }
}

.order-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-elev-2);
  margin-bottom: 1rem;
  overflow: hidden;
}
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  gap: .8rem;
  flex-wrap: wrap;
}
.order-card-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.order-date  { font-weight: 700; font-size: .9rem; color: var(--blue); margin-right: .5rem; }
.order-meta  { font-size: .78rem; color: var(--muted); }
.order-total { font-weight: 800; font-size: 1rem; color: var(--green); white-space: nowrap; }
.order-card-link {
  color: inherit;
  text-decoration: none;
}
.order-card-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.acc-page-wrap {
  max-width: 460px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

.account-shell {
  width: 100%;
  max-width: var(--site-container);
  margin: 0 auto;
  padding: var(--site-shell-y) var(--site-gutter-x) 3rem;
  display: grid;
  gap: 1.25rem;
}

.account-shell--centered {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 2rem var(--site-gutter-x);
}

/* Auth card — login / verify */
.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background:
    radial-gradient(ellipse at top left, rgba(3, 133, 255, .06), transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(247,250,255,.96));
  box-shadow: var(--shadow-elev-1);
  overflow: hidden;
}

.auth-card__header {
  padding: 2rem 2rem 0;
  text-align: center;
  align-content:center;
  justify-content:center;
}

.auth-card__logo {
  height: 50px;
  align-self:center !important;
  margin-bottom: 1.1rem;
}

.auth-card__title {
  margin: 0 0 .4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.04em;
  color: var(--heading);
}

.auth-card__subtitle {
  margin: 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.auth-card__body {
  padding: 1.5rem 2rem;
}

.auth-card__footer {
  padding: 0 2rem 1.5rem;
  text-align: center;
}

.auth-card__footer p {
  margin: 0;
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

html[data-theme='dark'] .auth-card {
  background:
    radial-gradient(ellipse at top left, rgba(3, 133, 255, .1), transparent 52%),
    linear-gradient(180deg, rgba(30,41,59,.98), rgba(15,23,42,.96));
}

@media (max-width: 480px) {
  .auth-card__header,
  .auth-card__body,
  .auth-card__footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.account-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .78fr);
  gap: 1rem;
  padding: .15rem 0 .45rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.account-page-hero h1 {
  margin: .45rem 0 .45rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.3vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -.05em;
  color: #0f172a;
}

.account-page-hero p {
  margin: 0;
  max-width: 62ch;
  color: #475569;
  line-height: 1.8;
}

.workspace-page-title {
  padding: .2rem 0 .2rem;
}

.workspace-page-title h1 {
  margin: 0;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.account-summary-card,
.account-side-card {
  padding: 1.25rem 1.3rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-elev-1);
}

.account-summary-card strong {
  display: block;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.account-summary-card span {
  display: block;
  margin-top: .55rem;
  color: #5b6b7f;
  line-height: 1.7;
  font-size: .88rem;
}

.account-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.account-subnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(255,255,255,.82);
  color: #334155;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.account-subnav a:hover,
.account-subnav__active {
  border-color: rgba(3,133,255,.24);
  background: rgba(3,133,255,.1);
  color: var(--blue);
}

.account-section-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .72fr);
  gap: 1rem;
  align-items: start;
}

.account-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .72fr);
  gap: 1rem;
  align-items: start;
}

.account-page-hero .account-summary-card {
  box-shadow: var(--shadow-elev-2);
}

.account-dashboard-grid > .step-card,
.account-dashboard-grid > .account-side-card {
  box-shadow: var(--shadow-elev-1);
}

.account-side-card__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .34rem .68rem;
  border-radius: 999px;
  background: rgba(3,133,255,.08);
  color: var(--blue);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.account-side-card h2 {
  margin: .85rem 0 .55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.16;
  color: #0f172a;
}

.account-side-card__section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.account-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.1rem;
}

.account-table-wrap {
  overflow-x: auto;
}

.account-empty-state {
  padding: 2rem;
  text-align: center;
  display: grid;
  gap: .8rem;
  justify-items: center;
}

.account-empty-state strong {
  color: #0f172a;
  font-size: 1rem;
}

.account-empty-state p {
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.7;
}

.acc-dash-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.acc-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .95fr);
  gap: 1rem;
}
.acc-section-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}
.acc-section-footnote {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}
.acc-quick-profile {
  margin: .25rem 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(3,133,255,.14);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(3,133,255,.08), rgba(96,165,250,.07));
  color: #0f172a;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.55;
}
.acc-traffic-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}
.acc-traffic-mini {
  padding: .9rem 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.18);
}
.acc-traffic-mini strong {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.acc-traffic-mini span {
  display: block;
  margin-top: .35rem;
  color: var(--blue);
  font-size: 1.35rem;
  font-weight: 800;
}
.acc-traffic-block + .acc-traffic-block {
  margin-top: 1rem;
}
.acc-traffic-block h3 {
  margin: 0 0 .55rem;
  color: var(--text);
  font-size: .95rem;
}
.acc-metric-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.acc-metric-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.15);
}
.acc-metric-list li span {
  color: #334155;
  font-size: .84rem;
  word-break: break-word;
}
.acc-metric-list li strong {
  color: var(--green);
  font-size: .9rem;
}
.acc-empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}
.success-shell {
  width: 100%;
  max-width: var(--site-container);
  margin: 0 auto;
  padding-inline: var(--site-gutter-x);
  display: grid;
  gap: 1.25rem;
}
.document-viewer-shell {
  width: 100%;
  max-width: var(--site-container);
  margin: 0 auto;
  padding-inline: var(--site-gutter-x);
  display: grid;
  gap: 1.25rem;
}
.success-hero {
  padding: 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.45), transparent 38%),
    linear-gradient(135deg, #0f4c81 0%, #0a6cb7 46%, #0385ff 100%);
  color: #fff;
  box-shadow: 0 26px 60px rgba(15, 76, 129, .22);
}
.success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .38rem .78rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.success-hero h1 {
  margin: .8rem 0 .55rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.success-hero p {
  margin: 0;
  max-width: 70ch;
  font-size: .98rem;
  line-height: 1.75;
  color: rgba(255,255,255,.88);
}
.success-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 1.2rem;
}

.success-meta--compact {
  margin-top: 0;
  margin-bottom: 1rem;
}
.success-mini {
  padding: .95rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}
.success-mini strong {
  display: block;
  margin-bottom: .35rem;
  color: rgba(255,255,255,.7);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.success-mini span {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.success-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .85fr);
  gap: 1rem;
}
.document-viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .75fr);
  gap: 1rem;
}
.success-actions,
.success-side-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.viewer-tabs,
.viewer-actions {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}
.viewer-tabs a,
.viewer-actions a {
  text-decoration: none;
}
.document-viewer-frame-wrap {
  margin-top: 1rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(241,245,249,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.document-viewer-frame {
  width: 100%;
  height: 900px;
  border: 0;
  background: #eef3f9;
}
.success-note {
  margin: .95rem 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}
.success-note--ok { color: #166534; }
.success-note--error { color: #b91c1c; }
.success-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: #334155;
  line-height: 1.7;
  font-size: .84rem;
}

@media (max-width: 768px) {
  .account-page-hero,
  .account-section-split,
  .account-dashboard-grid,
  .acc-panel-grid,
  .success-grid,
  .document-viewer-grid {
    grid-template-columns: 1fr;
  }

  .order-card-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .success-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Stats row */
.acc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) { .acc-stats-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .acc-stats-row { grid-template-columns: 1fr; } }

.acc-stat-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-elev-1);
  padding: 1.2rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, transform .15s;
  display: block;
}
.acc-stat-card:hover { box-shadow: var(--shadow-centered-md); transform: translateY(-2px); }
.acc-stat-num   { font-size: 1.8rem; font-weight: 800; color: var(--green); line-height: 1; }
.acc-stat-label { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* Buttons */
.btn-acc-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--site-touch-target);
  background: #0268d4;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .72rem 1.25rem;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .15s;
  box-shadow: 0 14px 26px rgba(2, 104, 212, .22);
}
.btn-acc-primary:hover { background: #0258b5; transform: translateY(-1px); box-shadow: 0 18px 32px rgba(2, 88, 181, .26); }

.btn-acc-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--site-touch-target);
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .66rem 1.05rem;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, transform .15s, color .15s;
}
.btn-acc-secondary:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }

.btn-delete {
  background: none;
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  border-radius: 5px;
  padding: .25rem .7rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-delete:hover { background: #e74c3c; color: #fff; }

.muted-copy { color: #94a3b8; font-size: .85rem; }
.table-cell-strong { font-weight: 600; }

/* History table */
.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.acc-table th {
 
  border-bottom: 2px solid var(--border);
  padding: .6rem .9rem;
  text-align: left;
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.acc-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.acc-table tr:last-child td { border-bottom: none; }
.acc-table tr:hover td { background: #f8f9fa; }

/* Saved company/employee bar on Index form */
.saved-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #f0fff4;
  border: 1px solid #a8e6bc;
  border-radius: 6px;
  padding: .5rem .8rem;
  margin-bottom: .9rem;
  font-size: .82rem;
  color: var(--green-dk);
}
.saved-bar select {
  flex: 1;
  border: 1px solid #a8e6bc;
  border-radius: 5px;
  padding: .3rem .5rem;
  font-size: .82rem;
  background: #fff;
  color: var(--text);
  max-width: 280px;
}

/* Toast notification */
#accountToast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--green);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  z-index: 9999;
  pointer-events: none;
}
#accountToast.show { opacity: 1; transform: translateY(0); }

/* WIZARD PROGRESS BAR */
.wiz-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  --wiz-side-pad: clamp(1rem, 8vw, 11rem);
  padding: 2rem var(--wiz-side-pad) 2rem;
  margin: 2% 0 0 0;
  position: relative;
}
/* Gray base line */
.wiz-progress::before {
  content: '';
  position: absolute;
  top: calc(2rem + 14px);
  left: var(--wiz-line-left, calc(var(--wiz-side-pad) + 14px));
  width: var(--wiz-line-width, calc(100% - (var(--wiz-side-pad) * 2) - 28px));
  height: 2px;
  background: #cbd5e1;
  z-index: 0;
  border-radius: 2px;
}
/* Blue progress fill line (width driven by JS) */
.wiz-line-fill {
  position: absolute;
  top: calc(2rem + 14px);
  left: var(--wiz-line-left, calc(var(--wiz-side-pad) + 14px));
  height: 3px;
  background: var(--blue);
  z-index: 1;
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}
.wiz-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  position: relative;
  z-index: 2;
  cursor: pointer;
  min-width: 28px;
}
.wiz-dot-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #6b7280;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  transition: all .25s;
  user-select: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6b7280;
}
.wiz-dot.done   .wiz-dot-circle { background: var(--blue);  border-color: var(--blue);  color: #fff; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--blue); }
.wiz-dot.active .wiz-dot-circle { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--green); }
.wiz-dot-label {
  font-size: .75rem;
  color: #374151;
  font-weight: 600;
  white-space: normal;
  max-width: 8ch;
  text-align: center;
  line-height: 1.3;
  text-wrap: balance;
}
.wiz-dot.active .wiz-dot-label { color: var(--green); font-weight: 700; }
.wiz-dot.done   .wiz-dot-label { color: var(--blue);  font-weight: 700; }

img {
  max-width: 100%;
  height: auto;
}

.step-card[data-wiz-step],
.wiz-step-wrap[data-wiz-step],
.wiz-review-step { display: none; }

.step-card[data-wiz-step].wiz-active,
.wiz-step-wrap[data-wiz-step].wiz-active,
.wiz-review-step.wiz-active {
  display: block;
  animation: wizIn .22s ease;
}
@keyframes wizIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wiz-nav {
  display: flex;
  gap: 0;
  margin-top: 1rem;
  
  border-radius: 0.75rem;
  box-shadow:
    0 8px 16px -2px rgba(0,0,0,.06),
    0 32px 64px -12px rgba(0,0,0,.1),
    0 64px 120px -20px rgba(0,0,0,.14);
}
.btn-wiz-back {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 0.75rem 0 0 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  position: relative;
}
.btn-wiz-back .btn-wiz-arrow-left {
  position: absolute;
  left: 1rem;
}
.btn-wiz-back:hover { background: #3f1a86; }
.btn-wiz-next {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 0 0.75rem 0.75rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  position: relative;
}
.btn-wiz-next .btn-wiz-arrow-right {
  position: absolute;
  right: 1rem;
}
.btn-wiz-next:hover { background: var(--blue-dk); }
.btn-wiz-next--solo { border-radius: .75rem; }
.btn-wiz-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: .72rem 1.5rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transition: background .18s;
}
.btn-wiz-cart:hover { background: var(--green-dk); }
.btn-wiz-buynow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: .72rem 1.5rem;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transition: background .18s;
}
.btn-wiz-buynow:hover { background: #6d28d9; }
.btn-wiz-arrow-left,
.btn-wiz-arrow-right { flex-shrink: 0; display: block; }

/* PREVIEW LOCK OVERLAY */
.preview-canvas-wrap {
  position: relative;
  overflow: visible;
}
.preview-template-menu {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 12;
}
.preview-template-toggle {
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  color: var(--text);
  padding: .45rem .8rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .2s, box-shadow .2s;
}
.preview-template-toggle:hover {
  background: rgba(255,255,255,.4);
  box-shadow: 0 6px 20px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.4);
}
.preview-template-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .85rem;
  padding: .75rem .9rem;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 1rem;
 
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
  backdrop-filter: blur(10px);
}
.preview-template-status__eyebrow {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}
.preview-template-status__row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.preview-template-status__name {
  font-size: .98rem;
  color: var(--text);
}
.preview-template-status__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .73rem;
  font-weight: 700;
}
.preview-template-status__chip--classic,
.preview-template-status__chip--quickbooks {
  background: rgba(3, 133, 255, .1);
  color: #0f4c81;
}
.preview-template-status__chip--modern,
.preview-template-status__chip--adp {
  background: rgba(111, 84, 255, .12);
  color: #5b3fd0;
}
.preview-template-status__chip--professional {
  background: rgba(15, 23, 42, .08);
  color: #1e293b;
}
.preview-template-dropdown {
  margin-top: .45rem;
  min-width: 148px;
  padding: .35rem;
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(148,163,184,.35);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .18);
  backdrop-filter: blur(12px);
}
.preview-template-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 9px;
  padding: .55rem .65rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.preview-template-option:hover,
.preview-template-option.is-active {
  background: rgba(3,133,255,.08);
  color: var(--blue);
}
/* Smooth zoom transition on the canvas container */
#pdfPages {
  transform-origin: center center;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
#pdfPages canvas {
  display: block;
  border: 1px solid var(--blue);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 16px -2px rgba(0,0,0,.06),
    0 32px 64px -12px rgba(0,0,0,.1),
    0 64px 120px -20px rgba(0,0,0,.14);
}
.preview-blurred {
  transition: filter .4s;
}
.preview-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(3px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  border-radius: 8px;
  min-height: 180px;
}
.preview-lock-icon  { font-size: 2.4rem; margin-bottom: .45rem; }
.preview-lock-title { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-bottom: .3rem; }
.preview-lock-sub   { font-size: .8rem; color: var(--muted); margin-bottom: 1.1rem; max-width: 300px; line-height: 1.45; }
.preview-lock-form  { width: 100%; max-width: 310px; display: flex; flex-direction: column; gap: .55rem; }
.preview-email-input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .88rem;
  width: 100%;
  outline: none;
  background: #fafbfc;
  transition: border-color .18s;
}
.preview-lock-check {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  font-size: .74rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
}
.preview-lock-check input { margin-top: .15rem; flex-shrink: 0; }
.preview-lock-check a { color: var(--blue); }
.btn-unlock-preview {
  padding: .65rem 1.2rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
  margin-top: .2rem;
}
.btn-unlock-preview:hover:not(:disabled) { background: var(--green-dk); }
.btn-unlock-preview:disabled { background: #b0b8c1; cursor: not-allowed; }

/* Preview action buttons bar */
#previewCartActions {
  display: none;
  gap: .65rem;
  margin-top: .85rem;
}
#previewCartActions .btn-wiz-cart,
#previewCartActions .btn-wiz-buynow { flex: 1; }

/* REVIEW STEP CARD */
.wiz-review-step {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
  overflow: hidden;
  margin-bottom: 1rem;
}
.wiz-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem 1.2rem;
  padding: 1.1rem 1.2rem .4rem;
}
.wiz-review-item span {
  font-size: .71rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: .1rem;
}
.wiz-review-item strong { font-size: .88rem; color: var(--text); }
.wiz-review-price {
  padding: .6rem 1.2rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green);
  text-align: right;
  border-top: 1px solid var(--border);
  margin-top: .8rem;
}

.wiz-preview-step {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
  overflow: hidden;
  display: none;
}
.wiz-preview-step.wiz-active { display: block; animation: wizIn .22s ease; }

.wiz-preview-actions {
  display: flex;
  gap: .75rem;
  padding: 1rem 1rem 1.2rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.wiz-preview-actions .btn-wiz-cart,
.wiz-preview-actions .btn-wiz-buynow { flex: 1; font-size: 1rem; padding: .85rem 1.2rem; }

.generator-panel {
  margin-top: .85rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
}
.generator-panel--spacious {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
}
.generator-panel__title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .65rem;
}
.generator-panel__section { margin-top: .85rem; }
.form-label-note {
  color: #888;
}
.step-card-header__hint {
  font-weight: 400;
  font-size: .85rem;
  color: #95a5a6;
}
.ps-row--top-gap { margin-top: .8rem; }
.ps-row--flush-top { margin-top: 0; }
.ps-row--align-end { align-items: end; }
.ps-check-row--top-gap-sm { margin-top: .65rem; }
.ps-check-row--top-gap { margin-top: .8rem; }
.ps-check-row--top-gap-md { margin-top: .75rem; }
.ps-check-row--top-gap-lg { margin-top: 1rem; }
.ps-check-row--bottom-gap { margin-bottom: .75rem; }
.ps-field--section { margin-bottom: .9rem; }
.ps-field--compact { margin-bottom: .85rem; }
.ps-field--check-number {
  max-width: 220px;
  margin-bottom: .8rem;
}
.step-card--compact-gap { margin-bottom: .75rem; }
.generator-hire-date-row { margin-top: .5rem; }
.generator-inline-note {
  margin: 0 0 .85rem;
  font-size: .78rem;
  line-height: 1.5;
}
.generator-inline-note--warning {
  color: #e67e22;
}
.generator-warning {
  margin-top: .5rem;
  padding: .4rem .7rem;
  border-left: 3px solid #e67e22;
  border-radius: 5px;
  background: #fff8f0;
  color: #e67e22;
  font-size: .8rem;
}
.generator-local-note {
  padding-top: .35rem;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.generator-add-btn { margin-top: .65rem; }
.generator-ytd-grid { margin-top: .5rem; }
.generator-ytd-label {
  color: var(--muted);
  font-size: .78rem;
}
.generator-estimate-input {
  background: #f5f5f5;
  color: var(--muted);
}
.generator-onboard-copy {
  margin: 0 0 1rem;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--muted);
}
.generator-required {
  color: #e74c3c;
  font-size: .8rem;
}
.generator-email-input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .9rem;
  width: 100%;
  outline: none;
  background: #fafbfc;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.generator-email-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(110,193,130,.12);
}
.generator-consent {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}
.generator-consent + .generator-consent { margin-top: .6rem; }
.generator-consent-check {
  margin-top: .15rem;
  flex-shrink: 0;
}
.generator-link-inline {
  color: var(--blue);
  margin: 0 .2rem;
}
.generator-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.generator-preview-nav {
  justify-content: center;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.generator-preview-label {
  font-size: .82rem;
  color: #555;
}
.generator-spinner {
  padding: 2rem;
  text-align: center;
  color: #888;
  font-size: .85rem;
}
.generator-spinner--wide {
  padding: 3rem;
  font-size: .88rem;
}
.generator-preview-pages {
  padding: .75rem 1rem 0;
}
.generator-seo-prose { margin-top: 1.1rem; }
.preview-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .65rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: #f8f9fa;
  color: var(--text);
  font-size: .82rem;
}
.preview-summary-bar__price {
  color: var(--green);
  font-weight: 700;
}
.preview-error {
  margin: 0;
  color: #dc2626;
  font-size: .85rem;
  padding: 1rem;
}
.pdf-preview-canvas {
  width: 100%;
  pointer-events: none;
}
.cart-overlay {
  position: fixed;
  top: 66px;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, .44);
  backdrop-filter: blur(4px);
  z-index: 79;
}
body.cart-panel-open {
  overflow: hidden;
}
.cart-panel {
  position: fixed;
  top: 66px;
  right: env(safe-area-inset-right, 0);
  bottom: 0;
  width: min(27.5rem, calc(100vw - 1rem - env(safe-area-inset-right, 0px) - env(safe-area-inset-left, 0px)));
  max-width: 100%;
  height: calc(100vh - 66px);
  height: calc(100dvh - 66px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(3, 133, 255, .08), transparent 30%),
    rgba(255, 255, 255, .98);
  border-left: 1px solid rgba(148, 163, 184, .18);
  box-shadow: -18px 0 38px rgba(15, 23, 42, .16);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 80;
  font-size: .88rem;
  color: #0f172a;
}
.cart-panel.is-open { transform: translateX(0); }
.cart-panel__header,
.cart-panel__footer {
  padding: 1.1rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  background: transparent;
  backdrop-filter: none;
}
.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cart-panel__title {
  margin: 0;
  font-size: .95rem;
  font-family: var(--font-display);
  color: #0f172a;
  letter-spacing: .01em;
}
.cart-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: .9rem;
  background: rgba(255, 255, 255, .88);
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
}
.cart-panel__close:hover {
  color: var(--blue);
  border-color: rgba(3, 133, 255, .18);
  background: rgba(3, 133, 255, .08);
}
.cart-panel__items {
  /* Legacy; replaced by .cart-invoice list in the shared sidebar. */
  display: none;
}
.cart-panel__footer {
  border-top: 1px solid rgba(148, 163, 184, .18);
  border-bottom: none;
  display: grid;
  gap: .8rem;
}
.cart-panel__meta-row,
.cart-panel__total-row,
.cart-panel__discount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.cart-panel__meta-row { margin-bottom: 0; }
.cart-panel__meta {
  color: #475569;
  font-size: .78rem;
  font-weight: 600;
}
.cart-panel__meta--global-note {
  display: block;
  margin: .85rem 0 1rem;
  line-height: 1.55;
}
.cart-panel__promo-row {
  display: flex;
  gap: .6rem;
}
.cart-panel__clear,
.cart-panel__promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: .6rem;
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.cart-panel__clear {
  padding: .3rem .65rem;
  font-size: .72rem;
  min-height: 30px;
}
.cart-panel__promo-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: .6rem;
  background: rgba(255, 255, 255, .92);
  padding: .4rem .65rem;
  font-size: .78rem;
  color: var(--text);
}
.cart-panel__promo-btn {
  padding: .35rem .7rem;
  font-size: .72rem;
  min-height: 36px;
}
.cart-panel__clear:hover,
.cart-panel__promo-btn:hover {
  border-color: rgba(3, 133, 255, .2);
  background: rgba(3, 133, 255, .08);
  color: var(--blue-dk);
  transform: translateY(-1px);
}
.cart-panel__promo-message {
  min-height: 1.25rem;
  margin: .45rem 0 .6rem;
  font-size: .82rem;
}
.cart-panel__promo-message.is-success { color: #27ae60; }
.cart-panel__promo-message.is-error { color: #e74c3c; }
.cart-panel__discount-row[hidden] { display: none; }
.cart-panel__discount-amount,
.cart-panel__total-value,
.cart-item__price {
  color: var(--green);
  font-weight: 700;
}
.cart-panel__total-row {
  margin-top: .3rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}
.cart-panel__total-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
}
.cart-panel__total-value { font-size: .92rem; }
.cart-panel__checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #36a2ff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(3, 133, 255, .22);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}
.cart-panel__checkout:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--blue-dk), var(--blue));
  box-shadow: 0 20px 36px rgba(3, 133, 255, .24);
  transform: translateY(-1px);
}
.cart-panel__checkout:disabled {
  cursor: not-allowed;
  opacity: .62;
  box-shadow: none;
}
.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}
.cart-item {
  margin-bottom: 0;
  padding: .7rem .8rem .65rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .65);
  box-shadow: none;
}
.cart-item.is-editing {
  border-color: rgba(3, 133, 255, .25);
  box-shadow: 0 0 0 1px rgba(3, 133, 255, .18), 0 14px 28px rgba(3, 133, 255, .12);
}
.cart-item__header,
.cart-item__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.cart-item__content {
  flex: 1;
  min-width: 0;
}
.cart-item__title {
  margin: 0 0 .15rem;
  font-size: .82rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}
.cart-item__meta {
  margin: 0;
  font-size: .72rem;
  color: #64748b;
  font-weight: 400;
}
.cart-item__meta strong { color: var(--text); }
.cart-item__actions {
  display: flex;
  gap: .3rem;
  flex-shrink: 0;
}
.cart-item__edit {
  background: rgba(3, 133, 255, .08);
  border: 1px solid rgba(3, 133, 255, .16);
  color: var(--blue);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: .6rem;
  padding: .3rem .6rem;
  line-height: 1.2;
  min-height: 28px;
}
.cart-item__edit:hover {
  background: rgba(3, 133, 255, .14);
  color: var(--blue-dk);
}
.cart-item__remove {
  background: rgba(248, 250, 252, .96);
  border: 1px solid rgba(148, 163, 184, .16);
  color: #e74c3c;
  font-size: .82rem;
  cursor: pointer;
  line-height: 1;
  padding: .3rem .5rem;
  border-radius: .6rem;
  min-height: 28px;
}
.cart-item__footer {
  align-items: center;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(148, 163, 184, .14);
}
.cart-item__details {
  font-size: .72rem;
  color: #475569;
}
.cart-item__price { font-size: .78rem; font-weight: 600; }
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 81;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(6px);
}
.payment-modal__dialog {
  width: min(40rem, 100%);
  max-height: min(90vh, 48rem);
  overflow: auto;
  background: #fff;
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: 0 22px 48px rgba(15,23,42,.2);
  display: flex;
  flex-direction: column;
}
.payment-modal__title {
  margin: 0 0 .9rem;
  font-size: 1.18rem;
}
.payment-modal__summary { margin-bottom: 1rem; }
.payment-modal__element {
  margin-bottom: .85rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.payment-modal__error {
  min-height: 1.2rem;
  color: #dc2626;
  font-size: .84rem;
  margin-bottom: .85rem;
}
.payment-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
}
.payment-modal__pay,
.payment-modal__cancel {
  min-height: 2.75rem;
  padding: .7rem 1rem;
  border-radius: .85rem;
  font-weight: 700;
  cursor: pointer;
}
.payment-modal__pay {
  border: none;
  background: var(--green);
  color: #fff;
  flex: 1;
  font-size: 1.05rem;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.payment-modal__pay:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(16,185,129,.4);
}
.payment-modal__pay:active {
  transform: scale(.98);
}
.payment-modal__cancel {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.payment-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .5rem;
}
.payment-summary-table th {
  padding: .35rem .3rem;
  font-size: .75rem;
  color: var(--muted);
}
.payment-summary-table td {
  padding: .4rem .3rem;
  font-size: .82rem;
}
.payment-summary-table th:first-child,
.payment-summary-table td:first-child { text-align: left; }
.payment-summary-table th:nth-child(2),
.payment-summary-table td:nth-child(2) { text-align: center; }
.payment-summary-table th:last-child,
.payment-summary-table td:last-child { text-align: right; }
.payment-summary-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
}
.payment-summary-table tfoot tr:last-child {
  border-top: 2px solid var(--border);
}
.payment-summary-table__subtext {
  color: var(--muted);
}
.payment-summary-table__money,
.payment-summary-table__promo,
.wiz-review-item__price {
  color: var(--green);
  font-weight: 700;
}
.payment-summary-table__total {
  font-weight: 800;
  font-size: 1rem;
}

/* Full-width mode when on step 8 */
.ps-layout.wiz-preview-mode .ps-preview-col { display: none; }
.ps-layout.wiz-preview-mode .ps-form-col    { max-width: 100%; flex: 1; }

/* Step 8 preview centering */
#wizPreviewPages {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#wizPreviewPages canvas {
  display: block;
  margin: 0 auto 1rem;
  max-width: 100%;
}

/* Blur hint label */
.preview-blur-hint {
  display: none;
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .35rem;
  padding: .2rem .5rem;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --background: 222 47% 8%;
  --foreground: 210 40% 96%;
  --card: 222 45% 11%;
  --card-foreground: 210 40% 96%;
  --popover: 222 43% 10%;
  --popover-foreground: 210 40% 96%;
  --secondary: 217 30% 18%;
  --secondary-foreground: 210 40% 96%;
  --muted-hsl: 222 30% 13%;
  --muted-foreground: 215 20% 72%;
  --accent: 217 30% 18%;
  --accent-foreground: 210 40% 96%;
  --border-hsl: 217 24% 22%;
  --input-hsl: 217 24% 22%;
  --ring: 210 100% 64%;
  --text: hsl(var(--foreground));
  --heading: #f8fafc;
  --text-secondary: #94a3b8;
  --muted: hsl(var(--muted-foreground));
  --bg: #0b1220;
  --white: #0f172a;
  --shadow-centered-sm: 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 24px rgba(2, 6, 23, .28), 0 24px 56px rgba(2, 6, 23, .36);
  --shadow-centered-md: 0 0 0 1px rgba(255, 255, 255, .04), 0 14px 30px rgba(2, 6, 23, .30), 0 30px 70px rgba(2, 6, 23, .40);
  --shadow-centered-lg: 0 0 0 1px rgba(255, 255, 255, .04), 0 18px 36px rgba(2, 6, 23, .32), 0 36px 84px rgba(2, 6, 23, .44);
  --shadow-elev-1: 0 0 0 1px rgba(255, 255, 255, .04), 0 16px 34px rgba(2, 6, 23, .30), 0 34px 72px rgba(2, 6, 23, .42);
  --shadow-elev-2: 0 0 0 1px rgba(255, 255, 255, .04), 0 12px 28px rgba(2, 6, 23, .26), 0 26px 56px rgba(2, 6, 23, .36);
  --shadow-elev-3: 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 22px rgba(2, 6, 23, .22), 0 20px 44px rgba(2, 6, 23, .30);
}

html[data-theme='dark'] body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, .10), transparent 26%),
    linear-gradient(180deg, #071120 0%, #0b1220 42%, #0f172a 100%);
  color: #e5edf7;
}

html[data-theme='dark'] .ps-header {
  background: rgba(8, 15, 28, .92);
  border-bottom-color: rgba(148, 163, 184, .16);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 18px 42px rgba(2, 6, 23, .32);
}

html[data-theme='dark'] .ps-header--admin,
html[data-theme='dark'] .ps-header--account,
html[data-theme='dark'] .ps-header--utility,
html[data-theme='dark'] .shell-storefront .ps-header {
  background:
    linear-gradient(180deg, rgba(8, 15, 28, .96), rgba(11, 18, 32, .92));
  border-bottom-color: rgba(148, 163, 184, .16);
}

html[data-theme='dark'] .shell-storefront .ps-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

html[data-theme='dark'] .ps-logo-text,
html[data-theme='dark'] .ps-header-context,
html[data-theme='dark'] .ps-footer,
html[data-theme='dark'] .ps-footer-links a,
html[data-theme='dark'] .cart-panel__title,
html[data-theme='dark'] .cart-item__title,
html[data-theme='dark'] .payment-modal__title,
html[data-theme='dark'] .payment-summary-table__total,
html[data-theme='dark'] .acc-table td,
html[data-theme='dark'] .acc-table th {
  color: #f8fafc;
}

html[data-theme='dark'] .ps-footer,
html[data-theme='dark'] .shell-account .ps-footer,
html[data-theme='dark'] .shell-admin .ps-footer {
  background: linear-gradient(180deg, rgba(8,15,28,.96), rgba(11,18,32,.94));
  border-top-color: rgba(148, 163, 184, .16);
}

html[data-theme='dark'] .ps-footer-links a + a,
html[data-theme='dark'] .shell-account .ps-footer-links a + a,
html[data-theme='dark'] .shell-admin .ps-footer-links a + a {
  border-left-color: rgba(148, 163, 184, .18);
}

html[data-theme='dark'] .ps-alert {
  background: rgba(239, 68, 68, .12);
  border-left-color: #f87171;
  color: #fca5a5;
}

html[data-theme='dark'] .ps-footer-copy,
html[data-theme='dark'] .cart-panel__meta,
html[data-theme='dark'] .cart-panel__meta--global-note,
html[data-theme='dark'] .cart-empty,
html[data-theme='dark'] .cart-item__meta,
html[data-theme='dark'] .cart-item__details,
html[data-theme='dark'] .payment-summary-table__subtext,
html[data-theme='dark'] .ps-field label,
html[data-theme='dark'] .step-card-header__hint,
html[data-theme='dark'] .doc-muted,
html[data-theme='dark'] .acc-stat-label,
html[data-theme='dark'] .order-meta {
  color: rgba(226, 232, 240, .74);
}

html[data-theme='dark'] .step-card,
html[data-theme='dark'] .cart-panel,
html[data-theme='dark'] .cart-panel__header,
html[data-theme='dark'] .cart-panel__footer,
html[data-theme='dark'] .cart-item,
html[data-theme='dark'] .payment-modal__dialog,
html[data-theme='dark'] .account-table-wrap,
html[data-theme='dark'] .acc-table,
html[data-theme='dark'] .preview-summary-bar,
html[data-theme='dark'] .preview-template-dropdown,
html[data-theme='dark'] .preview-template-status,
html[data-theme='dark'] .saved-bar select {
  border-color: rgba(148, 163, 184, .16);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .24);
}

html[data-theme='dark'] .cart-panel {
  background: #02040a !important;
  border-color: var(--border);
}
html[data-theme='dark'] .cart-panel__body {
  background: #02040a;
}

html[data-theme='dark'] .cart-panel__header,
html[data-theme='dark'] .cart-panel__footer {
  background: transparent;
  backdrop-filter: none;
  border-color: var(--border);
}

@media (max-width: 768px) {
  html[data-theme='dark'] .payment-modal__actions {
    background: rgba(15, 23, 42, .78);
    border-top-color: rgba(148, 163, 184, .16);
  }
}

html[data-theme='dark'] .btn-acc-secondary {
  background: rgba(30, 41, 59, .72);
  color: #93c5fd;
  border-color: rgba(148, 163, 184, .22);
}

html[data-theme='dark'] .btn-acc-secondary:hover {
  background: rgba(30, 41, 59, .92);
  border-color: rgba(96, 165, 250, .36);
  color: #bfdbfe;
}



html[data-theme='dark'] .payment-summary-table tbody tr,
html[data-theme='dark'] .payment-summary-table tfoot tr:last-child,
html[data-theme='dark'] .cart-panel__total-row,
html[data-theme='dark'] .cart-item__footer,
html[data-theme='dark'] .acc-table td,
html[data-theme='dark'] .acc-table th {
  border-color: rgba(148, 163, 184, .16);
}

html[data-theme='dark'] .acc-table tr:hover td {
  background: rgba(30, 41, 59, .72);
}

html[data-theme='dark'] .workspace-page-title h1,
html[data-theme='dark'] .account-side-card h2 {
  color: #f8fafc;
}

html[data-theme='dark'] .account-side-card__label {
  background: rgba(3, 133, 255, .14);
  color: #93c5fd;
}

html[data-theme='dark'] .success-list {
  color: #94a3b8;
}

html[data-theme='dark'] .ps-field input,
html[data-theme='dark'] .ps-field select,
html[data-theme='dark'] .ps-field textarea,
html[data-theme='dark'] .ps-check-row + div input,
html[data-theme='dark'] .cart-panel__promo-input,
html[data-theme='dark'] .cart-panel__clear,
html[data-theme='dark'] .cart-panel__promo-btn,
html[data-theme='dark'] .cart-panel__close,
html[data-theme='dark'] .payment-modal__cancel,
html[data-theme='dark'] .cart-item__remove,
html[data-theme='dark'] .dollar-input,
html[data-theme='dark'] .hrs-input {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .70);
  color: #f8fafc;
}

html[data-theme='dark'] .ps-field input::placeholder,
html[data-theme='dark'] .ps-field textarea::placeholder {
  color: rgba(226, 232, 240, .42);
}

html[data-theme='dark'] .dollar-input span {
  background: rgba(30, 41, 59, .92);
  border-right-color: rgba(148, 163, 184, .18);
  color: rgba(226, 232, 240, .74);
}

html[data-theme='dark'] .payment-modal__cancel,
html[data-theme='dark'] .cart-panel__clear,
html[data-theme='dark'] .cart-panel__promo-btn,
html[data-theme='dark'] .cart-panel__close {
  color: #cbd5e1;
}

html[data-theme='dark'] .cart-item__remove {
  color: #fca5a5;
}

html[data-theme='dark'] .cart-panel__clear:hover,
html[data-theme='dark'] .cart-panel__promo-btn:hover,
html[data-theme='dark'] .cart-panel__close:hover {
  color: #93c5fd;
  background: rgba(30, 41, 59, .92);
}

html[data-theme='dark'] .payment-summary-table th {
  color: rgba(226, 232, 240, .68);
}

html[data-theme='dark'] .payment-summary-table td {
  color: #e5edf7;
}

html[data-theme='dark'] .payment-summary-table__money,
html[data-theme='dark'] .payment-summary-table__promo,
html[data-theme='dark'] .cart-panel__discount-amount,
html[data-theme='dark'] .cart-panel__total-value,
html[data-theme='dark'] .cart-item__price {
  color: #7dd3fc;
}

html[data-theme='dark'] .ps-page-body,
html[data-theme='dark'] .ps-layout,
html[data-theme='dark'] .wiz-progress-wrap {
  background: transparent;
}

html[data-theme='dark'] .wiz-progress::before {
  background: rgba(148, 163, 184, .24);
}

html[data-theme='dark'] .wiz-line-fill {
  background: var(--blue);
}

html[data-theme='dark'] .wiz-dot-circle {
  background: #334155;
  color: #f8fafc;
  box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px #334155;
}

html[data-theme='dark'] .wiz-dot.done .wiz-dot-circle {
  box-shadow: 0 0 0 3px #0b1220, 0 0 0 5px var(--blue);
}

html[data-theme='dark'] .wiz-dot.active .wiz-dot-circle {
  box-shadow: 0 0 0 3px #0b1220, 0 0 0 5px var(--green);
}

html[data-theme='dark'] .wiz-dot-label,
html[data-theme='dark'] .tmpl-step-intro,
html[data-theme='dark'] .pay-type-hint,
html[data-theme='dark'] .form-label-note,
html[data-theme='dark'] .generator-inline-note,
html[data-theme='dark'] .generator-local-note,
html[data-theme='dark'] .generator-onboard-copy,
html[data-theme='dark'] .saved-bar,
html[data-theme='dark'] .preview-lock-sub,
html[data-theme='dark'] .preview-lock-check,
html[data-theme='dark'] .preview-template-status__eyebrow,
html[data-theme='dark'] .wiz-review-item span {
  color: rgba(226, 232, 240, .74);
}

html[data-theme='dark'] .wiz-nav,
html[data-theme='dark'] .wiz-review-step,
html[data-theme='dark'] .wiz-preview-step,
html[data-theme='dark'] .generator-panel,
html[data-theme='dark'] .tmpl-card,
html[data-theme='dark'] .saved-bar,
html[data-theme='dark'] .acc-item,
html[data-theme='dark'] .preview-template-toggle,
html[data-theme='dark'] .preview-lock-overlay,
html[data-theme='dark'] .local-tax-toggle {
  border-color: rgba(148, 163, 184, .16);
  background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(10, 17, 31, .92));
  color: #e5edf7;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .24);
}

html[data-theme='dark'] .tmpl-card__frame,
html[data-theme='dark'] .preview-template-dropdown {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .94);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .28);
}

html[data-theme='dark'] .tmpl-card__title,
html[data-theme='dark'] .preview-template-status__name,
html[data-theme='dark'] .generator-panel__title,
html[data-theme='dark'] .wiz-review-item strong,
html[data-theme='dark'] .preview-lock-title,
html[data-theme='dark'] .acc-header,
html[data-theme='dark'] .acc-num,
html[data-theme='dark'] .local-tax-toggle,
html[data-theme='dark'] .saved-bar select,
html[data-theme='dark'] .preview-template-option,
html[data-theme='dark'] .pay-type-opt {
  color: #f8fafc;
}

html[data-theme='dark'] .tmpl-card__subtitle,
html[data-theme='dark'] .preview-template-option,
html[data-theme='dark'] .acc-chevron,
html[data-theme='dark'] .acc-date,
html[data-theme='dark'] .li-header,
html[data-theme='dark'] .li-header.li-ded,
html[data-theme='dark'] .add-section-label,
html[data-theme='dark'] .generator-ytd-label {
  color: rgba(226, 232, 240, .68);
}

html[data-theme='dark'] .tmpl-card,
html[data-theme='dark'] .tmpl-opt--center .tmpl-card,
html[data-theme='dark'] .tmpl-opt--grid.is-selected .tmpl-card,
html[data-theme='dark'] .tmpl-opt input:checked + .tmpl-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 20px 44px rgba(2, 6, 23, .28);
}

html[data-theme='dark'] .tmpl-card:hover {
  border-color: rgba(96, 165, 250, .42);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .12), 0 24px 48px rgba(2, 6, 23, .34);
}

html[data-theme='dark'] .pay-type-opt {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .78);
}

html[data-theme='dark'] .pay-type-opt:has(input:checked) {
  border-color: rgba(96, 165, 250, .34);
  background: rgba(3, 133, 255, .14);
  color: #93c5fd;
}

html[data-theme='dark'] .acc-header {
  background: rgba(30, 41, 59, .72);
}

html[data-theme='dark'] .acc-item.acc-open .acc-header,
html[data-theme='dark'] .acc-header:hover,
html[data-theme='dark'] .acc-item.acc-open .acc-header:hover {
  background: rgba(37, 52, 77, .88);
}

html[data-theme='dark'] .acc-date {
  background: rgba(15, 23, 42, .9);
}

html[data-theme='dark'] .acc-item.acc-open .acc-date {
  background: rgba(3, 133, 255, .16);
  color: #93c5fd;
}

html[data-theme='dark'] .acc-body,
html[data-theme='dark'] .wiz-review-price,
html[data-theme='dark'] .wiz-preview-actions {
  border-top-color: rgba(148, 163, 184, .16);
}

html[data-theme='dark'] .wiz-review-price,
html[data-theme='dark'] .preview-template-option:hover,
html[data-theme='dark'] .preview-template-option.is-active {
  color: #93c5fd;
}

html[data-theme='dark'] .li-row input,
html[data-theme='dark'] .preview-email-input,
html[data-theme='dark'] .generator-email-input,
html[data-theme='dark'] .saved-bar select,
html[data-theme='dark'] .generator-estimate-input {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .78);
  color: #f8fafc;
}

html[data-theme='dark'] .li-row input:focus,
html[data-theme='dark'] .preview-email-input:focus,
html[data-theme='dark'] .generator-email-input:focus {
  background: rgba(15, 23, 42, .94);
}

html[data-theme='dark'] .generator-warning {
  border-left-color: #fb923c;
  background: rgba(251, 146, 60, .12);
  color: #fdba74;
}

html[data-theme='dark'] #pdfPages canvas {
  border-color: rgba(96, 165, 250, .34);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .3);
}

@media (max-width: 768px) {
  html {
    font-size: 17px;
  }

  body {
    font-size: 15.5px;
  }

  .ps-header {
    padding-inline: 1rem;
  }

  .ps-footer-links a,
  .ps-footer-copy,
  .ps-field label,
  .cart-item__meta,
  .cart-item__details,
  .payment-summary-table th,
  .acc-stat-label,
  .order-meta,
  .step-card-header__hint,
  .doc-muted {
    font-size: .84rem;
  }

  .btn-acc-primary,
  .btn-acc-secondary,
  .payment-modal__pay,
  .payment-modal__cancel,
  .cart-panel__checkout,
  .cart-panel__clear,
  .cart-panel__promo-btn,
  .cart-item__edit,
  .cart-item__remove {
    min-height: 52px;
    padding: .82rem 1rem;
    font-size: .98rem;
    line-height: 1.15;
    border-radius: 14px;
  }
}

/* ── MOBILE OPTIMIZATIONS (max-width: 480px) ── */
@media (max-width: 480px) {
  .step-card-body {
    padding: 2rem;
  }

  .step-badge {
    font-size: .72rem;
    padding: .1rem .55rem;
    left: -.85rem;
  }

  .wiz-nav {
    flex-direction: column;
    border-radius: .65rem;
    overflow: hidden;
  }

    .btn-wiz-back {
        border-radius: 0.75rem !important;
        padding: .85rem 1rem;
        font-size: .88rem;
    }

    .btn-wiz-next {
        border-radius: 0.75rem !important;
        padding: .85rem 1rem;
        font-size: .88rem;
    }

  .btn-wiz-next--solo {
    border-radius: .65rem;
  }

  .btn-wiz-cart,
  .btn-wiz-buynow {
    padding: .72rem .85rem;
    font-size: .92rem;
    border-radius: .55rem;
  }

  .wiz-preview-actions .btn-wiz-cart,
  .wiz-preview-actions .btn-wiz-buynow {
    font-size: .92rem;
    padding: .72rem .85rem;
  }

  .ps-row.two,
  .ps-row.three {
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .dollar-input span {
    padding: .4rem .5rem;
    font-size: .82rem;
  }

  .ps-header {
    padding-inline: .65rem;
  }

  .ps-header nav {
    gap: .35rem;
  }

  .ps-header nav a {
    font-size: .78rem;
    padding: .35rem .45rem;
  }

  .order-card {
    padding: .85rem;
  }

  .order-card__header {
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
  }

  .acc-stats-row {
    grid-template-columns: 1fr;
    gap: .65rem;
  }
}

/* ── MOBILE OPTIMIZATIONS (max-width: 768px) — wizard, preview, order processing ── */
@media (max-width: 768px) {
  .wiz-nav {
    box-shadow:
      0 4px 10px -2px rgba(0,0,0,.05),
      0 16px 32px -8px rgba(0,0,0,.08);
  }

  .ps-preview-col {
    display: none;
  }

  .ps-form-col {
    padding: 0;
  }

  #wizPreviewPages {
    flex-direction: column;
    align-items: center;
  }

  #wizPreviewPages canvas {
    max-width: 100%;
    height: auto !important;
  }

  .order-processing-overlay {
    padding: 1rem;
  }

  .order-processing-overlay__card {
    padding: 1.5rem;
    max-width: 92vw;
  }
}

/* Generator responsiveness hardening */
.saved-bar {
  flex-wrap: wrap;
}

.saved-bar > span {
  flex: 0 0 auto;
}

.saved-bar select {
  flex: 1 1 220px;
  width: 100%;
  max-width: none;
  min-width: min(100%, 180px);
}

.pay-type-opt {
  min-width: 0;
}

.pay-type-opt > span {
  flex: 1 1 auto;
  min-width: 0;
}

.pay-type-opt input[type="radio"] {
  width: 1.1rem;
  min-width: 1.1rem;
  height: 1.1rem !important;
  margin: 0;
}

.pay-type-hint {
  flex: 1 0 100%;
  margin-top: .15rem;
}

.acc-header {
  gap: .75rem;
}

.acc-title {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.acc-date {
  max-width: 100%;
  white-space: nowrap;
}

.acc-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.generator-consent {
  align-items: flex-start;
  gap: .75rem;
}

.generator-consent-check {
  flex: 0 0 auto;
  margin-top: .1rem;
}

.wiz-preview-layout,
.wiz-preview-gallery,
#wizPreviewPages.wiz-preview-carousel,
#wizPreviewPages.wiz-preview-carousel .wiz-carousel-item,
.ps-layout.wiz-preview-mode .ps-form-col,
.ps-layout.wiz-preview-mode .ps-preview-col {
  min-width: 0;
}

@media (max-width: 900px) {
  .wiz-progress-wrap {
    overflow-x: auto;
    padding: 0 .25rem .25rem;
    margin-inline: -.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .wiz-progress-wrap::-webkit-scrollbar {
    display: none;
  }

  .wiz-progress {
    width: 100%;
    min-width: 40rem;
    justify-content: space-between;
    gap: 0;
    --wiz-side-pad: .75rem;
    padding: 1.5rem .75rem 1.35rem;
  }

  .wiz-progress::before,
  .wiz-line-fill {
    top: calc(1.5rem + 14px);
  }

  .wiz-dot {
    flex: 0 0 auto;
    min-width: 44px;
    scroll-snap-align: center;
  }

  .wiz-dot-label {
    max-width: 8ch;
    font-size: .72rem;
  }

  .acc-header {
    align-items: flex-start;
  }

  .li-header.li-ded {
    display: none;
  }

  .li-row--addition {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px;
    gap: .5rem;
  }

  .li-row--addition > :first-child {
    grid-column: 1 / -1;
  }

  .li-row--addition > :nth-child(2),
  .li-row--addition > :nth-child(3),
  .li-row--addition > :nth-child(4) {
    grid-row: 2;
  }

  .li-row.li-ded {
    grid-template-columns: minmax(0, 1fr) minmax(82px, 102px) 28px 32px;
    gap: .35rem;
  }

  .local-tax-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px;
  }

  .local-tax-row > :first-child {
    grid-column: 1 / -1;
  }

  .local-tax-row > :nth-child(4) {
    grid-column: 1 / 3;
    width: 100%;
    justify-content: center;
  }

  .local-tax-row > :nth-child(5) {
    grid-column: 3;
    justify-self: center;
  }

  .ps-layout.wiz-preview-mode .ps-preview-col {
    flex: 0 0 min(320px, 100%);
    max-width: min(320px, 100%);
  }

  #wizPreviewPages.wiz-preview-carousel {
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .35rem .25rem .5rem;
    scroll-snap-type: x proximity;
  }

  #wizPreviewPages.wiz-preview-carousel .wiz-carousel-item {
    scroll-snap-align: center;
  }
}

@media (max-width: 640px) {
  .saved-bar {
    padding: .6rem .7rem;
  }

  .pay-type-toggle {
    gap: .6rem;
  }

  .pay-type-opt {
    flex-basis: 100%;
  }

  .acc-title {
    gap: .45rem .55rem;
  }

  .generator-consent {
    font-size: .82rem;
  }

  .wiz-preview-step .generator-preview-header {
    padding: 1rem 1rem .55rem;
    min-height: 0;
  }

  .wiz-preview-layout {
    padding: .7rem .75rem .9rem;
  }

  .wiz-preview-gallery #wizPreviewNav {
    padding-inline: .1rem;
  }

  .wiz-preview-gallery #wizPreviewNav .btn-nav {
    width: 1.9rem;
    height: 1.9rem;
  }

  #wizPreviewPages.wiz-preview-carousel .wiz-carousel-item {
    flex-basis: min(250px, calc(100vw - 2.5rem));
    max-width: min(250px, calc(100vw - 2.5rem));
  }
}

@media (max-width: 540px) {
  .li-row--addition,
  .local-tax-row {
    grid-template-columns: 1fr;
  }

  .li-row--addition > *,
  .local-tax-row > * {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .btn-rm {
    justify-self: start;
  }

  .li-row.li-ded {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 92px) 28px 30px;
    gap: .3rem;
  }

  .li-row.li-ded > * {
    width: auto;
  }

  .li-row.li-ded .btn-rm,
  .li-row.li-ded .btn-drag {
    justify-self: center;
  }
}
/* =========================================
   PAYMENT MODAL - MYSTUBS FULL CSS
   Light theme default + dark theme override
   ========================================= */

/* ---------- Backdrop ---------- */

.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 30%), rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

    .payment-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

/* ---------- Dialog ---------- */

.payment-modal__dialog {
    width: min(100%, 760px);
    max-height: min(90vh, 900px);
    overflow: auto;
    position: relative;
    border-radius: 24px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 8px 24px rgba(15, 23, 42, 0.10);
    transform: translateY(10px) scale(0.985);
    transition: transform 0.2s ease, opacity 0.2s ease;
    color: #0f172a;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.payment-modal.is-open .payment-modal__dialog {
    transform: translateY(0) scale(1);
}

.payment-modal__dialog::-webkit-scrollbar {
    width: 10px;
}

.payment-modal__dialog::-webkit-scrollbar-track {
    background: transparent;
}

.payment-modal__dialog::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.payment-modal__dialog::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #2563eb, #1d4ed8);
}

.payment-modal__dialog::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 24%), radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.03), transparent 24%);
}

/* ---------- Title ---------- */

.payment-modal__title {
    margin: 0;
    padding: 1.45rem 1.5rem 0.5rem;
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.6rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    position: relative;
    z-index: 1;
}

/* ---------- Summary ---------- */

.payment-modal__summary {
    position: relative;
    z-index: 1;
    margin: 0 1.5rem 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: linear-gradient(180deg, #f8fbff 0%, #f1f7ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 14px rgba(37, 99, 235, 0.04);
}

    .payment-modal__summary::before {
        content: "Secure checkout powered by Stripe";
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        margin-bottom: 0.85rem;
        padding: 0.4rem 0.7rem;
        border-radius: 999px;
        font-size: 0.74rem;
        font-weight: 800;
        line-height: 1;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: #1d4ed8;
        background: rgba(37, 99, 235, 0.08);
        border: 1px solid rgba(37, 99, 235, 0.12);
    }

.payment-modal__hint {
    margin: 0 0 0.95rem;
    font-size: 0.94rem;
    line-height: 1.55;
    color: #475569;
}

/* ---------- Summary table ---------- */

.payment-summary-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.97rem;
    color: #0f172a;
    overflow: hidden;
}

    .payment-summary-table thead th {
        text-align: left;
        padding: 0.8rem 0.85rem;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #64748b;
        background: rgba(37, 99, 235, 0.04);
        border-bottom: 1px solid rgba(148, 163, 184, 0.20);
    }

    .payment-summary-table tbody td,
    .payment-summary-table tfoot td {
        padding: 0.92rem 0.85rem;
        vertical-align: middle;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .payment-summary-table tbody tr:last-child td {
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .payment-summary-table tfoot td {
        padding-top: 1rem;
        border-bottom: 0;
    }

    .payment-summary-table th:nth-child(2),
    .payment-summary-table th:nth-child(3),
    .payment-summary-table td:nth-child(2),
    .payment-summary-table td:nth-child(3) {
        text-align: right;
        white-space: nowrap;
    }

.payment-summary-table__subtext {
    display: inline-block;
    margin-top: 0.18rem;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.35;
}

.payment-summary-table__money {
    font-weight: 700;
    color: #0f172a;
}

.payment-summary-table__total {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
}

/* ---------- Stripe container ---------- */

.payment-modal__element {
    position: relative;
    z-index: 1;
    margin: 0 1.5rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 6px 18px rgba(37, 99, 235, 0.06);
}

    .payment-modal__element:focus-within {
        border-color: rgba(37, 99, 235, 0.36);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10), inset 0 1px 0 rgba(255,255,255,0.75), 0 6px 18px rgba(37, 99, 235, 0.08);
    }

    /* Neutralize extra Stripe wrapper spacing a bit */
    .payment-modal__element .StripeElement,
    .payment-modal__element .__PrivateStripeElement {
        border-radius: 14px;
    }

/* ---------- Error ---------- */

.payment-modal__error {
    min-height: 1.2rem;
    margin: 0.8rem 1.5rem 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    color: #dc2626;
    position: relative;
    z-index: 1;
}

/* ---------- Actions ---------- */

.payment-modal__actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.85rem;
    justify-content: flex-end;
    align-items: center;
    padding: 1.2rem 1.5rem 1.5rem;
}

.payment-modal__pay,
.payment-modal__cancel {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 14px;
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.payment-modal__pay {
    border: 0;
    min-width: 170px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255,255,255,0.18);
}

    .payment-modal__pay:hover {
        transform: translateY(-1px);
        box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255,255,255,0.20);
    }

    .payment-modal__pay:active {
        transform: translateY(0);
        box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20), inset 0 1px 0 rgba(255,255,255,0.16);
    }

.payment-modal__cancel {
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #334155;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

    .payment-modal__cancel:hover {
        transform: translateY(-1px);
        background: #f8fafc;
        border-color: rgba(37, 99, 235, 0.22);
        color: #0f172a;
    }

    .payment-modal__cancel:active {
        transform: translateY(0);
    }

    .payment-modal__pay:focus-visible,
    .payment-modal__cancel:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
    }

    .payment-modal__pay:disabled,
    .payment-modal__cancel:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* ---------- Optional loading state ---------- */

.payment-modal__pay.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

    .payment-modal__pay.is-loading::after {
        content: "";
        position: absolute;
        inset: 50% auto auto 50%;
        width: 18px;
        height: 18px;
        margin-left: -9px;
        margin-top: -9px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.34);
        border-top-color: #ffffff;
        animation: payment-modal-spin 0.8s linear infinite;
    }

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

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .payment-modal,
    .payment-modal__dialog,
    .payment-modal__pay,
    .payment-modal__cancel {
        transition: none;
    }

        .payment-modal__pay.is-loading::after {
            animation: none;
        }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .payment-modal {
        align-items: flex-end;
        padding: 0.75rem;
    }

    .payment-modal__dialog {
        width: 100%;
        max-height: min(92vh, 1000px);
        border-radius: 22px 22px 16px 16px;
    }

    .payment-modal__title {
        padding: 1.1rem 1rem 0.45rem;
        font-size: 1.16rem;
    }

    .payment-modal__summary,
    .payment-modal__element,
    .payment-modal__error {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .payment-modal__summary {
        padding: 0.9rem;
    }

    .payment-modal__element {
        padding: 0.9rem;
    }

    .payment-summary-table thead th,
    .payment-summary-table tbody td,
    .payment-summary-table tfoot td {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .payment-modal__actions {
        padding: 1rem;
        flex-direction: column;
    }

    .payment-modal__pay,
    .payment-modal__cancel {
        width: 100%;
    }
}

/* ---------- Very small phones ---------- */

@media (max-width: 420px) {
    .payment-modal__title {
        font-size: 1.08rem;
    }

    .payment-modal__hint {
        font-size: 0.9rem;
    }

    .payment-summary-table {
        font-size: 0.93rem;
    }

        .payment-summary-table thead th {
            font-size: 0.72rem;
        }
}

/* =========================================
   DARK THEME OVERRIDE
   ========================================= */

html[data-theme='dark'] .payment-modal {
    background: radial-gradient(circle at top, rgba(30, 167, 255, 0.10), transparent 30%), rgba(2, 6, 23, 0.58);
}

html[data-theme='dark'] .payment-modal__dialog {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(8, 15, 28, 0.98) 100%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.22);
    color: #f8fbff;
}

    html[data-theme='dark'] .payment-modal__dialog::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.22);
    }

    html[data-theme='dark'] .payment-modal__dialog::before {
        background: linear-gradient(90deg, #6bd3ff, #1ea7ff, #1557ff);
    }

    html[data-theme='dark'] .payment-modal__dialog::after {
        background: radial-gradient(circle at top right, rgba(30, 167, 255, 0.10), transparent 24%), radial-gradient(circle at bottom left, rgba(21, 87, 255, 0.08), transparent 24%);
    }

html[data-theme='dark'] .payment-modal__title {
    color: #f8fbff;
}

html[data-theme='dark'] .payment-modal__summary {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 6px 18px rgba(0,0,0,0.14);
}

    html[data-theme='dark'] .payment-modal__summary::before {
        color: #dff4ff;
        background: rgba(30, 167, 255, 0.10);
        border-color: rgba(30, 167, 255, 0.22);
    }

html[data-theme='dark'] .payment-modal__hint {
    color: #cbd5e1;
}

html[data-theme='dark'] .payment-summary-table {
    color: #f8fbff;
}

    html[data-theme='dark'] .payment-summary-table thead th {
        color: #94a3b8;
        background: rgba(255,255,255,0.03);
        border-bottom-color: rgba(255,255,255,0.08);
    }

    html[data-theme='dark'] .payment-summary-table tbody td,
    html[data-theme='dark'] .payment-summary-table tfoot td {
        border-bottom-color: rgba(255,255,255,0.07);
    }

html[data-theme='dark'] .payment-summary-table__subtext {
    color: #94a3b8;
}

html[data-theme='dark'] .payment-summary-table__money,
html[data-theme='dark'] .payment-summary-table__total {
    color: #ffffff;
}

html[data-theme='dark'] .payment-modal__element {
    background: linear-gradient(180deg, rgba(12,18,31,0.96), rgba(8,14,25,0.98));
    border-color: rgba(96, 165, 250, 0.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 22px rgba(0,0,0,0.20);
}

    html[data-theme='dark'] .payment-modal__element:focus-within {
        border-color: rgba(30, 167, 255, 0.34);
        box-shadow: 0 0 0 4px rgba(30, 167, 255, 0.12), inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 22px rgba(0,0,0,0.20);
    }

html[data-theme='dark'] .payment-modal__error {
    color: #fb7185;
}

html[data-theme='dark'] .payment-modal__pay {
    color: #ffffff;
    background: linear-gradient(135deg, #1ea7ff, #1557ff);
    box-shadow: 0 14px 26px rgba(21, 87, 255, 0.32), inset 0 1px 0 rgba(255,255,255,0.16);
}

    html[data-theme='dark'] .payment-modal__pay:hover {
        box-shadow: 0 18px 30px rgba(21, 87, 255, 0.40), inset 0 1px 0 rgba(255,255,255,0.18);
    }

    html[data-theme='dark'] .payment-modal__pay:active {
        box-shadow: 0 10px 20px rgba(21, 87, 255, 0.26), inset 0 1px 0 rgba(255,255,255,0.14);
    }

html[data-theme='dark'] .payment-modal__cancel {
    color: #dbe7f5;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.10);
    box-shadow: none;
}

    html[data-theme='dark'] .payment-modal__cancel:hover {
        background: rgba(255,255,255,0.07);
        color: #ffffff;
        border-color: rgba(255,255,255,0.14);
    }

    html[data-theme='dark'] .payment-modal__pay:focus-visible,
    html[data-theme='dark'] .payment-modal__cancel:focus-visible {
        box-shadow: 0 0 0 4px rgba(30, 167, 255, 0.16);
    }


/* ── Dedicated /Checkout page ──────────────────────────────────────────── */
.checkout-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px;
}
.checkout-page__layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .checkout-page__layout {
        grid-template-columns: 1fr 1fr;
    }
}
.checkout-page__title {
    font-size: 28px;
    margin: 0 0 16px;
}
.checkout-page__summary,
.checkout-page__payment {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e4e4e8);
    border-radius: 14px;
    padding: 24px;
}
.checkout-page__table {
    width: 100%;
    border-collapse: collapse;
}
.checkout-page__table th,
.checkout-page__table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-muted, #eee);
    text-align: left;
}
.checkout-page__subtext {
    color: var(--muted, #6c6c72);
    font-size: 13px;
}
.checkout-page__total {
    text-align: right;
    font-weight: 700;
    font-size: 18px;
}
.checkout-page__promo {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted, #6c6c72);
}
.checkout-page__stripe {
    min-height: 180px;
    margin-bottom: 12px;
}
.checkout-page__error {
    color: #c0392b;
    min-height: 20px;
    font-size: 14px;
    margin-bottom: 8px;
}
.checkout-page__pay {
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--accent, #1e67f5);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}
.checkout-page__pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.checkout-page__cancel {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted, #6c6c72);
}

/* ── Cart delivery-email rows (global; rendered anywhere the cart sidebar is open) ─── */
.delivery-email-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
    margin-top: .5rem;
}
.delivery-email-add,
.delivery-email-remove {
    border: 1px solid rgba(59, 130, 246, .22);
    background: rgba(59, 130, 246, .08);
    color: #2563eb;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.delivery-email-add {
    min-height: 42px;
    padding: 0 .9rem;
}
.delivery-email-remove {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
}
.delivery-email-add:hover,
.delivery-email-remove:hover {
    background: rgba(59, 130, 246, .14);
    border-color: rgba(59, 130, 246, .34);
    transform: translateY(-1px);
}
.delivery-email-actions {
    margin-top: .6rem;
}
html[data-theme='dark'] .delivery-email-add,
html[data-theme='dark'] .delivery-email-remove {
    background: rgba(59, 130, 246, .14);
    border-color: rgba(96, 165, 250, .26);
    color: #bfdbfe;
}
html[data-theme='dark'] .delivery-email-add:hover,
html[data-theme='dark'] .delivery-email-remove:hover {
    background: rgba(59, 130, 246, .2);
    border-color: rgba(147, 197, 253, .38);
}

/* ── Cart-panel labels (global; readable on both light and dark surfaces) ─── */
.cart-panel__title {
    color: var(--text);
    font-size: .95rem;
    font-weight: 700;
}
.cart-panel__delivery {
    margin-top: 0;
    padding-top: .8rem;
    border-top: 1px solid rgba(148, 163, 184, .18);
}
.cart-panel__delivery-title {
    display: block;
    margin-bottom: .4rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
}
.cart-panel__delivery .delivery-email-copy {
    margin: 0 0 .6rem;
    font-size: .74rem;
    color: #64748b;
    line-height: 1.4;
}
.cart-panel__delivery .ps-field label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text);
}
.cart-panel__delivery .generator-email-input,
.cart-panel .generator-email-input {
    min-height: 36px;
    padding: .4rem .65rem;
    font-size: .78rem;
    border-radius: .6rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    color: var(--text);
}
.delivery-email-add {
    font-size: .72rem;
    font-weight: 600;
    min-height: 32px;
    padding: 0 .7rem;
}
.delivery-email-remove {
    width: 32px;
    height: 32px;
    font-size: .9rem;
}
html[data-theme='dark'] .cart-panel__title,
html[data-theme='dark'] .cart-panel__total-label,
html[data-theme='dark'] .cart-panel__delivery-title,
html[data-theme='dark'] .cart-panel__delivery .ps-field label {
    color: var(--text);
}
html[data-theme='dark'] .cart-panel__delivery .delivery-email-copy,
html[data-theme='dark'] .cart-panel__meta,
html[data-theme='dark'] .cart-item__meta,
html[data-theme='dark'] .cart-item__details {
    color: #94a3b8;
}
html[data-theme='dark'] .cart-panel__delivery .generator-email-input,
html[data-theme='dark'] .cart-panel .generator-email-input,
html[data-theme='dark'] .cart-panel__promo-input {
    background: var(--surface) !important;
    border-color: var(--border);
    color: var(--text);
}

/* ── Cart panel: invoice-style redesign ─────────────────────────────────── */
.cart-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.cart-panel__count {
    font-size: .72rem;
    color: #64748b;
    font-weight: 500;
}
html[data-theme='dark'] .cart-panel__count { color: #94a3b8; }

/* Selection toolbar */
.cart-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem 1rem;
    background: rgba(3, 133, 255, .06);
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    font-size: .75rem;
    color: var(--text);
}
.cart-selection-bar[hidden] { display: none; }
.cart-selection-bar__count { font-weight: 600; }
.cart-selection-bar__actions { display: flex; gap: .4rem; }
.cart-selection-bar__btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, .22);
    color: var(--blue);
    font-size: .72rem;
    font-weight: 600;
    padding: .3rem .65rem;
    border-radius: .5rem;
    cursor: pointer;
    min-height: 28px;
}
.cart-selection-bar__btn:hover:not(:disabled) { background: rgba(3, 133, 255, .1); }
.cart-selection-bar__btn:disabled { opacity: .4; cursor: not-allowed; }
.cart-selection-bar__btn--danger { color: #e74c3c; }
.cart-selection-bar__btn--danger:hover:not(:disabled) { background: rgba(231, 76, 60, .08); }

/* Invoice list (replaces .cart-panel__items) */
.cart-invoice {
    flex: 0 1 auto;
    max-height: 50%;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    display: block;
}
.cart-invoice__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: .82rem;
}
.cart-invoice__row {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    transition: background .15s ease;
}
.cart-invoice__row.is-selected { background: rgba(3, 133, 255, .05); }
.cart-invoice__head {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
}
.cart-invoice__check {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}
.cart-invoice__check input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    cursor: pointer;
}
.cart-invoice__summary {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr auto auto 14px;
    align-items: center;
    gap: .65rem;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--text);
    font: inherit;
    text-align: left;
}
.cart-invoice__template {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-invoice__qty {
    font-size: .74rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.cart-invoice__price {
    font-size: .82rem;
    font-weight: 600;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}
.cart-invoice__caret {
    font-size: 1.1rem;
    color: #94a3b8;
    transform: rotate(90deg);
    transition: transform .18s ease;
    display: inline-block;
    text-align: center;
    line-height: 1;
}
.cart-invoice__row.is-expanded .cart-invoice__caret { transform: rotate(-90deg); }
.cart-invoice__detail {
    padding: 0 1rem .6rem 1rem;
    font-size: .74rem;
    color: #64748b;
}
.cart-invoice__detail[hidden] { display: none; }
.cart-invoice__dates {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .2rem;
}
.cart-invoice__date-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: .75rem;
    padding: .2rem 0;
}
.cart-invoice__date-label,
.cart-invoice__date-qty,
.cart-invoice__date-price { font-size: .72rem; }
.cart-invoice__date-label strong,
.cart-invoice__date-qty strong,
.cart-invoice__date-price strong { color: var(--text); font-weight: 600; }
.cart-invoice__date-qty { min-width: 3.25rem; text-align: right; font-variant-numeric: tabular-nums; }
.cart-invoice__date-price { min-width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.cart-invoice__detail-empty { font-style: italic; }
html[data-theme='dark'] .cart-invoice__date-label strong,
html[data-theme='dark'] .cart-invoice__date-qty strong,
html[data-theme='dark'] .cart-invoice__date-price strong { color: var(--text); }
html[data-theme='dark'] .cart-invoice__template { color: var(--text); }
html[data-theme='dark'] .cart-invoice__qty,
html[data-theme='dark'] .cart-invoice__detail { color: #94a3b8; }
html[data-theme='dark'] .cart-invoice__row.is-selected { background: rgba(96, 165, 250, .08); }

/* Scrollable summary region (coupon + delivery) */
.cart-panel__summary {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .75rem 1rem .6rem;
    border-top: 1px solid rgba(148, 163, 184, .18);
    display: grid;
    gap: .75rem;
}

/* Coupon trigger (collapsed by default) */
.cart-panel__promo-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    padding: .2rem 0;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}
.cart-panel__promo-toggle-label { text-align: left; }
.cart-panel__promo-toggle-caret {
    font-size: .95rem;
    font-weight: 700;
    width: 18px;
    text-align: center;
}
.cart-panel__promo-toggle:hover { color: var(--blue-dk); }
.cart-panel__promo-collapse { display: grid; gap: .4rem; }
.cart-panel__promo-collapse[hidden] { display: none; }

/* Footer sticks to bottom; total + checkout */
.cart-panel__footer {
    padding: .85rem 1rem 1rem;
    display: grid;
    gap: .7rem;
    border-top: 1px solid rgba(148, 163, 184, .18);
    background: transparent;
}

/* ── Cart select-mode toggle + row content update ───────────────────────── */
.cart-panel__select-toggle {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, .28);
    color: var(--blue);
    font-size: .72rem;
    font-weight: 600;
    padding: .25rem .7rem;
    border-radius: .5rem;
    cursor: pointer;
    min-height: 28px;
}
.cart-panel__select-toggle:hover { background: rgba(3, 133, 255, .08); }
.cart-panel__select-toggle[aria-pressed="true"] {
    background: rgba(3, 133, 255, .12);
    border-color: rgba(3, 133, 255, .4);
}
.cart-panel__select-toggle[hidden] { display: none; }

/* Checkboxes hidden unless selection-mode is active */
.cart-invoice__check { display: none; }
.cart-panel.is-selection-mode .cart-invoice__check {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

/* Row summary now stacks party line over meta line */
.cart-invoice__summary {
    grid-template-columns: 1fr auto auto;
    gap: .5rem;
}
.cart-invoice__body {
    display: grid;
    gap: .1rem;
    min-width: 0;
}
.cart-invoice__parties {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    font-size: .76rem;
    font-weight: 600;
    color: var(--text);
}
.cart-invoice__party {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    color: var(--text);
}
.cart-invoice__party svg { flex-shrink: 0; color: #64748b; }
.cart-invoice__party-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 8rem;
}
.cart-invoice__arrow {
    color: #94a3b8;
    font-size: .85rem;
    flex-shrink: 0;
}
.cart-invoice__meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    color: #64748b;
    font-weight: 400;
    white-space: nowrap;
}
.cart-invoice__meta-sep { color: #cbd5e1; }
html[data-theme='dark'] .cart-invoice__party svg { color: #94a3b8; }
html[data-theme='dark'] .cart-invoice__meta { color: #94a3b8; }
html[data-theme='dark'] .cart-invoice__meta-sep { color: rgba(148, 163, 184, .4); }

/* ── Cart drawer: three layers (top / body / bottom) ──────────────────── */
.cart-panel {
    /* override the earlier .cart-panel rules: turn the panel into a flex column
       of three regions. */
    padding: 0;
}
.cart-panel__top,
.cart-panel__bottom {
    flex: 0 0 auto;
    background: rgba(248, 250, 252, .72);
    backdrop-filter: blur(8px);
    border-color: rgba(148, 163, 184, .18);
}
.cart-panel__top    { border-bottom: 1px solid rgba(148, 163, 184, .18); }
.cart-panel__bottom {
    border-top: 1px solid rgba(148, 163, 184, .22);
    padding: .9rem 1rem 1rem;
    display: grid;
    gap: .65rem;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .04);
}
.cart-panel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
    background: transparent;
}

html[data-theme='dark'] .cart-panel__top,
html[data-theme='dark'] .cart-panel__bottom {
    background: #060a14;
    border-color: var(--border);
}
html[data-theme='dark'] .cart-panel__bottom {
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .25);
}

/* Section blocks within the body */
.cart-panel__section {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    background: transparent;
}
.cart-panel__section:last-child { border-bottom: 0; }
.cart-panel__section--items { padding: .65rem 0 .85rem; }
.cart-panel__section--items .cart-invoice { padding: 0; }
.cart-panel__section-title {
    margin: 0 0 .55rem;
    padding: 0 1rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
}
.cart-panel__section--delivery .cart-panel__section-title { padding: 0; }
html[data-theme='dark'] .cart-panel__section { border-bottom-color: rgba(148, 163, 184, .14); }
html[data-theme='dark'] .cart-panel__section-title { color: #64748b; }

/* Items list inside section: lose old caps, let body region scroll */
.cart-invoice {
    flex: none;
    max-height: none;
    overflow: visible;
    padding: 0;
}

/* Product row: cleaner visuals as receipt lines */
.cart-invoice__row {
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    transition: background .15s ease;
}
.cart-invoice__row:last-child { border-bottom: 0; }
.cart-invoice__head { padding: .6rem 1rem; }
.cart-invoice__row.is-expanded { background: rgba(3, 133, 255, .03); }

/* Expanded detail uses subtle surface to read as nested */
.cart-invoice__detail {
    padding: 0 1rem .7rem 2.4rem;
    border-top: 1px dashed rgba(148, 163, 184, .2);
    margin-top: -.15rem;
    padding-top: .55rem;
    background: rgba(248, 250, 252, .55);
}
html[data-theme='dark'] .cart-invoice__detail {
    background: rgba(15, 23, 42, .35);
    border-top-color: rgba(148, 163, 184, .14);
}
html[data-theme='dark'] .cart-invoice__row.is-expanded {
    background: rgba(96, 165, 250, .04);
}

/* Coupon section gets a flat receipt look */
.cart-panel__section--coupon { padding: .55rem 1rem; }
.cart-panel__promo-toggle { padding: .35rem 0; }

/* Totals: make the Total amount visually significant */
.cart-panel__total-row {
    margin: 0;
    padding: 0;
    border-top: 0;
    font-size: .9rem;
}
.cart-panel__total-label { font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; }
.cart-panel__total-value { font-size: 1.05rem; }

/* Hide the old summary class if any leftover refers to it */
.cart-panel__summary { display: contents; }

/* ── Discount block lives in the sticky bottom layer, just before Total ── */
.cart-panel__discount {
    display: grid;
    gap: .35rem;
    padding-bottom: .5rem;
    border-bottom: 1px dashed rgba(148, 163, 184, .25);
}
.cart-panel__discount .cart-panel__promo-toggle {
    padding: .15rem 0;
}
.cart-panel__discount .cart-panel__discount-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .76rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.cart-panel__discount .cart-panel__discount-row[hidden] { display: none; }
.cart-panel__discount-amount {
    color: #16a34a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
html[data-theme='dark'] .cart-panel__discount {
    border-bottom-color: rgba(148, 163, 184, .2);
}
html[data-theme='dark'] .cart-panel__discount .cart-panel__discount-row { color: #94a3b8; }

/* ── Cart top: title row + action bar (Select / selection toolbar swap) ── */
.cart-panel__header {
    padding: .85rem 1rem .35rem;
    justify-content: center;
    text-align: center;
}
.cart-panel__header .cart-panel__title { text-align: center; }
.cart-panel__action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem 1rem .65rem;
    min-height: 36px;
}
.cart-panel__action-bar-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    flex: 1 1 auto;
}
.cart-selection-bar__count[hidden],
.cart-selection-bar__actions[hidden] { display: none; }

/* ── Sticky-bottom Delivery block (mirrors Discount block) ─────────────── */
.cart-panel__delivery-block {
    display: grid;
    gap: .35rem;
    padding-bottom: .5rem;
    border-bottom: 1px dashed rgba(148, 163, 184, .25);
}
.cart-panel__delivery-block .cart-panel__promo-toggle { padding: .15rem 0; }
.cart-panel__delivery-body { display: grid; gap: .55rem; padding-top: .25rem; }
html[data-theme='dark'] .cart-panel__delivery-block {
    border-bottom-color: rgba(148, 163, 184, .2);
}

/* Bottom-layer Delivery typography (matches Discount + section labels) */
.cart-panel .cart-panel__delivery-body .delivery-email-copy {
    margin: 0 0 .35rem !important;
    font-size: .68rem !important;
    font-weight: 400 !important;
    font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif) !important;
    color: #64748b;
    line-height: 1.35;
}
.cart-panel__delivery-body .ps-field label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text);
}
.cart-panel__delivery-body .generator-email-input {
    min-height: 36px;
    padding: .4rem .65rem;
    font-size: .78rem;
    border-radius: .6rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    color: var(--text);
}
html[data-theme='dark'] .cart-panel__delivery-body .delivery-email-copy { color: #94a3b8; }
html[data-theme='dark'] .cart-panel__delivery-body .generator-email-input {
    background: var(--surface) !important;
    border-color: var(--border);
    color: var(--text);
}

/* ── Muted summary value on collapsible toggles (delivery / coupon) ────── */
.cart-panel__promo-toggle {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .5rem;
    text-align: left;
}
.cart-panel__promo-toggle-label {
    text-align: left;
    flex: none;
}
.cart-panel__promo-toggle-value {
    color: #94a3b8;
    font-weight: 400;
    font-size: .72rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.cart-panel__promo-toggle-value:empty { display: none; }
html[data-theme='dark'] .cart-panel__promo-toggle-value { color: #64748b; }

/* ── Cart item row: structured two-line invoice line ────────────────────── */
.cart-invoice__row { padding: 0; }
.cart-invoice__head {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: .65rem;
    padding: .7rem 1rem;
}
.cart-panel.is-selection-mode .cart-invoice__head {
    grid-template-columns: auto auto auto 1fr;
}
.cart-invoice__qty-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 .45rem;
    border-radius: 8px;
    background: rgba(3, 133, 255, .1);
    color: var(--blue);
    font-size: .78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(3, 133, 255, .18);
}
.cart-invoice__summary {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: .15rem;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    text-align: left;
    width: 100%;
    min-width: 0;
}
.cart-invoice__body {
    display: grid;
    gap: .1rem;
    min-width: 0;
}
.cart-invoice__row-top,
.cart-invoice__row-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .65rem;
    min-width: 0;
}
.cart-invoice__company {
    font-size: .86rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.cart-invoice__price {
    font-size: .86rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.cart-invoice__meta {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    font-size: .72rem;
    color: #94a3b8;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-invoice__meta-to {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #cbd5e1;
    font-weight: 600;
}
.cart-invoice__meta-dot { color: rgba(148, 163, 184, .5); padding: 0 .1rem; }
.cart-invoice__caret {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1;
    flex-shrink: 0;
    transform: rotate(90deg);
    transition: transform .18s ease;
}
.cart-invoice__row.is-expanded .cart-invoice__caret { transform: rotate(-90deg); color: var(--blue); }
.cart-invoice__row:hover { background: rgba(148, 163, 184, .04); }
.cart-invoice__row.is-selected { background: rgba(3, 133, 255, .05); }
.cart-invoice__row.is-selected .cart-invoice__qty-badge {
    background: var(--blue);
    color: #fff;
    border-color: transparent;
}

/* Dark mode tweaks */
html[data-theme='dark'] .cart-invoice__qty-badge {
    background: rgba(96, 165, 250, .14);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, .22);
}
html[data-theme='dark'] .cart-invoice__company,
html[data-theme='dark'] .cart-invoice__price { color: var(--text); }
html[data-theme='dark'] .cart-invoice__meta { color: #64748b; }
html[data-theme='dark'] .cart-invoice__meta-to { color: rgba(148, 163, 184, .55); }
html[data-theme='dark'] .cart-invoice__caret { color: rgba(148, 163, 184, .5); }
html[data-theme='dark'] .cart-invoice__row:hover { background: rgba(255, 255, 255, .03); }
html[data-theme='dark'] .cart-invoice__row.is-selected { background: rgba(96, 165, 250, .07); }

/* Per-stub price column — bold, brand-green, right-aligned to match $13.98 line total */
.cart-invoice__date-price {
    font-weight: 700 !important;
    color: var(--green) !important;
    font-size: .76rem !important;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 4rem;
}
.cart-invoice__date-row {
    grid-template-columns: 1fr auto 4rem;
}

/* Item line total color matches per-stub price + bottom-row Total color */
.cart-invoice__price {
    color: var(--green) !important;
}

/* Force per-stub date row to match head row alignment exactly */
.cart-invoice__detail .cart-invoice__date-row {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .2rem 0;
}
.cart-invoice__detail .cart-invoice__date-label {
    flex: 1 1 auto;
    text-align: left;
}
.cart-invoice__detail .cart-invoice__date-qty {
    flex: 0 0 auto;
    min-width: 0 !important;
    text-align: right;
    color: #94a3b8;
    margin-right: .25rem;
}
.cart-invoice__detail .cart-invoice__date-price {
    flex: 0 0 auto;
    min-width: 0 !important;
    text-align: right !important;
    margin-left: 0;
}
/* Match the head's right padding so $X.XX ends at same x as $13.98 */
.cart-invoice__detail {
    padding-right: 1rem !important;
}

/* Indent only enough to clear the qty badge (28px + 0.65rem gap) — match where company name starts */
.cart-invoice__detail { padding-left: calc(1rem + 28px + .65rem) !important; }

/* Caret: ▸ collapsed, rotated to ▾ when expanded */
.cart-invoice__caret {
    transform: none !important;
    transition: transform .18s ease;
    font-size: .85rem;
}
.cart-invoice__row.is-expanded .cart-invoice__caret {
    transform: rotate(90deg) !important;
    color: var(--blue);
}

/* "TO" outdent so it visually aligns under the company name above */
.cart-invoice__meta-to {
    margin-left: -.05rem;
    padding-right: .15rem;
}

/* Paydate rows: subtle alternating stripe */
.cart-invoice__detail .cart-invoice__date-row:nth-child(odd) {
    background: rgba(148, 163, 184, .05);
}
.cart-invoice__detail .cart-invoice__date-row {
    padding: .35rem .5rem !important;
    margin: 0 -.5rem;
    border-radius: 4px;
}
html[data-theme='dark'] .cart-invoice__detail .cart-invoice__date-row:nth-child(odd) {
    background: rgba(148, 163, 184, .06);
}

/* ── Global Checkout slide-over (mirrors cart sidebar pattern) ─────────── */
.checkout-panel-overlay {
    position: fixed;
    top: 66px;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    z-index: 90;
}
.checkout-panel-overlay[hidden] { display: none; }

.checkout-panel {
    position: fixed;
    top: 66px;
    right: 0;
    bottom: 0;
    width: min(28rem, calc(100vw - 1rem));
    height: calc(100vh - 66px);
    height: calc(100dvh - 66px);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(3, 133, 255, .08), transparent 30%),
        rgba(255, 255, 255, .98);
    border-left: 1px solid rgba(148, 163, 184, .18);
    box-shadow: -18px 0 38px rgba(15, 23, 42, .16);
    transform: translateX(100%);
    transition: transform .22s ease;
    z-index: 91;
    color: #0f172a;
    font-size: .88rem;
}
.checkout-panel.is-open { transform: translateX(0); }
body.checkout-panel-open { overflow: hidden; }

.checkout-panel__top,
.checkout-panel__bottom {
    flex: 0 0 auto;
    background: #f8fafc;
    border-color: rgba(148, 163, 184, .18);
}
.checkout-panel__top    { border-bottom: 1px solid rgba(148, 163, 184, .18); }
.checkout-panel__bottom {
    border-top: 1px solid rgba(148, 163, 184, .22);
    padding: .85rem 1rem 1rem;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .04);
}
.checkout-panel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    background: #ffffff;
}

.checkout-panel__header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: .9rem 1rem;
}
.checkout-panel__title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}
.checkout-panel__close {
    position: absolute;
    right: .65rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 1.4rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}
.checkout-panel__close:hover { color: var(--text); background: rgba(148, 163, 184, .1); }

.checkout-panel__section {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.checkout-panel__section:last-child { border-bottom: 0; }
.checkout-panel__section-title {
    margin: 0 0 .55rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.checkout-panel__loading {
    padding: 1rem 0;
    color: #94a3b8;
    font-size: .8rem;
    text-align: center;
}
.checkout-panel__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
}
.checkout-panel__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .65rem;
    font-size: .82rem;
}
.checkout-panel__item-main { display: flex; flex-direction: column; min-width: 0; }
.checkout-panel__item-main strong {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.checkout-panel__item-sub { font-size: .7rem; color: #94a3b8; }
.checkout-panel__item-qty {
    flex-shrink: 0;
    color: #64748b;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}
.checkout-panel__promo-line {
    margin-top: .5rem;
    font-size: .72rem;
    color: #64748b;
}
.checkout-panel__totals {
    margin-top: .65rem;
    padding-top: .55rem;
    border-top: 1px dashed rgba(148, 163, 184, .25);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .85rem;
}
.checkout-panel__total-value {
    color: var(--green);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.checkout-panel__stripe { min-height: 180px; margin-bottom: .5rem; }
.checkout-panel__error {
    color: #c0392b;
    min-height: 18px;
    font-size: .76rem;
}

.checkout-panel__pay {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), #36a2ff);
    color: #fff;
    box-shadow: 0 10px 24px rgba(3, 133, 255, .22);
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, opacity .18s ease;
}
.checkout-panel__pay:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.checkout-panel__pay:not(:disabled):hover {
    background: linear-gradient(135deg, var(--blue-dk), var(--blue));
}

/* Dark mode */
html[data-theme='dark'] .checkout-panel {
    background: #02040a !important;
    border-color: var(--border);
    color: var(--text);
}
html[data-theme='dark'] .checkout-panel__top,
html[data-theme='dark'] .checkout-panel__bottom {
    background: #060a14;
    border-color: var(--border);
}
html[data-theme='dark'] .checkout-panel__body {
    background: #02040a;
}
html[data-theme='dark'] .checkout-panel__section { border-bottom-color: rgba(148, 163, 184, .14); }
html[data-theme='dark'] .checkout-panel__section-title { color: #64748b; }
html[data-theme='dark'] .checkout-panel__item-main strong,
html[data-theme='dark'] .checkout-panel__title { color: var(--text); }
html[data-theme='dark'] .checkout-panel__item-sub,
html[data-theme='dark'] .checkout-panel__item-qty,
html[data-theme='dark'] .checkout-panel__promo-line,
html[data-theme='dark'] .checkout-panel__loading { color: #94a3b8; }
html[data-theme='dark'] .checkout-panel__totals { border-top-color: rgba(148, 163, 184, .2); }

/* ── Mobile: cart + checkout slide-overs go full width ──────────────────── */
@media (max-width: 640px) {
    .cart-panel,
    .checkout-panel {
        width: 100vw;
        max-width: 100vw;
        border-left: 0;
    }
    .cart-overlay,
    .checkout-panel-overlay {
        display: none;
    }
}

/* Checkout panel: skeleton + success state */
.checkout-panel__skeleton {
    display: grid;
    gap: .5rem;
    padding: .5rem 0;
}
.checkout-panel__skeleton-row {
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(148, 163, 184, .12), rgba(148, 163, 184, .2), rgba(148, 163, 184, .12));
    background-size: 200% 100%;
    animation: checkout-skeleton-shimmer 1.4s infinite linear;
}
.checkout-panel__skeleton-row--short { width: 55%; }
@keyframes checkout-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
html[data-theme='dark'] .checkout-panel__skeleton-row {
    background: linear-gradient(90deg, rgba(148, 163, 184, .08), rgba(148, 163, 184, .15), rgba(148, 163, 184, .08));
    background-size: 200% 100%;
}

.checkout-panel__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: 3rem 1rem;
    height: 100%;
    color: var(--green);
    text-align: center;
    animation: checkout-success-pop .28s ease;
}
.checkout-panel__success-check svg { color: var(--green); }
.checkout-panel__success-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.checkout-panel__success-sub {
    margin: 0;
    font-size: .82rem;
    color: #64748b;
}
@keyframes checkout-success-pop {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
html[data-theme='dark'] .checkout-panel__success-sub { color: #94a3b8; }

/* ── Mobile polish (phones <=640px): cart + checkout slide-overs ───────── */
@media (max-width: 640px) {
    /* Cart: keep body typography tight, prevent horizontal overflow */
    .cart-panel { font-size: .86rem; }
    .cart-invoice__head { padding: .55rem .8rem; gap: .5rem; }
    .cart-invoice__detail { padding-left: calc(.8rem + 28px + .5rem) !important; padding-right: .8rem !important; }
    .cart-invoice__company,
    .cart-invoice__price { font-size: .84rem; }
    .cart-invoice__meta { font-size: .68rem; }
    .cart-invoice__party-name { max-width: 6.5rem; }
    .cart-panel__section { padding: .7rem .85rem; }
    .cart-panel__bottom { padding: .75rem .85rem .85rem; }
    .cart-panel__delivery-body,
    .cart-panel__promo-collapse { padding-top: .35rem; }

    /* Checkout panel: tighten paddings, keep Stripe element at full width */
    .checkout-panel { font-size: .86rem; }
    .checkout-panel__section { padding: .75rem .85rem; }
    .checkout-panel__bottom { padding: .75rem .85rem max(.85rem, env(safe-area-inset-bottom)); }
    .checkout-panel__stripe { min-height: 160px; }
    .checkout-panel__title { font-size: .9rem; }
    .checkout-panel__close { right: .4rem; }

    /* B2 — On phones, render Payment first and Order summary below it.
       The user lands directly on the Stripe element instead of scrolling
       past the summary, and the Pay button + soft keyboard compete for
       less vertical space. Desktop layout unchanged. */
    .checkout-panel__body { display: flex; flex-direction: column; }
    .checkout-panel__body > section:nth-of-type(1) { order: 2; }
    .checkout-panel__body > section:nth-of-type(2) { order: 1; }

    /* Account menu dropdown can get clipped on small screens — cap its width */
    .nav-account-menu__panel { width: min(300px, calc(100vw - 1.5rem)); }
}
