/* ==========================================================================
   UA Pro CRM SaaS Portal v1.1.0 - CRM Motion Craft, Glass Header & 8-Tone Semantics
   Tokens ONLY from /design-vars.css + /css/portal-vars.css
   0 raw hex, 0 rgb/rgba, 0 gradients, 0 ease-in, 0 infinite animations
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: var(--body-weight);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

svg {
  display: block;
}

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hp-field {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-6);
  padding-right: var(--sp-6);
}

/* ==========================================================================
   1. Sticky Frosted Glass Header (64px) - Neutral/Inverse CTA only (G8)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 105;
  background-color: var(--bg-glass-bar);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-bar);
  -webkit-backdrop-filter: var(--blur-bar);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
  min-height: 44px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background-color: var(--bg-inverse);
  color: var(--ink-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 20px;
  height: 22px;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--r-xs);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--ink-secondary);
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-pill);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 140ms var(--ease-snappy);
}

.nav-link:hover {
  color: var(--ink-primary);
  background-color: var(--bg-surface-1);
}

.nav-link.is-active {
  color: var(--ink-primary);
  font-weight: 600;
  background-color: var(--bg-surface-1);
  border-color: var(--border-subtle);
}

.nav-link:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--r-pill);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  padding: 6px var(--sp-2);
  min-height: 32px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.seg-btn:hover {
  color: var(--ink-primary);
}

.seg-btn.is-active {
  background-color: var(--bg-surface-1);
  color: var(--ink-primary);
  border: 1px solid var(--border-subtle);
}

.seg-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-1);
  color: var(--ink-primary);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), transform 160ms var(--ease-snappy);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface-2);
}

.icon-btn:active {
  transform: scale(var(--press-scale));
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle-btn {
  position: relative;
}

.theme-icon-sun,
.theme-icon-moon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: transform 260ms var(--ease-wave), opacity 180ms var(--ease-out);
}

.theme-icon-moon {
  opacity: 0;
  transform: rotate(-45deg) scale(0.75);
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(45deg) scale(0.75);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ==========================================================================
   2. CRM Signature Dual-Layer Sweep Buttons (.ua-btn--sweep) & Pressable
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 40px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden;
  white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform 160ms var(--ease-snappy);
}

.btn--simple {
  padding: var(--sp-2) var(--sp-4);
}

.btn--lg {
  min-height: 48px;
  font-size: 16px;
}

.btn--lg.btn--simple {
  padding: var(--sp-3) var(--sp-5);
}

.ua-btn--sweep {
  padding: 0;
}

.ua-btn__base,
.ua-btn__fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: inherit;
  padding: var(--sp-2) var(--sp-5);
}

.btn:not(.btn--lg) .ua-btn__base,
.btn:not(.btn--lg) .ua-btn__fill {
  padding: var(--sp-2) var(--sp-4);
}

.ua-btn--sweep .ua-btn__fill {
  position: absolute;
  inset: 0;
  background-color: var(--btn-fill-bg, var(--accent-hover));
  color: var(--btn-fill-ink, var(--accent-on));
  pointer-events: none;
  clip-path: inset(0 100% 0 0 round var(--r-md));
  transition: clip-path var(--dur-base) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .ua-btn--sweep:hover .ua-btn__fill {
    clip-path: inset(0 0 0 0 round var(--r-md));
  }
}

.ua-pressable {
  transition: transform 160ms var(--ease-snappy), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.btn:not(:disabled):active,
.ua-pressable:not(:disabled):active {
  transform: scale(var(--press-scale));
  transition-duration: 90ms;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-on);
  --btn-fill-bg: var(--accent-hover);
  --btn-fill-ink: var(--accent-on);
}

.btn--primary:hover {
  border-color: var(--accent-hover);
}

.btn--inverse {
  background-color: var(--bg-inverse);
  border-color: var(--bg-inverse);
  color: var(--ink-inverse);
  --btn-fill-bg: var(--accent-primary);
  --btn-fill-ink: var(--accent-on);
}

.btn--ghost {
  background-color: var(--bg-surface-1);
  border-color: var(--border-strong);
  color: var(--ink-primary);
  --btn-fill-bg: var(--bg-surface-2);
  --btn-fill-ink: var(--ink-primary);
}

.btn--ghost:hover {
  border-color: var(--ink-secondary);
}

.btn--text {
  background-color: transparent;
  border-color: transparent;
  color: var(--ink-secondary);
}

.btn--text:hover {
  color: var(--ink-primary);
  background-color: var(--bg-surface-2);
}

.btn--full {
  width: 100%;
}

.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.72;
  cursor: not-allowed;
}

.mobile-menu-btn {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--r-md);
  transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out), color 220ms var(--ease-out), transform 160ms var(--ease-snappy);
}

.mobile-menu-btn.is-open {
  background-color: var(--bg-inverse);
  border-color: var(--bg-inverse);
  color: var(--ink-inverse);
}

.hb-box {
  position: relative;
  width: 18px;
  height: 14px;
  display: block;
}

.hb-line {
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: var(--r-pill);
  background-color: currentColor;
  transform-origin: center;
  transition: transform 320ms var(--ease-wave), opacity 180ms var(--ease-out), width 240ms var(--ease-out);
}

.hb-line--1 { top: 0; }
.hb-line--2 { top: 6px; width: 13px; left: 5px; }
.hb-line--3 { top: 12px; }

.mobile-menu-btn.is-open .hb-line--1 {
  transform: translate3d(0, 6px, 0) rotate(45deg);
}

.mobile-menu-btn.is-open .hb-line--2 {
  transform: scaleX(0);
  opacity: 0;
}

.mobile-menu-btn.is-open .hb-line--3 {
  transform: translate3d(0, -6px, 0) rotate(-45deg);
}

/* ==========================================================================
   3. Scroll & Tab Wave Animations (Exact CRM Motion Craft)
   ========================================================================== */
@keyframes uaRevealIn {
  from {
    opacity: 0;
    transform: translate3d(0, var(--reveal-y), 0) scale(0.976);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes uaTabWaveIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .wave-card {
    animation: uaRevealIn var(--dur-reveal) var(--ease-wave) both;
  }

  .stagger-grid > *:nth-child(1) { animation-delay: 0ms; }
  .stagger-grid > *:nth-child(2) { animation-delay: 55ms; }
  .stagger-grid > *:nth-child(3) { animation-delay: 110ms; }
  .stagger-grid > *:nth-child(4) { animation-delay: 165ms; }
  .stagger-grid > *:nth-child(5) { animation-delay: 220ms; }
  .stagger-grid > *:nth-child(6) { animation-delay: 275ms; }
  .stagger-grid > *:nth-child(7) { animation-delay: 330ms; }
  .stagger-grid > *:nth-child(8) { animation-delay: 385ms; }
  .stagger-grid > *:nth-child(9) { animation-delay: 440ms; }
  .stagger-grid > *:nth-child(10) { animation-delay: 495ms; }

  .tab-wave-enter > * {
    animation: uaTabWaveIn var(--dur-tab-wave) var(--ease-wave) both;
  }

  .tab-wave-enter > *:nth-child(2) { animation-delay: 45ms; }
  .tab-wave-enter > *:nth-child(3) { animation-delay: 90ms; }
  .tab-wave-enter > *:nth-child(4) { animation-delay: 135ms; }
}

/* ==========================================================================
   4. Mobile Drawer Sheet
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: var(--bg-scrim);
  backdrop-filter: var(--blur-scrim);
  -webkit-backdrop-filter: var(--blur-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-out);
}

.sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(360px, 92vw);
  background-color: var(--bg-glass-card);
  backdrop-filter: var(--blur-bar);
  -webkit-backdrop-filter: var(--blur-bar);
  border-left: 1px solid var(--glass-border);
  padding: var(--sp-5);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow-y: auto;
  transform: translate3d(100%, 0, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 340ms var(--ease-wave), opacity 240ms var(--ease-out), visibility 0s linear 340ms;
}

.mobile-drawer.is-open {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 360ms var(--ease-wave), opacity 220ms var(--ease-out), visibility 0s linear 0s;
}

.mobile-drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-left: var(--sp-2);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
  opacity: 0;
  transform: translate3d(16px, 0, 0);
  transition: opacity 220ms var(--ease-out), transform 280ms var(--ease-wave), background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.mobile-drawer-link svg {
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  transition: transform 180ms var(--ease-out), color 180ms var(--ease-out);
}

.mobile-drawer-link:hover {
  background-color: var(--bg-surface-2);
  border-color: var(--border-subtle);
}

.mobile-drawer-link:hover svg {
  color: var(--accent-primary);
  transform: translateX(3px);
}

.mobile-drawer.is-open .mobile-drawer-link {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.mobile-drawer.is-open .mobile-drawer-link:nth-child(1) { transition-delay: 50ms; }
.mobile-drawer.is-open .mobile-drawer-link:nth-child(2) { transition-delay: 95ms; }
.mobile-drawer.is-open .mobile-drawer-link:nth-child(3) { transition-delay: 140ms; }
.mobile-drawer.is-open .mobile-drawer-link:nth-child(4) { transition-delay: 185ms; }

.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translate3d(16px, 0, 0);
  transition: opacity 220ms var(--ease-out), transform 280ms var(--ease-wave);
}

.mobile-drawer.is-open .mobile-drawer-actions {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 220ms;
}

.mobile-drawer-controls {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translate3d(16px, 0, 0);
  transition: opacity 220ms var(--ease-out), transform 280ms var(--ease-wave);
}

.mobile-drawer.is-open .mobile-drawer-controls {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 260ms;
}

/* ==========================================================================
   5. Section Rhythm, Typography & Asymmetric Grids
   ========================================================================== */
.section {
  padding-top: 84px;
  padding-bottom: 84px;
}

.section--hero {
  padding-top: 52px;
  padding-bottom: 68px;
}

.section--surface {
  background-color: var(--bg-surface-2);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section--tight {
  padding-top: 36px;
  padding-bottom: 36px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--sp-3);
}

.h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--ink-primary);
}

.lead {
  margin: var(--sp-4) 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.body-copy {
  margin: var(--sp-2) 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--sp-6);
  align-items: start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.hero-micro {
  margin-top: var(--sp-4);
  font-size: 14px;
  color: var(--ink-muted);
}

/* ==========================================================================
   6. Interactive 5-Tab Hero Workbench (Balanced Across Whole CRM)
   ========================================================================== */
.showcase-shell {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-4);
  box-shadow: var(--shadow-card);
}

.showcase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-4);
}

.showcase-tab {
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--ink-secondary);
  border-radius: var(--r-md);
  padding: 6px 10px;
  min-height: 36px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform 140ms var(--ease-snappy);
}

.showcase-tab:hover {
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.showcase-tab:active {
  transform: scale(var(--press-scale));
}

.showcase-tab.is-active {
  background-color: var(--bg-inverse);
  border-color: var(--bg-inverse);
  color: var(--ink-inverse);
}

.showcase-tab:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.showcase-stage {
  min-height: 344px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-3);
}

.preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.preview-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--ok-border);
  background-color: var(--ok-bg);
  color: var(--ok-text);
}

.preview-pill.is-warn {
  border-color: var(--warn-border);
  background-color: var(--warn-bg);
  color: var(--warn-text);
}

.preview-pill.is-info {
  border-color: var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
}

.preview-pill.is-ai {
  border-color: var(--pipe-csl-border);
  background-color: var(--pipe-csl-bg);
  color: var(--pipe-csl-text);
}

.preview-pill.is-delivery {
  border-color: var(--st-delivery-border);
  background-color: var(--st-delivery-bg);
  color: var(--st-delivery-text);
}

.preview-pill.is-assembly {
  border-color: var(--st-assembly-border);
  background-color: var(--st-assembly-bg);
  color: var(--st-assembly-text);
}

.preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background-color: currentColor;
}

.preview-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.preview-row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3);
  min-height: 50px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), transform 140ms var(--ease-snappy);
}

.preview-row-btn:hover {
  border-color: var(--border-strong);
  background-color: var(--row-hover);
}

.preview-row-btn:active {
  transform: scale(0.99);
}

.preview-row-btn.is-selected {
  border-color: var(--accent-primary);
  background-color: var(--accent-soft);
}

.preview-row-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.preview-detail-box {
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  padding: var(--sp-3) var(--sp-4);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}

.metric-lbl {
  font-size: 12px;
  color: var(--ink-muted);
}

.metric-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-top: 2px;
}

.label-well {
  background-color: var(--lbl-ruler-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.label-paper {
  background-color: var(--lbl-paper-bg);
  color: var(--lbl-paper-ink);
  border: 1px solid var(--lbl-paper-border);
  border-radius: var(--r-xs);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width var(--dur-base) var(--ease-wave), min-height var(--dur-base) var(--ease-wave);
}

.label-paper--58x40 {
  width: 244px;
  min-height: 132px;
}

.label-paper--40x25 {
  width: 196px;
  min-height: 112px;
}

.label-paper--100x150 {
  width: 268px;
  min-height: 152px;
}

.label-barcode-bars {
  height: 22px;
  border-top: 2px solid var(--lbl-paper-ink);
  border-bottom: 2px solid var(--lbl-paper-ink);
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  padding: 3px 0;
}

.label-bar-line {
  background-color: var(--lbl-paper-ink);
}

/* ==========================================================================
   7. Proof Facts Strip & Filterable 10-Module Bento Grid
   ========================================================================== */
.facts-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.fact-cell {
  padding: var(--sp-6) var(--sp-5);
  border-right: 1px solid var(--border-subtle);
}

.fact-cell:first-child {
  padding-left: 0;
}

.fact-cell:last-child {
  border-right: 0;
  padding-right: 0;
}

.fact-num {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink-primary);
}

.fact-label {
  margin-top: var(--sp-2);
  font-size: 14px;
  color: var(--ink-secondary);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--sp-6);
  align-items: end;
  margin-bottom: var(--sp-5);
}

.mod-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-4);
}

.card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-4);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--border-strong);
  }
}

.card--span-3 {
  grid-column: span 3;
}

.card--span-2 {
  grid-column: span 2;
}

.card--surface-2 {
  background-color: var(--bg-surface-2);
}

.card[hidden] {
  display: none;
}

.mod-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.mod-num {
  font-size: 12px;
  color: var(--ink-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.v-chip {
  min-height: 38px;
  padding: 6px var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.v-chip.is-selected {
  background-color: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.v-chip:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

/* ==========================================================================
   8. 17+ Ukrainian Integrations Strip
   ========================================================================== */
.int-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}

.int-group {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-card);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.int-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

/* ==========================================================================
   9. Comparison Matrix (@container -> vertical cards <= 700px)
   ========================================================================== */
.compare-wrap {
  container-type: inline-size;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  overflow: hidden;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.compare-table th,
.compare-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
  vertical-align: middle;
}

.compare-table thead th {
  background-color: var(--bg-surface-2);
  font-weight: 600;
  color: var(--ink-primary);
}

.compare-table tr:last-child td {
  border-bottom: 0;
}

.compare-table .col-our {
  color: var(--ink-primary);
  font-weight: 600;
  background-color: var(--accent-soft);
}

.compare-cards {
  display: none;
}

@container (max-width: 700px) {
  .compare-table {
    display: none;
  }

  .compare-cards {
    display: flex;
    flex-direction: column;
  }

  .compare-card-row {
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .compare-card-row:last-child {
    border-bottom: 0;
  }

  .compare-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
  }

  .compare-card-sub {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    font-size: 14px;
    color: var(--ink-secondary);
  }
}

/* ==========================================================================
   10. Pricing (KeyCRM+ Market Position), Steps, FAQ, Final CTA & Footer Version
   ========================================================================== */
.billing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: stretch;
}

.plan-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-5);
}

.plan-card--featured {
  border: 2px solid var(--accent-primary);
}

.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.plan-price {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink-primary);
}

.plan-unit {
  font-size: 15px;
  color: var(--ink-muted);
}

.plan-list {
  margin: var(--sp-4) 0 0;
  padding: var(--sp-4) 0 0;
  border-top: 1px solid var(--border-subtle);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.plan-list li {
  font-size: 15px;
  color: var(--ink-secondary);
  padding-left: var(--sp-4);
  position: relative;
}

.plan-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background-color: var(--ok-dot);
}

.addon-bar {
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.steps-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--sp-6);
}

.steps-list {
  border-top: 1px solid var(--border-subtle);
}

.step-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.step-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-text);
}

.faq-list {
  border-top: 1px solid var(--border-subtle);
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  padding: var(--sp-4) 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
}

.faq-trigger:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--ink-muted);
  transition: transform var(--dur-base) var(--ease-wave);
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-panel {
  padding-bottom: var(--sp-4);
  font-size: 16px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.cta-panel {
  max-width: 760px;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--sp-5);
  padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-xs);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--ink-secondary);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--ink-primary);
}

/* ==========================================================================
   11. Auth Split (/login, /register) + Google & Diia OAuth Quick Actions
   ========================================================================== */
.auth-main {
  padding-top: 44px;
  padding-bottom: 56px;
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
}

.auth-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
}

.auth-aside {
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.sec-list {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  overflow: hidden;
}

.sec-item {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
}

.sec-item:last-child {
  border-bottom: 0;
}

.sec-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  padding-top: 3px;
}

.oauth-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.oauth-google-wrap {
  position: relative;
  display: flex;
  width: 100%;
}

.oauth-google-wrap .oauth-btn {
  width: 100%;
}

.oauth-google-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background-color: var(--google-badge-bg);
  flex-shrink: 0;
}

.oauth-google-badge svg {
  width: 15px;
  height: 15px;
}

.oauth-google-gsi {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  border-radius: var(--r-md);
  z-index: 2;
  color-scheme: light;
  pointer-events: none;
}

.oauth-google-gsi.is-active {
  pointer-events: auto;
}

.oauth-google-gsi iframe {
  width: 100%;
  height: 100%;
}

.oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-1);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), transform 160ms var(--ease-snappy);
}

.oauth-btn:hover {
  background-color: var(--bg-surface-2);
  border-color: var(--ink-secondary);
}

.oauth-btn:active {
  transform: scale(var(--press-scale));
}

.oauth-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.oauth-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.oauth-or {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  font-size: 13px;
  color: var(--ink-muted);
}

.oauth-or::before,
.oauth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
}

.lang-mobile-select {
  display: none;
  min-height: 44px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border-input);
  background-color: var(--bg-surface-1);
  color: var(--ink-primary);
  font-size: 16px;
  font-weight: 600;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-input);
  background-color: var(--bg-surface-1);
  color: var(--ink-primary);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color var(--dur-base) var(--ease-out);
}

.field-input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.field-input:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-color: var(--accent-primary);
}

.field-input--pw {
  padding-right: 52px;
}

.field-input[aria-invalid="true"] {
  border-color: var(--bad-dot);
}

.pw-toggle {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pw-toggle:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 1px;
}

.field-error {
  margin: 0;
  font-size: 14px;
  color: var(--bad-text);
  min-height: 20px;
}

.field-error:empty {
  display: none;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-1);
}

.strength-bar {
  height: 4px;
  border-radius: var(--r-xs);
  background-color: var(--border-subtle);
}

.strength-bars[data-score="1"] .strength-bar:nth-child(-n+1) { background-color: var(--bad-dot); }
.strength-bars[data-score="2"] .strength-bar:nth-child(-n+2) { background-color: var(--warn-dot); }
.strength-bars[data-score="3"] .strength-bar:nth-child(-n+3) { background-color: var(--accent-primary); }
.strength-bars[data-score="4"] .strength-bar:nth-child(-n+4) { background-color: var(--ok-dot); }

.strength-label {
  font-size: 13px;
  color: var(--ink-muted);
}

.vertical-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.alert-box {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--bad-border);
  background-color: var(--bad-bg);
  color: var(--bad-text);
  font-size: 14px;
  line-height: 1.45;
}

.alert-box--ok {
  border-color: var(--ok-border);
  background-color: var(--ok-bg);
  color: var(--ok-text);
}

.alert-box--info {
  border-color: var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
}

.alert-box[hidden] {
  display: none;
}

.auth-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--sp-5) 0;
}

.auth-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  z-index: 100;
  width: min(460px, calc(100vw - 32px));
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sheet);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sheet);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-wave);
}

.modal-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

[data-theme="dark"] .modal-panel,
[data-theme="dark"] .mobile-drawer {
  border-color: var(--border-strong);
}

.prose-doc {
  max-width: 780px;
}

.prose-block {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   12. Responsive Breakpoints (1024px, 767px Mobile 390px)
   ========================================================================== */
@media (max-width: 1024px) {
  .header-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-grid,
  .section-head,
  .steps-grid,
  .auth-split {
    grid-template-columns: 1fr;
  }

  .mod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card--span-3,
  .card--span-2 {
    grid-column: span 1;
  }

  .int-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact-cell:nth-child(odd) {
    padding-left: 0;
  }

  .fact-cell:nth-child(even) {
    border-right: 0;
  }

  .fact-cell:nth-child(1),
  .fact-cell:nth-child(2) {
    border-bottom: 1px solid var(--border-subtle);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }
}

@media (max-width: 767px), (pointer: coarse) {
  .seg-btn,
  .icon-btn,
  .btn,
  .showcase-tab,
  .v-chip,
  .oauth-btn,
  .faq-trigger {
    min-height: 44px;
  }

  .field-input {
    font-size: 16px;
    min-height: 48px;
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .header-desktop-controls {
    display: none;
  }

  .auth-header-controls .seg-group,
  .auth-header-controls .btn--text {
    display: none;
  }

  .lang-mobile-select {
    display: inline-block;
  }

  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .section--hero {
    padding-top: var(--sp-5);
    padding-bottom: 44px;
  }

  .h1 {
    font-size: 32px;
  }

  .h2 {
    font-size: 26px;
  }

  .facts-strip,
  .mod-grid,
  .int-grid,
  .oauth-stack {
    grid-template-columns: 1fr;
  }

  .fact-cell {
    padding: var(--sp-4) 0;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .fact-cell:last-child {
    border-bottom: 0;
  }

  .preview-detail-box {
    grid-template-columns: 1fr;
  }

  .sec-item,
  .step-row {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .auth-card {
    padding: var(--sp-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
