/* ==========================================================================
   PingSell Core UI & Brand System Stylesheet
   100% Driven by Design Tokens in ../tokens/tokens.css
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

img, svg {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-primary-hover);
}

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-2-5) var(--space-4);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border-radius: var(--radius-md);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-3);
}

/* Typography Helpers */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  font-weight: 800;
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-snug);
  font-weight: 700;
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  font-weight: 700;
}

p {
  margin: 0;
}

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

/* Layout Primitives */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-20);
}

.section-tight {
  padding-block: var(--space-12);
}

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

.section-inverse {
  background-color: var(--bg-surface-inverse);
  color: var(--text-on-inverse);
}
.section-inverse h2,
.section-inverse h3 {
  color: var(--text-on-inverse);
}
.section-inverse p {
  color: var(--text-on-inverse-muted);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-12);
}
.section-head.centered {
  margin-inline: auto;
  text-align: center;
}
.section-head p {
  margin-top: var(--space-3);
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
}

/* Eyebrow & Badges */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--brand-subtle-bg);
  border: 1px solid var(--brand-subtle-border);
  color: var(--brand-subtle-text);
  font-size: var(--text-caption);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.badge-closing {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-full);
  background: var(--alert-closing-badge-bg);
  color: var(--alert-closing-badge-text);
  font-size: var(--text-caption);
  font-weight: 700;
  line-height: 1.2;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
}
.badge-status.success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}
.badge-status.warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}
.badge-status.neutral {
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Channel Pills */
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.channel-pill.zalo { background: var(--channel-zalo-bg); color: var(--channel-zalo-text); border-color: transparent; }
.channel-pill.shopee { background: var(--channel-shopee-bg); color: var(--channel-shopee-text); border-color: transparent; }
.channel-pill.tiktok { background: var(--channel-tiktok-bg); color: var(--channel-tiktok-text); border-color: transparent; }
.channel-pill.messenger { background: var(--channel-messenger-bg); color: var(--channel-messenger-text); border-color: transparent; }
.channel-pill.telegram { background: var(--channel-telegram-bg); color: var(--channel-telegram-text); border-color: transparent; }
.channel-pill.web { background: var(--channel-web-bg); color: var(--channel-web-text); border-color: transparent; }

/* Buttons (WCAG 44px touch target) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--btn-min-height);
  padding-inline: var(--btn-pad-x);
  padding-block: var(--space-2-5);
  border-radius: var(--btn-radius);
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  color: var(--text-on-brand);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-muted);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-sm {
  min-height: 2.25rem;
  padding-inline: var(--space-3);
  padding-block: var(--space-1-5);
  font-size: var(--text-caption);
}

/* Sticky Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2-5);
  min-height: var(--btn-min-height);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.primary-nav a {
  color: var(--text-secondary);
  font-size: var(--text-ui);
  font-weight: 600;
  padding-block: var(--space-2);
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brand-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mobile-menu-btn {
  display: none;
  min-width: var(--btn-min-height);
  min-height: var(--btn-min-height);
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-4) var(--container-pad) var(--space-6);
}
.mobile-drawer.open {
  display: block;
}
.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mobile-drawer nav a {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
}
.mobile-drawer nav a:hover {
  background: var(--bg-surface-muted);
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.card {
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow-sm);
}
.card p {
  margin-top: var(--space-2-5);
  color: var(--text-secondary);
  font-size: var(--text-ui);
}

.icon-box {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--brand-subtle-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.icon-box.closing {
  background: var(--alert-closing-surface);
}

/* Hero Split */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: center;
}
.hero-copy p.lead {
  margin-top: var(--space-5);
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.hero-microcopy {
  margin-top: var(--space-3);
  font-size: var(--text-caption);
  color: var(--text-muted);
}
.channel-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
  align-items: center;
}

/* Metric Strip */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
}
.metric-item {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.metric-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1.1;
}
.metric-label {
  margin-top: var(--space-2);
  font-size: var(--text-ui);
  color: var(--text-secondary);
}

/* ==========================================================================
   LIVE UI MOCKUP: OMNICHANNEL INBOX + 10S QUICK ORDER PANEL
   ========================================================================== */
.inbox-simulator {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sim-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-caption);
}
.sim-dots {
  display: inline-flex;
  gap: var(--space-1-5);
}
.sim-dots span {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  background: var(--border-strong);
}

.sim-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 250px;
  min-height: 390px;
}

.sim-col-list {
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}
.sim-list-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-caption);
  font-weight: 700;
}

.chat-row {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  border-left: var(--inbox-closing-border-width) solid transparent;
  background: var(--bg-surface);
  font-size: var(--text-caption);
}
.chat-row.needs-closing {
  background: var(--alert-closing-surface);
  border-left-color: var(--alert-closing-border);
}
.chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1-5);
  font-weight: 700;
  color: var(--text-primary);
}
.chat-row-preview {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-row-meta {
  margin-top: var(--space-1-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-col-thread {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}
.sim-thread-banner {
  padding: var(--space-2-5) var(--space-3);
  background: var(--alert-closing-surface);
  border-bottom: 1px solid var(--ps-red-200);
  color: var(--alert-closing-text);
  font-size: var(--text-caption);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.sim-messages {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  font-size: var(--text-caption);
}
.msg-bubble {
  max-width: 88%;
  padding: var(--space-2-5) var(--space-3);
  border-radius: var(--radius-md);
  line-height: 1.45;
}
.msg-customer {
  align-self: flex-start;
  background: var(--bg-surface-muted);
  color: var(--text-primary);
}
.msg-bot {
  align-self: flex-end;
  background: var(--brand-subtle-bg);
  color: var(--brand-subtle-text);
  border: 1px solid var(--brand-subtle-border);
}
.msg-system {
  align-self: center;
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-full);
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  font-size: var(--text-micro);
  font-weight: 600;
}

.sim-col-order {
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  padding: var(--space-3);
  font-size: var(--text-caption);
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
}
.sim-field {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}
.sim-field-label {
  font-size: var(--text-micro);
  color: var(--text-muted);
  display: block;
}
.sim-field-val {
  font-weight: 600;
  color: var(--text-primary);
}

/* Telegram/Zalo Instant Ping Alert Card */
.ping-alert-card {
  background: var(--bg-surface-inverse);
  color: var(--text-on-inverse);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--border-inverse);
  box-shadow: var(--shadow-md);
}
.ping-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-inverse);
  font-size: var(--text-caption);
}

/* Comparison Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-ui);
}
.compare-table th,
.compare-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.compare-table th {
  background: var(--bg-surface-muted);
  font-family: var(--font-display);
  font-weight: 700;
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-good {
  background: rgba(239, 246, 255, 0.55);
  font-weight: 600;
  color: var(--text-primary);
}

/* Pricing Cards */
.billing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.pricing-card.featured {
  border: 2px solid var(--brand-primary);
  box-shadow: var(--shadow-md);
}
.pricing-popular {
  position: absolute;
  top: -0.75rem;
  right: var(--space-5);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: var(--text-micro);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}
.price-amount {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
}
.price-amount span {
  font-size: var(--text-ui);
  font-weight: 500;
  color: var(--text-muted);
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  font-size: var(--text-ui);
  color: var(--text-secondary);
}
.feature-list li {
  display: block;
  position: relative;
  padding-left: var(--space-5);
}
.check-dot {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--status-success-text);
  font-weight: 800;
}

/* Code / Embed Box */
.code-box {
  background: var(--bg-surface-inverse);
  color: var(--text-on-inverse);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  overflow-x: auto;
  border: 1px solid var(--border-inverse);
}

/* Brand Kit Specific Swatches & Logo Stage */
.logo-stage {
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  border: 1px solid var(--border-subtle);
  background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
  background-size: 16px 16px;
  background-color: var(--bg-surface);
  min-height: 180px;
}
.logo-stage.dark {
  background-color: var(--bg-surface-inverse);
  background-image: radial-gradient(var(--border-inverse) 1px, transparent 1px);
  border-color: var(--border-inverse);
  color: var(--text-on-inverse);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-4);
}
.swatch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: inherit;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.swatch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.swatch-color {
  height: 76px;
  width: 100%;
  border-bottom: 1px solid var(--border-subtle);
}
.swatch-meta {
  padding: var(--space-3) var(--space-4);
}
.swatch-name {
  font-weight: 700;
  font-size: var(--text-ui);
  color: var(--text-primary);
  display: block;
}
.swatch-token {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--text-muted);
  display: block;
  margin-top: var(--space-1);
}

.icon-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: var(--space-3);
}
.icon-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2-5);
  text-align: center;
}
.icon-tile span {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--text-secondary);
}

/* ==========================================================================
   FLOATING CHAT WIDGET SANDBOX (<30KB Shadow DOM Concept)
   ========================================================================== */
.ps-widget-root {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}

.ps-widget-popover {
  width: min(var(--widget-popover-width), calc(100vw - 2rem));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
}
.ps-widget-popover.open {
  display: block;
}
.ps-widget-head {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.ps-widget-sub {
  font-size: var(--text-micro);
  color: var(--text-on-brand);
}
.ps-widget-close,
.ps-widget-close-btn {
  min-width: var(--btn-min-height);
  min-height: var(--btn-min-height);
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--ps-blue-800);
  color: var(--text-on-brand);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ps-widget-close:hover,
.ps-widget-close-btn:hover {
  background: var(--ps-blue-900);
}
.ps-widget-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  font-size: var(--text-ui);
}
.ps-widget-channel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2-5) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--text-caption);
  cursor: pointer;
}
.ps-widget-channel-btn:hover {
  border-color: var(--brand-primary);
  background: var(--brand-subtle-bg);
}
.ps-widget-foot {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface-muted);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: var(--text-micro);
  color: var(--text-secondary);
}

.ps-widget-fab {
  width: var(--widget-fab-size);
  height: var(--widget-fab-size);
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border: none;
  box-shadow: var(--shadow-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--duration-fast) var(--ease-out);
}
.ps-widget-fab:hover {
  transform: scale(1.05);
  background: var(--brand-primary-hover);
}
.ps-widget-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 4px;
  border-radius: var(--radius-full);
  background: var(--alert-closing-badge-bg);
  color: var(--alert-closing-badge-text);
  font-size: var(--text-micro);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* ==========================================================================
   ACCESSIBLE LEAD-CAPTURE MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.open {
  display: flex;
}
.modal-dialog {
  width: 100%;
  max-width: 28rem;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.form-group {
  margin-top: var(--space-4);
}
.form-label {
  display: block;
  font-size: var(--text-ui);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1-5);
}
.form-input, .form-select {
  width: 100%;
  min-height: var(--btn-min-height);
  padding: var(--space-2-5) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--text-primary);
  background: var(--bg-surface);
}
.form-error {
  margin-top: var(--space-1-5);
  font-size: var(--text-caption);
  color: var(--alert-closing-text);
  display: none;
}
.form-error.visible {
  display: block;
}

/* Toast notification for copy feedback */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface-inverse);
  color: var(--text-on-inverse);
  padding: var(--space-2-5) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  z-index: 150;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-16) var(--space-10);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
}
.footer-col h3 {
  font-size: var(--text-ui);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-ui);
}
.footer-links a {
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--brand-primary);
}
.footer-bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-caption);
  color: var(--text-muted);
}

/* ==========================================================================
   MULTI-PAGE SUB-HERO, PIPELINE, FAQ, API DOCS & WIDGET CONFIGURATOR
   ========================================================================== */
.page-hero {
  padding-block: var(--space-16) var(--space-12);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.breadcrumb a {
  color: var(--text-secondary);
  font-weight: 500;
}
.breadcrumb a:hover {
  color: var(--brand-primary);
}

.pipeline-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
.pipeline-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  box-shadow: var(--shadow-xs);
}
.pipeline-step.priority-1 {
  border-top: 4px solid var(--alert-closing-border);
}
.pipeline-step.priority-std {
  border-top: 4px solid var(--brand-primary);
}
.pipeline-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 700;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.stock-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 52rem;
  margin-inline: auto;
}
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
}
.faq-item summary {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 2rem;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--brand-primary);
  flex-shrink: 0;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item p {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-ui);
  line-height: var(--leading-relaxed);
}

.api-card {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.method-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 700;
  background: var(--brand-subtle-bg);
  color: var(--brand-subtle-text);
  border: 1px solid var(--brand-subtle-border);
}
.method-badge.webhook {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

.configurator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-6);
  align-items: start;
}
.configurator-grid > *,
.hero-grid > * {
  min-width: 0;
}
.widget-preview-stage {
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (1440px Desktop -> 1024px Tablet -> 390px Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid,
  .configurator-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pipeline-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sim-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .sim-col-list {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .sim-col-order {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .grid-4, .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--space-12);
  }
  .header-inner {
    gap: var(--space-2);
  }
  .brand-link {
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-link img {
    width: 128px;
    height: auto;
  }
  .header-actions {
    gap: var(--space-2);
    flex-shrink: 0;
  }
  .primary-nav,
  .header-actions .hide-mobile {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .metric-grid,
  .pipeline-list,
  .stock-kpi-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-cta-row .btn {
    width: 100%;
  }
  .ps-widget-root {
    right: var(--space-4);
    bottom: var(--space-4);
  }
}

.ps-widget-sub { opacity: 1; }
.ps-widget-close-btn {
  background: var(--brand-primary-hover, var(--brand-primary));
  color: var(--text-on-brand);
  border: 1px solid var(--text-on-brand);
  min-height: 32px;
  padding-inline: 10px;
}
